fdf

Struct DispatcherBuilder

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

A builder for Dispatchers

Implementations§

Source§

impl DispatcherBuilder

Source

pub fn new() -> Self

Creates a new DispatcherBuilder that can be used to configure a new dispatcher. For more information on the threading-related flags for the dispatcher, see https://fuchsia.dev/fuchsia-src/concepts/drivers/driver-dispatcher-and-threads

Source

pub fn unsynchronized(self) -> Self

Sets whether parallel callbacks in the callbacks set in the dispatcher are allowed. May not be set with Self::allow_thread_blocking.

See https://fuchsia.dev/fuchsia-src/concepts/drivers/driver-dispatcher-and-threads for more information on the threading model of driver dispatchers.

Source

pub fn is_unsynchronized(&self) -> bool

Whether or not this is an unsynchronized dispatcher

Source

pub fn allow_thread_blocking(self) -> Self

This dispatcher may not share zircon threads with other drivers. May not be set with Self::unsynchronized.

See https://fuchsia.dev/fuchsia-src/concepts/drivers/driver-dispatcher-and-threads for more information on the threading model of driver dispatchers.

Source

pub fn allows_thread_blocking(&self) -> bool

Source

pub fn name(self, name: &str) -> Self

A descriptive name for this dispatcher that is used in debug output and process lists.

Source

pub fn scheduler_role(self, role: &str) -> Self

A hint string for the runtime that may or may not impact the priority the work scheduled by this dispatcher is handled at. It may or may not impact the ability for other drivers to share zircon threads with the dispatcher.

Source

pub fn shutdown_observer<F: ShutdownObserverFn>( self, shutdown_observer: F, ) -> Self

A callback to be called before after the dispatcher has completed asynchronous shutdown.

Source

pub fn create(self) -> Result<Dispatcher, Status>

Create the dispatcher as configured by this object. This must be called from a thread managed by the driver runtime. The dispatcher returned is owned by the caller, and will initiate asynchronous shutdown when the object is dropped unless Dispatcher::release is called on it to convert it into an unowned DispatcherRef.

Source

pub fn create_released(self) -> Result<DispatcherRef<'static>, Status>

As with Self::create, this creates a new dispatcher as configured by this object, but instead of returning an owned reference it immediately releases the reference to be managed by the driver runtime.

Trait Implementations§

Source§

impl Default for DispatcherBuilder

Source§

fn default() -> DispatcherBuilder

Returns the “default value” for a type. 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> 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, 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.