pub struct ObjectDictionary<const N: usize> { /* private fields */ }Expand description
An object dictionary holding up to N entries, addressed by
(index, subindex).
Implementations§
Source§impl<const N: usize> ObjectDictionary<N>
impl<const N: usize> ObjectDictionary<N>
Sourcepub fn insert(&mut self, addr: Address, entry: Entry) -> Result<()>
pub fn insert(&mut self, addr: Address, entry: Entry) -> Result<()>
Insert or replace the entry at addr.
Returns Error::DictionaryFull when capacity N is exhausted.
Sourcepub fn entry(&self, addr: Address) -> Option<&Entry>
pub fn entry(&self, addr: Address) -> Option<&Entry>
Borrow the raw entry at addr, ignoring access rights.
Sourcepub fn read(&self, addr: Address) -> Result<Value>
pub fn read(&self, addr: Address) -> Result<Value>
Read the value at addr, honouring access rights.
Returns Error::ObjectNotFound if absent, or Error::WriteOnly if
the object is not readable.
Sourcepub fn write(&mut self, addr: Address, value: Value) -> Result<()>
pub fn write(&mut self, addr: Address, value: Value) -> Result<()>
Write value at addr, honouring access rights and the object’s data
type.
Returns Error::ObjectNotFound if absent, Error::ReadOnly if not
writable, or Error::TypeMismatch if value’s type differs from the
stored object’s type.
Trait Implementations§
Source§impl<const N: usize> Debug for ObjectDictionary<N>
impl<const N: usize> Debug for ObjectDictionary<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for ObjectDictionary<N>
impl<const N: usize> RefUnwindSafe for ObjectDictionary<N>
impl<const N: usize> Send for ObjectDictionary<N>
impl<const N: usize> Sync for ObjectDictionary<N>
impl<const N: usize> Unpin for ObjectDictionary<N>
impl<const N: usize> UnsafeUnpin for ObjectDictionary<N>
impl<const N: usize> UnwindSafe for ObjectDictionary<N>
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