#[non_exhaustive]pub struct FieldInfo {
pub format: Format,
pub referenced_types: Vec<TypeReference>,
}Expand description
Rich semantic information of an API field beyond basic typing.
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.format: FormatThe standard format of a field value. This does not explicitly configure any API consumer, just documents the API’s format for the field it is applied to.
referenced_types: Vec<TypeReference>The type(s) that the annotated, generic field may represent.
Currently, this must only be used on fields of type google.protobuf.Any.
Supporting other generic types may be considered in the future.
Implementations§
Source§impl FieldInfo
impl FieldInfo
Sourcepub fn set_format<T: Into<Format>>(self, v: T) -> Self
pub fn set_format<T: Into<Format>>(self, v: T) -> Self
Sets the value of format.
Sourcepub fn set_referenced_types<T, V>(self, v: T) -> Self
pub fn set_referenced_types<T, V>(self, v: T) -> Self
Sets the value of referenced_types.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FieldInfo
impl<'de> Deserialize<'de> for FieldInfo
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 FieldInfo
Auto Trait Implementations§
impl Freeze for FieldInfo
impl RefUnwindSafe for FieldInfo
impl Send for FieldInfo
impl Sync for FieldInfo
impl Unpin for FieldInfo
impl UnwindSafe for FieldInfo
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