pub struct CreateBasinRequest {
pub basin: BasinName,
pub config: Option<BasinConfig>,
pub scope: Option<BasinScope>,
}This crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
Expand description
Create basin request.
Fields§
§basin: BasinNameThis crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
Basin name, which must be globally unique. The name must be between 8 and 48 characters, comprising lowercase letters, numbers and hyphens. It cannot begin or end with a hyphen.
config: Option<BasinConfig>This crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
Basin configuration.
scope: Option<BasinScope>This crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
Basin scope.
Implementations§
Source§impl CreateBasinRequest
impl CreateBasinRequest
Sourcepub fn new(basin: BasinName) -> Self
👎Deprecated since 0.21.1: This crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
pub fn new(basin: BasinName) -> Self
This crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
Create a new request with basin name.
Examples found in repository?
9async fn main() -> Result<(), Box<dyn std::error::Error>> {
10 let token = std::env::var("S2_ACCESS_TOKEN")?;
11 let config = ClientConfig::new(token);
12 let client = Client::new(config);
13
14 let basin: BasinName = "my-favorite-basin".parse()?;
15
16 let default_stream_config = StreamConfig::new().with_retention_policy(RetentionPolicy::Age(
17 // Set the default retention age to 10 days.
18 Duration::from_secs(10 * 24 * 60 * 60),
19 ));
20
21 let basin_config = BasinConfig::new()
22 .with_default_stream_config(default_stream_config)
23 .with_create_stream_on_append(false)
24 .with_create_stream_on_read(false);
25
26 let create_basin_request = CreateBasinRequest::new(basin.clone()).with_config(basin_config);
27
28 let created_basin = client.create_basin(create_basin_request).await?;
29 println!("{created_basin:#?}");
30
31 let basin_config = client.get_basin_config(basin).await?;
32 println!("{basin_config:#?}");
33
34 Ok(())
35}Sourcepub fn with_config(self, config: BasinConfig) -> Self
👎Deprecated since 0.21.1: This crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
pub fn with_config(self, config: BasinConfig) -> Self
This crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
Overwrite basin configuration.
Examples found in repository?
9async fn main() -> Result<(), Box<dyn std::error::Error>> {
10 let token = std::env::var("S2_ACCESS_TOKEN")?;
11 let config = ClientConfig::new(token);
12 let client = Client::new(config);
13
14 let basin: BasinName = "my-favorite-basin".parse()?;
15
16 let default_stream_config = StreamConfig::new().with_retention_policy(RetentionPolicy::Age(
17 // Set the default retention age to 10 days.
18 Duration::from_secs(10 * 24 * 60 * 60),
19 ));
20
21 let basin_config = BasinConfig::new()
22 .with_default_stream_config(default_stream_config)
23 .with_create_stream_on_append(false)
24 .with_create_stream_on_read(false);
25
26 let create_basin_request = CreateBasinRequest::new(basin.clone()).with_config(basin_config);
27
28 let created_basin = client.create_basin(create_basin_request).await?;
29 println!("{created_basin:#?}");
30
31 let basin_config = client.get_basin_config(basin).await?;
32 println!("{basin_config:#?}");
33
34 Ok(())
35}Sourcepub fn with_scope(self, scope: BasinScope) -> Self
👎Deprecated since 0.21.1: This crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
pub fn with_scope(self, scope: BasinScope) -> Self
This crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
Overwrite basin scope.
Trait Implementations§
Source§impl Clone for CreateBasinRequest
impl Clone for CreateBasinRequest
Source§fn clone(&self) -> CreateBasinRequest
fn clone(&self) -> CreateBasinRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CreateBasinRequest
impl RefUnwindSafe for CreateBasinRequest
impl Send for CreateBasinRequest
impl Sync for CreateBasinRequest
impl Unpin for CreateBasinRequest
impl UnsafeUnpin for CreateBasinRequest
impl UnwindSafe for CreateBasinRequest
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
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>
T in a tonic::Request