Struct OmniConfig
pub struct OmniConfig {
pub default_target: Option<String>,
pub targets: BTreeMap<String, Target>,
}Expand description
The whole declarative connection config.
Fields§
§default_target: Option<String>Target used when --target is omitted.
targets: BTreeMap<String, Target>Named connection targets.
Implementations§
§impl OmniConfig
impl OmniConfig
pub fn parse(yaml: &str) -> Result<OmniConfig, AppError>
pub fn parse(yaml: &str) -> Result<OmniConfig, AppError>
Parse config from a YAML string and validate it.
§Errors
AppError::validation on a YAML parse error or a semantic validation
failure (bad target shape, dangling/cyclic group, missing default).
pub fn validate(&self) -> Result<(), AppError>
pub fn validate(&self) -> Result<(), AppError>
Validate target shapes, group references, group acyclicity, and the default target.
§Errors
AppError::validation describing the first problem found.
pub fn effective_target<'a>(
&'a self,
cli: Option<&'a str>,
) -> Result<&'a str, AppError>
pub fn effective_target<'a>( &'a self, cli: Option<&'a str>, ) -> Result<&'a str, AppError>
The effective target name: cli if given, else default_target.
§Errors
AppError::validation if neither is set.
pub fn resolve_endpoints(
&self,
name: &str,
) -> Result<Vec<ResolvedEndpoint>, AppError>
pub fn resolve_endpoints( &self, name: &str, ) -> Result<Vec<ResolvedEndpoint>, AppError>
Resolve a target name to its de-duplicated, ordered list of leaf endpoints, expanding groups recursively.
§Errors
AppError::validation for an unknown target or a group cycle.
Trait Implementations§
§impl Clone for OmniConfig
impl Clone for OmniConfig
§fn clone(&self) -> OmniConfig
fn clone(&self) -> OmniConfig
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 more§impl Debug for OmniConfig
impl Debug for OmniConfig
§impl Default for OmniConfig
impl Default for OmniConfig
§fn default() -> OmniConfig
fn default() -> OmniConfig
Returns the “default value” for a type. Read more
§impl<'de> Deserialize<'de> for OmniConfig
impl<'de> Deserialize<'de> for OmniConfig
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OmniConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OmniConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl JsonSchema for OmniConfig
impl JsonSchema for OmniConfig
§fn schema_name() -> Cow<'static, str>
fn schema_name() -> Cow<'static, str>
The name of the generated JSON Schema. Read more
§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read more§impl PartialEq for OmniConfig
impl PartialEq for OmniConfig
§impl Serialize for OmniConfig
impl Serialize for OmniConfig
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for OmniConfig
impl StructuralPartialEq for OmniConfig
Auto Trait Implementations§
impl Freeze for OmniConfig
impl RefUnwindSafe for OmniConfig
impl Send for OmniConfig
impl Sync for OmniConfig
impl Unpin for OmniConfig
impl UnsafeUnpin for OmniConfig
impl UnwindSafe for OmniConfig
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
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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key and return true if they are equal.