pub struct HdlcAddress {
pub value: u32,
pub length: u8,
}Expand description
An HDLC address (client or server), of 1, 2 or 4 octets. Each octet carries seven address bits and one extension bit (set on the final octet).
Fields§
§value: u32The address value (up to 28 significant bits, seven per octet).
length: u8The address length in octets (1, 2 or 4).
Implementations§
Source§impl HdlcAddress
impl HdlcAddress
Sourcepub fn new(value: u32, length: u8) -> Self
pub fn new(value: u32, length: u8) -> Self
Creates an address with an explicit octet length (1, 2 or 4).
Sourcepub fn one_byte(value: u8) -> Self
pub fn one_byte(value: u8) -> Self
Creates a single-octet address (typical for a client address).
fn encode(self, out: &mut Vec<u8>)
fn decode( bytes: &[u8], offset: usize, ) -> Result<(HdlcAddress, usize), HdlcError>
Trait Implementations§
Source§impl Clone for HdlcAddress
impl Clone for HdlcAddress
Source§fn clone(&self) -> HdlcAddress
fn clone(&self) -> HdlcAddress
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HdlcAddress
Source§impl Debug for HdlcAddress
impl Debug for HdlcAddress
impl Eq for HdlcAddress
Source§impl PartialEq for HdlcAddress
impl PartialEq for HdlcAddress
impl StructuralPartialEq for HdlcAddress
Auto Trait Implementations§
impl Freeze for HdlcAddress
impl RefUnwindSafe for HdlcAddress
impl Send for HdlcAddress
impl Sync for HdlcAddress
impl Unpin for HdlcAddress
impl UnsafeUnpin for HdlcAddress
impl UnwindSafe for HdlcAddress
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