#[non_exhaustive]pub struct MessageStoragePolicy {
pub allowed_persistence_regions: Vec<String>,
pub enforce_in_transit: bool,
/* private fields */
}Expand description
A policy constraining the storage of messages published to the topic.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.allowed_persistence_regions: Vec<String>Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
enforce_in_transit: boolOptional. If true, allowed_persistence_regions is also used to enforce
in-transit guarantees for messages. That is, Pub/Sub will fail
Publish operations on this topic and subscribe operations
on any subscription attached to this topic in any region that is
not in allowed_persistence_regions.
Implementations§
Source§impl MessageStoragePolicy
impl MessageStoragePolicy
pub fn new() -> Self
Sourcepub fn set_allowed_persistence_regions<T, V>(self, v: T) -> Self
pub fn set_allowed_persistence_regions<T, V>(self, v: T) -> Self
Sets the value of allowed_persistence_regions.
§Example
let x = MessageStoragePolicy::new().set_allowed_persistence_regions(["a", "b", "c"]);Sourcepub fn set_enforce_in_transit<T: Into<bool>>(self, v: T) -> Self
pub fn set_enforce_in_transit<T: Into<bool>>(self, v: T) -> Self
Sets the value of enforce_in_transit.
§Example
let x = MessageStoragePolicy::new().set_enforce_in_transit(true);Trait Implementations§
Source§impl Clone for MessageStoragePolicy
impl Clone for MessageStoragePolicy
Source§fn clone(&self) -> MessageStoragePolicy
fn clone(&self) -> MessageStoragePolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MessageStoragePolicy
impl Debug for MessageStoragePolicy
Source§impl Default for MessageStoragePolicy
impl Default for MessageStoragePolicy
Source§fn default() -> MessageStoragePolicy
fn default() -> MessageStoragePolicy
Source§impl Message for MessageStoragePolicy
impl Message for MessageStoragePolicy
Source§impl PartialEq for MessageStoragePolicy
impl PartialEq for MessageStoragePolicy
impl StructuralPartialEq for MessageStoragePolicy
Auto Trait Implementations§
impl Freeze for MessageStoragePolicy
impl RefUnwindSafe for MessageStoragePolicy
impl Send for MessageStoragePolicy
impl Sync for MessageStoragePolicy
impl Unpin for MessageStoragePolicy
impl UnwindSafe for MessageStoragePolicy
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