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<Provider>,
pub providers_denied: HashSet<Provider>,
pub regions_allowed: HashSet<Region>,
pub regions_denied: HashSet<Region>,
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<Provider>Use actual API model since that is ultimately what we want
providers_denied: HashSet<Provider>Use actual API model since that is ultimately what we want
regions_allowed: HashSet<Region>Use actual API model since that is ultimately what we want
regions_denied: HashSet<Region>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 duplicate 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
Auto Trait Implementations§
impl Freeze for RestrictCtx
impl RefUnwindSafe for RestrictCtx
impl Send for RestrictCtx
impl Sync for RestrictCtx
impl Unpin for RestrictCtx
impl UnwindSafe for RestrictCtx
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