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.
Sourcepub fn set(&mut self, addr: Address, value: Value) -> Result<()>
pub fn set(&mut self, addr: Address, value: Value) -> Result<()>
Set the value at addr from the device side, ignoring master access
rights — those govern SDO access, not the application, so this can update
a master-read-only object (e.g. publish process data into a TPDO source,
or the node’s error register 0x1001). The object must exist and the
value’s type must match.
Returns Error::ObjectNotFound if absent or Error::TypeMismatch on
a type mismatch.