Struct drawbridge::server::store::Repository
source · pub struct Repository<'a, P = Utf8PathBuf>(/* private fields */);
Implementations§
source§impl<'a, P> Repository<'a, P>
impl<'a, P> Repository<'a, P>
pub async fn get_json(&self) -> Result<Config, GetError<Error>>
pub async fn is_public(&self) -> Result<bool, GetError<Error>>
pub fn tag(&self, name: &Name) -> Tag<'a>
pub async fn create_tag( &self, name: &Name, meta: Meta, entry: &Entry ) -> Result<Tag<'a>, CreateError<Error>>
Methods from Deref<Target = Entity<'a, P>>§
sourcepub fn child(&self, path: impl AsRef<Utf8Path>) -> Entity<'a, Utf8PathBuf>
pub fn child(&self, path: impl AsRef<Utf8Path>) -> Entity<'a, Utf8PathBuf>
Returns a child Entity rooted at path
.
sourcepub async fn get_content(&self) -> Result<impl AsyncRead, GetError<Error>>
pub async fn get_content(&self) -> Result<impl AsyncRead, GetError<Error>>
Returns contents of the entity as AsyncRead.
sourcepub async fn read_content(&self) -> Result<Vec<u8>, GetError<Error>>
pub async fn read_content(&self) -> Result<Vec<u8>, GetError<Error>>
Reads contents of the entity.
sourcepub async fn get_content_json<T>(&self) -> Result<T, GetError<Error>>where
T: for<'de> Deserialize<'de>,
pub async fn get_content_json<T>(&self) -> Result<T, GetError<Error>>where
T: for<'de> Deserialize<'de>,
Returns the contents of the entity as JSON.
sourcepub async fn get(&self) -> Result<(Meta, impl AsyncRead), GetError<Error>>
pub async fn get(&self) -> Result<(Meta, impl AsyncRead), GetError<Error>>
Returns metadata of the entity and a reader of its contents.
sourcepub async fn get_to_writer(
&self,
dst: &mut (impl Unpin + AsyncWrite)
) -> Result<Meta, GetToWriterError<Error>>
pub async fn get_to_writer( &self, dst: &mut (impl Unpin + AsyncWrite) ) -> Result<Meta, GetToWriterError<Error>>
Returns metadata of the entity and writes its contents into dst
.
Trait Implementations§
source§impl<'a, P> Clone for Repository<'a, P>where
P: Clone,
impl<'a, P> Clone for Repository<'a, P>where
P: Clone,
source§fn clone(&self) -> Repository<'a, P>
fn clone(&self) -> Repository<'a, P>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a, P> Debug for Repository<'a, P>where
P: Debug,
impl<'a, P> Debug for Repository<'a, P>where
P: Debug,
source§impl<'a, P> Deref for Repository<'a, P>
impl<'a, P> Deref for Repository<'a, P>
source§impl<'a, P> From<Entity<'a, P>> for Repository<'a, P>
impl<'a, P> From<Entity<'a, P>> for Repository<'a, P>
source§fn from(entity: Entity<'a, P>) -> Repository<'a, P>
fn from(entity: Entity<'a, P>) -> Repository<'a, P>
Converts to this type from the input type.
impl<'a, P> Copy for Repository<'a, P>where
P: Copy,
Auto Trait Implementations§
impl<'a, P> Freeze for Repository<'a, P>where
P: Freeze,
impl<'a, P = Utf8PathBuf> !RefUnwindSafe for Repository<'a, P>
impl<'a, P> Send for Repository<'a, P>where
P: Send,
impl<'a, P> Sync for Repository<'a, P>where
P: Sync,
impl<'a, P> Unpin for Repository<'a, P>where
P: Unpin,
impl<'a, P = Utf8PathBuf> !UnwindSafe for Repository<'a, P>
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