pub struct ScalarDescriptor {
pub name: String,
pub description: String,
pub field_type: Vec<i32>,
}
Expand description
ScalarDescriptor describes an scalar type to be used with the scalar field option and declared by declare_scalar. Scalars extend simple protobuf built-in types with additional syntax and semantics, for instance to represent big integers. Scalars should ideally define an encoding such that there is only one valid syntactical representation for a given semantic meaning, i.e. the encoding should be deterministic.
Fields§
§name: String
name is the name of the scalar. It should be a short-name (without a period) such that the fully qualified name of the scalar will be package.name, ex. for the package a.b and scalar named C, the fully-qualified name will be a.b.C.
description: String
description is a human-readable description of the scalar and its encoding format. For instance a big integer or decimal scalar should specify precisely the expected encoding format.
field_type: Vec<i32>
field_type is the type of field with which this scalar can be used. Scalars can be used with one and only one type of field so that encoding standards and simple and clear. Currently only string and bytes fields are supported for scalars.
Implementations§
Source§impl ScalarDescriptor
impl ScalarDescriptor
Sourcepub fn field_type(
&self,
) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<ScalarType>>
pub fn field_type( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<ScalarType>>
Returns an iterator which yields the valid enum values contained in field_type
.
Sourcepub fn push_field_type(&mut self, value: ScalarType)
pub fn push_field_type(&mut self, value: ScalarType)
Appends the provided enum value to field_type
.
Trait Implementations§
Source§impl Clone for ScalarDescriptor
impl Clone for ScalarDescriptor
Source§fn clone(&self) -> ScalarDescriptor
fn clone(&self) -> ScalarDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ScalarDescriptor
impl Debug for ScalarDescriptor
Source§impl Default for ScalarDescriptor
impl Default for ScalarDescriptor
Source§impl Message for ScalarDescriptor
impl Message for ScalarDescriptor
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.Source§impl Name for ScalarDescriptor
impl Name for ScalarDescriptor
Source§const NAME: &'static str = "ScalarDescriptor"
const NAME: &'static str = "ScalarDescriptor"
Message
.
This name is the same as it appears in the source .proto file, e.g. FooBar
.Source§const PACKAGE: &'static str = "cosmos_proto"
const PACKAGE: &'static str = "cosmos_proto"
.
, e.g. google.protobuf
.Source§fn full_name() -> String
fn full_name() -> String
Message
.
It’s prefixed with the package name and names of any parent messages,
e.g. google.rpc.BadRequest.FieldViolation
.
By default, this is the package name followed by the message name.
Fully-qualified names must be unique within a domain of Type URLs.Source§impl PartialEq for ScalarDescriptor
impl PartialEq for ScalarDescriptor
impl StructuralPartialEq for ScalarDescriptor
Auto Trait Implementations§
impl Freeze for ScalarDescriptor
impl RefUnwindSafe for ScalarDescriptor
impl Send for ScalarDescriptor
impl Sync for ScalarDescriptor
impl Unpin for ScalarDescriptor
impl UnwindSafe for ScalarDescriptor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request