Struct ReadAtFiles
pub struct ReadAtFiles { /* private fields */ }std only.Expand description
A regular file opened for ReadAt from many threads.
Windows serializes all reads on one handle, so there the file is opened
several times (by default min(available_parallelism, 8)) and each thread
sticks to one handle. Elsewhere one handle suffices.
On Windows the handles share read and delete access but not write access:
a writer that opens the file in place fails, and the handles keep reading
a file that was replaced or removed. Replacing it needs a rename that may
replace an open file: MoveFileExW with MOVEFILE_REPLACE_EXISTING, which
many runtimes use for their rename or move, fails with ERROR_ACCESS_DENIED
while a handle is open. std::fs::rename then falls back to a POSIX
semantics rename (NTFS, Windows 10 1809 and later), which works. With
other tools, first rename the old file away, then the new one into place.
Implementations§
§impl ReadAtFiles
impl ReadAtFiles
pub fn open(path: impl AsRef<Path>) -> Result<ReadAtFiles, Error>
pub fn open(path: impl AsRef<Path>) -> Result<ReadAtFiles, Error>
Open path with the default number of handles for this platform.
§Errors
Returns the I/O error of opening path, io::ErrorKind::InvalidInput
if it is not a regular file, or io::ErrorKind::Other if the path
kept naming different files while the handles were opened.
pub fn open_with_handles(
path: impl AsRef<Path>,
handles: NonZero<usize>,
) -> Result<ReadAtFiles, Error>
pub fn open_with_handles( path: impl AsRef<Path>, handles: NonZero<usize>, ) -> Result<ReadAtFiles, Error>
pub fn identity(&self) -> FileIdentity
pub fn identity(&self) -> FileIdentity
The identity of the file, taken from the first handle when it was opened.
Trait Implementations§
§impl Debug for ReadAtFiles
impl Debug for ReadAtFiles
Auto Trait Implementations§
impl Freeze for ReadAtFiles
impl RefUnwindSafe for ReadAtFiles
impl Send for ReadAtFiles
impl Sync for ReadAtFiles
impl Unpin for ReadAtFiles
impl UnsafeUnpin for ReadAtFiles
impl UnwindSafe for ReadAtFiles
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more