pub struct ImmutableIndexLayer { /* private fields */ }Expand description
ImmutableIndexLayer adds an immutable in-memory index to a storage service.
Especially useful for services without list capability like HTTP.
§Examples
let mut iil = ImmutableIndexLayer::new();
for i in ["file", "dir/", "dir/file", "dir_without_prefix/file"] {
iil.insert(i.to_string())
}
let op = Operator::from_iter::<services::Memory>(HashMap::<_, _>::default())?
.layer(iil);Implementations§
Source§impl ImmutableIndexLayer
impl ImmutableIndexLayer
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new ImmutableIndexLayer.
Source§impl ImmutableIndexLayer
impl ImmutableIndexLayer
Sourcepub fn extend_iter<I>(&mut self, iter: I)where
I: IntoIterator<Item = String>,
pub fn extend_iter<I>(&mut self, iter: I)where
I: IntoIterator<Item = String>,
Insert keys from iter.
Trait Implementations§
Source§impl Clone for ImmutableIndexLayer
impl Clone for ImmutableIndexLayer
Source§fn clone(&self) -> ImmutableIndexLayer
fn clone(&self) -> ImmutableIndexLayer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ImmutableIndexLayer
impl Debug for ImmutableIndexLayer
Source§impl Default for ImmutableIndexLayer
impl Default for ImmutableIndexLayer
Source§fn default() -> ImmutableIndexLayer
fn default() -> ImmutableIndexLayer
Returns the “default value” for a type. Read more
Source§impl Layer for ImmutableIndexLayer
impl Layer for ImmutableIndexLayer
Source§fn apply_service(&self, inner: Servicer) -> Servicer
fn apply_service(&self, inner: Servicer) -> Servicer
Intercept the operation service stack. Read more
Source§fn apply_context(
&self,
srv: Arc<dyn ServiceDyn>,
inner: OperationContext,
) -> OperationContext
fn apply_context( &self, srv: Arc<dyn ServiceDyn>, inner: OperationContext, ) -> OperationContext
Intercept the operation context (HTTP transport and executor). Read more
Auto Trait Implementations§
impl Freeze for ImmutableIndexLayer
impl RefUnwindSafe for ImmutableIndexLayer
impl Send for ImmutableIndexLayer
impl Sync for ImmutableIndexLayer
impl Unpin for ImmutableIndexLayer
impl UnsafeUnpin for ImmutableIndexLayer
impl UnwindSafe for ImmutableIndexLayer
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