pub struct StaticJsonEndpoint {
pub body: Vec<u8>,
pub content_type: &'static str,
}Expand description
Endpoint that serves a static JSON payload.
Used for built-in endpoints like /openapi.json and /health.
The content_type field allows RFC 8407 application/health+json
for health endpoints while defaulting to application/json.
Fields§
§body: Vec<u8>§content_type: &'static strImplementations§
Source§impl StaticJsonEndpoint
impl StaticJsonEndpoint
Sourcepub fn new(body: Vec<u8>) -> StaticJsonEndpoint
pub fn new(body: Vec<u8>) -> StaticJsonEndpoint
Create a new endpoint with the default application/json content type.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StaticJsonEndpoint
impl RefUnwindSafe for StaticJsonEndpoint
impl Send for StaticJsonEndpoint
impl Sync for StaticJsonEndpoint
impl Unpin for StaticJsonEndpoint
impl UnsafeUnpin for StaticJsonEndpoint
impl UnwindSafe for StaticJsonEndpoint
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