pub struct DeleteBasinRequest {
pub basin: BasinName,
pub if_exists: bool,
}
Expand description
Delete basin request.
Fields§
§basin: BasinName
Name of the basin to delete.
if_exists: bool
Delete basin if it exists else do nothing.
Implementations§
Source§impl DeleteBasinRequest
impl DeleteBasinRequest
Sourcepub fn new(basin: BasinName) -> Self
pub fn new(basin: BasinName) -> Self
Create a new request.
Examples found in repository?
examples/delete_basin.rs (line 14)
7async fn main() -> Result<(), Box<dyn std::error::Error>> {
8 let token = std::env::var("S2_ACCESS_TOKEN")?;
9 let config = ClientConfig::new(token);
10 let client = Client::new(config);
11
12 let basin: BasinName = "my-favorite-basin".parse()?;
13
14 let delete_basin_request = DeleteBasinRequest::new(basin)
15 // Don't error if the basin doesn't exist.
16 .with_if_exists(true);
17
18 client.delete_basin(delete_basin_request).await?;
19
20 Ok(())
21}
Sourcepub fn with_if_exists(self, if_exists: bool) -> Self
pub fn with_if_exists(self, if_exists: bool) -> Self
Overwrite the if exists parameter.
Examples found in repository?
examples/delete_basin.rs (line 16)
7async fn main() -> Result<(), Box<dyn std::error::Error>> {
8 let token = std::env::var("S2_ACCESS_TOKEN")?;
9 let config = ClientConfig::new(token);
10 let client = Client::new(config);
11
12 let basin: BasinName = "my-favorite-basin".parse()?;
13
14 let delete_basin_request = DeleteBasinRequest::new(basin)
15 // Don't error if the basin doesn't exist.
16 .with_if_exists(true);
17
18 client.delete_basin(delete_basin_request).await?;
19
20 Ok(())
21}
Trait Implementations§
Source§impl Clone for DeleteBasinRequest
impl Clone for DeleteBasinRequest
Source§fn clone(&self) -> DeleteBasinRequest
fn clone(&self) -> DeleteBasinRequest
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 moreAuto Trait Implementations§
impl Freeze for DeleteBasinRequest
impl RefUnwindSafe for DeleteBasinRequest
impl Send for DeleteBasinRequest
impl Sync for DeleteBasinRequest
impl Unpin for DeleteBasinRequest
impl UnwindSafe for DeleteBasinRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request