Struct drawbridge_server::store::Entity
source · [−]pub struct Entity<'a, P> { /* private fields */ }Implementations
sourceimpl<'a, P: AsRef<Utf8Path>> Entity<'a, P>
impl<'a, P: AsRef<Utf8Path>> 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
for<'de> T: Deserialize<'de>,
pub async fn get_content_json<T>(&self) -> Result<T, GetError<Error>> where
for<'de> T: 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
sourceimpl<'a, P> From<Entity<'a, P>> for Repository<'a, P>
impl<'a, P> From<Entity<'a, P>> for Repository<'a, P>
impl<'a, P: Copy> Copy for Entity<'a, P>
Auto Trait Implementations
impl<'a, P> !RefUnwindSafe for Entity<'a, P>
impl<'a, P> Send for Entity<'a, P> where
P: Send,
impl<'a, P> Sync for Entity<'a, P> where
P: Sync,
impl<'a, P> Unpin for Entity<'a, P> where
P: Unpin,
impl<'a, P> !UnwindSafe for Entity<'a, P>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more