struct PartiallyValidatedUtf8<'a> {
slice: &'a [u8],
offset: usize,
}Expand description
Bytes that have been partially validated as UTF-8 up to an offset.
Fields§
§slice: &'a [u8]§offset: usizeImplementations§
Source§impl<'a> PartiallyValidatedUtf8<'a>
impl<'a> PartiallyValidatedUtf8<'a>
fn new(slice: &'a [u8]) -> Self
Sourcefn try_push(&mut self, valid_str: &str) -> bool
fn try_push(&mut self, valid_str: &str) -> bool
Check whether the given string is the next chunk of unvalidated bytes. If so, increment offset and return true. Otherwise, return false.
Sourcefn validated_as_str(&self) -> &'a str
fn validated_as_str(&self) -> &'a str
Return the validated portion as &str.
Auto Trait Implementations§
impl<'a> Freeze for PartiallyValidatedUtf8<'a>
impl<'a> RefUnwindSafe for PartiallyValidatedUtf8<'a>
impl<'a> Send for PartiallyValidatedUtf8<'a>
impl<'a> Sync for PartiallyValidatedUtf8<'a>
impl<'a> Unpin for PartiallyValidatedUtf8<'a>
impl<'a> UnsafeUnpin for PartiallyValidatedUtf8<'a>
impl<'a> UnwindSafe for PartiallyValidatedUtf8<'a>
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