Struct moras::remote::server::RpcServerImpl
source · pub struct RpcServerImpl {
port: AtomicU16,
tokio_runtime: Runtime,
rpc_server_handle: Option<JoinHandle<()>>,
shared_handler: Arc<Mutex<ServerHandle>>,
}
Fields§
§port: AtomicU16
§tokio_runtime: Runtime
§rpc_server_handle: Option<JoinHandle<()>>
Implementations§
source§impl RpcServerImpl
impl RpcServerImpl
sourcepub fn start_server(
&mut self,
cur_tab_name: String,
tab_map: Ptr<TabMap>,
cursor_list: &Arc<Mutex<LinkedList<ClientCursor>>>,
) -> Result<(), Box<dyn Error>>
pub fn start_server( &mut self, cur_tab_name: String, tab_map: Ptr<TabMap>, cursor_list: &Arc<Mutex<LinkedList<ClientCursor>>>, ) -> Result<(), Box<dyn Error>>
Start the service with a tab map.
If the server is already running, return an error.
pub fn stop_server(&mut self)
sourcepub fn set_port(&mut self, port: u16) -> Result<(), Box<dyn Error>>
pub fn set_port(&mut self, port: u16) -> Result<(), Box<dyn Error>>
Set the port for the server.
If the server is already running, return an error.
sourcepub fn change_password(&mut self, new_password: &str)
pub fn change_password(&mut self, new_password: &str)
Change the password for the server.
sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the server is running.
sourcepub fn set_host_cursor(&mut self, row: u64, col: u64)
pub fn set_host_cursor(&mut self, row: u64, col: u64)
Update the host cursor position.
row
: The row of the cursor.col
: The column of the cursor. TODO: add out of range check
const fn get_ip() -> &'static str
Trait Implementations§
source§impl Default for RpcServerImpl
impl Default for RpcServerImpl
Auto Trait Implementations§
impl !Freeze for RpcServerImpl
impl RefUnwindSafe for RpcServerImpl
impl Send for RpcServerImpl
impl Sync for RpcServerImpl
impl Unpin for RpcServerImpl
impl UnwindSafe for RpcServerImpl
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.