pub struct ServerSection {
pub framework: String,
pub operations: Vec<String>,
pub prune_models: bool,
}Expand description
Opt-in server codegen scope.
operations accepts three selector forms, parsed by
crate::server::Selector::parse:
operationId(recommended)METHOD /pathtag:<name>
Fields§
§framework: StringTarget framework. Only "axum" is currently supported.
operations: Vec<String>Selectors picking which operations get server scaffolding. Empty ⇒ section is a no-op.
prune_models: boolEmit only the model types reachable (transitively) from the
picked operations. Off by default because the bundled
types.rs is shared with the HTTP client generator and
pruning would silently drop types client code still needs.
Enable when generating a server-only crate to cut the
emitted surface dramatically (often 100× for spec-heavy APIs).
Implementations§
Source§impl ServerSection
impl ServerSection
Sourcepub fn parsed_selectors(&self) -> Result<Vec<Selector>, SelectorParseError>
pub fn parsed_selectors(&self) -> Result<Vec<Selector>, SelectorParseError>
Parse each operations entry into a crate::server::Selector.
Returns the first parse error encountered.
Trait Implementations§
Source§impl Clone for ServerSection
impl Clone for ServerSection
Source§fn clone(&self) -> ServerSection
fn clone(&self) -> ServerSection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServerSection
impl Debug for ServerSection
Source§impl<'de> Deserialize<'de> for ServerSection
impl<'de> Deserialize<'de> for ServerSection
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
Source§impl Serialize for ServerSection
impl Serialize for ServerSection
Source§impl Validate for ServerSection
impl Validate for ServerSection
Source§impl<'v_a> ValidateArgs<'v_a> for ServerSection
impl<'v_a> ValidateArgs<'v_a> for ServerSection
Auto Trait Implementations§
impl Freeze for ServerSection
impl RefUnwindSafe for ServerSection
impl Send for ServerSection
impl Sync for ServerSection
impl Unpin for ServerSection
impl UnsafeUnpin for ServerSection
impl UnwindSafe for ServerSection
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