Struct InlineJson

Source
#[repr(C, packed(1))]
pub struct InlineJson<T = u16> { /* private fields */ }

Implementations§

Source§

impl InlineJson<u8>

Source

pub unsafe fn from_ptr<'a>(ptr: *const u8) -> &'a Self

§Safety
Source

pub fn as_ptr(&self) -> *const u8

Source

pub const fn as_bytes(&self) -> &[u8]

Source

pub const fn as_str(&self) -> &str

Source

pub const fn len(&self) -> usize

Parse inline bytes to json value.

§Panic

It will panic when the inner bytes is not valid to parse as json.

Source§

impl InlineJson<u16>

Source

pub unsafe fn from_ptr<'a>(ptr: *const u8) -> &'a Self

§Safety
Source

pub fn as_ptr(&self) -> *const u8

Source

pub const fn as_bytes(&self) -> &[u8]

Source

pub const fn as_str(&self) -> &str

Source

pub const fn len(&self) -> usize

Parse inline bytes to json value.

§Panic

It will panic when the inner bytes is not valid to parse as json.

Source§

impl InlineJson<u32>

Source

pub unsafe fn from_ptr<'a>(ptr: *const u8) -> &'a Self

§Safety
Source

pub fn as_ptr(&self) -> *const u8

Source

pub const fn as_bytes(&self) -> &[u8]

Source

pub const fn as_str(&self) -> &str

Source

pub const fn len(&self) -> usize

Parse inline bytes to json value.

§Panic

It will panic when the inner bytes is not valid to parse as json.

Source§

impl InlineJson<u64>

Source

pub unsafe fn from_ptr<'a>(ptr: *const u8) -> &'a Self

§Safety
Source

pub fn as_ptr(&self) -> *const u8

Source

pub const fn as_bytes(&self) -> &[u8]

Source

pub const fn as_str(&self) -> &str

Source

pub const fn len(&self) -> usize

Parse inline bytes to json value.

§Panic

It will panic when the inner bytes is not valid to parse as json.

Source§

impl InlineJson<usize>

Source

pub unsafe fn from_ptr<'a>(ptr: *const u8) -> &'a Self

§Safety
Source

pub fn as_ptr(&self) -> *const u8

Source

pub const fn as_bytes(&self) -> &[u8]

Source

pub const fn as_str(&self) -> &str

Source

pub const fn len(&self) -> usize

Parse inline bytes to json value.

§Panic

It will panic when the inner bytes is not valid to parse as json.

Trait Implementations§

Source§

impl AsRef<str> for InlineJson<u16>

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<str> for InlineJson<u32>

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<str> for InlineJson<u64>

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<str> for InlineJson<u8>

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<str> for InlineJson<usize>

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Debug for InlineJson<u16>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Debug for InlineJson<u32>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Debug for InlineJson<u64>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Debug for InlineJson<u8>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Debug for InlineJson<usize>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for InlineJson<u16>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for InlineJson<u32>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for InlineJson<u64>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for InlineJson<u8>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for InlineJson<usize>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Inlinable for InlineJson<u16>

Source§

fn write_inlined<W: Write>(&self, wtr: &mut W) -> Result<usize>

Write inlined bytes to a writer.
Source§

fn read_inlined<R: Read>(_: &mut R) -> Result<Self>

Read inlined bytes into object.
Source§

fn read_optional_inlined<R: Read>(reader: &mut R) -> Result<Option<Self>>
where Self: Sized,

Source§

fn write_inlined_with<W: Write>( &self, wtr: &mut W, _opts: InlineOpts, ) -> Result<usize>

Write inlined bytes with specific options
Source§

fn inlined(&self) -> Vec<u8>

Get inlined bytes as vector.
Source§

fn printable_inlined(&self) -> String

Get inlined bytes as printable string, all the bytes will displayed with escaped ascii code.
Source§

impl Inlinable for InlineJson<u32>

Source§

fn write_inlined<W: Write>(&self, wtr: &mut W) -> Result<usize>

Write inlined bytes to a writer.
Source§

fn read_inlined<R: Read>(_: &mut R) -> Result<Self>

Read inlined bytes into object.
Source§

fn read_optional_inlined<R: Read>(reader: &mut R) -> Result<Option<Self>>
where Self: Sized,

Source§

fn write_inlined_with<W: Write>( &self, wtr: &mut W, _opts: InlineOpts, ) -> Result<usize>

Write inlined bytes with specific options
Source§

fn inlined(&self) -> Vec<u8>

Get inlined bytes as vector.
Source§

fn printable_inlined(&self) -> String

Get inlined bytes as printable string, all the bytes will displayed with escaped ascii code.
Source§

impl Inlinable for InlineJson<u64>

Source§

fn write_inlined<W: Write>(&self, wtr: &mut W) -> Result<usize>

Write inlined bytes to a writer.
Source§

fn read_inlined<R: Read>(_: &mut R) -> Result<Self>

Read inlined bytes into object.
Source§

fn read_optional_inlined<R: Read>(reader: &mut R) -> Result<Option<Self>>
where Self: Sized,

Source§

fn write_inlined_with<W: Write>( &self, wtr: &mut W, _opts: InlineOpts, ) -> Result<usize>

Write inlined bytes with specific options
Source§

fn inlined(&self) -> Vec<u8>

Get inlined bytes as vector.
Source§

fn printable_inlined(&self) -> String

Get inlined bytes as printable string, all the bytes will displayed with escaped ascii code.
Source§

impl Inlinable for InlineJson<u8>

Source§

fn write_inlined<W: Write>(&self, wtr: &mut W) -> Result<usize>

Write inlined bytes to a writer.
Source§

fn read_inlined<R: Read>(_: &mut R) -> Result<Self>

Read inlined bytes into object.
Source§

fn read_optional_inlined<R: Read>(reader: &mut R) -> Result<Option<Self>>
where Self: Sized,

Source§

fn write_inlined_with<W: Write>( &self, wtr: &mut W, _opts: InlineOpts, ) -> Result<usize>

Write inlined bytes with specific options
Source§

fn inlined(&self) -> Vec<u8>

Get inlined bytes as vector.
Source§

fn printable_inlined(&self) -> String

Get inlined bytes as printable string, all the bytes will displayed with escaped ascii code.
Source§

impl Inlinable for InlineJson<usize>

Source§

fn write_inlined<W: Write>(&self, wtr: &mut W) -> Result<usize>

Write inlined bytes to a writer.
Source§

fn read_inlined<R: Read>(_: &mut R) -> Result<Self>

Read inlined bytes into object.
Source§

fn read_optional_inlined<R: Read>(reader: &mut R) -> Result<Option<Self>>
where Self: Sized,

Source§

fn write_inlined_with<W: Write>( &self, wtr: &mut W, _opts: InlineOpts, ) -> Result<usize>

Write inlined bytes with specific options
Source§

fn inlined(&self) -> Vec<u8>

Get inlined bytes as vector.
Source§

fn printable_inlined(&self) -> String

Get inlined bytes as printable string, all the bytes will displayed with escaped ascii code.

Auto Trait Implementations§

§

impl<T> Freeze for InlineJson<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for InlineJson<T>
where T: RefUnwindSafe,

§

impl<T> Send for InlineJson<T>
where T: Send,

§

impl<T> Sync for InlineJson<T>
where T: Sync,

§

impl<T> Unpin for InlineJson<T>
where T: Unpin,

§

impl<T> UnwindSafe for InlineJson<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.