Skip to main content

WxfWriter

Struct WxfWriter 

Source
pub struct WxfWriter<W> { /* private fields */ }
Expand description

Typed WXF writer wrapping a raw byte Writer.

Implementations§

Source§

impl<W: Writer> WxfWriter<W>

Source

pub fn new(inner: W) -> Self

Wrap a raw writer. The writer emits only the WXF token stream — the 8: / 8C: header is framing, written by crate::to_wxf.

Source

pub fn into_inner(self) -> W

Consume the writer, returning the underlying sink.

Source

pub fn write_varint(&mut self, n: u64) -> Result<(), Error>

Write a WXF varint (LEB128, 7-bit groups, little-endian).

Source

pub fn write_expr_token(&mut self, t: ExpressionEnum) -> Result<(), Error>

Write a single expression token byte.

Source

pub fn write_integer(&mut self, n: i64) -> Result<(), Error>

Write an integer using the smallest of Integer8/16/32/64.

Source

pub fn write_real(&mut self, f: f64) -> Result<(), Error>

Write a Real64.

Source

pub fn write_string(&mut self, s: &str) -> Result<(), Error>

Write a String.

Source

pub fn write_symbol(&mut self, name: &str) -> Result<(), Error>

Write a Symbol (fully-qualified name).

Source

pub fn write_byte_array(&mut self, bytes: &[u8]) -> Result<(), Error>

Write a ByteArray.

Source

pub fn write_big_integer(&mut self, digits: &str) -> Result<(), Error>

Write a BigInteger from its decimal digit string.

Source

pub fn write_big_real(&mut self, digits: &str) -> Result<(), Error>

Write a BigReal from its digit string.

Source

pub fn write_numeric_array( &mut self, dt: NumericArrayEnum, dims: &[usize], bytes: &[u8], ) -> Result<(), Error>

Write a NumericArray from raw parts.

Source

pub fn write_packed_array( &mut self, dt: PackedArrayEnum, dims: &[usize], bytes: &[u8], ) -> Result<(), Error>

Write a PackedArray from raw parts.

Source

pub fn write_function(&mut self, arity: usize) -> Result<(), Error>

Write a Function header (head[args…]): the token + arity. The caller next writes the head value, then arity argument values.

Source

pub fn write_association(&mut self, count: usize) -> Result<(), Error>

Write an Association header: the token + entry count. The caller next writes count × (write_rule, key, value).

Source

pub fn write_rule(&mut self, delayed: bool) -> Result<(), Error>

Write a Rule (or RuleDelayed) token.

Auto Trait Implementations§

§

impl<W> Freeze for WxfWriter<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for WxfWriter<W>
where W: RefUnwindSafe,

§

impl<W> Send for WxfWriter<W>
where W: Send,

§

impl<W> Sync for WxfWriter<W>
where W: Sync,

§

impl<W> Unpin for WxfWriter<W>
where W: Unpin,

§

impl<W> UnsafeUnpin for WxfWriter<W>
where W: UnsafeUnpin,

§

impl<W> UnwindSafe for WxfWriter<W>
where W: 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, 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.