pub struct BodyField {
pub name: String,
pub field_type: UnifiedType,
pub repeated: bool,
pub required: bool,
pub oneof_variants: Option<Vec<OneofVariant>>,
pub documentation: Option<String>,
}Expand description
A body field that should be extracted from the request body
Fields§
§name: StringField name
field_type: UnifiedTypeParsed type of the body parameter
repeated: boolWhether this field is a repeated (Vec) type
required: boolWhether the field is explicitly marked (google.api.field_behavior) = REQUIRED.
oneof_variants: Option<Vec<OneofVariant>>For oneof fields, the variants with their names and types
documentation: Option<String>Documentation from protobuf field comments
Implementations§
Source§impl BodyField
impl BodyField
Sourcepub fn is_optional(&self) -> bool
pub fn is_optional(&self) -> bool
Denotes whether this field should be treated as optional in builder APIs.
A field marked REQUIRED is never optional — even for complex types — so it becomes a
required constructor parameter rather than a with_* setter. (Without this, a required
message body like tag_assignment would be a no-arg-constructor + optional setter, and the
NAPI binding would execute with an empty body.)
Otherwise a field is optional when its UnifiedType.is_optional flag is set, when it is
repeated, or when its base type is Map, Message, or OneOf (complex types have a valid
default and are treated as optional constructor parameters).
Trait Implementations§
Auto Trait Implementations§
impl Forget for BodyField
impl Freeze for BodyField
impl RefUnwindSafe for BodyField
impl Send for BodyField
impl Sync for BodyField
impl Unpin for BodyField
impl UnsafeUnpin for BodyField
impl UnwindSafe for BodyField
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more