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: boolImplementations§
Source§impl FastUser
impl FastUser
pub fn kowito_json_schema_version() -> &'static str
Sourcepub fn from_kview<'a>(view: &KView<'a>) -> Self
pub fn from_kview<'a>(view: &KView<'a>) -> Self
Zero-Decode constructor — populates from a KView without copying string data (lazy decode).
Sourcepub fn to_json_bytes(&self, buf: &mut Vec<u8>)
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§
Auto Trait Implementations§
impl Freeze for FastUser
impl RefUnwindSafe for FastUser
impl Send for FastUser
impl Sync for FastUser
impl Unpin for FastUser
impl UnsafeUnpin for FastUser
impl UnwindSafe for FastUser
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