Skip to main content

WebShareHandle

Struct WebShareHandle 

Source
pub struct WebShareHandle { /* private fields */ }
Expand description

A share handle returned by a create operation.

Dropping this handle does not stop the daemon-side share. The share remains active until its TTL expires, the shared pane or session goes away, or Self::stop is called explicitly.

Cloned handles point at the same daemon share. Stopping one clone invalidates the share for every other clone.

Implementations§

Source§

impl WebShareHandle

Source

pub fn id(&self) -> &str

Returns the opaque share id.

Source

pub const fn scope(&self) -> &WebShareScope

Returns the pane or session scope resolved by the daemon at create time.

Source

pub fn pane_target(&self) -> Option<&PaneTargetRef>

Returns the pane target when this is a single-pane share.

Source

pub const fn operator(&self) -> bool

Returns whether this share minted an operator URL.

Source

pub const fn spectator(&self) -> bool

Returns whether this share minted a spectator URL.

Source

pub const fn kill_session_on_expire(&self) -> bool

Returns whether this share kills its target session on expiry.

Source

pub fn spectator_url(&self) -> Option<&str>

Returns the spectator browser URL.

Source

pub fn spectator_token(&self) -> Option<&str>

Returns the spectator capability token carried in the browser URL, when present.

Source

pub fn operator_url(&self) -> Option<&str>

Returns the privileged operator URL, when this share has an operator.

Source

pub fn operator_token(&self) -> Option<&str>

Returns the operator capability token carried in the operator URL, when present.

Source

pub fn operator_pairing_code(&self) -> Option<&str>

Returns the out-of-band operator pairing code required by this share.

Source

pub fn spectator_pairing_code(&self) -> Option<&str>

Returns the out-of-band spectator pairing code required by this share.

Source

pub const fn max_spectators(&self) -> Option<u16>

Returns the effective cap for concurrent spectator clients, when capped.

Source

pub const fn max_operators(&self) -> Option<u16>

Returns the effective cap for concurrent operator clients, when capped.

Source

pub const fn expires_at_unix(&self) -> Option<u64>

Returns the expiration timestamp in UNIX seconds.

Source

pub async fn summary(&self) -> Result<WebShareSummary>

Fetches redacted live metadata for this share.

Source

pub async fn spectators_active(&self) -> Result<u16>

Returns the current number of spectator clients.

Source

pub async fn operators_active(&self) -> Result<u16>

Returns the current number of operator clients.

Source

pub async fn stop(self) -> Result<()>

Stops this share on the daemon.

Trait Implementations§

Source§

impl Clone for WebShareHandle

Source§

fn clone(&self) -> WebShareHandle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.