[−][src]Struct veriform::encoder::Encoder
Veriform encoder
Implementations
impl<'a> Encoder<'a>
[src]
pub fn new(buffer: &'a mut [u8]) -> Self
[src]
Create a new Encoder
which writes into the provided buffer
pub fn uint64(
&mut self,
tag: Tag,
critical: bool,
value: u64
) -> Result<(), Error>
[src]
&mut self,
tag: Tag,
critical: bool,
value: u64
) -> Result<(), Error>
Write a field containing an unsigned 64-bit integer
pub fn sint64(
&mut self,
tag: Tag,
critical: bool,
value: i64
) -> Result<(), Error>
[src]
&mut self,
tag: Tag,
critical: bool,
value: i64
) -> Result<(), Error>
Write a field containing a signed 64-bit integer
pub fn message(
&mut self,
tag: Tag,
critical: bool,
message: &dyn Message
) -> Result<(), Error>
[src]
&mut self,
tag: Tag,
critical: bool,
message: &dyn Message
) -> Result<(), Error>
Write a message (nested inside of a field)
pub fn message_seq<'m>(
&mut self,
tag: Tag,
critical: bool,
length: usize,
messages: impl Iterator<Item = &'m dyn Message>
) -> Result<(), Error>
[src]
&mut self,
tag: Tag,
critical: bool,
length: usize,
messages: impl Iterator<Item = &'m dyn Message>
) -> Result<(), Error>
Write a sequence of messages (nested inside of a field)
pub fn bytes(
&mut self,
tag: Tag,
critical: bool,
bytes: &[u8]
) -> Result<(), Error>
[src]
&mut self,
tag: Tag,
critical: bool,
bytes: &[u8]
) -> Result<(), Error>
Write a field containing bytes
pub fn string(
&mut self,
tag: Tag,
critical: bool,
string: &str
) -> Result<(), Error>
[src]
&mut self,
tag: Tag,
critical: bool,
string: &str
) -> Result<(), Error>
Write a field containing a string
pub fn finish(self) -> &'a [u8]
[src]
Finish constructing a message, returning a slice of the buffer containing the serialized message
Auto Trait Implementations
impl<'a> RefUnwindSafe for Encoder<'a>
impl<'a> Send for Encoder<'a>
impl<'a> Sync for Encoder<'a>
impl<'a> Unpin for Encoder<'a>
impl<'a> !UnwindSafe for Encoder<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,