pub struct Template { /* private fields */ }
Expand description
A Spin template.
Implementations§
Source§impl Template
impl Template
Sourcepub fn id(&self) -> &str
pub fn id(&self) -> &str
The ID of the template. This is used to identify the template on the Spin command line.
Returns true if the templates matches the provided set of tags.
The set of tags associated with the template, provided by the template author.
Sourcepub fn description(&self) -> &Option<String>
pub fn description(&self) -> &Option<String>
A human-readable description of the template, provided by the template author.
Sourcepub fn description_or_empty(&self) -> &str
pub fn description_or_empty(&self) -> &str
A human-readable description of the template, provided by the template author, or an empty string if no description was provided.
Sourcepub fn source_repo(&self) -> Option<&str>
pub fn source_repo(&self) -> Option<&str>
The Git repository from which the template was installed, if it was installed from Git; otherwise None.
Sourcepub fn installed_from_or_empty(&self) -> &str
pub fn installed_from_or_empty(&self) -> &str
A human-readable description of where the template was installed from.
Sourcepub fn supports_variant(&self, variant: &TemplateVariantInfo) -> bool
pub fn supports_variant(&self, variant: &TemplateVariantInfo) -> bool
Checks if the template supports the specified variant mode.
Sourcepub fn run(self, options: RunOptions) -> Run
pub fn run(self, options: RunOptions) -> Run
Creates a runner for the template, governed by the given options. Call
the relevant associated function of the Run
to execute the template
as appropriate to your application (e.g. interactive()
to prompt the user
for values and interact with the user at the console).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Template
impl !RefUnwindSafe for Template
impl Send for Template
impl Sync for Template
impl Unpin for Template
impl !UnwindSafe for Template
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> 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