pub struct VoltClientConfig {
pub client_name: String,
pub volt: VoltConfig,
pub credential: Option<CredentialCache>,
pub auto_reconnect: bool,
pub ping_interval: u64,
pub reconnect_interval: u64,
pub timeout_interval: u64,
pub bind_request_ttl: Option<u64>,
pub passphrase: Option<String>,
}Expand description
Full client configuration
Fields§
§client_name: StringName of this client
volt: VoltConfigVolt server configuration
credential: Option<CredentialCache>Cached credentials
auto_reconnect: boolAuto-reconnect on disconnection
ping_interval: u64Ping interval in milliseconds
reconnect_interval: u64Reconnect interval in milliseconds
timeout_interval: u64Timeout interval in milliseconds
bind_request_ttl: Option<u64>TTL for bind requests
passphrase: Option<String>Passphrase for encrypted keys
Implementations§
Source§impl VoltClientConfig
impl VoltClientConfig
Sourcepub async fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub async fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load configuration from a JSON file
Sourcepub fn from_value(value: Value) -> Result<Self>
pub fn from_value(value: Value) -> Result<Self>
Create configuration from a JSON object
Sourcepub async fn save_to_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub async fn save_to_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
Save configuration to a file
Sourcepub fn is_relayed(&self) -> bool
pub fn is_relayed(&self) -> bool
Check if this connection is through a relay
Trait Implementations§
Source§impl Clone for VoltClientConfig
impl Clone for VoltClientConfig
Source§fn clone(&self) -> VoltClientConfig
fn clone(&self) -> VoltClientConfig
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 moreSource§impl Debug for VoltClientConfig
impl Debug for VoltClientConfig
Source§impl Default for VoltClientConfig
impl Default for VoltClientConfig
Source§impl<'de> Deserialize<'de> for VoltClientConfig
impl<'de> Deserialize<'de> for VoltClientConfig
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
Source§impl From<VoltClientConfig> for ConfigSource
impl From<VoltClientConfig> for ConfigSource
Source§fn from(c: VoltClientConfig) -> Self
fn from(c: VoltClientConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for VoltClientConfig
impl RefUnwindSafe for VoltClientConfig
impl Send for VoltClientConfig
impl Sync for VoltClientConfig
impl Unpin for VoltClientConfig
impl UnwindSafe for VoltClientConfig
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,
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>
Wrap the input message
T in a tonic::Request