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 sandboxes = client.sandboxes().list().await?;
for c in sandboxes {
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 sandboxes(&self) -> SandboxService
pub fn sandboxes(&self) -> SandboxService
Get the sandbox service (preferred).
Sourcepub fn containers(&self) -> ContainerService
👎Deprecated since 1.1.0: use sandboxes()
pub fn containers(&self) -> ContainerService
use sandboxes()
Get the sandbox service.
Deprecated: use sandboxes.
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§
Auto 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