pub struct Dir { /* private fields */ }
Expand description
A filesystem directory.
Implementations
sourceimpl Dir
impl Dir
pub fn new(cache: DirLock<CacheBlock>) -> Self
pub fn load<'a>(
cache: DirLock<CacheBlock>,
txn_id: TxnId
) -> TCBoxTryFuture<'a, Self>
pub async fn get_or_create_dir(
&self,
txn_id: TxnId,
name: PathSegment
) -> TCResult<Self>
Trait Implementations
sourceimpl Dir for Dir
impl Dir for Dir
sourcefn contains<'life0, 'life1, 'async_trait>(
&'life0 self,
txn_id: TxnId,
name: &'life1 PathSegment
) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn contains<'life0, 'life1, 'async_trait>(
&'life0 self,
txn_id: TxnId,
name: &'life1 PathSegment
) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Return true
if this directory has an entry at the given PathSegment
.
sourcefn create_dir<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId,
name: PathSegment
) -> Pin<Box<dyn Future<Output = TCResult<Self>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn create_dir<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId,
name: PathSegment
) -> Pin<Box<dyn Future<Output = TCResult<Self>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Create a new Dir
.
sourcefn create_dir_unique<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Dir>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn create_dir_unique<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Dir>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Create a new Dir
with a new unique ID.
sourcefn create_file<'life0, 'async_trait, C, F, B>(
&'life0 self,
txn_id: TxnId,
file_id: Id,
class: C
) -> Pin<Box<dyn Future<Output = TCResult<F>> + Send + 'async_trait>> where
C: Copy + Send + Display,
StateType: From<C>,
FileEntry: AsType<F>,
F: File<B>,
B: BlockData,
C: 'async_trait,
F: 'async_trait,
B: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn create_file<'life0, 'async_trait, C, F, B>(
&'life0 self,
txn_id: TxnId,
file_id: Id,
class: C
) -> Pin<Box<dyn Future<Output = TCResult<F>> + Send + 'async_trait>> where
C: Copy + Send + Display,
StateType: From<C>,
FileEntry: AsType<F>,
F: File<B>,
B: BlockData,
C: 'async_trait,
F: 'async_trait,
B: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Create a new Self::File
.
sourcefn create_file_unique<'life0, 'async_trait, C, F, B>(
&'life0 self,
txn_id: TxnId,
class: C
) -> Pin<Box<dyn Future<Output = TCResult<F>> + Send + 'async_trait>> where
C: Copy + Send + Display,
StateType: From<C>,
FileEntry: AsType<F>,
F: File<B>,
B: BlockData,
C: 'async_trait,
F: 'async_trait,
B: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn create_file_unique<'life0, 'async_trait, C, F, B>(
&'life0 self,
txn_id: TxnId,
class: C
) -> Pin<Box<dyn Future<Output = TCResult<F>> + Send + 'async_trait>> where
C: Copy + Send + Display,
StateType: From<C>,
FileEntry: AsType<F>,
F: File<B>,
B: BlockData,
C: 'async_trait,
F: 'async_trait,
B: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Create a new Self::File
with a new unique ID.
sourcefn get_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
txn_id: TxnId,
name: &'life1 PathSegment
) -> Pin<Box<dyn Future<Output = TCResult<Option<Self>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
txn_id: TxnId,
name: &'life1 PathSegment
) -> Pin<Box<dyn Future<Output = TCResult<Option<Self>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Look up a subdirectory of this Dir
.
sourcefn get_file<'life0, 'life1, 'async_trait, F, B>(
&'life0 self,
txn_id: TxnId,
file_id: &'life1 Id
) -> Pin<Box<dyn Future<Output = TCResult<Option<F>>> + Send + 'async_trait>> where
FileEntry: AsType<F>,
F: File<B>,
B: BlockData,
F: 'async_trait,
B: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_file<'life0, 'life1, 'async_trait, F, B>(
&'life0 self,
txn_id: TxnId,
file_id: &'life1 Id
) -> Pin<Box<dyn Future<Output = TCResult<Option<F>>> + Send + 'async_trait>> where
FileEntry: AsType<F>,
F: File<B>,
B: BlockData,
F: 'async_trait,
B: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get a Self::File
in this Dir
.
sourceimpl<'en> IntoView<'en, Dir> for BlockChain
impl<'en> IntoView<'en, Dir> for BlockChain
type Txn = Txn
type View = (Schema, SeqStream<Result<(Bytes, MapStream<TxnId, Result<SeqStream<Result<MutationView<'en>, TCError>, Pin<Box<dyn Stream<Item = Result<MutationView<'en>, TCError>> + Unpin + Send + 'en, Global>>>, TCError>, Pin<Box<dyn Stream<Item = (TxnId, Result<SeqStream<Result<MutationView<'en>, TCError>, Pin<Box<dyn Stream<Item = Result<MutationView<'en>, TCError>> + Unpin + Send + 'en, Global>>>, TCError>)> + Unpin + Send + 'en, Global>>>), TCError>, Pin<Box<dyn Stream<Item = Result<(Bytes, MapStream<TxnId, Result<SeqStream<Result<MutationView<'en>, TCError>, Pin<Box<dyn Stream<Item = Result<MutationView<'en>, TCError>> + Unpin + Send + 'en, Global>>>, TCError>, Pin<Box<dyn Stream<Item = (TxnId, Result<SeqStream<Result<MutationView<'en>, TCError>, Pin<Box<dyn Stream<Item = Result<MutationView<'en>, TCError>> + Unpin + Send + 'en, Global>>>, TCError>)> + Unpin + Send + 'en, Global>>>), TCError>> + Unpin + Send + 'en, Global>>>)
sourceimpl<'en> IntoView<'en, Dir> for SubjectCollection
impl<'en> IntoView<'en, Dir> for SubjectCollection
sourceimpl<'en> IntoView<'en, Dir> for TCStream
impl<'en> IntoView<'en, Dir> for TCStream
sourceimpl<'en> IntoView<'en, Dir> for SubjectMap
impl<'en> IntoView<'en, Dir> for SubjectMap
sourceimpl<'en> IntoView<'en, Dir> for Collection
impl<'en> IntoView<'en, Dir> for Collection
sourceimpl<'en> IntoView<'en, Dir> for InstanceExt<State>
impl<'en> IntoView<'en, Dir> for InstanceExt<State>
type Txn = Txn
type View = InstanceView<'en>
sourcefn into_view<'async_trait>(
self,
txn: Txn
) -> Pin<Box<dyn Future<Output = TCResult<InstanceView<'en>>> + Send + 'async_trait>> where
Self: 'async_trait,
fn into_view<'async_trait>(
self,
txn: Txn
) -> Pin<Box<dyn Future<Output = TCResult<InstanceView<'en>>> + Send + 'async_trait>> where
Self: 'async_trait,
Return a View
which can be encoded with en::IntoStream
.
sourceimpl<'en> IntoView<'en, Dir> for Object
impl<'en> IntoView<'en, Dir> for Object
type Txn = Txn
type View = ObjectView<'en>
sourcefn into_view<'async_trait>(
self,
txn: Txn
) -> Pin<Box<dyn Future<Output = TCResult<ObjectView<'en>>> + Send + 'async_trait>> where
Self: 'async_trait,
fn into_view<'async_trait>(
self,
txn: Txn
) -> Pin<Box<dyn Future<Output = TCResult<ObjectView<'en>>> + Send + 'async_trait>> where
Self: 'async_trait,
Return a View
which can be encoded with en::IntoStream
.
sourceimpl Transact for Dir
impl Transact for Dir
sourceimpl Transaction<Dir> for Txn
impl Transaction<Dir> for Txn
sourcefn into_context(self) -> Dir
fn into_context(self) -> Dir
Consume this Txn
and return its fs::Dir
.
Auto Trait Implementations
impl !RefUnwindSafe for Dir
impl Send for Dir
impl Sync for Dir
impl Unpin for Dir
impl !UnwindSafe for Dir
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>
sourceimpl<F> Match for F
impl<F> Match for F
sourcefn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
fn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
Returns true
if self
can be cast into the target type T
.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
sourcefn can_cast_from(&F) -> bool
fn can_cast_from(&F) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
sourcefn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if self
can be cast into T
.
sourcefn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns Some(T)
if self
can be cast into T
, otherwise None
.
sourcefn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
Returns Ok(T)
if self
can be cast into T
, otherwise calls on_err
.
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