Struct seaplane_cli::context::restrict::RestrictCtx
source · pub struct RestrictCtx {
pub api: Option<String>,
pub directory: Option<RestrictedDirectory>,
pub from_api: Option<String>,
pub from_dir: Option<String>,
pub providers_allowed: HashSet<ProviderModel>,
pub providers_denied: HashSet<ProviderModel>,
pub regions_allowed: HashSet<RegionModel>,
pub regions_denied: HashSet<RegionModel>,
pub base64: bool,
pub decode: bool,
pub no_header: bool,
}Expand description
Represents the “Source of Truth” i.e. it combines all the CLI options, ENV vars, and config values into a single structure that can be used later to build models for the API or local structs for serializing
Fields§
§api: Option<String>§directory: Option<RestrictedDirectory>A base64 encoded directory
from_api: Option<String>§from_dir: Option<String>A base64 encoded key
providers_allowed: HashSet<ProviderModel>Use actual API model since that is ultimately what we want
providers_denied: HashSet<ProviderModel>Use actual API model since that is ultimately what we want
regions_allowed: HashSet<RegionModel>Use actual API model since that is ultimately what we want
regions_denied: HashSet<RegionModel>Use actual API model since that is ultimately what we want
base64: boolIs the directory already URL safe base64 encoded
decode: boolPrint with decoding
no_header: boolSkip the headers in –format=table
Implementations§
source§impl RestrictCtx
impl RestrictCtx
sourcepub fn from_restrict_common(
matches: &SeaplaneRestrictCommonArgMatches<'_>
) -> Result<RestrictCtx>
pub fn from_restrict_common(
matches: &SeaplaneRestrictCommonArgMatches<'_>
) -> Result<RestrictCtx>
Builds a RestictCtx from ArgMatches
sourcepub fn from_restrict_list(
matches: &SeaplaneRestrictListArgMatches<'_>
) -> Result<RestrictCtx>
pub fn from_restrict_list(
matches: &SeaplaneRestrictListArgMatches<'_>
) -> Result<RestrictCtx>
Builds a RestictCtx from ArgMatches
sourcepub fn from_restrict_set(
matches: &SeaplaneRestrictSetArgMatches<'_>
) -> Result<RestrictCtx>
pub fn from_restrict_set(
matches: &SeaplaneRestrictSetArgMatches<'_>
) -> Result<RestrictCtx>
Builds a RestictCtx from ArgMatches
pub fn restriction_details(&self) -> Result<RestrictionDetails>
Trait Implementations§
source§impl Clone for RestrictCtx
impl Clone for RestrictCtx
source§fn clone(&self) -> RestrictCtx
fn clone(&self) -> RestrictCtx
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for RestrictCtx
impl Debug for RestrictCtx
source§impl Default for RestrictCtx
impl Default for RestrictCtx
source§fn default() -> RestrictCtx
fn default() -> RestrictCtx
Returns the “default value” for a type. Read more