pub struct Catalog<'a> {
pub krate: &'a Path,
pub vis: &'a Visibility,
pub root: &'a Ident,
pub resources: &'a [ResourceField],
}Expand description
One root’s resource catalog, ready to emit.
It borrows for OptionsSpine’s reason: what it needs is the list
the root model already holds, and a second copy is a second thing to keep in step.
Fields§
§krate: &'a PathWhere ingraph lives, as the declaration named it.
vis: &'a VisibilityThe root’s own visibility — what the block and its accessors take.
root: &'a IdentThe root type, whose name the block derives its own from.
resources: &'a [ResourceField]The RESOURCES, in declaration order.
Implementations§
Source§impl Catalog<'_>
impl Catalog<'_>
Sourcepub fn sections(&self) -> impl Iterator<Item = &ResourceField>
pub fn sections(&self) -> impl Iterator<Item = &ResourceField>
Every resource whose options come from the document, in declaration order.
Sourcepub fn has_block(&self) -> bool
pub fn has_block(&self) -> bool
Whether the spine carries a resources field at all — see the module note.
Sourcepub fn emit(&self) -> TokenStream
pub fn emit(&self) -> TokenStream
The block a deployment writes its resource sections in, and the walk that declares every resource whether or not it has one.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Send for Catalog<'a>
impl<'a> !Sync for Catalog<'a>
impl<'a> Freeze for Catalog<'a>
impl<'a> RefUnwindSafe for Catalog<'a>
impl<'a> Unpin for Catalog<'a>
impl<'a> UnsafeUnpin for Catalog<'a>
impl<'a> UnwindSafe for Catalog<'a>
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