pub struct FileAccessRightsPersistence { /* private fields */ }Expand description
A file holding one Access Rights object’s written rule arrays, Enable and
Accompaniment, replaced whole on each save, the same way as
FileNotificationClassPersistence: a failed save leaves the previous
state in place, and a completed one survives a power loss.
After the magic tag RBNACR01 and the object’s identifier, the file
holds BACnet encodings of up to four members, in this order, each only
once a write has set it:
- context tag 0, opening, then each Positive_Access_Rules rule in its
Clause 21
BACnetAccessRuleencoding, then context tag 0, closing; - the same for Negative_Access_Rules under context tag 1;
- Enable as a context-tagged BOOLEAN with tag 2;
- context tag 3, opening, then Accompaniment in its Clause 21
BACnetDeviceObjectReferenceencoding, then context tag 3, closing.
Loading refuses a file past 128 KiB, an array of more than
MAX_ACCESS_RULES rules, members out of order or repeated, a rule or
reference that does not decode, and octets after the last member. It
does not check the rules or the reference themselves; the object does,
as it loads them. It does not coordinate between processes.
Implementations§
Trait Implementations§
Source§impl AccessRightsPersistence for FileAccessRightsPersistence
impl AccessRightsPersistence for FileAccessRightsPersistence
Source§fn load(
&self,
rights: ObjectIdentifier,
) -> Result<Option<AccessRightsSnapshot>, Error>
fn load( &self, rights: ObjectIdentifier, ) -> Result<Option<AccessRightsSnapshot>, Error>
What was last saved for
rights, or None when nothing was saved.Source§fn save(
&self,
rights: ObjectIdentifier,
snapshot: &AccessRightsSnapshot,
) -> Result<(), Error>
fn save( &self, rights: ObjectIdentifier, snapshot: &AccessRightsSnapshot, ) -> Result<(), Error>
Durably replace what is saved for
rights with snapshot.Source§impl Clone for FileAccessRightsPersistence
impl Clone for FileAccessRightsPersistence
Auto Trait Implementations§
impl Freeze for FileAccessRightsPersistence
impl RefUnwindSafe for FileAccessRightsPersistence
impl Send for FileAccessRightsPersistence
impl Sync for FileAccessRightsPersistence
impl Unpin for FileAccessRightsPersistence
impl UnsafeUnpin for FileAccessRightsPersistence
impl UnwindSafe for FileAccessRightsPersistence
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