Struct brane_cfg::infra::InfraFile

source ·
pub struct InfraFile { /* private fields */ }
Expand description

Defines a “handle” to the document that contains the Brane instance layout.

It is recommended to only load when used, to allow system admins to update the file during runtime.

Implementations§

source§

impl InfraFile

source

pub fn new(locations: HashMap<String, InfraLocation>) -> Self

Constructor for the InfraFile.

Arguments
  • locations: The map of location IDs to InfraLocations around which to initialize this InfraFile.
Returns

A new InfraFile instance.

source

pub fn get(&self, name: impl AsRef<str>) -> Option<&InfraLocation>

Returns the metadata for the location with the given name.

Arguments
  • name: The name of the location to retrieve.
Returns

The InfraLocation of the location that was referenced by the name, or else None if it didn’t exist.

source

pub fn iter(&self) -> Iter<'_, String, InfraLocation>

Returns an iterator-by-reference over the internal map.

source

pub fn iter_mut(&mut self) -> IterMut<'_, String, InfraLocation>

Returns a muteable iterator-by-reference over the internal map.

Trait Implementations§

source§

impl Clone for InfraFile

source§

fn clone(&self) -> InfraFile

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for InfraFile

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for InfraFile

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<'a> IntoIterator for &'a InfraFile

§

type Item = (&'a String, &'a InfraLocation)

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, String, InfraLocation>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a> IntoIterator for &'a mut InfraFile

§

type Item = (&'a String, &'a mut InfraLocation)

The type of the elements being iterated over.
§

type IntoIter = IterMut<'a, String, InfraLocation>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl IntoIterator for InfraFile

§

type Item = (String, InfraLocation)

The type of the elements being iterated over.
§

type IntoIter = IntoIter<String, InfraLocation>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl Serialize for InfraFile

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'de> YamlConfig<'de> for InfraFile

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Config for Twhere T: DeserializeOwned + Serialize + for<'de> YamlConfig<'de>,

§

type Error = Error

The types of errors that may be thrown by the serialization function(s).
source§

fn to_string( &self, _pretty: bool ) -> Result<String, ConfigError<<T as Config>::Error>>

Serializes this Config to a string. Read more
source§

fn to_writer( &self, writer: impl Write, _pretty: bool ) -> Result<(), ConfigError<<T as Config>::Error>>

Serializes this Config to a reader. Read more
source§

fn from_string( raw: impl AsRef<str> ) -> Result<T, ConfigError<<T as Config>::Error>>

Deserializes the given string to an instance of ourselves. Read more
source§

fn from_reader( reader: impl Read ) -> Result<T, ConfigError<<T as Config>::Error>>

Deserializes the contents of the given reader to an instance of ourselves. Read more
source§

fn to_path( &self, path: impl AsRef<Path> ) -> Result<(), ConfigError<Self::Error>>

Serializes this Config to a file at the given path. Read more
source§

fn from_path(path: impl AsRef<Path>) -> Result<Self, ConfigError<Self::Error>>

Deserializes this Config from the file at the given path. Read more
source§

fn from_path_async<'async_trait>( path: impl 'async_trait + Send + AsRef<Path> ) -> Pin<Box<dyn Future<Output = Result<Self, ConfigError<Self::Error>>> + Send + 'async_trait>>where Self: Send + 'async_trait,

Deserializes this Config from the file at the given path, with the reading part done asynchronously. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for Twhere T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,