Struct sea_streamer_file::MessageSink
source · pub struct MessageSink { /* private fields */ }
Expand description
A high level file writer that mux messages and beacon
Implementations§
source§impl MessageSink
impl MessageSink
sourcepub async fn new(
file_id: FileId,
beacon_interval: u32,
limit: u64
) -> Result<Self, FileErr>
pub async fn new( file_id: FileId, beacon_interval: u32, limit: u64 ) -> Result<Self, FileErr>
Create a fresh sink. Overwrite if file already exists.
sourcepub async fn append(
file_id: FileId,
beacon_interval: u32,
limit: u64
) -> Result<Self, FileErr>
pub async fn append( file_id: FileId, beacon_interval: u32, limit: u64 ) -> Result<Self, FileErr>
Create a sink. Append if file already exists, and follow its beacon interval.
sourcepub fn write(&mut self, message: OwnedMessage) -> Result<Checksum, FileErr>
pub fn write(&mut self, message: OwnedMessage) -> Result<Checksum, FileErr>
This method does not block. To make sure messages have been written, call MessageSink::flush
.
pub fn offset(&self) -> u64
sourcepub fn started_from(&self) -> u64
pub fn started_from(&self) -> u64
Where this sink was started
pub async fn flush(&mut self) -> Result<(), FileErr>
Auto Trait Implementations§
impl Freeze for MessageSink
impl RefUnwindSafe for MessageSink
impl Send for MessageSink
impl Sync for MessageSink
impl Unpin for MessageSink
impl UnwindSafe for MessageSink
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