#[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: String
The 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: Syntax
The source syntax.
edition: String
The 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
Sets the value of fields.
Sourcepub fn set_oneofs<T, V>(self, v: T) -> Self
pub fn set_oneofs<T, V>(self, v: T) -> Self
Sets the value of oneofs.
Sourcepub fn set_options<T, V>(self, v: T) -> Self
pub fn set_options<T, V>(self, v: T) -> Self
Sets the value of options.
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.
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.
Sourcepub fn set_syntax<T: Into<Syntax>>(self, v: T) -> Self
pub fn set_syntax<T: Into<Syntax>>(self, v: T) -> Self
Sets the value of syntax.
Sourcepub fn set_edition<T: Into<String>>(self, v: T) -> Self
pub fn set_edition<T: Into<String>>(self, v: T) -> Self
Sets the value of edition.
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