FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    AutoPersistMetadata

    struct · ferroui-reactiveui · v0.5.0

    struct AutoPersistMetadata
    

    What AutoPersist needs to know of an object: whether it is a data contract, and which of its properties are persisted (AutoPersistHelperMixins.AutoPersistMetadata).

    Upstream reads it by reflection from [DataContract] and [DataMember]; here it is given explicitly, or declared once per type with DataContract and read with for_type.

    View source

    Members

    new

    fn new<S: Into<String>>(has_data_contract: bool, persistable_property_names: impl IntoIterator<Item = S>) -> Self
    

    The metadata of an object: whether it is a data contract, and the names of its persisted properties, in PascalCase (AutoPersistMetadata(bool, ISet<string>)).

    Source

    with_properties

    fn with_properties<S: Into<String>>(persistable_property_names: impl IntoIterator<Item = S>) -> Self
    

    The metadata of a data contract whose persisted properties are persistable_property_names.

    Source

    with_path

    fn with_path<S: 'static, V: 'static>(self: Self, path: &ferroui_system::component_model::PropertyPath<S, V>) -> Self
    

    Adds the property at the start of path to the persisted properties, for a list written with prop! rather than with names.

    Source

    has_data_contract

    fn has_data_contract(self: &Self) -> bool
    

    Whether the object is a data contract (HasDataContract).

    Source

    persistable_property_names

    fn persistable_property_names(self: &Self) -> &HashSet<String>
    

    The names of the persisted properties (PersistablePropertyNames).

    Source

    for_type

    fn for_type<T: DataContract>() -> Rc<AutoPersistMetadata>
    

    The metadata a type declares with DataContract, created once per type and thread (AutoPersistHelperMixins.CreateMetadata<T>()).

    Source

    provider_for_type

    fn provider_for_type<T: DataContract>() -> MetadataProvider<T>
    

    A provider that gives the metadata of for_type for every item (AutoPersistHelperMixins.CreateMetadataProvider<TItem>()).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • Clone
    • StructuralPartialEq
    • PartialEq
    • Eq
    • Debug

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.