Trait bs58::encode::EncodeTarget
source · pub trait EncodeTarget {
// Required method
fn encode_with(
&mut self,
max_len: usize,
f: impl for<'a> FnOnce(&'a mut [u8]) -> Result<usize>,
) -> Result<usize>;
}
Expand description
Represents a buffer that can be encoded into. See EncodeBuilder::onto
and the provided
implementations for more details.
Required Methods§
sourcefn encode_with(
&mut self,
max_len: usize,
f: impl for<'a> FnOnce(&'a mut [u8]) -> Result<usize>,
) -> Result<usize>
fn encode_with( &mut self, max_len: usize, f: impl for<'a> FnOnce(&'a mut [u8]) -> Result<usize>, ) -> Result<usize>
Encodes into this buffer, provides the maximum length for implementations that wish to preallocate space, along with a function that will encode ASCII bytes into the buffer and return the length written to it.
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl EncodeTarget for str
impl EncodeTarget for str
source§impl EncodeTarget for String
Available on crate feature alloc
only.
impl EncodeTarget for String
Available on crate feature
alloc
only.source§impl EncodeTarget for Vec<u8>
Available on crate feature alloc
only.
impl EncodeTarget for Vec<u8>
Available on crate feature
alloc
only.