pub struct ImmutableGlobs { /* private fields */ }Expand description
Declared-immutable path patterns, matched against a file’s path relative to the served root of the component that produced it.
Syntax, deliberately small: / separates segments; * matches any run of
characters within one segment; ? matches one character; a whole **
segment matches zero or more segments. Matching is against the WHOLE path,
so *_bg.wasm matches app_bg.wasm but not snippets/x/app_bg.wasm —
write **/*_bg.wasm to reach into directories. That is on purpose: Trunk’s
snippets/<crate>-<hash>/ directories look hashed but are keyed on the
crate, not on the bytes, and a pattern that reached them by accident would
pin stale JS in browsers for a year.
Implementations§
Source§impl ImmutableGlobs
impl ImmutableGlobs
Sourcepub fn new<S: AsRef<str>>(patterns: &[S]) -> Result<Self, BundleError>
pub fn new<S: AsRef<str>>(patterns: &[S]) -> Result<Self, BundleError>
Validate and compile patterns. Rejects what could only be a mistake:
an empty pattern, an absolute one, a .. or empty segment, and [ —
character classes are not supported and silently matching [ literally
would turn a typo into a year-long cache entry.
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for ImmutableGlobs
impl Clone for ImmutableGlobs
Source§impl Debug for ImmutableGlobs
impl Debug for ImmutableGlobs
Source§impl Default for ImmutableGlobs
impl Default for ImmutableGlobs
impl Eq for ImmutableGlobs
Source§impl PartialEq for ImmutableGlobs
impl PartialEq for ImmutableGlobs
impl StructuralPartialEq for ImmutableGlobs
Auto Trait Implementations§
impl Freeze for ImmutableGlobs
impl RefUnwindSafe for ImmutableGlobs
impl Send for ImmutableGlobs
impl Sync for ImmutableGlobs
impl Unpin for ImmutableGlobs
impl UnsafeUnpin for ImmutableGlobs
impl UnwindSafe for ImmutableGlobs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.