pub struct PortableRegistry {
pub types: Vec<PortableType>,
}Expand description
A read-only registry containing types in their portable form for serialization.
Fields§
§types: Vec<PortableType>The types contained by the PortableRegistry.
Implementations§
Source§impl PortableRegistry
impl PortableRegistry
Sourcepub fn resolve(&self, id: u32) -> Option<&Type<PortableForm>>
pub fn resolve(&self, id: u32) -> Option<&Type<PortableForm>>
Returns the type definition for the given identifier, None if no type found for that ID.
Sourcepub fn types(&self) -> &[PortableType]
👎Deprecated since 2.5.0: Prefer to access the fields directly; this getter will be removed in the next major version
pub fn types(&self) -> &[PortableType]
Prefer to access the fields directly; this getter will be removed in the next major version
Returns all types with their associated identifiers.
Sourcepub fn retain<F>(&mut self, filter: F) -> BTreeMap<u32, u32>
pub fn retain<F>(&mut self, filter: F) -> BTreeMap<u32, u32>
Retains only the portable types needed to express the provided ids.
The type IDs retained are returned as key to the BTreeMap.
The value of the map represents the new ID of that type.
§Note
A given type ID can be defined by nesting type IDs, such as the case
of a TypeDef::Composite and others. To retain a valid PortableRegistry
all the types needed to express an ID are included. Therefore, the number of
elements defined by the result equals or exceeds the number of provided IDs.
Trait Implementations§
Source§impl Clone for PortableRegistry
impl Clone for PortableRegistry
Source§fn clone(&self) -> PortableRegistry
fn clone(&self) -> PortableRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more