pub struct Entries<'a, T> { /* private fields */ }Expand description
A table carried in a BVLL payload, borrowed rather than copied: either
the wire octets of a decoded message, or entries a caller wants to
encode. Both read the same through Entries::iter, and two tables
compare equal when their entries do.
Implementations§
Source§impl<'a, T: TableEntry> Entries<'a, T>
impl<'a, T: TableEntry> Entries<'a, T>
Sourcepub fn from_wire(octets: &'a [u8]) -> Result<Self, BvllError>
pub fn from_wire(octets: &'a [u8]) -> Result<Self, BvllError>
Read a table from its wire octets, which must be a whole number of 10-octet entries. An empty table is allowed. The octets are borrowed, not copied.
use bacnet_bip_codec::{BdtEntries, BvllError};
let octets = [10, 0, 0, 1, 0xBA, 0xC0, 255, 255, 255, 255];
let table = BdtEntries::from_wire(&octets)?;
assert_eq!(table.len(), 1);
assert_eq!(table.iter().next().unwrap().address.port(), 0xBAC0);
assert_eq!(
BdtEntries::from_wire(&octets[..9]).unwrap_err(),
BvllError::TableLength { length: 9, entry_length: 10 },
);Sourcepub const fn from_entries(entries: &'a [T]) -> Self
pub const fn from_entries(entries: &'a [T]) -> Self
A table of these entries, for encoding.
Trait Implementations§
impl<'a, T: Copy> Copy for Entries<'a, T>
impl<T: TableEntry + Eq> Eq for Entries<'_, T>
Source§impl<'a, T: TableEntry> IntoIterator for Entries<'a, T>
impl<'a, T: TableEntry> IntoIterator for Entries<'a, T>
Source§impl<'a, T: TableEntry> IntoIterator for &Entries<'a, T>
impl<'a, T: TableEntry> IntoIterator for &Entries<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for Entries<'a, T>where
Repr<'a, T>: Freeze,
impl<'a, T> RefUnwindSafe for Entries<'a, T>where
Repr<'a, T>: RefUnwindSafe,
impl<'a, T> Send for Entries<'a, T>where
Repr<'a, T>: Send,
impl<'a, T> Sync for Entries<'a, T>where
Repr<'a, T>: Sync,
impl<'a, T> Unpin for Entries<'a, T>where
Repr<'a, T>: Unpin,
impl<'a, T> UnsafeUnpin for Entries<'a, T>where
Repr<'a, T>: UnsafeUnpin,
impl<'a, T> UnwindSafe for Entries<'a, T>where
Repr<'a, T>: UnwindSafe,
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