Struct lightning_invoice::Description
source · pub struct Description(/* private fields */);
Expand description
Implementations§
source§impl Description
impl Description
sourcepub fn new(description: String) -> Result<Description, CreationError>
pub fn new(description: String) -> Result<Description, CreationError>
Creates a new Description
if description
is at most 1023 * 5 bits (i.e., 639 bytes)
long, and returns CreationError::DescriptionTooLong
otherwise.
Please note that single characters may use more than one byte due to UTF8 encoding.
sourcepub fn into_inner(self) -> UntrustedString
pub fn into_inner(self) -> UntrustedString
Returns the underlying description UntrustedString
sourcepub fn as_inner(&self) -> &UntrustedString
pub fn as_inner(&self) -> &UntrustedString
Get a reference to the underlying description UntrustedString
Trait Implementations§
source§impl Base32Len for Description
impl Base32Len for Description
source§fn base32_len(&self) -> usize
fn base32_len(&self) -> usize
Calculate the base32 serialized length
source§impl Clone for Description
impl Clone for Description
source§fn clone(&self) -> Description
fn clone(&self) -> Description
Returns a copy 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 Description
impl Debug for Description
source§impl Default for Description
impl Default for Description
source§fn default() -> Description
fn default() -> Description
Returns the “default value” for a type. Read more
source§impl Display for Description
impl Display for Description
source§impl FromBase32 for Description
impl FromBase32 for Description
source§type Err = Bolt11ParseError
type Err = Bolt11ParseError
The associated error which can be returned from parsing (e.g. because of bad padding).
source§fn from_base32(field_data: &[u5]) -> Result<Description, Bolt11ParseError>
fn from_base32(field_data: &[u5]) -> Result<Description, Bolt11ParseError>
Convert a base32 slice to
Self
.source§impl Hash for Description
impl Hash for Description
source§impl Ord for Description
impl Ord for Description
source§fn cmp(&self, other: &Description) -> Ordering
fn cmp(&self, other: &Description) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for Description
impl PartialEq for Description
source§impl PartialOrd for Description
impl PartialOrd for Description
source§impl ToBase32 for Description
impl ToBase32 for Description
source§fn write_base32<W: WriteBase32>(
&self,
writer: &mut W,
) -> Result<(), <W as WriteBase32>::Err>
fn write_base32<W: WriteBase32>( &self, writer: &mut W, ) -> Result<(), <W as WriteBase32>::Err>
Encode as base32 and write it to the supplied writer
Implementations shouldn’t allocate.
impl Eq for Description
impl StructuralPartialEq for Description
Auto Trait Implementations§
impl Freeze for Description
impl RefUnwindSafe for Description
impl Send for Description
impl Sync for Description
impl Unpin for Description
impl UnwindSafe for Description
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)