Struct salvo_core::extract::metadata::Metadata
source · #[non_exhaustive]pub struct Metadata {
pub name: &'static str,
pub default_sources: Vec<Source>,
pub fields: Vec<Field>,
pub rename_all: Option<RenameRule>,
pub serde_rename_all: Option<RenameRule>,
}
Expand description
Struct’s metadata information.
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.name: &'static str
The name of this type.
default_sources: Vec<Source>
Default sources of all fields.
fields: Vec<Field>
Fields of this type.
rename_all: Option<RenameRule>
Rename rule for all fields of this type.
serde_rename_all: Option<RenameRule>
Rename rule for all fields of this type defined by serde.
Implementations§
source§impl Metadata
impl Metadata
sourcepub fn default_sources(self, default_sources: Vec<Source>) -> Self
pub fn default_sources(self, default_sources: Vec<Source>) -> Self
Sets the default sources list to a new value.
sourcepub fn add_default_source(self, source: Source) -> Self
pub fn add_default_source(self, source: Source) -> Self
Add a default source to default sources list.
sourcepub fn rename_all(self, rename_all: impl Into<Option<RenameRule>>) -> Self
pub fn rename_all(self, rename_all: impl Into<Option<RenameRule>>) -> Self
Rule for rename all fields of type.
sourcepub fn serde_rename_all(
self,
serde_rename_all: impl Into<Option<RenameRule>>
) -> Self
pub fn serde_rename_all( self, serde_rename_all: impl Into<Option<RenameRule>> ) -> Self
Rule for rename all fields of type defined by serde.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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