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.
Members
newwith_propertieswith_pathhas_data_contractpersistable_property_namesfor_typeprovider_for_type
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>)).
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.
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.
has_data_contract
fn has_data_contract(self: &Self) -> bool
Whether the object is a data contract (HasDataContract).
persistable_property_names
fn persistable_property_names(self: &Self) -> &HashSet<String>
The names of the persisted properties (PersistablePropertyNames).
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>()).
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>()).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedCloneStructuralPartialEqPartialEqEqDebug
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.