pub struct Server {
backend: ServerBackend,
pub(crate) task_group: Arc<TaskGroup>,
pub(crate) config: ServerConfig,
}Expand description
A JSON-RPC 2.0 server.
Fields§
§backend: ServerBackend§task_group: Arc<TaskGroup>§config: ServerConfigImplementations§
Source§impl Server
impl Server
Source§impl Server
impl Server
pub fn start(self: Arc<Self>)
pub async fn start_block(self: Arc<Self>) -> Result<()>
async fn accept_loop(self: &Arc<Self>) -> Result<()>
pub fn local_endpoint(&self) -> Result<Endpoint>
pub async fn shutdown(&self)
Sourcepub(crate) fn handle_message_conn<R, W>(
self: &Arc<Self>,
reader: R,
writer: W,
peer: Option<Endpoint>,
)
pub(crate) fn handle_message_conn<R, W>( self: &Arc<Self>, reader: R, writer: W, peer: Option<Endpoint>, )
Handle a split message connection (framed byte stream or WebSocket). Spawns a reader and writer task; the writer drains both responses and notifications.
async fn new_request( self: &Arc<Self>, queue: Arc<AsyncQueue<Value>>, channel: Arc<Channel>, msg: Value, )
pub(crate) async fn init<B, W>(
config: ServerConfig,
ex: Option<Executor>,
byte_codec: B,
ws_codec: W,
) -> Result<Arc<Self>>where
B: JsonRpcCodec,
W: WsCodec,
Auto Trait Implementations§
impl Freeze for Server
impl !RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Server
impl !UnwindSafe for Server
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