pub enum CoreRequest {
Generation(GenerationRequest),
GenerationStream(GenerationRequest),
GetLastThreadInfo,
GetAllThreadInfos,
GetThreadMessages {
id: String,
},
InitProject,
}
Expand description
Enum containing all types of core requests.
Variants§
Generation(GenerationRequest)
GenerationStream(GenerationRequest)
GetLastThreadInfo
GetAllThreadInfos
GetThreadMessages
InitProject
Trait Implementations§
Source§impl Clone for CoreRequest
impl Clone for CoreRequest
Source§fn clone(&self) -> CoreRequest
fn clone(&self) -> CoreRequest
Returns a copy 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<'de> Deserialize<'de> for CoreRequest
impl<'de> Deserialize<'de> for CoreRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl RequestHttpConvert<CoreRequest> for CoreRequest
impl RequestHttpConvert<CoreRequest> for CoreRequest
Source§fn from_http_request<'async_trait>(
request: HttpRequest<Body>,
) -> Pin<Box<dyn Future<Output = Result<Option<Self>, ProtocolError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn from_http_request<'async_trait>(
request: HttpRequest<Body>,
) -> Pin<Box<dyn Future<Output = Result<Option<Self>, ProtocolError>> + Send + 'async_trait>>where
Self: 'async_trait,
Deserializes a
HttpRequest<Body>
into Request
. Returns a protocol error
if the request conversion fails (i.e. request validation fails,
unexpected error, etc.). Returns None
if the request type is unknown or unsupported for remote host scenarios,
which is synonymous with a “not found” error.Source§fn to_http_request(
&self,
base_url: &Uri,
) -> Result<Option<HttpRequest<Body>>, ProtocolError>
fn to_http_request( &self, base_url: &Uri, ) -> Result<Option<HttpRequest<Body>>, ProtocolError>
Serializes a
Request
into a HttpRequest<Body>
. Returns None
if
the request is unsupported for this protocol, which is synonymous with a
“not found” error.Source§impl RequestJsonRpcConvert<CoreRequest> for CoreRequest
impl RequestJsonRpcConvert<CoreRequest> for CoreRequest
Source§fn from_jsonrpc_request(
value: JsonRpcRequest,
) -> Result<Option<Self>, ProtocolError>
fn from_jsonrpc_request( value: JsonRpcRequest, ) -> Result<Option<Self>, ProtocolError>
Deserializes a
JsonRpcRequest
into Request
. Returns a protocol error
if the request conversion fails (i.e. request validation fails,
unexpected error, etc.). Returns None
if the request type is unknown or unsupported,
which is synonymous with a “not found” error.Source§fn into_jsonrpc_request(&self) -> JsonRpcRequest
fn into_jsonrpc_request(&self) -> JsonRpcRequest
Serializes a
Request
into a JsonRpcRequest
.Source§impl ResponseHttpConvert<CoreRequest, CoreResponse> for CoreResponse
impl ResponseHttpConvert<CoreRequest, CoreResponse> for CoreResponse
Source§fn from_http_response<'life0, 'async_trait>(
response: ModalHttpResponse,
original_request: &'life0 CoreRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<ServiceResponse<Self>>, ProtocolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn from_http_response<'life0, 'async_trait>(
response: ModalHttpResponse,
original_request: &'life0 CoreRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<ServiceResponse<Self>>, ProtocolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Deserializes a
ModalHttpResponse
into ServiceResponse<Response>
.
Returns a protocol error if the response conversion fails (i.e.
response validation fails, unexpected error, etc.). A reference to the associated
request is provided, in case it’s helpful. Returns None
if the response type is unknown or unsupported
for remote host scenarios, which is synonymous with a “not found” error.Source§fn to_http_response(
response: ServiceResponse<Self>,
) -> Result<Option<ModalHttpResponse>, ProtocolError>
fn to_http_response( response: ServiceResponse<Self>, ) -> Result<Option<ModalHttpResponse>, ProtocolError>
Serializes a
Response
into a ModalHttpResponse
.
Returns None
if the response type is unsupported, which is synonymous
with a “not found” error.Source§impl ResponseJsonRpcConvert<CoreRequest, CoreResponse> for CoreResponse
impl ResponseJsonRpcConvert<CoreRequest, CoreResponse> for CoreResponse
Source§fn from_jsonrpc_message(
value: JsonRpcMessage,
original_request: &CoreRequest,
) -> Result<Option<Self>, ProtocolError>
fn from_jsonrpc_message( value: JsonRpcMessage, original_request: &CoreRequest, ) -> Result<Option<Self>, ProtocolError>
Deserializes a
JsonRpcResponse
or
JsonRpcNotification
into Response
.
Returns a protocol error if the response conversion fails (i.e.
response validation fails, unexpected error, etc.). A reference to the associated
request is provided, in case it’s helpful. Returns None
if the response type is unknown or unsupported,
which is synonymous with a “not found” error.Source§fn into_jsonrpc_message(response: CoreResponse, id: Value) -> JsonRpcMessage
fn into_jsonrpc_message(response: CoreResponse, id: Value) -> JsonRpcMessage
Serializes a
Response
into a JsonRpcResponse
or
JsonRpcNotification
.
Notifications must use the provided id
argument as the method
value.
Returns Value::Null
Source§impl Serialize for CoreRequest
impl Serialize for CoreRequest
Source§impl<C> Service<CoreRequest> for CoreService<C>where
C: Core + 'static,
impl<C> Service<CoreRequest> for CoreService<C>where
C: Core + 'static,
Source§type Response = ServiceResponse<CoreResponse>
type Response = ServiceResponse<CoreResponse>
Responses given by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<ServiceResponse<CoreResponse>, Box<dyn Error + Sync + Send>>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<ServiceResponse<CoreResponse>, Box<dyn Error + Sync + Send>>> + Send>>
The future response value.
Auto Trait Implementations§
impl Freeze for CoreRequest
impl RefUnwindSafe for CoreRequest
impl Send for CoreRequest
impl Sync for CoreRequest
impl Unpin for CoreRequest
impl UnwindSafe for CoreRequest
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