pub struct ClientOptions {
pub keypair: Option<Keypair>,
pub server_public_key: Option<Vec<u8>>,
pub pattern: Option<String>,
}
Expand description
Options used to create a new websocket client.
Fields§
§keypair: Option<Keypair>
Client static keypair.
server_public_key: Option<Vec<u8>>
Public key for the server to connect to.
pattern: Option<String>
Noise parameters pattern.
If no pattern is specified the default noise parameters pattern is used.
Implementations§
Source§impl ClientOptions
impl ClientOptions
Sourcepub fn is_encrypted(&self) -> bool
pub fn is_encrypted(&self) -> bool
Determine if this client expects to use an encrypted channel.
Sourcepub fn url(&self, server: &str) -> String
pub fn url(&self, server: &str) -> String
Build a connection URL for the given server.
This method appends the public key query string parameter necessary for connecting to the server.
Sourcepub fn params(&self) -> Result<NoiseParams>
pub fn params(&self) -> Result<NoiseParams>
Parse noise parameters from the pattern.
Trait Implementations§
Source§impl Default for ClientOptions
impl Default for ClientOptions
Source§fn default() -> ClientOptions
fn default() -> ClientOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ClientOptions
impl RefUnwindSafe for ClientOptions
impl Send for ClientOptions
impl Sync for ClientOptions
impl Unpin for ClientOptions
impl UnwindSafe for ClientOptions
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