pub struct LineWrap {
pub line_len: usize,
pub line_ending: LineEnding,
}Expand description
Base64 line wrapping policy.
line_len is measured in encoded Base64 bytes, not source input bytes.
Encoders insert line endings between lines and do not append a trailing line
ending after the final line.
Fields§
§line_len: usizeMaximum encoded bytes per line.
line_ending: LineEndingLine ending inserted between wrapped lines.
Implementations§
Source§impl LineWrap
impl LineWrap
Sourcepub const fn new(line_len: usize, line_ending: LineEnding) -> Self
pub const fn new(line_len: usize, line_ending: LineEnding) -> Self
Creates a wrapping policy.
Sourcepub const fn checked_new(
line_len: usize,
line_ending: LineEnding,
) -> Option<Self>
pub const fn checked_new( line_len: usize, line_ending: LineEnding, ) -> Option<Self>
Creates a wrapping policy, returning None when the line length is
invalid.
Base64 line-wrapping requires a non-zero encoded line length. This helper is useful when accepting a wrapping policy from configuration or another untrusted source.
Sourcepub const fn line_ending(self) -> LineEnding
pub const fn line_ending(self) -> LineEnding
Returns the line ending inserted between wrapped lines.
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