pub struct Writer<T> { /* private fields */ }Implementations§
Source§impl<T: SegmentReadWrite> Writer<T>
impl<T: SegmentReadWrite> Writer<T>
pub fn new( ctx: T, buf_size: usize, segid: SegmentId, hyper_file_config: &HyperFileMetaConfig, ) -> Self
pub fn calc_ss_aligned_bytes(ndatablk: usize) -> usize
pub fn realize_ss(&mut self, checksum: u32, inode: &InodeRaw)
pub fn append(&mut self, buf: &[u8]) -> Result<()>
Sourcepub fn append_data_block(&mut self, block: &DataBlock) -> Result<()>
pub fn append_data_block(&mut self, block: &DataBlock) -> Result<()>
Append one cached data block to the segment.
Non-WAL: pushes a zero-copy Bytes view over the block’s
internal Arc<AllocDataBlock> (no memcpy of the 4 KiB
payload). The cache continues to hold the block; the
segment body holds an extra Arc clone via the Bytes,
so the buffer lives as long as the upload needs it.
WAL: falls back to the buffer-based append path because
the WAL feature requires the segment body to live as one
contiguous Vec<u8> for in-memory replay.
pub async fn done(self) -> Result<()>
Source§impl<T> Writer<T>
impl<T> Writer<T>
pub fn inc_metablk(&mut self)
pub fn inc_datablk(&mut self, blkidx: &BlockIndex, blkptr: &BlockPtr)
Auto Trait Implementations§
impl<T> Freeze for Writer<T>where
T: Freeze,
impl<T> RefUnwindSafe for Writer<T>where
T: RefUnwindSafe,
impl<T> Send for Writer<T>where
T: Send,
impl<T> Sync for Writer<T>where
T: Sync,
impl<T> Unpin for Writer<T>where
T: Unpin,
impl<T> UnsafeUnpin for Writer<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Writer<T>where
T: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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 moreCreates a shared type from an unshared type.