pub struct ProxyObjectStorePolicy { /* private fields */ }
Expand description
A policy container, meant to be shared between test code and the proxy object store.
This container allows you to configure policies that should apply to the proxied calls.
Typically, you would use this to simulate I/O errors or mock out data.
Currently, for simplicity, we only proxy calls that involve some kind of path. Calls to copy functions, which have a src and dst, will provide the source to the policy
Implementations§
Source§impl ProxyObjectStorePolicy
impl ProxyObjectStorePolicy
pub fn new() -> Self
Sourcepub fn set_before_policy(&mut self, name: &str, policy: Arc<dyn PolicyFnT>)
pub fn set_before_policy(&mut self, name: &str, policy: Arc<dyn PolicyFnT>)
Set a new policy with the given name
The name can be used to later remove this policy
pub fn clear_before_policy(&mut self, name: &str)
pub fn set_obj_meta_policy( &mut self, name: &str, policy: Arc<dyn ObjectMetaPolicyFnT>, )
Trait Implementations§
Source§impl Debug for ProxyObjectStorePolicy
impl Debug for ProxyObjectStorePolicy
Source§impl Default for ProxyObjectStorePolicy
impl Default for ProxyObjectStorePolicy
Source§fn default() -> ProxyObjectStorePolicy
fn default() -> ProxyObjectStorePolicy
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProxyObjectStorePolicy
impl !RefUnwindSafe for ProxyObjectStorePolicy
impl Send for ProxyObjectStorePolicy
impl Sync for ProxyObjectStorePolicy
impl Unpin for ProxyObjectStorePolicy
impl !UnwindSafe for ProxyObjectStorePolicy
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> 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 more