pub struct ClientBuilder { /* private fields */ }Expand description
Constructs a n0des client
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
pub fn new(endpoint: &Endpoint) -> Self
Sourcepub fn metrics_interval(self, interval: Duration) -> Self
pub fn metrics_interval(self, interval: Duration) -> Self
Set the metrics collection interval
Defaults to enabled, every 60 seconds.
Sourcepub fn disable_metrics(self) -> Self
pub fn disable_metrics(self) -> Self
Disable metrics collection.
Sourcepub fn secret_from_env(self) -> Result<Self>
pub fn secret_from_env(self) -> Result<Self>
Check N0DES_SECRET environment variable to supply a N0desTicket
Sourcepub fn ticket(self, ticket: N0desTicket) -> Result<Self>
pub fn ticket(self, ticket: N0desTicket) -> Result<Self>
Use a shared secret & remote n0des endpoint ID contained within a ticket to construct a n0des client. The resulting client will have “Client” capabilities.
Sourcepub async fn ssh_key_from_file<P: AsRef<Path>>(self, path: P) -> Result<Self>
pub async fn ssh_key_from_file<P: AsRef<Path>>(self, path: P) -> Result<Self>
Loads the private ssh key from the given path, and creates the needed capability.
Sourcepub fn ssh_key(self, key: &PrivateKey) -> Result<Self>
pub fn ssh_key(self, key: &PrivateKey) -> Result<Self>
Creates the capability from the provided private ssh key.
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl !RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl !UnwindSafe for ClientBuilder
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