Skip to main content

RnsSerialScanner

Struct RnsSerialScanner 

Source
pub struct RnsSerialScanner { /* private fields */ }
Expand description

Bytes that arrive with no frame open are taken as the body of a frame whose opening FLAG was missed, so they close at the next FLAG as one typically undecodable frame and the scanner realigns. RNS’s FLAG data FLAG FLAG data FLAG layout would otherwise let a mid-frame join lock the decoder a half-frame out of phase permanently.

Implementations§

Source§

impl RnsSerialScanner

Source

pub const fn new() -> RnsSerialScanner

Source

pub fn reset(&mut self)

Source

pub fn next_frame_into( &mut self, input: &[u8], offset: &mut usize, sink: &mut dyn FrameSink, ) -> Result<Option<usize>, DecodeError>

The next complete frame at or after *offset in input, its payload left in sink, advancing offset past the bytes consumed. Ok(Some(len)) is the payload length now in the sink (0 is a delimiter-only keepalive); Ok(None) means the chunk is exhausted mid-frame, with the partial payload accumulated in the sink to be continued by the next chunk. A frame past the sink’s capacity is discarded whole (DecodeError::FrameTooBig, sink cleared) and scanning realigns at the next FLAG.

Trait Implementations§

Source§

impl Clone for RnsSerialScanner

Source§

fn clone(&self) -> RnsSerialScanner

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for RnsSerialScanner

Source§

impl Debug for RnsSerialScanner

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for RnsSerialScanner

Source§

fn default() -> RnsSerialScanner

Returns the “default value” for a type. Read more
Source§

impl Eq for RnsSerialScanner

Source§

impl PartialEq for RnsSerialScanner

Source§

fn eq(&self, other: &RnsSerialScanner) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RnsSerialScanner

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.