pub struct UR { /* private fields */ }Expand description
A Uniform Resource (UR) is a URI-encoded CBOR object.
Implementations§
source§impl UR
impl UR
sourcepub fn new<T: Into<String>, C: CBOREncodable>(
ur_type: T,
cbor: &C
) -> Result<UR, URError>
pub fn new<T: Into<String>, C: CBOREncodable>( ur_type: T, cbor: &C ) -> Result<UR, URError>
Creates a new UR from the provided type and CBOR.
sourcepub fn from_ur_string<T: Into<String>>(ur_string: T) -> Result<UR, URError>
pub fn from_ur_string<T: Into<String>>(ur_string: T) -> Result<UR, URError>
Creates a new UR from the provided UR string.
sourcepub fn qr_string(&self) -> String
pub fn qr_string(&self) -> String
Returns the String representation of the UR in uppercase, most-efficient for QR codes.
sourcepub fn qr_data(&self) -> Vec<u8> ⓘ
pub fn qr_data(&self) -> Vec<u8> ⓘ
Returns the data representation of the UR in uppercase, most-efficient for QR codes.
Trait Implementations§
impl StructuralPartialEq for UR
Auto Trait Implementations§
impl RefUnwindSafe for UR
impl Send for UR
impl Sync for UR
impl Unpin for UR
impl UnwindSafe for UR
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