pub struct Modules { /* private fields */ }Expand description
What was read and compiled, shared by every handle to it.
Implementations§
Source§impl Modules
impl Modules
Sourcepub fn snapshot(&self, served: &ServedFolder, file: &Path) -> Snapshot
pub fn snapshot(&self, served: &ServedFolder, file: &Path) -> Snapshot
Reads file and every module its relative imports reach inside the
served folder served, each once. A file that resolves outside the
folder — through .. or a symbolic link — is never read.
Sourcepub fn forget(&self, file: &Path)
pub fn forget(&self, file: &Path)
Forgets what was read of file, so the next address or compile reads it
again, and what was read of every module with an import that could name
it, so a helper created or removed after its importer was read changes
what the importer imports. Called for every changed file: a change time
can miss an edit made within its resolution that keeps the size.
Sourcepub fn compile(
&self,
path: &Path,
source: &str,
known: &[String],
imports: &BTreeMap<String, String>,
) -> Result<String>
pub fn compile( &self, path: &Path, source: &str, known: &[String], imports: &BTreeMap<String, String>, ) -> Result<String>
[compile], remembered: the same file, source, widget names and import
addresses compile once.
Sourcepub fn system(&self, file: &str) -> Option<Result<String>>
pub fn system(&self, file: &str) -> Option<Result<String>>
The system module in file — a system widget’s, Tabs.tsx, or a
shared module’s, live.ts — compiled as its address serves it: it
renders by name only system widgets, and each relative import is
rewritten to the imported system module’s address. None for a
file that isn’t one.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Modules
impl Freeze for Modules
impl Move for Modules
impl RefUnwindSafe for Moduleswhere
Atomic<usize>: RefUnwindSafe,
Mutex<HashMap<PathBuf, Read>>: RefUnwindSafe,
Mutex<HashMap<u64, Result<String, String>>>: RefUnwindSafe,
impl Send for Modules
impl Sync for Modules
impl Unpin for Modules
impl UnsafeUnpin for Modules
impl UnwindSafe for Moduleswhere
Arc<Caches>: 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
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,
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
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for T
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 more