pub struct WorkspaceCommand { /* private fields */ }Expand description
Command for managing Terraform workspaces.
use terraform_wrapper::{Terraform, TerraformCommand};
use terraform_wrapper::commands::workspace::WorkspaceCommand;
let tf = Terraform::builder().working_dir("/tmp/infra").build()?;
// List workspaces
let output = WorkspaceCommand::list().execute(&tf).await?;
// Create and switch to a new workspace
WorkspaceCommand::new_workspace("staging").execute(&tf).await?;
// Switch back
WorkspaceCommand::select("default").execute(&tf).await?;
// Delete
WorkspaceCommand::delete("staging").execute(&tf).await?;Implementations§
Source§impl WorkspaceCommand
impl WorkspaceCommand
Sourcepub fn new_workspace(name: &str) -> Self
pub fn new_workspace(name: &str) -> Self
Create a new workspace.
Trait Implementations§
Source§impl Clone for WorkspaceCommand
impl Clone for WorkspaceCommand
Source§fn clone(&self) -> WorkspaceCommand
fn clone(&self) -> WorkspaceCommand
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 WorkspaceCommand
impl Debug for WorkspaceCommand
Source§impl TerraformCommand for WorkspaceCommand
impl TerraformCommand for WorkspaceCommand
Auto Trait Implementations§
impl Freeze for WorkspaceCommand
impl RefUnwindSafe for WorkspaceCommand
impl Send for WorkspaceCommand
impl Sync for WorkspaceCommand
impl Unpin for WorkspaceCommand
impl UnsafeUnpin for WorkspaceCommand
impl UnwindSafe for WorkspaceCommand
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