pub struct ReconfigureStreamRequest {
pub stream: String,
pub config: Option<StreamConfig>,
pub mask: Option<Vec<String>>,
}
Expand description
Reconfigure stream request.
Fields§
§stream: String
Stream name.
config: Option<StreamConfig>
Stream configuration with updated values.
mask: Option<Vec<String>>
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
pub fn new(stream: impl Into<String>) -> Self
Create a new request with stream name.
Examples found in repository?
examples/reconfigure_stream.rs (line 22)
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
pub fn with_config(self, config: StreamConfig) -> Self
Overwrite stream config.
Examples found in repository?
examples/reconfigure_stream.rs (line 23)
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
pub fn with_mask(self, mask: impl Into<Vec<String>>) -> Self
Overwrite field mask.
Examples found in repository?
examples/reconfigure_stream.rs (line 25)
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
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 ReconfigureStreamRequest
impl RefUnwindSafe for ReconfigureStreamRequest
impl Send for ReconfigureStreamRequest
impl Sync for ReconfigureStreamRequest
impl Unpin 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
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