Struct opendal::layers::RetryLayer
source · [−]Expand description
RetryLayer will add retry for OpenDAL.
Examples
use anyhow::Result;
use backon::ExponentialBackoff;
use opendal::layers::RetryLayer;
use opendal::Operator;
use opendal::Scheme;
let _ = Operator::from_env(Scheme::Fs)
.expect("must init")
.layer(RetryLayer::new(ExponentialBackoff::default()));
Implementations
sourceimpl<B> RetryLayer<B>where
B: Backoff + Send + Sync + Debug + 'static,
impl<B> RetryLayer<B>where
B: Backoff + Send + Sync + Debug + 'static,
sourcepub fn new(b: B) -> Self
pub fn new(b: B) -> Self
Create a new retry layer.
Examples
use anyhow::Result;
use backon::ExponentialBackoff;
use opendal::layers::RetryLayer;
use opendal::Operator;
use opendal::Scheme;
let _ = Operator::from_env(Scheme::Fs)
.expect("must init")
.layer(RetryLayer::new(ExponentialBackoff::default()));
Trait Implementations
Auto Trait Implementations
impl<B> RefUnwindSafe for RetryLayer<B>where
B: RefUnwindSafe,
impl<B> Send for RetryLayer<B>
impl<B> Sync for RetryLayer<B>
impl<B> Unpin for RetryLayer<B>where
B: Unpin,
impl<B> UnwindSafe for RetryLayer<B>where
B: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more