#[non_exhaustive]pub struct ProtoSchema {
pub proto_descriptors: Bytes,
/* private fields */
}Expand description
Represents a protobuf schema.
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.proto_descriptors: BytesRequired. Contains a protobuf-serialized
google.protobuf.FileDescriptorSet,
which could include multiple proto files.
To generate it, install and
run protoc with
--include_imports and --descriptor_set_out. For example, to generate
for moon/shot/app.proto, run
$protoc --proto_path=/app_path --proto_path=/lib_path \
--include_imports \
--descriptor_set_out=descriptors.pb \
moon/shot/app.protoFor more details, see protobuffer self description.
Implementations§
Source§impl ProtoSchema
impl ProtoSchema
pub fn new() -> Self
Sourcepub fn set_proto_descriptors<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_proto_descriptors<T: Into<Bytes>>(self, v: T) -> Self
Sets the value of proto_descriptors.
§Example
ⓘ
let x = ProtoSchema::new().set_proto_descriptors(bytes::Bytes::from_static(b"example"));Trait Implementations§
Source§impl Clone for ProtoSchema
impl Clone for ProtoSchema
Source§fn clone(&self) -> ProtoSchema
fn clone(&self) -> ProtoSchema
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProtoSchema
impl Debug for ProtoSchema
Source§impl Default for ProtoSchema
impl Default for ProtoSchema
Source§fn default() -> ProtoSchema
fn default() -> ProtoSchema
Returns the “default value” for a type. Read more
Source§impl Message for ProtoSchema
impl Message for ProtoSchema
Source§impl PartialEq for ProtoSchema
impl PartialEq for ProtoSchema
impl StructuralPartialEq for ProtoSchema
Auto Trait Implementations§
impl !Freeze for ProtoSchema
impl RefUnwindSafe for ProtoSchema
impl Send for ProtoSchema
impl Sync for ProtoSchema
impl Unpin for ProtoSchema
impl UnwindSafe for ProtoSchema
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