Struct spacetimedb_cli::Config
source · pub struct Config { /* private fields */ }Implementations§
source§impl Config
impl Config
pub fn host(&self) -> String
pub fn set_host(&mut self, host: &str)
pub fn protocol(&self) -> String
pub fn set_protocol(&mut self, protocol: &str)
pub fn default_identity(&self) -> Option<&str>
pub fn set_default_identity(&mut self, default_identity: String)
sourcepub fn set_identity_nickname(
&mut self,
identity: &str,
nickname: &str
) -> Result<Option<String>, Error>
pub fn set_identity_nickname( &mut self, identity: &str, nickname: &str ) -> Result<Option<String>, Error>
Sets the nickname for the provided identity.
If the identity already has a nickname set, it will be overwritten and returned. If the
identity is not found, an error will be returned.
Returns
Ok(Option<String>)- If the identity was found, the old nickname will be returned.Err(anyhow::Error)- If the identity was not found.
pub fn default_address(&self) -> Option<&str>
pub fn identity_configs(&self) -> &Vec<IdentityConfig>
pub fn identity_configs_mut(&mut self) -> &mut Vec<IdentityConfig>
pub fn load() -> Self
pub fn save(&self)
pub fn get_default_identity_config(&self) -> Option<&IdentityConfig>
pub fn name_exists(&self, nickname: &str) -> bool
pub fn get_identity_config_by_name(&self, name: &str) -> Option<&IdentityConfig>
pub fn get_identity_config_by_identity( &self, identity: &str ) -> Option<&IdentityConfig>
pub fn get_identity_config_by_identity_mut( &mut self, identity: &str ) -> Option<&mut IdentityConfig>
sourcepub fn resolve_name_to_identity(
&self,
identity_or_name: Option<&str>
) -> Option<String>
pub fn resolve_name_to_identity( &self, identity_or_name: Option<&str> ) -> Option<String>
Converts some given identity_or_name into an identity.
If identity_or_name is None then None is returned. If identity_or_name is Some,
then if its an identity then its just returned. If its not an identity it is assumed to be
a name and it is looked up as an identity nickname. If the identity exists it is returned,
otherwise we panic.
sourcepub fn get_identity_config_mut(
&mut self,
identity_or_name: &str
) -> Option<&mut IdentityConfig>
pub fn get_identity_config_mut( &mut self, identity_or_name: &str ) -> Option<&mut IdentityConfig>
Converts some given identity_or_name into a mutable IdentityConfig.
Returns
None- If an identity config with the givenidentity_or_namedoes not exist.Some- A mutable reference to theIdentityConfigwith the givenidentity_or_name.
pub fn delete_identity_config_by_name( &mut self, name: &str ) -> Option<IdentityConfig>
pub fn delete_identity_config_by_identity( &mut self, identity: &str ) -> Option<IdentityConfig>
sourcepub fn delete_all_identity_configs(&mut self)
pub fn delete_all_identity_configs(&mut self)
Deletes all stored identity configs. This function does not save the config after removing all configs.
pub fn update_default_identity(&mut self)
pub fn get_host_url(&self) -> String
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
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>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Upcastable for Twhere
T: Any + Send + Sync + 'static,
impl<T> Upcastable for Twhere T: Any + Send + Sync + 'static,
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref