pub struct SegmentSource<S> { /* private fields */ }Expand description
Read-through segment source over a blob/root store.
Implementations§
Source§impl<S: BlobStore + RootStore> SegmentSource<S>
impl<S: BlobStore + RootStore> SegmentSource<S>
Sourcepub fn index_root(&self, db: &str) -> Result<Option<DbRoot>, StoreError>
pub fn index_root(&self, db: &str) -> Result<Option<DbRoot>, StoreError>
Reads the current published index root for db.
§Errors
Returns an error when the root store cannot be read.
Sourcepub fn segment(
&self,
root: &DbRoot,
order: IndexOrder,
) -> Result<Option<Arc<[u8]>>, StoreError>
pub fn segment( &self, root: &DbRoot, order: IndexOrder, ) -> Result<Option<Arc<[u8]>>, StoreError>
Loads the segment for one index order of a published root, through the cache.
§Errors
Returns an error when the blob cannot be loaded.
Sourcepub fn segment_keys(bytes: &[u8]) -> Result<Vec<Vec<u8>>, StoreError>
pub fn segment_keys(bytes: &[u8]) -> Result<Vec<Vec<u8>>, StoreError>
Decodes a segment’s length-prefixed key entries.
§Errors
Returns StoreError::CorruptBlob-free decode failures as None
entries never occur; malformed framing yields an error.
Auto Trait Implementations§
impl<S> !Freeze for SegmentSource<S>
impl<S> RefUnwindSafe for SegmentSource<S>where
S: RefUnwindSafe,
impl<S> Send for SegmentSource<S>
impl<S> Sync for SegmentSource<S>
impl<S> Unpin for SegmentSource<S>
impl<S> UnsafeUnpin for SegmentSource<S>
impl<S> UnwindSafe for SegmentSource<S>where
S: RefUnwindSafe,
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request