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(
ur_type: impl Into<String>,
cbor: impl CBOREncodable
) -> Result<UR, URError>
pub fn new( ur_type: impl Into<String>, cbor: impl CBOREncodable ) -> Result<UR, URError>
Creates a new UR from the provided type and CBOR.
sourcepub fn from_ur_string(ur_string: impl Into<String>) -> Result<UR, URError>
pub fn from_ur_string(ur_string: impl Into<String>) -> 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