pub struct Builder<'a> { /* private fields */ }
Implementations§
source§impl<'a> Builder<'a>
impl<'a> Builder<'a>
pub fn new(bytes: &mut [u8]) -> Builder<'_>
pub fn with_pos(bytes: &mut [u8], pos: usize) -> Builder<'_>
pub fn is_empty(&self) -> bool
pub fn as_bytes(self) -> &'a [u8] ⓘ
sourcepub fn to_str(self) -> Result<&'a str, Utf8Error>
pub fn to_str(self) -> Result<&'a str, Utf8Error>
Converts to a str
, returning a error if the data contains invalid utf-8.
sourcepub fn to_string(self) -> Result<String, Utf8Error>
pub fn to_string(self) -> Result<String, Utf8Error>
Converts to a String
, returning a error if the data contains invalid utf-8.
pub fn as_bytes_mut(self) -> &'a mut [u8] ⓘ
sourcepub fn push_ascii(&mut self, ascii: u8)
pub fn push_ascii(&mut self, ascii: u8)
Writes a single ascii character at position pos
and increments pos
.
sourcepub fn push_str(&mut self, string: &str)
pub fn push_str(&mut self, string: &str)
Writes a string at position pos
and increases pos
a corresponding amount.
pub fn reborrow(&mut self) -> Builder<'_>
pub fn into_reader(self) -> Reader<'a>
pub fn reborrow_as_reader(&self) -> Reader<'_>
Trait Implementations§
source§impl<'a> DowncastBuilder<'a> for Builder<'a>
impl<'a> DowncastBuilder<'a> for Builder<'a>
fn downcast_builder(value: Builder<'a>) -> Self
source§impl<'a> FromPointerBuilder<'a> for Builder<'a>
impl<'a> FromPointerBuilder<'a> for Builder<'a>
fn init_pointer(builder: PointerBuilder<'a>, size: u32) -> Builder<'a>
fn get_from_pointer( builder: PointerBuilder<'a>, default: Option<&'a [Word]> ) -> Result<Builder<'a>>
source§impl<'a> PartialEq<&'a str> for Builder<'a>
impl<'a> PartialEq<&'a str> for Builder<'a>
source§impl<'a> PartialEq<Builder<'a>> for &'a str
impl<'a> PartialEq<Builder<'a>> for &'a str
Auto Trait Implementations§
impl<'a> Freeze for Builder<'a>
impl<'a> RefUnwindSafe for Builder<'a>
impl<'a> Send for Builder<'a>
impl<'a> Sync for Builder<'a>
impl<'a> Unpin for Builder<'a>
impl<'a> !UnwindSafe for Builder<'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