pub struct RpcServer { /* private fields */ }
Expand description
RPC server for handling remote commands
Implementations§
Source§impl RpcServer
impl RpcServer
Sourcepub fn new_tcp(port: u16) -> (Self, Receiver<(RpcCommand, Sender<Value>)>)
pub fn new_tcp(port: u16) -> (Self, Receiver<(RpcCommand, Sender<Value>)>)
Create new RPC server with TCP transport
Sourcepub fn new_unix(
socket_path: String,
) -> (Self, Receiver<(RpcCommand, Sender<Value>)>)
pub fn new_unix( socket_path: String, ) -> (Self, Receiver<(RpcCommand, Sender<Value>)>)
Create new RPC server with Unix socket transport
Sourcepub fn with_auth(
transport: RpcTransport,
auth_token: String,
) -> (Self, Receiver<(RpcCommand, Sender<Value>)>)
pub fn with_auth( transport: RpcTransport, auth_token: String, ) -> (Self, Receiver<(RpcCommand, Sender<Value>)>)
Create new RPC server with authentication
Sourcepub async fn set_node_handle(
&mut self,
handle: Arc<RwLock<dyn NodeRunnerTrait + Send + Sync>>,
)
pub async fn set_node_handle( &mut self, handle: Arc<RwLock<dyn NodeRunnerTrait + Send + Sync>>, )
Set the node handle for real operations
Sourcepub fn set_shutdown_channel(&mut self, tx: Sender<()>)
pub fn set_shutdown_channel(&mut self, tx: Sender<()>)
Set the shutdown channel for stopping the node
Sourcepub async fn add_auth_key(&self, client_id: String, public_key: MlDsaPublicKey)
pub async fn add_auth_key(&self, client_id: String, public_key: MlDsaPublicKey)
Add an authorized public key for ML-DSA authentication
Sourcepub async fn start(&mut self) -> Result<(), ProtocolError>
pub async fn start(&mut self) -> Result<(), ProtocolError>
Start RPC server
Sourcepub async fn stop(&mut self) -> Result<(), ProtocolError>
pub async fn stop(&mut self) -> Result<(), ProtocolError>
Stop RPC server
Auto Trait Implementations§
impl Freeze for RpcServer
impl !RefUnwindSafe for RpcServer
impl Send for RpcServer
impl Sync for RpcServer
impl Unpin for RpcServer
impl !UnwindSafe for RpcServer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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