Struct sshx_server::state::ServerState
source · pub struct ServerState { /* private fields */ }
Expand description
Shared state object for global server logic.
Implementations§
source§impl ServerState
impl ServerState
sourcepub fn new(options: ServerOptions) -> Result<Self>
pub fn new(options: ServerOptions) -> Result<Self>
Create an empty server state using the given secret.
sourcepub fn mac(&self) -> Hmac<Sha256>
pub fn mac(&self) -> Hmac<Sha256>
Returns the message authentication code used for signing tokens.
sourcepub fn override_origin(&self) -> Option<String>
pub fn override_origin(&self) -> Option<String>
Returns the override origin for the Open() RPC.
sourcepub async fn close_session(&self, name: &str) -> Result<()>
pub async fn close_session(&self, name: &str) -> Result<()>
Close a session permanently on this and other servers.
sourcepub async fn backend_connect(&self, name: &str) -> Result<Option<Arc<Session>>>
pub async fn backend_connect(&self, name: &str) -> Result<Option<Arc<Session>>>
Connect to a session by name from the sshx
client, which provides the
actual terminal backend.
sourcepub async fn frontend_connect(
&self,
name: &str,
) -> Result<Result<Arc<Session>, Option<String>>>
pub async fn frontend_connect( &self, name: &str, ) -> Result<Result<Arc<Session>, Option<String>>>
Connect to a session from a web browser frontend, possibly redirecting.
sourcepub async fn listen_for_transfers(&self)
pub async fn listen_for_transfers(&self)
Listen for and remove sessions that are transferred away from this host.
sourcepub async fn close_old_sessions(&self)
pub async fn close_old_sessions(&self)
Close all sessions that have been disconnected for too long.
Auto Trait Implementations§
impl Freeze for ServerState
impl !RefUnwindSafe for ServerState
impl Send for ServerState
impl Sync for ServerState
impl Unpin for ServerState
impl !UnwindSafe for ServerState
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> 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