pub struct FragmentTable { /* private fields */ }Expand description
Every fragment an app declares, keyed by Fragment::key.
Ordered rather than hashed: the artifact encodes the table field by field, so a stable order is what makes two builds of the same sources produce the same bytes.
Implementations§
Source§impl FragmentTable
impl FragmentTable
Sourcepub fn insert(&mut self, fragment: Fragment) -> Result<(), FragmentError>
pub fn insert(&mut self, fragment: Fragment) -> Result<(), FragmentError>
Add fragment under its own key.
A key already holding the same declaration absorbs the new origins and keeps one entry, which is what an include reached from two paths produces. A key holding a different declaration is an error: keys are content-addressed, so two different bodies under one key means the content that produced the key was not the content being stored.
Sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Fragment>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Fragment>
Every fragment, in key order, for a pass that rewrites bodies.
Sourcepub fn by_component(&self, name: &str) -> Option<(&Fragment, bool)>
pub fn by_component(&self, name: &str) -> Option<(&Fragment, bool)>
The fragment a candela component name reaches, with whether the baked body is what calling the function would have returned.
A name no component carries yields None, which the caller reports as
an unknown tag.
Sourcepub fn component(&self, name: &str) -> Option<&FragmentComponent>
pub fn component(&self, name: &str) -> Option<&FragmentComponent>
The candela component a use site naming name reaches.
A function that has to run is reached by name alone, so this answers without reference to the block it happens to be attached to.
Sourcepub fn names(&self) -> BTreeSet<String>
pub fn names(&self) -> BTreeSet<String>
Every name a use site may write: each fragment key, plus each candela component name.
Sourcepub fn merge(&mut self, other: FragmentTable) -> Result<(), FragmentError>
pub fn merge(&mut self, other: FragmentTable) -> Result<(), FragmentError>
Fold other into this table, applying the same collision rule per
key. Used to combine what markup declared with what the scripts
declared.
Trait Implementations§
Source§impl Clone for FragmentTable
impl Clone for FragmentTable
Source§fn clone(&self) -> FragmentTable
fn clone(&self) -> FragmentTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FragmentTable
impl Debug for FragmentTable
Source§impl Default for FragmentTable
impl Default for FragmentTable
Source§fn default() -> FragmentTable
fn default() -> FragmentTable
Source§impl<'de> Deserialize<'de> for FragmentTable
impl<'de> Deserialize<'de> for FragmentTable
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for FragmentTable
impl RefUnwindSafe for FragmentTable
impl Send for FragmentTable
impl Sync for FragmentTable
impl Unpin for FragmentTable
impl UnsafeUnpin for FragmentTable
impl UnwindSafe for FragmentTable
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,
§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>
§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>
entity context to produce a [Template::Output].§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.