pub struct MediaServerHandle {
pub port: u16,
pub registry: TokenRegistryHandle,
pub session_id: String,
pub shutdown: Mutex<Option<Sender<()>>>,
}Expand description
Handle to the running loopback media server.
Tauri manages this as app state so commands can read port and access the
registry to mint / revoke tokens.
The shutdown sender is wrapped in a Mutex<Option<_>> so that:
MediaServerHandleisSync(required by Tauri managed state).- Shutdown can be triggered exactly once by taking the sender.
Fields§
§port: u16The OS-assigned port the server is bound to.
registry: TokenRegistryHandleShared token registry — commands mint and revoke tokens here.
session_id: StringSession identifier minted at app start; all tokens are tagged with this.
revoke_session is called with this on app exit.
shutdown: Mutex<Option<Sender<()>>>Send () to trigger graceful shutdown (consume with .lock().take()).
Auto Trait Implementations§
impl !Freeze for MediaServerHandle
impl RefUnwindSafe for MediaServerHandle
impl Send for MediaServerHandle
impl Sync for MediaServerHandle
impl Unpin for MediaServerHandle
impl UnsafeUnpin for MediaServerHandle
impl UnwindSafe for MediaServerHandle
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> 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 moreCreates a shared type from an unshared type.