pub struct AppState { /* private fields */ }Expand description
Application state structure
Implementations§
Source§impl AppState
impl AppState
Sourcepub fn get_config(&self) -> &Arc<Config>
pub fn get_config(&self) -> &Arc<Config>
The application configuration
Sourcepub fn get_port_manager(&self) -> &Arc<RwLock<PortManager>>
pub fn get_port_manager(&self) -> &Arc<RwLock<PortManager>>
The port manager for handling sandbox port assignments
Source§impl AppState
impl AppState
Sourcepub fn new(config: Arc<Config>, port_manager: Arc<RwLock<PortManager>>) -> Self
pub fn new(config: Arc<Config>, port_manager: Arc<RwLock<PortManager>>) -> Self
Create a new application state instance
Sourcepub async fn get_portal_url_for_sandbox(
&self,
namespace: &str,
sandbox_name: &str,
) -> ServerResult<String>
pub async fn get_portal_url_for_sandbox( &self, namespace: &str, sandbox_name: &str, ) -> ServerResult<String>
Get a sandbox’s portal URL
Returns an error if no port is assigned for the given sandbox
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppState
impl !RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl !UnwindSafe for AppState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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