Skip to main content

ProtoType

Struct ProtoType 

Source
pub struct ProtoType { /* private fields */ }
Expand description

A compiled specification for the defaults of a set of features. These messages are generated from FeatureSet extensions and can be used to seed feature resolution. The resolution with this object becomes a simple search for the closest matching edition, followed by proto merges.

Implementations§

Source§

impl ProtoType

Source

pub fn clear(&mut self)

Resets all fields of FeatureSetDefaults to their default values.

Source

pub const fn file_descriptor() -> &'static ProtoType

Returns the file descriptor for google/protobuf/descriptor.proto.

Source

pub const fn descriptor_proto() -> &'static ProtoType

Returns the descriptor for FeatureSetDefaults.

Source

pub const fn defaults(&self) -> &[TypedMessage<ProtoType>]

Source

pub fn defaults_mut(&mut self) -> &mut RepeatedField<TypedMessage<ProtoType>>

Source

pub fn add_defaults( &mut self, arena: &mut Arena<'_>, ) -> Result<&mut ProtoType, Error<LayoutError>>

Source

pub const fn has_minimum_edition(&self) -> bool

Returns whether the minimum_edition field is set.

Source

pub const fn minimum_edition(&self) -> Option<Edition>

The minimum supported edition (inclusive) when this was constructed. Editions before this will not have defaults.

Source

pub fn set_minimum_edition(&mut self, value: Edition)

The minimum supported edition (inclusive) when this was constructed. Editions before this will not have defaults.

Source

pub fn set_optional_minimum_edition(&mut self, value: Option<Edition>)

Source

pub fn clear_minimum_edition(&mut self)

Clears the minimum_edition field.

Source

pub const fn has_maximum_edition(&self) -> bool

Returns whether the maximum_edition field is set.

Source

pub const fn maximum_edition(&self) -> Option<Edition>

The maximum known edition (inclusive) when this was constructed. Editions after this will not have reliable defaults.

Source

pub fn set_maximum_edition(&mut self, value: Edition)

The maximum known edition (inclusive) when this was constructed. Editions after this will not have reliable defaults.

Source

pub fn set_optional_maximum_edition(&mut self, value: Option<Edition>)

Source

pub fn clear_maximum_edition(&mut self)

Clears the maximum_edition field.

Trait Implementations§

Source§

impl Debug for ProtoType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProtoType

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ProtobufMut<'static> for T
where T: Protobuf,

Source§

fn as_dyn_mut<'msg>(&'msg mut self) -> DynamicMessage<'static, 'msg>

Get a mutable dynamic view of this message.
Source§

fn decode_flat<const STACK_DEPTH: usize>( &mut self, arena: &mut Arena<'_>, buf: &[u8], ) -> bool

Decode from a byte slice. Returns true on success.
Source§

fn decode<'a, E>( &mut self, arena: &mut Arena<'_>, provider: &'a mut impl FnMut() -> Result<Option<&'a [u8]>, E>, ) -> Result<(), Error<E>>

Source§

fn async_decode<'a, E, F>( &'a mut self, arena: &mut Arena<'_>, provider: &'a mut impl FnMut() -> F, ) -> impl Future<Output = Result<(), Error<E>>>
where F: Future<Output = Result<Option<&'a [u8]>, E>> + 'a,

Source§

fn decode_from_bufread<const STACK_DEPTH: usize>( &mut self, arena: &mut Arena<'_>, reader: &mut impl BufRead, ) -> Result<(), Error<Error>>

Source§

fn decode_from_read<const STACK_DEPTH: usize>( &mut self, arena: &mut Arena<'_>, reader: &mut impl Read, ) -> Result<(), Error<Error>>

Source§

fn decode_from_async_bufread<'a, const STACK_DEPTH: usize>( &'a mut self, arena: &'a mut Arena<'a>, reader: &mut (impl AsyncBufRead + Unpin), ) -> impl Future<Output = Result<(), Error<Error>>>

Source§

fn decode_from_async_read<'a, const STACK_DEPTH: usize>( &'a mut self, arena: &'a mut Arena<'a>, reader: &mut (impl AsyncRead + Unpin), ) -> impl Future<Output = Result<(), Error<Error>>>

Source§

fn serde_deserialize<'arena, 'alloc, 'de, D>( &'de mut self, arena: &'arena mut Arena<'alloc>, deserializer: D, ) -> Result<(), D::Error>
where D: Deserializer<'de>,

Source§

impl<T> ProtobufRef<'static> for T
where T: Protobuf,

Source§

fn as_dyn<'msg>(&'msg self) -> DynamicMessageRef<'static, 'msg>

Get a dynamic view of this message for reflection.
Source§

fn descriptor(&self) -> &'pool ProtoType

Get the message’s descriptor (schema metadata).
Source§

fn encode_flat<'a, const STACK_DEPTH: usize>( &self, buffer: &'a mut [u8], ) -> Result<&'a [u8], Error>

Encode to a fixed buffer. Returns the encoded slice or an error.
Source§

fn encode_vec<const STACK_DEPTH: usize>(&self) -> Result<Vec<u8>, Error>

Encode to a new Vec, growing as needed.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.