pub struct RexecClient { /* private fields */ }Expand description
Main client for interacting with Rexec API.
§Example
use rexec::RexecClient;
#[tokio::main]
async fn main() -> Result<(), rexec::Error> {
let client = RexecClient::new("https://your-instance.com", "your-token");
let containers = client.containers().list().await?;
for c in containers {
println!("{}: {}", c.name, c.status);
}
Ok(())
}Implementations§
Source§impl RexecClient
impl RexecClient
Sourcepub fn new(base_url: impl Into<String>, token: impl Into<String>) -> Self
pub fn new(base_url: impl Into<String>, token: impl Into<String>) -> Self
Create a new Rexec client.
§Arguments
base_url- Base URL of your Rexec instancetoken- API token for authentication
Sourcepub fn with_config(config: ClientConfig) -> Self
pub fn with_config(config: ClientConfig) -> Self
Create a new Rexec client with custom configuration.
Sourcepub fn containers(&self) -> ContainerService
pub fn containers(&self) -> ContainerService
Get the container service.
Sourcepub fn files(&self) -> FileService
pub fn files(&self) -> FileService
Get the file service.
Sourcepub fn terminal(&self) -> TerminalService
pub fn terminal(&self) -> TerminalService
Get the terminal service.
Trait Implementations§
Source§impl Clone for RexecClient
impl Clone for RexecClient
Source§fn clone(&self) -> RexecClient
fn clone(&self) -> RexecClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for RexecClient
impl !UnwindSafe for RexecClient
impl Freeze for RexecClient
impl Send for RexecClient
impl Sync for RexecClient
impl Unpin for RexecClient
impl UnsafeUnpin for RexecClient
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