pub struct NetworkConnect { /* private fields */ }Expand description
Connect a container to a network.
§Examples
use ironflow_ops_docker::networks::NetworkConnect;
use ironflow_ops_docker::DockerClient;
use ironflow_core::operation::Operation;
let client = DockerClient::connect_local().unwrap();
let op = NetworkConnect::new(&client, "my-network", "my-container");
assert_eq!(op.kind(), "docker");Implementations§
Source§impl NetworkConnect
impl NetworkConnect
Sourcepub fn new(
client: impl Into<DockerRef>,
network: impl Into<String>,
container: impl Into<String>,
) -> Self
pub fn new( client: impl Into<DockerRef>, network: impl Into<String>, container: impl Into<String>, ) -> Self
Create a new network-connect operation.
Sourcepub async fn run(
&self,
_ctx: &OperationContext,
) -> Result<NetworkConnectOutput, OperationError>
pub async fn run( &self, _ctx: &OperationContext, ) -> Result<NetworkConnectOutput, OperationError>
Execute and return a typed result.
§Errors
Returns OperationError::External if the network or container does
not exist.
Trait Implementations§
Source§impl Operation for NetworkConnect
impl Operation for NetworkConnect
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 OperationContext,
) -> Pin<Box<dyn Future<Output = Result<Value, OperationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 OperationContext,
) -> Pin<Box<dyn Future<Output = Result<Value, OperationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the operation and return the result as JSON. Read more
Source§impl TypedOperation for NetworkConnect
impl TypedOperation for NetworkConnect
Source§type Output = NetworkConnectOutput
type Output = NetworkConnectOutput
The concrete output type that
Operation::execute produces.Auto Trait Implementations§
impl !RefUnwindSafe for NetworkConnect
impl !UnwindSafe for NetworkConnect
impl Freeze for NetworkConnect
impl Send for NetworkConnect
impl Sync for NetworkConnect
impl Unpin for NetworkConnect
impl UnsafeUnpin for NetworkConnect
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