pub struct AppDataDictionary { /* private fields */ }extensions-draft-08 only.Expand description
Serializable app data dictionary in the AppDataDictionaryExtension.
This struct contains a list of ComponentData entries.
Entries are in order, and there is at most one entry per ComponentId.
These properties are checked upon creation, as well as upon deserialization.
Implementations§
Source§impl AppDataDictionary
impl AppDataDictionary
Sourcepub fn new() -> Self
pub fn new() -> Self
Initialize a new, empty AppDataDictionary.
Sourcepub fn entries(&self) -> impl Iterator<Item = &ComponentData>
pub fn entries(&self) -> impl Iterator<Item = &ComponentData>
Returns an iterator over the ComponentData entries,
ordered by ComponentId.
Sourcepub fn to_entries(self) -> Vec<ComponentData>
pub fn to_entries(self) -> Vec<ComponentData>
Returns the data that is currently stored in the AppDataDictionary.
Sourcepub fn get(&self, component_id: &ComponentId) -> Option<&[u8]>
pub fn get(&self, component_id: &ComponentId) -> Option<&[u8]>
Get a reference to an entry in the dictionary.
Sourcepub fn insert(
&mut self,
component_id: ComponentId,
data: Vec<u8>,
) -> Option<VLBytes>
pub fn insert( &mut self, component_id: ComponentId, data: Vec<u8>, ) -> Option<VLBytes>
Insert an entry into the dictionary. If an entry for this ComponentId already exists,
replace the old entry and return it.
Sourcepub fn contains(&self, component_id: &ComponentId) -> bool
pub fn contains(&self, component_id: &ComponentId) -> bool
Returns true if the dictionary contains an entry for the specified ComponentId.
Sourcepub fn remove(&mut self, component_id: &ComponentId) -> Option<VLBytes>
pub fn remove(&mut self, component_id: &ComponentId) -> Option<VLBytes>
Remove an entry from the dictionary by ComponentId. If this entry exists,
return it.
Trait Implementations§
Source§impl Clone for AppDataDictionary
impl Clone for AppDataDictionary
Source§fn clone(&self) -> AppDataDictionary
fn clone(&self) -> AppDataDictionary
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AppDataDictionary
impl Debug for AppDataDictionary
Source§impl Default for AppDataDictionary
impl Default for AppDataDictionary
Source§fn default() -> AppDataDictionary
fn default() -> AppDataDictionary
Source§impl<'de> Deserialize<'de> for AppDataDictionary
impl<'de> Deserialize<'de> for AppDataDictionary
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Deserialize for AppDataDictionary
impl Deserialize for AppDataDictionary
Source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
Available on crate feature std only.
fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
std only.Deserialize from bytes.
This function also ensures that the ComponentData entries are in order by
ComponentId, and there is at most one entry per ComponentId.
Source§impl DeserializeBytes for AppDataDictionary
impl DeserializeBytes for AppDataDictionary
Source§impl PartialEq for AppDataDictionary
impl PartialEq for AppDataDictionary
Source§impl Serialize for AppDataDictionary
impl Serialize for AppDataDictionary
Source§impl Serialize for AppDataDictionary
impl Serialize for AppDataDictionary
Source§impl Size for AppDataDictionary
impl Size for AppDataDictionary
fn tls_serialized_len(&self) -> usize
impl Eq for AppDataDictionary
impl StructuralPartialEq for AppDataDictionary
Auto Trait Implementations§
impl Freeze for AppDataDictionary
impl RefUnwindSafe for AppDataDictionary
impl Send for AppDataDictionary
impl Sync for AppDataDictionary
impl Unpin for AppDataDictionary
impl UnwindSafe for AppDataDictionary
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more