Struct glommio::io::ImmutableFilePreSealSink [−][src]
pub struct ImmutableFilePreSealSink { /* fields omitted */ }
Expand description
Sink portion of the ImmutableFile
To build it, use build_sink
on the ImmutableFileBuilder
Implementations
Seals the file for further writes.
Once this is called, it is no longer possible to write to the resulting
ImmutableFile
Waits for all currently in-flight buffers to be written to the underlying storage.
This does not include the current buffer if it is not full. If all data
must be flushed, use flush
.
Returns the flushed position of the file.
Waits for all currently in-flight buffers to be written to the underlying storage, and ensures they are safely persisted.
This does not include the current buffer if it is not full. If all data
must be synced, use Self::sync
.
Returns the flushed position of the file at the time the sync started.
Waits for all buffers to be written to the underlying storage, and ensures they are safely persisted.
This includes the current buffer even if it is not full, by padding it.
The padding will get over-written by future writes, or truncated upon
Self::seal
or close
.
Returns the flushed position of the file at the time the sync started.
Acquires the current position of this ImmutableFilePreSealSink
.
Acquires the current position of this ImmutableFilePreSealSink
that
is flushed to the underlying media.
Warning: the position reported by this API is not restart or crash safe.
You need to call ImmutableFilePreSealSink::sync
for that. Although
the ImmutableFilePreSealSink uses Direct I/O, modern storage devices
have their own caches and may still lose data that sits on those
caches upon a restart until ImmutableFilePreSealSink::sync
is called
(Note that ImmutableFilePreSealSink::seal
implies a sync).
However within the same session, new readers trying to read from any position before what we return in this method will be guaranteed to read the data we just wrote.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for ImmutableFilePreSealSink
impl !Send for ImmutableFilePreSealSink
impl !Sync for ImmutableFilePreSealSink
impl Unpin for ImmutableFilePreSealSink
impl !UnwindSafe for ImmutableFilePreSealSink
Blanket Implementations
Writes some bytes into the byte stream. Read more
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectoredFuture<'a, Self> where
Self: Unpin,
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectoredFuture<'a, Self> where
Self: Unpin,
Writes an entire buffer into the byte stream. Read more
Flushes the stream to ensure that all buffered contents reach their destination. Read more
Closes the writer. Read more
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more