pub struct ResponseContract {
pub status: StatusCode,
pub id: ContractId,
pub content_type: MediaType,
}Expand description
Logical response schema contract attached to a status code.
Fields§
§status: StatusCodeHTTP response status represented by the contract.
id: ContractIdContract resolved by a schema adapter.
content_type: MediaTypeSerialized response content type.
Implementations§
Source§impl ResponseContract
impl ResponseContract
Sourcepub fn json(status: StatusCode, id: ContractId) -> Self
pub fn json(status: StatusCode, id: ContractId) -> Self
Creates a JSON response contract reference.
Trait Implementations§
Source§impl Clone for ResponseContract
impl Clone for ResponseContract
Source§fn clone(&self) -> ResponseContract
fn clone(&self) -> ResponseContract
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 ResponseContract
impl Debug for ResponseContract
impl Eq for ResponseContract
Source§impl PartialEq for ResponseContract
impl PartialEq for ResponseContract
impl StructuralPartialEq for ResponseContract
Auto Trait Implementations§
impl Freeze for ResponseContract
impl RefUnwindSafe for ResponseContract
impl Send for ResponseContract
impl Sync for ResponseContract
impl Unpin for ResponseContract
impl UnsafeUnpin for ResponseContract
impl UnwindSafe for ResponseContract
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