pub async fn remove_volume<T>(&self, name: T, force: bool) -> Result<(), DockerError>
        where T: Into<String>
    {

        let uri = self.make_uri(format!("/volumes/{}?force={}", name.into(), force.to_string()));
        let request = Request::delete(uri)
            .body(hyper::Body::empty())
            .unwrap();

        self.execute_async(request).await
            .and_then(|response| {
                match response.status {
                    204 => Ok(()),
                    400 => Err(DockerError::BadParameters(json::from_str(response.body_as_string().as_str()).unwrap())),
                    404 => Err(DockerError::NotFound(json::from_str(response.body_as_string().as_str()).unwrap())),
                    409 => Err(DockerError::Busy(json::from_str(response.body_as_string().as_str()).unwrap())),
                    500 => Err(DockerError::ServerError(json::from_str(response.body_as_string().as_str()).unwrap())),
                    _ => Err(DockerError::UnknownStatus),
                }
            })
    }
/// Remove volume
///
/// Instruct the driver to remove the volume.
///
/// # Arguments
/// * `name` - ID or name of the volume.
/// * `force` - Force the removal of the volume.
///
/// # Examples
///
/// ```rust
/// # use docker_client::{DockerClient, DockerError};
/// fn main() {
///    let client = DockerClient::new();
///
///     match client.remove_volume("test", false) {
///         Ok(_) => {},
///         Err(e) => { println!("Error: {:?}", e); },
///     }
///
/// }
/// ```
Remove volume
Instruct the driver to remove the volume.
Remove volume Instruct the driver to remove the volume .
pub async fn remove_volume<T>(&self, name: T, force: bool) -> Result<(), DockerError>
        where T: Into<String>
    {
        let uri = self.make_uri(format!("/volumes/{}?force={}", name.into(), force.to_string()));
        let request = Request::delete(uri)
            .body(hyper::Body::empty())
            .unwrap();
        self.execute_async(request).await
            .and_then(|response| {
                match response.status {
                    204 => Ok(()),
                    400 => Err(DockerError::BadParameters(json::from_str(response.body_as_string().as_str()).unwrap())),
                    404 => Err(DockerError::NotFound(json::from_str(response.body_as_string().as_str()).unwrap())),
                    409 => Err(DockerError::Busy(json::from_str(response.body_as_string().as_str()).unwrap())),
                    500 => Err(DockerError::ServerError(json::from_str(response.body_as_string().as_str()).unwrap())),
                    _ => Err(DockerError::UnknownStatus),
                }
            })
    }
pub async fn remove_volume < T > ( & self , name : T , force : bool ) -> Result < ( ) , DockerError > where T : Into < String > { let uri = self . make_uri ( format ! ( " " name into ( ) force to_string ( ) ) ) ; let request = Request :: delete ( uri ) . body ( hyper :: Body :: empty ( ) ) . unwrap ( ) ; self . execute_async ( request ) . await . and_then ( | response | { match response . status { 204 => Ok ( ( ) ) , 400 => Err ( DockerError :: BadParameters ( json :: from_str ( response . body_as_string ( ) . as_str ( ) ) . unwrap ( ) ) ) , 404 => Err ( DockerError :: NotFound ( json :: from_str ( response . body_as_string ( ) . as_str ( ) ) . unwrap ( ) ) ) , 409 => Err ( DockerError :: Busy ( json :: from_str ( response . body_as_string ( ) . as_str ( ) ) . unwrap ( ) ) ) , 500 => Err ( DockerError :: ServerError ( json :: from_str ( response . body_as_string ( ) . as_str ( ) ) . unwrap ( ) ) ) , _ => Err ( DockerError :: UnknownStatus ) , } } ) }
Remove volume
Instruct the driver to remove the volume.
Remove volume Instruct the driver to remove the volume .
&self
name
T
force
bool
&self
name
T
force
bool
examples
None
use docker_client::{dockerclient, dockererror};
fn main() {
let client = DockerClient::new().




fn main () { let client = DockerClient :: new () .