#[non_exhaustive]pub struct SchemaSettings {
pub schema: String,
pub encoding: Encoding,
pub first_revision_id: String,
pub last_revision_id: String,
/* private fields */
}Expand description
Settings for validating messages published against a schema.
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.schema: StringRequired. The name of the schema that messages published should be
validated against. Format is projects/{project}/schemas/{schema}. The
value of this field will be _deleted-schema_ if the schema has been
deleted.
encoding: EncodingOptional. The encoding of messages validated against schema.
first_revision_id: StringOptional. The minimum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against last_revision or any revision created before.
last_revision_id: StringOptional. The maximum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against first_revision or any revision created after.
Implementations§
Source§impl SchemaSettings
impl SchemaSettings
pub fn new() -> Self
Sourcepub fn set_schema<T: Into<String>>(self, v: T) -> Self
pub fn set_schema<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_encoding<T: Into<Encoding>>(self, v: T) -> Self
pub fn set_encoding<T: Into<Encoding>>(self, v: T) -> Self
Sourcepub fn set_first_revision_id<T: Into<String>>(self, v: T) -> Self
pub fn set_first_revision_id<T: Into<String>>(self, v: T) -> Self
Sets the value of first_revision_id.
§Example
let x = SchemaSettings::new().set_first_revision_id("example");Sourcepub fn set_last_revision_id<T: Into<String>>(self, v: T) -> Self
pub fn set_last_revision_id<T: Into<String>>(self, v: T) -> Self
Sets the value of last_revision_id.
§Example
let x = SchemaSettings::new().set_last_revision_id("example");Trait Implementations§
Source§impl Clone for SchemaSettings
impl Clone for SchemaSettings
Source§fn clone(&self) -> SchemaSettings
fn clone(&self) -> SchemaSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SchemaSettings
impl Debug for SchemaSettings
Source§impl Default for SchemaSettings
impl Default for SchemaSettings
Source§fn default() -> SchemaSettings
fn default() -> SchemaSettings
Source§impl Message for SchemaSettings
impl Message for SchemaSettings
Source§impl PartialEq for SchemaSettings
impl PartialEq for SchemaSettings
impl StructuralPartialEq for SchemaSettings
Auto Trait Implementations§
impl Freeze for SchemaSettings
impl RefUnwindSafe for SchemaSettings
impl Send for SchemaSettings
impl Sync for SchemaSettings
impl Unpin for SchemaSettings
impl UnwindSafe for SchemaSettings
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