pub struct TokenUrDecoder { /* private fields */ }Expand description
Implementations§
Source§impl TokenUrDecoder
impl TokenUrDecoder
Sourcepub fn receive(&mut self, part: &str) -> Result<(), Error>
pub fn receive(&mut self, part: &str) -> Result<(), Error>
Feeds one scanned QR frame into the decoder
Accepts both multi-part fragments (ur:bytes/<seq>-<len>/<payload>)
and the single-part form (ur:bytes/<payload>).
§Errors
Returns an error if the frame is not a well-formed ur:bytes UR, is
inconsistent with previously received frames, exceeds the decoder
resource limits, or fails checksum validation.
Sourcepub fn fragment_count(&self) -> usize
pub fn fragment_count(&self) -> usize
Returns the total number of fragments the token was split into
This is 0 until the first multi-part fragment is received.
Sourcepub fn resolved_fragment_count(&self) -> Option<usize>
pub fn resolved_fragment_count(&self) -> Option<usize>
Returns the number of fragments resolved so far, either received directly or recovered via the fountain code
Useful for progress indication. Returns None before any fragment
has been received.
Trait Implementations§
Source§impl Debug for TokenUrDecoder
impl Debug for TokenUrDecoder
Source§impl Default for TokenUrDecoder
impl Default for TokenUrDecoder
Source§fn default() -> TokenUrDecoder
fn default() -> TokenUrDecoder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TokenUrDecoder
impl RefUnwindSafe for TokenUrDecoder
impl Send for TokenUrDecoder
impl Sync for TokenUrDecoder
impl Unpin for TokenUrDecoder
impl UnsafeUnpin for TokenUrDecoder
impl UnwindSafe for TokenUrDecoder
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