#[non_exhaustive]pub enum Target {
Netlify,
Vercel,
CloudflarePages,
GithubPages,
S3,
None,
}Expand description
Deploy targets accepted by ssg deploy --target <TARGET>.
Kept in lockstep with crate::cmd::DEPLOY_TARGETS (the CLI-facing
list); this enum is the typed view used inside the deploy pipeline.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Netlify
Netlify static-site hosting (SSG_NETLIFY_TOKEN).
Vercel
Vercel static deployment (SSG_VERCEL_TOKEN).
CloudflarePages
Cloudflare Pages direct-upload (SSG_CLOUDFLARE_TOKEN).
GithubPages
GitHub Pages branch push (SSG_GITHUB_TOKEN).
S3
Amazon S3 bucket sync (SSG_S3_BUCKET, AWS_*).
None
No-op: build only, do not upload. Useful for CI dry-runs.
Implementations§
Source§impl Target
impl Target
Sourcepub fn from_cli(name: &str) -> Result<Self, SsgError>
pub fn from_cli(name: &str) -> Result<Self, SsgError>
Parses a CLI string into a Target.
Unknown values are rejected by clap before reaching here (see
Cli::subcommand_app -> --target PossibleValuesParser),
but we treat an unknown input as a defensive validation error
rather than panic.
§Examples
use ssg::deploy_adapter::Target;
assert_eq!(Target::from_cli("netlify").unwrap(), Target::Netlify);
assert!(Target::from_cli("not-a-target").is_err());§Errors
Returns SsgError::Validation if name is not one of the
six supported targets.
Trait Implementations§
impl Copy for Target
impl Eq for Target
impl StructuralPartialEq for Target
Auto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnsafeUnpin for Target
impl UnwindSafe for Target
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§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>
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