pub struct RequestContract {
pub id: ContractId,
pub location: RequestContractLocation,
pub content_type: Option<MediaType>,
}Expand description
Logical validation/schema contract attached to part of a request.
Fields§
§id: ContractIdContract resolved by a validation or schema adapter.
location: RequestContractLocationRequest component covered by the contract.
content_type: Option<MediaType>Content type expected for body contracts.
Implementations§
Source§impl RequestContract
impl RequestContract
Sourcepub const fn new(id: ContractId, location: RequestContractLocation) -> Self
pub const fn new(id: ContractId, location: RequestContractLocation) -> Self
Creates a request contract reference.
Sourcepub fn content_type(self, content_type: MediaType) -> Self
pub fn content_type(self, content_type: MediaType) -> Self
Associates the contract with one body content type.
Trait Implementations§
Source§impl Clone for RequestContract
impl Clone for RequestContract
Source§fn clone(&self) -> RequestContract
fn clone(&self) -> RequestContract
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 RequestContract
impl Debug for RequestContract
impl Eq for RequestContract
Source§impl PartialEq for RequestContract
impl PartialEq for RequestContract
impl StructuralPartialEq for RequestContract
Auto Trait Implementations§
impl Freeze for RequestContract
impl RefUnwindSafe for RequestContract
impl Send for RequestContract
impl Sync for RequestContract
impl Unpin for RequestContract
impl UnsafeUnpin for RequestContract
impl UnwindSafe for RequestContract
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