pub struct ReconfigureStreamRequest {
pub stream: String,
pub config: Option<StreamConfig>,
pub mask: Option<Vec<String>>,
}This crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
Expand description
Reconfigure stream request.
Fields§
§stream: StringThis crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
Stream name.
config: Option<StreamConfig>This crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
Stream configuration with updated values.
mask: Option<Vec<String>>This crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
Specifies the pieces of configuration being updated. See https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask
Implementations§
Source§impl ReconfigureStreamRequest
impl ReconfigureStreamRequest
Sourcepub fn new(stream: impl Into<String>) -> 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(stream: impl Into<String>) -> Self
This crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
Create a new request with stream 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 basin: BasinName = "my-favorite-basin".parse()?;
13 let basin_client = BasinClient::new(config, basin);
14
15 let stream = "my-favorite-stream";
16
17 let stream_config_updates = StreamConfig::new().with_retention_policy(RetentionPolicy::Age(
18 // Change to retention policy to 1 day
19 Duration::from_secs(24 * 60 * 60),
20 ));
21
22 let reconfigure_stream_request = ReconfigureStreamRequest::new(stream)
23 .with_config(stream_config_updates)
24 // Field mask specifies which fields to update.
25 .with_mask(vec!["retention_policy".to_string()]);
26
27 let updated_stream_config = basin_client
28 .reconfigure_stream(reconfigure_stream_request)
29 .await?;
30
31 println!("{updated_stream_config:#?}");
32
33 Ok(())
34}Sourcepub fn with_config(self, config: StreamConfig) -> 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: StreamConfig) -> Self
This crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
Overwrite stream config.
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 basin: BasinName = "my-favorite-basin".parse()?;
13 let basin_client = BasinClient::new(config, basin);
14
15 let stream = "my-favorite-stream";
16
17 let stream_config_updates = StreamConfig::new().with_retention_policy(RetentionPolicy::Age(
18 // Change to retention policy to 1 day
19 Duration::from_secs(24 * 60 * 60),
20 ));
21
22 let reconfigure_stream_request = ReconfigureStreamRequest::new(stream)
23 .with_config(stream_config_updates)
24 // Field mask specifies which fields to update.
25 .with_mask(vec!["retention_policy".to_string()]);
26
27 let updated_stream_config = basin_client
28 .reconfigure_stream(reconfigure_stream_request)
29 .await?;
30
31 println!("{updated_stream_config:#?}");
32
33 Ok(())
34}Sourcepub fn with_mask(self, mask: impl Into<Vec<String>>) -> 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_mask(self, mask: impl Into<Vec<String>>) -> Self
This crate has been renamed to s2-sdk. Please update your Cargo.toml to use s2-sdk instead.
Overwrite field mask.
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 basin: BasinName = "my-favorite-basin".parse()?;
13 let basin_client = BasinClient::new(config, basin);
14
15 let stream = "my-favorite-stream";
16
17 let stream_config_updates = StreamConfig::new().with_retention_policy(RetentionPolicy::Age(
18 // Change to retention policy to 1 day
19 Duration::from_secs(24 * 60 * 60),
20 ));
21
22 let reconfigure_stream_request = ReconfigureStreamRequest::new(stream)
23 .with_config(stream_config_updates)
24 // Field mask specifies which fields to update.
25 .with_mask(vec!["retention_policy".to_string()]);
26
27 let updated_stream_config = basin_client
28 .reconfigure_stream(reconfigure_stream_request)
29 .await?;
30
31 println!("{updated_stream_config:#?}");
32
33 Ok(())
34}Trait Implementations§
Source§impl Clone for ReconfigureStreamRequest
impl Clone for ReconfigureStreamRequest
Source§fn clone(&self) -> ReconfigureStreamRequest
fn clone(&self) -> ReconfigureStreamRequest
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 ReconfigureStreamRequest
impl RefUnwindSafe for ReconfigureStreamRequest
impl Send for ReconfigureStreamRequest
impl Sync for ReconfigureStreamRequest
impl Unpin for ReconfigureStreamRequest
impl UnsafeUnpin for ReconfigureStreamRequest
impl UnwindSafe for ReconfigureStreamRequest
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