#[non_exhaustive]pub struct FieldInfo {
pub format: Format,
pub referenced_types: Vec<TypeReference>,
/* private fields */
}
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: Format
The 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
pub fn new() -> Self
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§
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