pub struct Builder { /* private fields */ }Implementations§
Source§impl Builder
impl Builder
pub fn new() -> Self
pub fn WriteString(&mut self, s: impl AsRef<str>) -> (int, error)
pub fn WriteByte(&mut self, b: byte) -> error
pub fn WriteRune(&mut self, r: char) -> (int, error)
pub fn String(&self) -> string
Sourcepub fn Cap(&self) -> int
pub fn Cap(&self) -> int
b.Cap() — underlying capacity of the backing buffer. Used by
Go’s tests; here we forward to String::capacity.
Sourcepub fn Write(&mut self, p: &[byte]) -> (int, error)
pub fn Write(&mut self, p: &[byte]) -> (int, error)
b.Write(p) — append raw bytes (must be valid UTF-8 for goish;
Go’s Builder accepts arbitrary bytes since []byte ⊂ string there).
pub fn Len(&self) -> int
pub fn Reset(&mut self)
pub fn Grow(&mut self, n: int)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnsafeUnpin for Builder
impl UnwindSafe for Builder
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