#[non_exhaustive]pub struct Type {
pub name: String,
pub fields: Vec<Field>,
pub oneofs: Vec<String>,
pub options: Vec<Option>,
pub source_context: Option<SourceContext>,
pub syntax: Syntax,
pub edition: String,
/* private fields */
}Expand description
A protocol buffer message type.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringThe fully qualified message name.
fields: Vec<Field>The list of fields.
oneofs: Vec<String>The list of types appearing in oneof definitions in this type.
options: Vec<Option>The protocol buffer options.
source_context: Option<SourceContext>The source context.
syntax: SyntaxThe source syntax.
edition: StringThe source edition string, only valid when syntax is SYNTAX_EDITIONS.
Implementations§
Source§impl Type
impl Type
pub fn new() -> Self
Sourcepub fn set_fields<T, V>(self, v: T) -> Self
pub fn set_fields<T, V>(self, v: T) -> Self
Sourcepub fn set_oneofs<T, V>(self, v: T) -> Self
pub fn set_oneofs<T, V>(self, v: T) -> Self
Sourcepub fn set_options<T, V>(self, v: T) -> Self
pub fn set_options<T, V>(self, v: T) -> Self
Sourcepub fn set_source_context<T>(self, v: T) -> Selfwhere
T: Into<SourceContext>,
pub fn set_source_context<T>(self, v: T) -> Selfwhere
T: Into<SourceContext>,
Sets the value of source_context.
§Example
ⓘ
use google_cloud_wkt::SourceContext;
let x = Type::new().set_source_context(SourceContext::default()/* use setters */);Sourcepub fn set_or_clear_source_context<T>(self, v: Option<T>) -> Selfwhere
T: Into<SourceContext>,
pub fn set_or_clear_source_context<T>(self, v: Option<T>) -> Selfwhere
T: Into<SourceContext>,
Sets or clears the value of source_context.
§Example
ⓘ
use google_cloud_wkt::SourceContext;
let x = Type::new().set_or_clear_source_context(Some(SourceContext::default()/* use setters */));
let x = Type::new().set_or_clear_source_context(None::<SourceContext>);Sourcepub fn set_syntax<T: Into<Syntax>>(self, v: T) -> Self
pub fn set_syntax<T: Into<Syntax>>(self, v: T) -> Self
Trait Implementations§
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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