Skip to main content

FastUser

Struct FastUser 

Source
pub struct FastUser {
    pub id: u64,
    pub name: String,
    pub active: bool,
}
Expand description

Example binding utilizing Schema-JIT

Fields§

§id: u64§name: String§active: bool

Implementations§

Source§

impl FastUser

Source

pub fn kowito_json_schema_version() -> &'static str

Source

pub fn from_kview<'a>(view: &KView<'a>) -> Self

Zero-Decode constructor — populates from a KView without copying string data (lazy decode).

Source

pub fn to_json_bytes(&self, buf: &mut Vec<u8>)

Ultra-Fast Schema-JIT Serializer.

The JSON object layout is baked in at compile time:

  • All field-key prefixes are static byte slices (&'static [u8]) stored in the read-only data segment — no heap allocation.
  • Integer fields use itoa (lookup-table based, branchless).
  • Float fields use ryu (Grisu3/Dragon4 — shortest round-trip).
  • String fields use the NEON SIMD escape fast-path in kowito_json::serialize::write_str_escape.

A single reserve call at the top pre-allocates the estimated capacity so the hot loop below never reallocates for typical small payloads.

Trait Implementations§

Source§

impl Debug for FastUser

Source§

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

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

impl Default for FastUser

Source§

fn default() -> FastUser

Returns the “default value” for a type. Read more
Source§

impl Serialize for FastUser

Source§

fn serialize(&self, buf: &mut Vec<u8>)

Source§

impl SerializeRaw for FastUser

Source§

unsafe fn serialize_raw(&self, curr: *mut u8) -> *mut u8

Serialize the value directly to raw memory. Read more

Auto Trait Implementations§

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, 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.