Struct seaplane_cli::context::flight::FlightCtx
source · pub struct FlightCtx {
pub image: ImageReference,
pub name_id: Option<String>,
pub generated_name: 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§
§image: ImageReference§name_id: Option<String>§generated_name: boolImplementations§
source§impl FlightCtx
impl FlightCtx
sourcepub fn from_inline_flight(
inline_flight: &str,
registry: &str
) -> Result<FlightCtx>
pub fn from_inline_flight( inline_flight: &str, registry: &str ) -> Result<FlightCtx>
Builds a FlightCtx from a string value using the inline flight spec syntax:
name=FOO,image=nginx:latest
Where only image=… is required
sourcepub fn from_json(s: &str) -> Result<Self>
pub fn from_json(s: &str) -> Result<Self>
Try to deserialize a Flight from a JSON string or convert to a CLI Error
sourcepub fn from_str(flight: &str, registry: &str) -> Result<Vec<Self>>
pub fn from_str(flight: &str, registry: &str) -> Result<Vec<Self>>
Create from an string which can be a PATH, - (STDIN), or the INLINE spec.
sourcepub fn model(&self) -> FlightModel
pub fn model(&self) -> FlightModel
Creates a new seaplane::api::compute::v2::Flight from the contained values
Trait Implementations§
source§impl<'de> Deserialize<'de> for FlightCtx
impl<'de> Deserialize<'de> for FlightCtx
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more