#[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,
}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
Sourcepub fn set_source_context<T: Into<Option<SourceContext>>>(self, v: T) -> Self
pub fn set_source_context<T: Into<Option<SourceContext>>>(self, v: T) -> Self
Sets 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.
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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Type
impl<'de> Deserialize<'de> for Type
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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