pub struct TextString(pub String);Expand description
A UTF-8 text string.
use cbor_tools::{CborType, TextString, Encode};
let name = "Foo!";
let val = TextString::from(name);
assert_eq!(CborType::from(val).encode(), vec![0x64, 0x46, 0x6f, 0x6f, 0x21]);Tuple Fields§
§0: StringTrait Implementations§
Source§impl Clone for TextString
impl Clone for TextString
Source§fn clone(&self) -> TextString
fn clone(&self) -> TextString
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextString
impl Debug for TextString
Source§impl<T> From<T> for TextString
impl<T> From<T> for TextString
Source§impl From<TextString> for CborType
impl From<TextString> for CborType
Source§fn from(x: TextString) -> CborType
fn from(x: TextString) -> CborType
Converts to this type from the input type.
Source§impl PartialEq for TextString
impl PartialEq for TextString
impl StructuralPartialEq for TextString
Auto Trait Implementations§
impl Freeze for TextString
impl RefUnwindSafe for TextString
impl Send for TextString
impl Sync for TextString
impl Unpin for TextString
impl UnwindSafe for TextString
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