Struct capnp::text::Builder

source ·
pub struct Builder<'a> { /* private fields */ }

Implementations§

source§

impl<'a> Builder<'a>

source

pub fn new(bytes: &mut [u8]) -> Builder<'_>

source

pub fn with_pos(bytes: &mut [u8], pos: usize) -> Builder<'_>

source

pub fn len(&self) -> usize

The string’s length, in bytes.

source

pub fn is_empty(&self) -> bool

source

pub fn as_bytes(self) -> &'a [u8]

source

pub fn to_str(self) -> Result<&'a str, Utf8Error>

Converts to a str, returning a error if the data contains invalid utf-8.

source

pub fn to_string(self) -> Result<String, Utf8Error>

Converts to a String, returning a error if the data contains invalid utf-8.

source

pub fn as_bytes_mut(self) -> &'a mut [u8]

source

pub fn push_ascii(&mut self, ascii: u8)

Writes a single ascii character at position pos and increments pos.

source

pub fn push_str(&mut self, string: &str)

Writes a string at position pos and increases pos a corresponding amount.

source

pub fn clear(&mut self)

Zeroes all data and resets pos.

source

pub fn reborrow(&mut self) -> Builder<'_>

source

pub fn into_reader(self) -> Reader<'a>

source

pub fn reborrow_as_reader(&self) -> Reader<'_>

Trait Implementations§

source§

impl<'a> Debug for Builder<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> DowncastBuilder<'a> for Builder<'a>

source§

fn downcast_builder(value: Builder<'a>) -> Self

source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(t: Builder<'a>) -> Builder<'a>

Converts to this type from the input type.
source§

impl<'a> FromPointerBuilder<'a> for Builder<'a>

source§

fn init_pointer(builder: PointerBuilder<'a>, size: u32) -> Builder<'a>

source§

fn get_from_pointer( builder: PointerBuilder<'a>, default: Option<&'a [Word]> ) -> Result<Builder<'a>>

source§

impl<'a> PartialEq<&'a str> for Builder<'a>

source§

fn eq(&self, other: &&'a str) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<Builder<'a>> for &'a str

source§

fn eq(&self, other: &Builder<'a>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq for Builder<'a>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

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> 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<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.