pub struct StudioFiles<S> { /* private fields */ }Expand description
The Studio’s files: the shipped examples over the reader’s store.
Implementations§
Source§impl<S> StudioFiles<S>
impl<S> StudioFiles<S>
Source§impl<S: Vfs> StudioFiles<S>
impl<S: Vfs> StudioFiles<S>
Sourcepub async fn retire_old_copies(&self) -> VfsResult<usize>
pub async fn retire_old_copies(&self) -> VfsResult<usize>
Remove the copies of the examples an earlier Studio wrote into the reader’s store, every file
and folder under /examples, and count what went. They have not shown since the examples
came from the site, and nothing else writes there, since the reader’s files live in
/workspace. A store with no such folder costs one listing. A removal cut short finishes on
the next visit.
Trait Implementations§
Source§impl<S: Clone> Clone for StudioFiles<S>
impl<S: Clone> Clone for StudioFiles<S>
Source§fn clone(&self) -> StudioFiles<S>
fn clone(&self) -> StudioFiles<S>
Returns a duplicate 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<S: Vfs> Vfs for StudioFiles<S>
impl<S: Vfs> Vfs for StudioFiles<S>
Source§fn read<'a, 'b, 'f>(
&'a self,
path: &'b str,
) -> Pin<Box<dyn Future<Output = VfsResult<Vec<u8>>> + Send + 'f>>where
Self: 'f,
'a: 'f,
'b: 'f,
fn read<'a, 'b, 'f>(
&'a self,
path: &'b str,
) -> Pin<Box<dyn Future<Output = VfsResult<Vec<u8>>> + Send + 'f>>where
Self: 'f,
'a: 'f,
'b: 'f,
Read entire file contents as bytes.
Source§fn read_to_string<'a, 'b, 'f>(
&'a self,
path: &'b str,
) -> Pin<Box<dyn Future<Output = VfsResult<String>> + Send + 'f>>where
Self: 'f,
'a: 'f,
'b: 'f,
fn read_to_string<'a, 'b, 'f>(
&'a self,
path: &'b str,
) -> Pin<Box<dyn Future<Output = VfsResult<String>> + Send + 'f>>where
Self: 'f,
'a: 'f,
'b: 'f,
Read file contents as UTF-8 string.
Source§fn write<'a, 'b, 'c, 'f>(
&'a self,
path: &'b str,
contents: &'c [u8],
) -> Pin<Box<dyn Future<Output = VfsResult<()>> + Send + 'f>>where
Self: 'f,
'a: 'f,
'b: 'f,
'c: 'f,
fn write<'a, 'b, 'c, 'f>(
&'a self,
path: &'b str,
contents: &'c [u8],
) -> Pin<Box<dyn Future<Output = VfsResult<()>> + Send + 'f>>where
Self: 'f,
'a: 'f,
'b: 'f,
'c: 'f,
Write bytes to file (atomic on native, best-effort on WASM).
Source§fn append<'a, 'b, 'c, 'f>(
&'a self,
path: &'b str,
contents: &'c [u8],
) -> Pin<Box<dyn Future<Output = VfsResult<()>> + Send + 'f>>where
Self: 'f,
'a: 'f,
'b: 'f,
'c: 'f,
fn append<'a, 'b, 'c, 'f>(
&'a self,
path: &'b str,
contents: &'c [u8],
) -> Pin<Box<dyn Future<Output = VfsResult<()>> + Send + 'f>>where
Self: 'f,
'a: 'f,
'b: 'f,
'c: 'f,
Append bytes to file (atomic append semantics).
Source§fn exists<'a, 'b, 'f>(
&'a self,
path: &'b str,
) -> Pin<Box<dyn Future<Output = VfsResult<bool>> + Send + 'f>>where
Self: 'f,
'a: 'f,
'b: 'f,
fn exists<'a, 'b, 'f>(
&'a self,
path: &'b str,
) -> Pin<Box<dyn Future<Output = VfsResult<bool>> + Send + 'f>>where
Self: 'f,
'a: 'f,
'b: 'f,
Check if file exists.
Source§fn remove<'a, 'b, 'f>(
&'a self,
path: &'b str,
) -> Pin<Box<dyn Future<Output = VfsResult<()>> + Send + 'f>>where
Self: 'f,
'a: 'f,
'b: 'f,
fn remove<'a, 'b, 'f>(
&'a self,
path: &'b str,
) -> Pin<Box<dyn Future<Output = VfsResult<()>> + Send + 'f>>where
Self: 'f,
'a: 'f,
'b: 'f,
Delete a file.
Source§fn create_dir_all<'a, 'b, 'f>(
&'a self,
path: &'b str,
) -> Pin<Box<dyn Future<Output = VfsResult<()>> + Send + 'f>>where
Self: 'f,
'a: 'f,
'b: 'f,
fn create_dir_all<'a, 'b, 'f>(
&'a self,
path: &'b str,
) -> Pin<Box<dyn Future<Output = VfsResult<()>> + Send + 'f>>where
Self: 'f,
'a: 'f,
'b: 'f,
Create directory and all parent directories.
Auto Trait Implementations§
impl<S> Freeze for StudioFiles<S>where
S: Freeze,
impl<S> RefUnwindSafe for StudioFiles<S>where
S: RefUnwindSafe,
impl<S> Send for StudioFiles<S>where
S: Send,
impl<S> Sync for StudioFiles<S>where
S: Sync,
impl<S> Unpin for StudioFiles<S>where
S: Unpin,
impl<S> UnsafeUnpin for StudioFiles<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for StudioFiles<S>where
S: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.