Struct mediasoup::worker::Worker [−][src]
A worker represents a mediasoup C++ thread that runs on a single CPU core and handles
Router
instances.
Implementations
impl Worker
[src]
pub fn id(&self) -> WorkerId
[src]
Worker id.
pub fn app_data(&self) -> &AppData
[src]
Custom application data.
pub fn closed(&self) -> bool
[src]
Whether the worker is closed.
pub async fn update_settings(
&self,
data: WorkerUpdateSettings
) -> Result<(), RequestError>
[src]
&self,
data: WorkerUpdateSettings
) -> Result<(), RequestError>
Updates the worker settings in runtime. Just a subset of the worker settings can be updated.
pub async fn create_router(
&self,
router_options: RouterOptions
) -> Result<Router, CreateRouterError>
[src]
&self,
router_options: RouterOptions
) -> Result<Router, CreateRouterError>
Create a Router.
Worker will be kept alive as long as at least one router instance is alive.
pub fn on_new_router<F: Fn(&Router) + Send + Sync + 'static>(
&self,
callback: F
) -> HandlerId
[src]
&self,
callback: F
) -> HandlerId
Callback is called when a new router is created.
pub fn on_dead<F: FnOnce(Result<(), ExitError>) + Send + Sync + 'static>(
&self,
callback: F
) -> HandlerId
[src]
&self,
callback: F
) -> HandlerId
Callback is called when the worker thread unexpectedly dies.
pub fn on_close<F: FnOnce() + Send + 'static>(&self, callback: F) -> HandlerId
[src]
Callback is called when the worker is closed for whatever reason.
NOTE: Callback will be called in place if worker is already closed.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Worker
impl Send for Worker
impl Sync for Worker
impl Unpin for Worker
impl !UnwindSafe for Worker
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,