pub struct CodecBuilder { /* private fields */ }Expand description
Fallible no-allocation builder for an advanced ordinary runtime codec.
Implementations§
Source§impl CodecBuilder
impl CodecBuilder
Sourcepub const fn new(alphabet: ValidatedAlphabet) -> Self
pub const fn new(alphabet: ValidatedAlphabet) -> Self
Starts with strict canonical padded policies and an owned alphabet.
Sourcepub const fn from_table(table: [u8; 64]) -> Result<Self, ValidatedAlphabetError>
pub const fn from_table(table: [u8; 64]) -> Result<Self, ValidatedAlphabetError>
Validates and owns an alphabet table before constructing the builder.
Sourcepub const fn from_slice(bytes: &[u8]) -> Result<Self, ValidatedAlphabetError>
pub const fn from_slice(bytes: &[u8]) -> Result<Self, ValidatedAlphabetError>
Copies and validates a runtime alphabet slice.
Sourcepub const fn encode_padding(self, policy: EncodePadding) -> Self
pub const fn encode_padding(self, policy: EncodePadding) -> Self
Sets whether encoding emits padding.
Sourcepub const fn decode_padding(self, policy: DecodePadding) -> Self
pub const fn decode_padding(self, policy: DecodePadding) -> Self
Sets the ordinary decode-padding policy.
Sourcepub const fn trailing_bits(self, policy: TrailingBits) -> Self
pub const fn trailing_bits(self, policy: TrailingBits) -> Self
Sets the ordinary trailing-bit canonicality policy.
Sourcepub const fn build(self) -> Result<Base64<RuntimeSpec>, CodecBuilderError>
pub const fn build(self) -> Result<Base64<RuntimeSpec>, CodecBuilderError>
Validates policy compatibility and constructs an owned runtime codec.
Trait Implementations§
Source§impl Clone for CodecBuilder
impl Clone for CodecBuilder
Source§fn clone(&self) -> CodecBuilder
fn clone(&self) -> CodecBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CodecBuilder
Source§impl Debug for CodecBuilder
impl Debug for CodecBuilder
impl Eq for CodecBuilder
Source§impl PartialEq for CodecBuilder
impl PartialEq for CodecBuilder
impl StructuralPartialEq for CodecBuilder
Auto Trait Implementations§
impl Freeze for CodecBuilder
impl RefUnwindSafe for CodecBuilder
impl Send for CodecBuilder
impl Sync for CodecBuilder
impl Unpin for CodecBuilder
impl UnsafeUnpin for CodecBuilder
impl UnwindSafe for CodecBuilder
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