pub struct UniversalAdapter<Req, Res, Err> { /* private fields */ }Expand description
Universal adapter that can work with any framework
Implementations§
Source§impl<Req, Res, Err> UniversalAdapter<Req, Res, Err>
impl<Req, Res, Err> UniversalAdapter<Req, Res, Err>
Sourcepub fn with_config(config: AdapterConfig) -> Self
pub fn with_config(config: AdapterConfig) -> Self
Create a new universal adapter with custom configuration
Sourcepub fn set_config(&mut self, config: AdapterConfig)
pub fn set_config(&mut self, config: AdapterConfig)
Update the configuration
Trait Implementations§
Source§impl<Req, Res, Err> Default for UniversalAdapter<Req, Res, Err>
impl<Req, Res, Err> Default for UniversalAdapter<Req, Res, Err>
Source§impl<Req, Res, Err> StreamingAdapter for UniversalAdapter<Req, Res, Err>
impl<Req, Res, Err> StreamingAdapter for UniversalAdapter<Req, Res, Err>
type StreamingResponseFuture<'a> = impl Future<Output = Result<<UniversalAdapter<Req, Res, Err> as StreamingAdapter>::Response, IntegrationError>> + Send + 'a where Self: 'a
type SseResponseFuture<'a> = impl Future<Output = Result<<UniversalAdapter<Req, Res, Err> as StreamingAdapter>::Response, IntegrationError>> + Send + 'a where Self: 'a
type JsonResponseFuture<'a> = impl Future<Output = Result<<UniversalAdapter<Req, Res, Err> as StreamingAdapter>::Response, IntegrationError>> + Send + 'a where Self: 'a
type MiddlewareFuture<'a> = impl Future<Output = Result<UniversalResponse, IntegrationError>> + Send + 'a where Self: 'a
Source§fn convert_request(
&self,
_request: Self::Request,
) -> IntegrationResult<UniversalRequest>
fn convert_request( &self, _request: Self::Request, ) -> IntegrationResult<UniversalRequest>
Convert framework request to universal format
Source§fn to_response(
&self,
_response: UniversalResponse,
) -> IntegrationResult<Self::Response>
fn to_response( &self, _response: UniversalResponse, ) -> IntegrationResult<Self::Response>
Convert universal response to framework format
Source§fn create_streaming_response<'a>(
&'a self,
session_id: SessionId,
frames: Vec<StreamFrame>,
format: StreamingFormat,
) -> Self::StreamingResponseFuture<'a>
fn create_streaming_response<'a>( &'a self, session_id: SessionId, frames: Vec<StreamFrame>, format: StreamingFormat, ) -> Self::StreamingResponseFuture<'a>
Create a streaming response with priority-based frame delivery
Source§fn create_sse_response<'a>(
&'a self,
session_id: SessionId,
frames: Vec<StreamFrame>,
) -> Self::SseResponseFuture<'a>
fn create_sse_response<'a>( &'a self, session_id: SessionId, frames: Vec<StreamFrame>, ) -> Self::SseResponseFuture<'a>
Create a Server-Sent Events response with SIMD acceleration
Source§fn create_json_response<'a>(
&'a self,
data: JsonData,
streaming: bool,
) -> Self::JsonResponseFuture<'a>
fn create_json_response<'a>( &'a self, data: JsonData, streaming: bool, ) -> Self::JsonResponseFuture<'a>
Create a JSON response with optional streaming
Source§fn apply_middleware<'a>(
&'a self,
request: &'a UniversalRequest,
response: UniversalResponse,
) -> Self::MiddlewareFuture<'a>
fn apply_middleware<'a>( &'a self, request: &'a UniversalRequest, response: UniversalResponse, ) -> Self::MiddlewareFuture<'a>
Handle framework-specific middleware integration
Source§fn supports_streaming(&self) -> bool
fn supports_streaming(&self) -> bool
Check if the framework supports streaming
Source§fn supports_sse(&self) -> bool
fn supports_sse(&self) -> bool
Check if the framework supports Server-Sent Events
Source§fn framework_name(&self) -> &'static str
fn framework_name(&self) -> &'static str
Get the framework name for debugging/logging
Auto Trait Implementations§
impl<Req, Res, Err> Freeze for UniversalAdapter<Req, Res, Err>
impl<Req, Res, Err> RefUnwindSafe for UniversalAdapter<Req, Res, Err>
impl<Req, Res, Err> Send for UniversalAdapter<Req, Res, Err>
impl<Req, Res, Err> Sync for UniversalAdapter<Req, Res, Err>
impl<Req, Res, Err> Unpin for UniversalAdapter<Req, Res, Err>
impl<Req, Res, Err> UnwindSafe for UniversalAdapter<Req, Res, Err>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more