#[non_exhaustive]pub struct Field {
pub decl_name: &'static str,
pub flatten: bool,
pub sources: Vec<Source>,
pub aliases: Vec<&'static str>,
pub rename: Option<&'static str>,
pub serde_rename: Option<&'static str>,
pub metadata: Option<&'static Metadata>,
}Expand description
Information about struct field.
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.decl_name: &'static strField declare name in struct definition.
flatten: boolField flatten, this field will extracted from request.
sources: Vec<Source>Field sources.
aliases: Vec<&'static str>Field aliaes.
rename: Option<&'static str>Field rename defined by #[derive(salvo(extract(rename="")))].
serde_rename: Option<&'static str>Field rename defined by #[derive(serde(rename=""))].
metadata: Option<&'static Metadata>Field metadata, this is used for nested extractible types.
Implementations§
source§impl Field
impl Field
sourcepub fn with_sources(decl_name: &'static str, sources: Vec<Source>) -> Field
pub fn with_sources(decl_name: &'static str, sources: Vec<Source>) -> Field
Create a new field with the given name and kind, and the given sources.
sourcepub fn metadata(self, metadata: &'static Metadata) -> Field
pub fn metadata(self, metadata: &'static Metadata) -> Field
Sets the metadata to the field type.
sourcepub fn add_source(self, source: Source) -> Field
pub fn add_source(self, source: Source) -> Field
Add a source to sources list.
sourcepub fn aliases(self, aliases: Vec<&'static str>) -> Field
pub fn aliases(self, aliases: Vec<&'static str>) -> Field
Sets the aliases list to a new value.
sourcepub fn serde_rename(self, serde_rename: &'static str) -> Field
pub fn serde_rename(self, serde_rename: &'static str) -> Field
Sets the rename to the given value.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Field
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnwindSafe for Field
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
source§impl<T> FutureTraceExt for Twhere
T: FutureExt,
impl<T> FutureTraceExt for Twhere
T: FutureExt,
source§fn with_current_context_span(self, otel_span: Span) -> WithContext<Self> ⓘ
fn with_current_context_span(self, otel_span: Span) -> WithContext<Self> ⓘ
Pass the span of opentelemetry to the current context of tracing.
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>
Wrap the input message
T in a tonic::Request