pub struct BodyWrap { /* private fields */ }Expand description
Immutable, always-progressing Base64 body wrapping policy.
Implementations§
Source§impl LineWrap
impl LineWrap
Sourcepub const fn try_new(
line_width: usize,
line_ending: LineEnding,
) -> Result<Self, LineWrapError>
pub const fn try_new( line_width: usize, line_ending: LineEnding, ) -> Result<Self, LineWrapError>
Constructs a validated wrapping policy.
Sourcepub const fn line_width(self) -> NonZeroUsize
pub const fn line_width(self) -> NonZeroUsize
Returns the non-zero encoded body width.
Sourcepub const fn line_ending(self) -> LineEnding
pub const fn line_ending(self) -> LineEnding
Returns the separator inserted between body lines.
Sourcepub const fn checked_output_len(self, payload_len: usize) -> Option<usize>
pub const fn checked_output_len(self, payload_len: usize) -> Option<usize>
Returns the exact wrapped size without a trailing line ending.
Sourcepub fn insert_into(self, payload: &[u8], output: &mut [u8]) -> Option<usize>
pub fn insert_into(self, payload: &[u8], output: &mut [u8]) -> Option<usize>
Inserts line endings into an already encoded Base64 body.
The destination is unchanged when it is too small or length arithmetic overflows. Successful output never has a trailing line ending.
Sourcepub fn payload_len(self, input: &[u8]) -> Option<usize>
pub fn payload_len(self, input: &[u8]) -> Option<usize>
Validates wrapped body layout and returns its unwrapped payload length.
Interior lines must have exactly the configured width. A final line may be shorter, and one final line ending is accepted for compatibility with body formats that terminate their last line.
Trait Implementations§
impl Copy for LineWrap
impl Eq for LineWrap
impl StructuralPartialEq for LineWrap
Auto Trait Implementations§
impl Freeze for LineWrap
impl RefUnwindSafe for LineWrap
impl Send for LineWrap
impl Sync for LineWrap
impl Unpin for LineWrap
impl UnsafeUnpin for LineWrap
impl UnwindSafe for LineWrap
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