pub struct BundleSource { /* private fields */ }Expand description
The built-in source: bytes served out of registered .lpak bundles.
A bundle is reachable two ways. A lumen://app/<key> URI addresses it
directly, and once Self::set_root names the directory the archive was
packed from, an ordinary path under that directory resolves to the
matching key as well, so markup that names icons/sun.png works whether
the app ships loose files or an archive. Bundled entries win over files on
disk, which is what lets an app ship the archive alone.
Implementations§
Source§impl BundleSource
impl BundleSource
Sourcepub fn register(&mut self, bundle: LumenBundle)
pub fn register(&mut self, bundle: LumenBundle)
Adds a bundle. Bundles are consulted in registration order and the first hit wins.
Sourcepub fn set_root(&mut self, root: impl Into<PathBuf>)
pub fn set_root(&mut self, root: impl Into<PathBuf>)
Declares the directory the registered bundles were packed from.
Sourcepub fn bundles(&self) -> &[LumenBundle]
pub fn bundles(&self) -> &[LumenBundle]
The registered bundles, in registration order.
Trait Implementations§
Source§impl AssetSource for BundleSource
impl AssetSource for BundleSource
Source§impl Clone for BundleSource
impl Clone for BundleSource
Source§fn clone(&self) -> BundleSource
fn clone(&self) -> BundleSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for BundleSource
impl Default for BundleSource
Source§fn default() -> BundleSource
fn default() -> BundleSource
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BundleSource
impl RefUnwindSafe for BundleSource
impl Send for BundleSource
impl Sync for BundleSource
impl Unpin for BundleSource
impl UnsafeUnpin for BundleSource
impl UnwindSafe for BundleSource
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> FromTemplate for T
impl<T> FromTemplate for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§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> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.
§impl<T> Template for T
impl<T> Template for T
§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>
Uses this template and the given
entity context to produce a [Template::Output].§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clones this template. See
Clone.