RoleSetup

Struct RoleSetup 

Source
pub struct RoleSetup<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> RoleSetup<'a>

Source

pub fn new( root_object_name: &'static str, spawner: RoleSpawner, worker_cx: &'a WorkerContext, packet_sender: PacketSender, plane_id: u32, role_id: u64, endpoint_addr: EndpointAddr, shutdown_signal: SignalTree, ) -> Self

Source

pub fn endpoint_addr(&self) -> EndpointAddr

Source

pub fn worker_id(&self) -> u16

Source

pub fn plane_id(&self) -> u32

Source

pub fn role_id(&self) -> u64

Source

pub fn role_spawner(&self) -> &RoleSpawner

Source

pub fn role_shutdown_signal(&self) -> &SignalTree

Source

pub fn worker_context(&self) -> &WorkerContext

Source

pub fn push_object_path(&mut self, name: &'static str)

Source

pub fn pop_object_path(&mut self)

Source

pub fn get_object_path(&self, end: &'static str) -> String

Source

pub fn event_tx<T>(&self, spec: InterfaceEvent<T>) -> EventTx<T>
where T: Encode + for<'d> Decode<'d>,

Source

pub fn event_rx<T: Owned>(&self, spec: InterfaceEvent<T>) -> EventRxBuilder<T>

Source

pub fn with_local<T, U>( &self, key: T::Key, params: &T::Params, f: impl FnOnce(&mut T) -> U, ) -> U
where T: ContextClass + 'static,

Source

pub fn with_local_fn<K, T, U>( &self, key: K, constructor: impl FnOnce() -> T, f: impl FnOnce(&mut T) -> U, ) -> U
where K: Eq + Hash, T: 'static,

Source

pub fn with_global<T, U>( &self, key: T::Key, params: &T::Params, f: impl FnOnce(&mut T) -> U, ) -> U
where T: ContextClass + Send + 'static, T::Key: Send,

Auto Trait Implementations§

§

impl<'a> Freeze for RoleSetup<'a>

§

impl<'a> !RefUnwindSafe for RoleSetup<'a>

§

impl<'a> !Send for RoleSetup<'a>

§

impl<'a> !Sync for RoleSetup<'a>

§

impl<'a> Unpin for RoleSetup<'a>

§

impl<'a> !UnwindSafe for RoleSetup<'a>

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.