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>
impl<'a> IonCWriterHandle<'a>
Sourcepub fn new_buf(
buf: &'a mut [u8],
options: &mut ION_WRITER_OPTIONS,
) -> Result<Self, IonCError>
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.
Sourcepub fn new_buf_mode(
buf: &'a mut [u8],
mode: WriterMode,
) -> Result<Self, IonCError>
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<'_>
impl Deref for IonCWriterHandle<'_>
Source§impl DerefMut for IonCWriterHandle<'_>
impl DerefMut for IonCWriterHandle<'_>
Source§impl Drop for IonCWriterHandle<'_>
impl Drop for IonCWriterHandle<'_>
Source§impl IonCAnnotationsFieldWriter for IonCWriterHandle<'_>
impl IonCAnnotationsFieldWriter for IonCWriterHandle<'_>
Source§type AFValueWriter = IonCWriterHandle<'_>
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<()>,
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<'_>
impl IonCValueWriter for IonCWriterHandle<'_>
Source§fn write_null(&mut self, tid: ION_TYPE) -> IonCResult<()>
fn write_null(&mut self, tid: ION_TYPE) -> IonCResult<()>
Writes a
null value. Read moreSource§fn write_bool(&mut self, value: bool) -> IonCResult<()>
fn write_bool(&mut self, value: bool) -> IonCResult<()>
Writes a
bool value. Read moreSource§fn write_bigint(&mut self, value: &BigInt) -> IonCResult<()>
fn write_bigint(&mut self, value: &BigInt) -> IonCResult<()>
Writes an
int value. Read moreSource§fn write_bigdecimal(&mut self, value: &BigDecimal) -> IonCResult<()>
fn write_bigdecimal(&mut self, value: &BigDecimal) -> IonCResult<()>
Writes a
decimal value. Read moreSource§fn write_datetime(&mut self, value: &IonDateTime) -> IonCResult<()>
fn write_datetime(&mut self, value: &IonDateTime) -> IonCResult<()>
Writes a
timestamp value. Read moreSource§fn write_symbol(&mut self, value: &str) -> IonCResult<()>
fn write_symbol(&mut self, value: &str) -> IonCResult<()>
Writes a
symbol value. Read moreSource§fn write_string(&mut self, value: &str) -> IonCResult<()>
fn write_string(&mut self, value: &str) -> IonCResult<()>
Writes a
string value. Read moreSource§fn write_clob(&mut self, value: &[u8]) -> IonCResult<()>
fn write_clob(&mut self, value: &[u8]) -> IonCResult<()>
Writes a
clob value. Read moreSource§fn write_blob(&mut self, value: &[u8]) -> IonCResult<()>
fn write_blob(&mut self, value: &[u8]) -> IonCResult<()>
Writes a
blob value. Read moreSource§fn start_container(&mut self, tid: ION_TYPE) -> IonCResult<()>
fn start_container(&mut self, tid: ION_TYPE) -> IonCResult<()>
Starts a container. Read more
Source§fn finish_container(&mut self) -> IonCResult<()>
fn finish_container(&mut self) -> IonCResult<()>
Finishes a container.
Source§impl<'a> IonCWriter<'a> for IonCWriterHandle<'a>
impl<'a> IonCWriter<'a> for IonCWriterHandle<'a>
Source§fn finish(&mut self) -> IonCResult<usize>
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>
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>
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> 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