pub enum TemplateSource {
Git(GitTemplateSource),
File(PathBuf),
RemoteTar(Url),
}
Expand description
A source from which to install templates.
Variants§
Git(GitTemplateSource)
Install from a Git repository at the specified URL. If a branch is specified, templates are installed from that branch or tag; otherwise, they are installed from HEAD.
Templates much be in a /templates
directory under the root of the
repository.
File(PathBuf)
Install from a directory in the file system.
Templates much be in a /templates
directory under the specified
root.
RemoteTar(Url)
Install from a remote tarball.
Templates should be in a /templates
directory under the root of the tarball.
The implementation also allows for there to be a single root directory containing
the templates
directory - this makes it compatible with GitHub release tarballs.
Implementations§
Source§impl TemplateSource
impl TemplateSource
Sourcepub fn try_from_git(
git_url: impl AsRef<str>,
branch: &Option<String>,
spin_version: &str,
) -> Result<Self>
pub fn try_from_git( git_url: impl AsRef<str>, branch: &Option<String>, spin_version: &str, ) -> Result<Self>
Creates a TemplateSource
referring to the specified Git repository
and branch.
Sourcepub async fn resolved_tag(&self) -> Option<String>
pub async fn resolved_tag(&self) -> Option<String>
For a Git source, resolves the tag to use as the source. For other sources, returns None.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TemplateSource
impl RefUnwindSafe for TemplateSource
impl Send for TemplateSource
impl Sync for TemplateSource
impl Unpin for TemplateSource
impl UnwindSafe for TemplateSource
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