pub struct BinaryWithType { /* private fields */ }Expand description
Binary response with a custom content type.
§Examples
use fastapi_core::Binary;
let pdf_data = vec![0x25, 0x50, 0x44, 0x46]; // PDF magic bytes
let response = Binary::new(pdf_data).with_content_type("application/pdf");Implementations§
Trait Implementations§
Source§impl Clone for BinaryWithType
impl Clone for BinaryWithType
Source§fn clone(&self) -> BinaryWithType
fn clone(&self) -> BinaryWithType
Returns a duplicate of the value. Read more
1.0.0 · 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 BinaryWithType
impl Debug for BinaryWithType
Source§impl IntoResponse for BinaryWithType
impl IntoResponse for BinaryWithType
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Convert into a response.
Auto Trait Implementations§
impl Freeze for BinaryWithType
impl RefUnwindSafe for BinaryWithType
impl Send for BinaryWithType
impl Sync for BinaryWithType
impl Unpin for BinaryWithType
impl UnwindSafe for BinaryWithType
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).