pub struct Prefixed<S: Source> { /* private fields */ }Expand description
A source that replays a buffered prefix before delegating to the rest.
Format sniffing needs to look at the first bytes and then hand the whole
stream to a decoder, but Source is forward-only (ADR-0005) and cannot
rewind. Reading the magic bytes into a prefix and putting them back in
front is how sniffing stays compatible with that: nothing is re-read, and
no source is required to seek.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Prefixed<S>where
S: Freeze,
impl<S> RefUnwindSafe for Prefixed<S>where
S: RefUnwindSafe,
impl<S> Send for Prefixed<S>
impl<S> Sync for Prefixed<S>where
S: Sync,
impl<S> Unpin for Prefixed<S>where
S: Unpin,
impl<S> UnsafeUnpin for Prefixed<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Prefixed<S>where
S: UnwindSafe,
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