Struct vstorage::readonly::ReadOnlyStorage

source ·
pub struct ReadOnlyStorage<S: Storage<I>, I: Item> { /* private fields */ }
Expand description

A wrapper around a Storage that disallows any write operations.

§Example

let orig = VdirStorage::<IcsItem>::new(
    Utf8PathBuf::from("/path/to/storage/"),
    String::from("ics"),
);

let read_only = ReadOnlyStorage::from(orig);

Trait Implementations§

source§

impl<S: Storage<I>, I: Item> From<S> for ReadOnlyStorage<S, I>

source§

fn from(value: S) -> Self

Converts to this type from the input type.
source§

impl<S: Storage<I>, I: Item> Storage<I> for ReadOnlyStorage<S, I>

source§

fn check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Checks that the storage works. This includes validating credentials, and reachability. Read more
source§

fn discover_collections<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Discovery, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Finds existing collections for this storage.
source§

fn create_collection<'life0, 'life1, 'async_trait>( &'life0 self, _href: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Collection, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Creates a new collection with a specified href.
source§

fn destroy_collection<'life0, 'life1, 'async_trait>( &'life0 self, _href: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes an existing collection. Read more
source§

fn list_items<'life0, 'life1, 'async_trait>( &'life0 self, collection_href: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<ItemRef>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Enumerates items in a given collection.
source§

fn get_item<'life0, 'life1, 'async_trait>( &'life0 self, href: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(I, Etag), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetches a single item from given collection. Read more
source§

fn get_many_items<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, hrefs: &'life1 [&'life2 str], ) -> Pin<Box<dyn Future<Output = Result<Vec<FetchedItem<I>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetches multiple items. Read more
source§

fn get_all_items<'life0, 'life1, 'async_trait>( &'life0 self, collection_href: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<FetchedItem<I>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch all items from a given collection. Read more
source§

fn add_item<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _: &'life1 str, _: &'life2 I, ) -> Pin<Box<dyn Future<Output = Result<ItemRef, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Saves a new item into a given collection
source§

fn update_item<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _: &'life1 str, _: &'life2 Etag, _: &'life3 I, ) -> Pin<Box<dyn Future<Output = Result<Etag, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Updates the contents of an existing item.
source§

fn set_property<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _: &'life1 str, __arg2: I::Property, _: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Sets the value of a property for a given collection.
source§

fn unset_property<'life0, 'life1, 'async_trait>( &'life0 self, _: &'life1 str, __arg2: I::Property, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Unsets a property for a given collection.
source§

fn get_property<'life0, 'life1, 'async_trait>( &'life0 self, href: &'life1 str, meta: I::Property, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns the value of a property for a given collection.
source§

fn delete_item<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _: &'life1 str, _: &'life2 Etag, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Deletes an existing item.
source§

fn collection_id(&self, collection_href: &str) -> Result<CollectionId, Error>

Return the id for a collection with the given href. Read more
source§

fn href_for_collection_id(&self, _id: &CollectionId) -> Result<Href, Error>

Return the href for a collection that is expected to have id. Read more
source§

fn list_properties<'life0, 'life1, 'async_trait>( &'life0 self, collection_href: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<ListedProperty<I::Property>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List all properties of a collection.
source§

fn monitor<'life0, 'async_trait>( &'life0 self, bufsize: NonZeroUsize, ) -> Pin<Box<dyn Future<Output = Result<Receiver<Event>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Monitor the storage for changes. Read more

Auto Trait Implementations§

§

impl<S, I> Freeze for ReadOnlyStorage<S, I>
where S: Freeze,

§

impl<S, I> RefUnwindSafe for ReadOnlyStorage<S, I>

§

impl<S, I> Send for ReadOnlyStorage<S, I>

§

impl<S, I> Sync for ReadOnlyStorage<S, I>

§

impl<S, I> Unpin for ReadOnlyStorage<S, I>
where S: Unpin, I: Unpin,

§

impl<S, I> UnwindSafe for ReadOnlyStorage<S, I>
where S: UnwindSafe, I: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Source, Target> OctetsInto<Target> for Source
where Target: OctetsFrom<Source>,

§

type Error = <Target as OctetsFrom<Source>>::Error

source§

fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>

Performs the conversion.
source§

fn octets_into(self) -> Target
where Self::Error: Into<Infallible>,

Performs an infallible conversion.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more