Struct IonCWriterHandle

Source
pub struct IonCWriterHandle<'a> { /* private fields */ }
Expand description

Wrapper over hWRITER to make it easier to use writers in IonC correctly.

Specifically supports the Drop trait to make sure ion_writer_close is run. Access to the underlying hWRITER pointer is done by de-referencing the handle.

See also:

Implementations§

Source§

impl<'a> IonCWriterHandle<'a>

Source

pub fn new_buf( buf: &'a mut [u8], options: &mut ION_WRITER_OPTIONS, ) -> Result<Self, IonCError>

Construct a writer to a given mutable slice with options.

Source

pub fn new_buf_mode( buf: &'a mut [u8], mode: WriterMode, ) -> Result<Self, IonCError>

Construct a text/binary mode writer with otherwise default options.

Trait Implementations§

Source§

impl Deref for IonCWriterHandle<'_>

Source§

type Target = *mut _ion_writer

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for IonCWriterHandle<'_>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl Drop for IonCWriterHandle<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl IonCAnnotationsFieldWriter for IonCWriterHandle<'_>

Source§

type AFValueWriter = IonCWriterHandle<'_>

The associated type of value writer when writing within annotations/field context
Source§

fn write_annotations_and_field<'a, A, F, FN>( &mut self, possible_annotations: A, possible_field: F, applier: FN, ) -> IonCResult<()>
where A: Into<Option<&'a [&'a str]>>, F: Into<Option<&'a str>>, FN: Fn(&mut Self::AFValueWriter) -> IonCResult<()>,

Writes a value within a context of annotations and/or a field name Read more
Source§

impl IonCValueWriter for IonCWriterHandle<'_>

Source§

fn write_null(&mut self, tid: ION_TYPE) -> IonCResult<()>

Writes a null value. Read more
Source§

fn write_bool(&mut self, value: bool) -> IonCResult<()>

Writes a bool value. Read more
Source§

fn write_i64(&mut self, value: i64) -> IonCResult<()>

Writes an int value. Read more
Source§

fn write_bigint(&mut self, value: &BigInt) -> IonCResult<()>

Writes an int value. Read more
Source§

fn write_f64(&mut self, value: f64) -> IonCResult<()>

Writes a float value. Read more
Source§

fn write_bigdecimal(&mut self, value: &BigDecimal) -> IonCResult<()>

Writes a decimal value. Read more
Source§

fn write_datetime(&mut self, value: &IonDateTime) -> IonCResult<()>

Writes a timestamp value. Read more
Source§

fn write_symbol(&mut self, value: &str) -> IonCResult<()>

Writes a symbol value. Read more
Source§

fn write_string(&mut self, value: &str) -> IonCResult<()>

Writes a string value. Read more
Source§

fn write_clob(&mut self, value: &[u8]) -> IonCResult<()>

Writes a clob value. Read more
Source§

fn write_blob(&mut self, value: &[u8]) -> IonCResult<()>

Writes a blob value. Read more
Source§

fn start_container(&mut self, tid: ION_TYPE) -> IonCResult<()>

Starts a container. Read more
Source§

fn finish_container(&mut self) -> IonCResult<()>

Finishes a container.
Source§

impl<'a> IonCWriter<'a> for IonCWriterHandle<'a>

Source§

fn finish(&mut self) -> IonCResult<usize>

Finalizes writing for the writer and returns the amount of bytes written.
Source§

fn field<'b, 'c>( &'b mut self, field: &'c str, ) -> IonCAnnotationsFieldWriterContext<'b, 'c, Self>

Returns a lifetime safe writing context for a field. Read more
Source§

fn annotations<'b, 'c>( &'b mut self, annotations: &'c [&'c str], ) -> IonCAnnotationsFieldWriterContext<'b, 'c, Self>

Returns a lifetime safe writing context for annotations. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for IonCWriterHandle<'a>

§

impl<'a> RefUnwindSafe for IonCWriterHandle<'a>

§

impl<'a> !Send for IonCWriterHandle<'a>

§

impl<'a> !Sync for IonCWriterHandle<'a>

§

impl<'a> Unpin for IonCWriterHandle<'a>

§

impl<'a> !UnwindSafe for IonCWriterHandle<'a>

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.