pub struct PrefixReadOutcome { /* private fields */ }Expand description
Bytes read from one opened resource together with bounded-read facts.
LimitReached means the requested bound was consumed without probing for
another byte; it does not prove that the stream has ended.
§Examples
use qubit_fs::Path;
use qubit_fs::read::PrefixReadTermination;
use qubit_fs::read::ReadOptions;
let fs = support::rustdoc_provider::filesystem();
let outcome = fs.read_prefix(&Path::parse("/report")?, ReadOptions::default(), 3)?;
assert_eq!(outcome.bytes(), b"rep");
assert_eq!(outcome.termination(), PrefixReadTermination::LimitReached);Implementations§
Source§impl PrefixReadOutcome
impl PrefixReadOutcome
Sourcepub const fn info(&self) -> &OpenedFileInfo
pub const fn info(&self) -> &OpenedFileInfo
Returns the information captured when the reader was opened.
Sourcepub const fn options(&self) -> &ReadOptions
pub const fn options(&self) -> &ReadOptions
Returns the caller options retained for this read.
Sourcepub const fn termination(&self) -> PrefixReadTermination
pub const fn termination(&self) -> PrefixReadTermination
Returns the reason the read stopped.
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Transfers the accumulated bytes without another allocation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PrefixReadOutcome
impl RefUnwindSafe for PrefixReadOutcome
impl Send for PrefixReadOutcome
impl Sync for PrefixReadOutcome
impl Unpin for PrefixReadOutcome
impl UnsafeUnpin for PrefixReadOutcome
impl UnwindSafe for PrefixReadOutcome
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