Type Alias json_ld_syntax::NumberBuf
source · pub type NumberBuf = NumberBuf<SmallVec<[u8; 16]>>;
Expand description
Number buffer.
Aliased Type§
struct NumberBuf { /* private fields */ }
Implementations
source§impl<B> NumberBuf<B>
impl<B> NumberBuf<B>
sourcepub fn new(data: B) -> Result<NumberBuf<B>, InvalidNumber<B>>
pub fn new(data: B) -> Result<NumberBuf<B>, InvalidNumber<B>>
Creates a new number buffer by parsing the given input data
buffer.
sourcepub unsafe fn new_unchecked(data: B) -> NumberBuf<B>
pub unsafe fn new_unchecked(data: B) -> NumberBuf<B>
Creates a new number buffer from the given input data
buffer.
§Safety
The input data
must hold a valid JSON number string.
sourcepub fn from_number(n: &Number) -> NumberBuf<B>where
B: FromIterator<u8>,
pub fn from_number(n: &Number) -> NumberBuf<B>where
B: FromIterator<u8>,
Creates a number buffer from the given number
.
pub fn buffer(&self) -> &B
pub fn into_buffer(self) -> B
Trait Implementations§
source§impl<B> Ord for NumberBuf<B>where
B: Ord,
impl<B> Ord for NumberBuf<B>where
B: Ord,
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 Parse for NumberBuf<SmallVec<[u8; 16]>>
impl Parse for NumberBuf<SmallVec<[u8; 16]>>
fn parse_in<C, E>( parser: &mut Parser<C, E>, context: Context ) -> Result<Meta<NumberBuf<SmallVec<[u8; 16]>>, usize>, Error<E>>
fn parse_slice(content: &[u8]) -> Result<(Self, CodeMap), Error>
fn parse_slice_with( content: &[u8], options: Options ) -> Result<(Self, CodeMap), Error>
fn parse_str(content: &str) -> Result<(Self, CodeMap), Error>
fn parse_str_with( content: &str, options: Options ) -> Result<(Self, CodeMap), Error>
fn parse_infallible_utf8<C>(chars: C) -> Result<(Self, CodeMap), Error>
fn parse_utf8_infallible_with<C>( chars: C, options: Options ) -> Result<(Self, CodeMap), Error>
fn parse_utf8<C, E>(chars: C) -> Result<(Self, CodeMap), Error<E>>
fn parse_utf8_with<C, E>( chars: C, options: Options ) -> Result<(Self, CodeMap), Error<E>>
fn parse_infallible<C>(chars: C) -> Result<(Self, CodeMap), Error>where
C: Iterator<Item = DecodedChar>,
fn parse_infallible_with<C>(
chars: C,
options: Options
) -> Result<(Self, CodeMap), Error>where
C: Iterator<Item = DecodedChar>,
fn parse<C, E>(chars: C) -> Result<(Self, CodeMap), Error<E>>
fn parse_with<C, E>( chars: C, options: Options ) -> Result<(Self, CodeMap), Error<E>>
source§impl<B> PartialEq for NumberBuf<B>where
B: PartialEq,
impl<B> PartialEq for NumberBuf<B>where
B: PartialEq,
source§impl<B> PartialOrd for NumberBuf<B>where
B: PartialOrd,
impl<B> PartialOrd for NumberBuf<B>where
B: PartialOrd,
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 moresource§impl Print for NumberBuf<SmallVec<[u8; 16]>>
impl Print for NumberBuf<SmallVec<[u8; 16]>>
fn fmt_with( &self, f: &mut Formatter<'_>, _options: &Options, _indent: usize ) -> Result<(), Error>
source§fn pretty_print(&self) -> Printed<'_, Self>
fn pretty_print(&self) -> Printed<'_, Self>
Print the value with
Options::pretty
options.source§fn compact_print(&self) -> Printed<'_, Self>
fn compact_print(&self) -> Printed<'_, Self>
Print the value with
Options::compact
options.source§fn inline_print(&self) -> Printed<'_, Self>
fn inline_print(&self) -> Printed<'_, Self>
Print the value with
Options::inline
options.source§fn print_with(&self, options: Options) -> Printed<'_, Self>
fn print_with(&self, options: Options) -> Printed<'_, Self>
Print the value with the given options.