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 async fn index_root(&self, db: &str) -> Result<Option<DbRoot>, StoreError>
pub async 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 async fn lease_holder_endpoint(
&self,
db: &str,
) -> Result<Option<String>, StoreError>
pub async fn lease_holder_endpoint( &self, db: &str, ) -> Result<Option<String>, StoreError>
Rediscovers the current lease holder’s advertised client endpoint from the root record — peers with storage credentials can rebuild their endpoint preference after an HA takeover without any static configuration.
§Errors
Returns an error when the root store cannot be read.
Sourcepub async fn segment(
&self,
root: &DbRoot,
order: IndexOrder,
) -> Result<Option<Arc<[u8]>>, StoreError>
pub async fn segment( &self, root: &DbRoot, order: IndexOrder, ) -> Result<Option<Arc<[u8]>>, StoreError>
Loads the full key stream for one index order of a published root, through the cache: a format-3 manifest’s chunks concatenated in order, or a pre-format-3 flat segment as stored.
§Errors
Returns an error when a blob cannot be loaded or is missing.
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
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>
T in a tonic::Request