pub struct BlobRouter { /* private fields */ }Expand description
One adaptive read router. Routes remain opaque and own any peer sets behind them; the router only orders route identities and bounds route attempts.
Implementations§
Source§impl BlobRouter
impl BlobRouter
pub fn new( routes: Vec<BlobRouteEntry>, cache: Option<Arc<dyn Store>>, config: BlobRouterConfig, ) -> Result<Self, StoreError>
Sourcepub async fn set_routes(
&self,
routes: Vec<BlobRouteEntry>,
) -> Result<(), StoreError>
pub async fn set_routes( &self, routes: Vec<BlobRouteEntry>, ) -> Result<(), StoreError>
Replace the route set. Outcome state survives only when both identity and the exact route allocation are unchanged; provider replacement is therefore immediately eligible for recovery.
pub async fn route_count(&self) -> usize
pub async fn outcomes( &self, ) -> HashMap<BlobRouteIdentity, BlobRouteOutcomeSnapshot>
pub async fn get( &self, hash: &Hash, preferred: Option<&[BlobRouteIdentity]>, ) -> Result<Option<Vec<u8>>, StoreError>
pub async fn get_request( &self, request: BlobRequest, preferred: Option<&[BlobRouteIdentity]>, outer_context: Option<BlobRouteContext>, ) -> Result<Option<Vec<u8>>, StoreError>
Trait Implementations§
Source§impl BlobRoute for BlobRouter
impl BlobRoute for BlobRouter
fn route<'life0, 'async_trait>(
&'life0 self,
request: BlobRequest,
) -> Pin<Box<dyn Future<Output = Result<BlobReply, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn route_with_context<'life0, 'async_trait>(
&'life0 self,
request: BlobRequest,
context: BlobRouteContext,
) -> Pin<Box<dyn Future<Output = Result<BlobReply, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !Freeze for BlobRouter
impl !RefUnwindSafe for BlobRouter
impl !UnwindSafe for BlobRouter
impl Send for BlobRouter
impl Sync for BlobRouter
impl Unpin for BlobRouter
impl UnsafeUnpin for BlobRouter
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