Struct brane_cli::instance::InstanceInfo
source · pub struct InstanceInfo {
pub api: Address,
pub drv: Address,
pub user: String,
}
Expand description
Defines the layout of an InstanceInfo, which describes what we remember about each instance.
Note that the name is encoded as the file’s name.
Fields§
§api: Address
The place where we can find the API service for this instance.
drv: Address
The place where we can find the driver service for this instance.
user: String
A username to send with workflow requests as receiver of the final result.
Implementations§
source§impl InstanceInfo
impl InstanceInfo
sourcepub fn from_active_path() -> Result<Self, Error>
pub fn from_active_path() -> Result<Self, Error>
Reads this InstanceInfo from the active instance’s directory in the local configuration directory.
§Returns
A new InstanceInfo instance that is populated with the contents of the file pointed to by the active-instance symlink.
§Errors
This function errors if we failed to get the local path, there is no active instance, if we failed to read the file or if we failed to parse it.
sourcepub fn active_instance_exists() -> Result<bool, Error>
pub fn active_instance_exists() -> Result<bool, Error>
sourcepub fn from_default_path(name: impl AsRef<str>) -> Result<Self, Error>
pub fn from_default_path(name: impl AsRef<str>) -> Result<Self, Error>
Reads this InstanceInfo from the default path in the local configuration directory.
§Arguments
name
: The name for this instance. Will cause errors if it contains characters incompatible for paths of OS.
§Returns
A new InstanceInfo instance that is populated with the contents of the file.
§Errors
This function errors if we failed to get the local path, if we failed to read the file or if we failed to parse it.
sourcepub fn get_active_name() -> Result<String, Error>
pub fn get_active_name() -> Result<String, Error>
sourcepub fn get_active_path() -> Result<PathBuf, Error>
pub fn get_active_path() -> Result<PathBuf, Error>
Trait Implementations§
source§impl Clone for InstanceInfo
impl Clone for InstanceInfo
source§fn clone(&self) -> InstanceInfo
fn clone(&self) -> InstanceInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for InstanceInfo
impl Debug for InstanceInfo
source§impl<'de> Deserialize<'de> for InstanceInfo
impl<'de> Deserialize<'de> for InstanceInfo
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>,
Auto Trait Implementations§
impl Freeze for InstanceInfo
impl RefUnwindSafe for InstanceInfo
impl Send for InstanceInfo
impl Sync for InstanceInfo
impl Unpin for InstanceInfo
impl UnwindSafe for InstanceInfo
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request