Struct bitcoin_internals::error::input_string::InputString
source · pub struct InputString(/* private fields */);
Expand description
Conditionally stores the input string in parse errors.
This type stores the input string of a parse function depending on whether alloc
feature is
enabled. When it is enabled, the string is stored inside as String
. When disabled this is a
zero-sized type and attempt to store a string does nothing.
This provides two methods to format the error strings depending on the context.
Implementations§
source§impl InputString
impl InputString
sourcepub fn display_cannot_parse<'a, T>(&'a self, what: &'a T) -> CannotParse<'a, T>
pub fn display_cannot_parse<'a, T>(&'a self, what: &'a T) -> CannotParse<'a, T>
Displays a message saying failed to parse <self> as <what>
.
This is normally used whith the write_err!
macro.
Trait Implementations§
source§impl Clone for InputString
impl Clone for InputString
source§fn clone(&self) -> InputString
fn clone(&self) -> InputString
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 InputString
impl Debug for InputString
source§impl From<&str> for InputString
impl From<&str> for InputString
source§impl Hash for InputString
impl Hash for InputString
source§impl Ord for InputString
impl Ord for InputString
source§fn cmp(&self, other: &InputString) -> Ordering
fn cmp(&self, other: &InputString) -> 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 InputString
impl PartialEq for InputString
source§fn eq(&self, other: &InputString) -> bool
fn eq(&self, other: &InputString) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for InputString
impl PartialOrd for InputString
source§fn partial_cmp(&self, other: &InputString) -> Option<Ordering>
fn partial_cmp(&self, other: &InputString) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for InputString
impl StructuralPartialEq for InputString
Auto Trait Implementations§
impl Freeze for InputString
impl RefUnwindSafe for InputString
impl Send for InputString
impl Sync for InputString
impl Unpin for InputString
impl UnwindSafe for InputString
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)