[−][src]Struct glommio::io::StreamReaderBuilder
Builds a StreamReader
, allowing linear read access to a BufferedFile
Implementations
impl StreamReaderBuilder
[src]
#[must_use = "The builder must be built to be useful"]pub fn new(file: BufferedFile) -> StreamReaderBuilder
[src]
Creates a new StreamReaderBuilder, given a BufferedFile
Various properties can be set by using its with
methods.
A StreamReader
can later be constructed from it by
calling build
Examples
use glommio::io::{BufferedFile, StreamReaderBuilder}; use glommio::LocalExecutor; let ex = LocalExecutor::make_default(); ex.run(async { let file = BufferedFile::open("myfile.txt").await.unwrap(); let _reader = StreamReaderBuilder::new(file).build(); });
pub fn with_start_pos(self, start: u64) -> Self
[src]
Define a starting position.
Reads from the StreamReader
will start from this position
pub fn with_end_pos(self, end: u64) -> Self
[src]
Define an end position.
Reads from the StreamReader
will end at this position even if the file
is larger.
pub fn with_buffer_size(self, buffer_size: usize) -> Self
[src]
Define the buffer size that will be used by the StreamReader
pub fn build(self) -> StreamReader
[src]
Builds a StreamReader
with the properties defined by this StreamReaderBuilder
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for StreamReaderBuilder
impl Send for StreamReaderBuilder
impl Sync for StreamReaderBuilder
impl Unpin for StreamReaderBuilder
impl UnwindSafe for StreamReaderBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,