pub struct Dir(/* private fields */);Expand description
A clone-able (internally Arc-ed), thread-safe in-memory filesystem.
This was built for MemoryAssetReader and is primarily used by unit tests
and by the embedded backend.
Implementations§
Source§impl Dir
impl Dir
Sourcepub fn insert_asset_text(&self, path: &Path, asset: &str)
pub fn insert_asset_text(&self, path: &Path, asset: &str)
Inserts textual data as an asset, at the path relative to this Dir.
Sourcepub fn insert_meta_text(&self, path: &Path, asset: &str)
pub fn insert_meta_text(&self, path: &Path, asset: &str)
Inserts textual data as asset metadata, at the path relative to this Dir.
Sourcepub fn insert_asset(&self, path: &Path, value: impl Into<Value>)
pub fn insert_asset(&self, path: &Path, value: impl Into<Value>)
Inserts a Vec of bytes or a 'static array of bytes as an asset,
at the path relative to this Dir.
Sourcepub fn remove_asset(&self, path: &Path) -> Option<Data>
pub fn remove_asset(&self, path: &Path) -> Option<Data>
Sourcepub fn insert_meta(&self, path: &Path, value: impl Into<Value>)
pub fn insert_meta(&self, path: &Path, value: impl Into<Value>)
Inserts a Vec of bytes or a 'static array of bytes as asset metadata,
at the path relative to this Dir.
Sourcepub fn remove_metadata(&self, path: &Path) -> Option<Data>
pub fn remove_metadata(&self, path: &Path) -> Option<Data>
Sourcepub fn get_or_insert_dir(&self, path: &Path) -> Dir
pub fn get_or_insert_dir(&self, path: &Path) -> Dir
Returns the Dir representing path relative to this Dir,
creating a new one for it if necessary.
Sourcepub fn remove_dir(&self, path: &Path) -> Option<Dir>
pub fn remove_dir(&self, path: &Path) -> Option<Dir>
Sourcepub fn get_dir(&self, path: &Path) -> Option<Dir>
pub fn get_dir(&self, path: &Path) -> Option<Dir>
Returns the Dir representing path relative to this Dir, if it exists.
Sourcepub fn get_asset(&self, path: &Path) -> Option<Data>
pub fn get_asset(&self, path: &Path) -> Option<Data>
Returns the asset stored at path relative to this Dir, if it exists.
Sourcepub fn get_metadata(&self, path: &Path) -> Option<Data>
pub fn get_metadata(&self, path: &Path) -> Option<Data>
Returns the asset metadata stored at path relative to this Dir, if it exists.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dir
impl RefUnwindSafe for Dir
impl Send for Dir
impl Sync for Dir
impl Unpin for Dir
impl UnsafeUnpin for Dir
impl UnwindSafe for Dir
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FromTemplate for T
impl<T> FromTemplate for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Settings for T
Source§impl<T> Template for T
impl<T> Template for T
Source§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a Template::Output.Source§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
self.