Struct ion_rs::binary::raw_binary_writer::RawBinaryWriter
source · [−]pub struct RawBinaryWriter<W: Write> { /* private fields */ }
Expand description
A system-level streaming binary Ion writer. This writer does not provide symbol table management; symbol-related operations (e.g. setting field IDs and annotations or writing symbol values) require a valid symbol ID to be provided by the caller.
To produce a valid binary Ion stream, the writer MUST call Writer::write_ion_version_marker before writing any data.
Implementations
sourceimpl<W: Write> RawBinaryWriter<W>
impl<W: Write> RawBinaryWriter<W>
pub fn clear_annotations(&mut self)
pub fn has_annotations(&self) -> bool
pub fn write_symbol_id(&mut self, symbol_id: SymbolId) -> IonResult<()>
pub fn set_field_id(&mut self, field_id: SymbolId)
sourcepub fn output_mut(&mut self) -> &mut W
pub fn output_mut(&mut self) -> &mut W
Returns a mutable reference to the underlying io::Write implementation. Modifying the underlying sink is an inherently risky operation and can result in unexpected behavior. It is not recommended for most use cases.
pub fn add_annotation<A: AsRawSymbolTokenRef>(&mut self, annotation: A)
Trait Implementations
sourceimpl<W: Debug + Write> Debug for RawBinaryWriter<W>
impl<W: Debug + Write> Debug for RawBinaryWriter<W>
sourceimpl<'a, W: Write> Writer for RawBinaryWriter<W>
impl<'a, W: Write> Writer for RawBinaryWriter<W>
sourcefn write_null(&mut self, ion_type: IonType) -> IonResult<()>
fn write_null(&mut self, ion_type: IonType) -> IonResult<()>
Writes an Ion null of the specified type.
sourcefn write_bool(&mut self, value: bool) -> IonResult<()>
fn write_bool(&mut self, value: bool) -> IonResult<()>
Writes an Ion boolean with the specified value.
sourcefn write_i64(&mut self, value: i64) -> IonResult<()>
fn write_i64(&mut self, value: i64) -> IonResult<()>
Writes an Ion integer with the specified value.
sourcefn write_integer(&mut self, value: &Integer) -> IonResult<()>
fn write_integer(&mut self, value: &Integer) -> IonResult<()>
Writes an Ion integer with the specified value.
sourcefn write_f32(&mut self, value: f32) -> IonResult<()>
fn write_f32(&mut self, value: f32) -> IonResult<()>
Writes an Ion float with the specified value.
sourcefn write_f64(&mut self, value: f64) -> IonResult<()>
fn write_f64(&mut self, value: f64) -> IonResult<()>
Writes an Ion float with the specified value.
sourcefn write_decimal(&mut self, value: &Decimal) -> IonResult<()>
fn write_decimal(&mut self, value: &Decimal) -> IonResult<()>
Writes an Ion decimal with the specified value.
sourcefn write_timestamp(&mut self, value: &Timestamp) -> IonResult<()>
fn write_timestamp(&mut self, value: &Timestamp) -> IonResult<()>
Writes an Ion timestamp with the specified value.
sourcefn step_in(&mut self, ion_type: IonType) -> IonResult<()>
fn step_in(&mut self, ion_type: IonType) -> IonResult<()>
Starts a container of the specified Ion type. If ion_type
is not a List, SExpression,
or Struct, step_in
will return an Err.
sourcefn step_out(&mut self) -> IonResult<()>
fn step_out(&mut self) -> IonResult<()>
Ends the current container. If the writer is at the top level, step_out
will return an Err.
sourcefn flush(&mut self) -> IonResult<()>
fn flush(&mut self) -> IonResult<()>
Writes any buffered data to the sink. This method can only be called when the writer is at the top level.
sourcefn ion_version(&self) -> (u8, u8)
fn ion_version(&self) -> (u8, u8)
Returns the (major, minor) version of the Ion stream being written. If ion_version is called before an Ion Version Marker has been emitted, the version (1, 0) will be returned. Read more
sourcefn write_ion_version_marker(&mut self, major: u8, minor: u8) -> IonResult<()>
fn write_ion_version_marker(&mut self, major: u8, minor: u8) -> IonResult<()>
Writes an Ion version marker to the output stream.
sourcefn supports_text_symbol_tokens(&self) -> bool
fn supports_text_symbol_tokens(&self) -> bool
Returns true
if this RawWriter supports writing field names, annotations, and
symbol values directly as text; otherwise, returns false
. Read more
sourcefn set_annotations<I, A>(&mut self, annotations: I) where
A: AsRawSymbolTokenRef,
I: IntoIterator<Item = A>,
fn set_annotations<I, A>(&mut self, annotations: I) where
A: AsRawSymbolTokenRef,
I: IntoIterator<Item = A>,
Sets a list of annotations that will be applied to the next value that is written.
sourcefn write_symbol<A: AsRawSymbolTokenRef>(&mut self, value: A) -> IonResult<()>
fn write_symbol<A: AsRawSymbolTokenRef>(&mut self, value: A) -> IonResult<()>
Writes an Ion symbol
with the specified value to the output stream.
sourcefn write_string<S: AsRef<str>>(&mut self, value: S) -> IonResult<()>
fn write_string<S: AsRef<str>>(&mut self, value: S) -> IonResult<()>
Writes an Ion string
with the specified value to the output stream.
sourcefn write_clob<A: AsRef<[u8]>>(&mut self, value: A) -> IonResult<()>
fn write_clob<A: AsRef<[u8]>>(&mut self, value: A) -> IonResult<()>
Writes an Ion clob
with the specified value to the output stream.
sourcefn write_blob<A: AsRef<[u8]>>(&mut self, value: A) -> IonResult<()>
fn write_blob<A: AsRef<[u8]>>(&mut self, value: A) -> IonResult<()>
Writes an Ion blob
with the specified value to the output stream.
sourcefn set_field_name<A: AsRawSymbolTokenRef>(&mut self, name: A)
fn set_field_name<A: AsRawSymbolTokenRef>(&mut self, name: A)
Sets the current field name to name
. If the TextWriter is currently positioned inside
of a struct, the field name will be written before the next value. Otherwise, it will be
ignored. Read more
sourcefn parent_type(&self) -> Option<IonType>
fn parent_type(&self) -> Option<IonType>
Auto Trait Implementations
impl<W> RefUnwindSafe for RawBinaryWriter<W> where
W: RefUnwindSafe,
impl<W> Send for RawBinaryWriter<W> where
W: Send,
impl<W> Sync for RawBinaryWriter<W> where
W: Sync,
impl<W> Unpin for RawBinaryWriter<W> where
W: Unpin,
impl<W> UnwindSafe for RawBinaryWriter<W> where
W: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more