pub struct Props(/* private fields */);Expand description
A list of key-value pairs that associate arbitrary properties with an object. Keys are null-terminated strings and values are arbitrary binary blobs, although by convention both are usually null-terminated ASCII strings.
Implementations§
Source§impl Props
impl Props
Sourcepub fn set<T>(&mut self, prop: Prop, value: T)
pub fn set<T>(&mut self, prop: Prop, value: T)
Sets a well-known property in the map.
If the property already has a value, it will be overwritten with the new one.
Sourcepub fn set_bytes<K, V>(&mut self, key: K, value: V)
pub fn set_bytes<K, V>(&mut self, key: K, value: V)
Sets a a property in the map.
If the property already has a value, it will be overwritten with the new one.
Sourcepub fn get(&self, prop: Prop) -> Option<&[u8]>
pub fn get(&self, prop: Prop) -> Option<&[u8]>
Gets the value of a well-known property.
If prop is not in the map, returns None.
Sourcepub fn get_mut(&mut self, prop: Prop) -> Option<&mut [u8]>
pub fn get_mut(&mut self, prop: Prop) -> Option<&mut [u8]>
Gets the value of a well-known property.
If prop is not in the map, returns None.
Sourcepub fn get_bytes_mut<K>(&mut self, key: K) -> Option<&mut [u8]>
pub fn get_bytes_mut<K>(&mut self, key: K) -> Option<&mut [u8]>
s Get a property from the map.
Trait Implementations§
Source§impl TagStructRead for Props
impl TagStructRead for Props
Source§fn read(
ts: &mut TagStructReader<'_>,
_protocol_version: u16,
) -> Result<Self, ProtocolError>
fn read( ts: &mut TagStructReader<'_>, _protocol_version: u16, ) -> Result<Self, ProtocolError>
Read an instance of
Self from a tagstruct.Source§impl TagStructWrite for Props
impl TagStructWrite for Props
Source§fn write(
&self,
w: &mut TagStructWriter<'_>,
_protocol_version: u16,
) -> Result<(), ProtocolError>
fn write( &self, w: &mut TagStructWriter<'_>, _protocol_version: u16, ) -> Result<(), ProtocolError>
Write
self into a tagstruct.impl Eq for Props
impl StructuralPartialEq for Props
Auto Trait Implementations§
impl Freeze for Props
impl RefUnwindSafe for Props
impl Send for Props
impl Sync for Props
impl Unpin for Props
impl UnwindSafe for Props
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
Mutably borrows from an owned value. Read more