Struct fdf::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>,

§

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>,

§

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.