StateService

Struct StateService 

Source
pub struct StateService<HANDLER, SCOPE = HANDLER>
where HANDLER: StateHandler + 'static, SCOPE: 'static,
{ /* private fields */ }
Expand description

Context agent for managing shared state. In charge of applying changes to state then notifying subscribers of new state.

Trait Implementations§

Source§

impl<HANDLER, SCOPE> Agent for StateService<HANDLER, SCOPE>
where HANDLER: StateHandler + 'static, SCOPE: 'static,

Source§

type Message = <HANDLER as StateHandler>::Message

Type of an input message.
Source§

type Reach = Context<StateService<HANDLER, SCOPE>>

Reach capability of the agent.
Source§

type Input = ServiceInput<HANDLER>

Incoming message type.
Source§

type Output = ServiceOutput<HANDLER>

Outgoing message type.
Source§

fn create(link: AgentLink<Self>) -> Self

Creates an instance of an agent.
Source§

fn update(&mut self, msg: Self::Message)

This method called on every update message.
Source§

fn handle_input(&mut self, msg: Self::Input, who: HandlerId)

This method called on every incoming message.
Source§

fn disconnected(&mut self, who: HandlerId)

This method called on when a new bridge destroyed.
Source§

fn connected(&mut self, _id: HandlerId)

This method called on when a new bridge created.
Source§

fn destroy(&mut self)

This method called when the agent is destroyed.
Source§

fn name_of_resource() -> &'static str

Represents the name of loading resorce for remote workers which have to live in a separate files.
Source§

fn is_module() -> bool

Signifies if resource is a module. This has pending browser support.

Auto Trait Implementations§

§

impl<HANDLER, SCOPE> Freeze for StateService<HANDLER, SCOPE>
where HANDLER: Freeze,

§

impl<HANDLER, SCOPE = HANDLER> !RefUnwindSafe for StateService<HANDLER, SCOPE>

§

impl<HANDLER, SCOPE = HANDLER> !Send for StateService<HANDLER, SCOPE>

§

impl<HANDLER, SCOPE = HANDLER> !Sync for StateService<HANDLER, SCOPE>

§

impl<HANDLER, SCOPE> Unpin for StateService<HANDLER, SCOPE>
where HANDLER: Unpin,

§

impl<HANDLER, SCOPE = HANDLER> !UnwindSafe for StateService<HANDLER, SCOPE>

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.
Source§

impl<T> Any for T
where T: Any,