Enum XiCore

Source
pub enum XiCore {
    Waiting,
    Running(Arc<Mutex<CoreState>>),
}
Expand description

A reference to the main core state.

§Note

Various items of initial setup are dependent on how the client is configured, so we defer instantiating state until we have that information.

Variants§

§

Waiting

§

Running(Arc<Mutex<CoreState>>)

Implementations§

Source§

impl XiCore

Source

pub fn new() -> Self

Source

pub fn inner(&self) -> MutexGuard<'_, CoreState>

Returns a guard to the core state. A convenience around Mutex::lock.

§Panics

Panics if core has not yet received the client_started message.

Trait Implementations§

Source§

impl Handler for XiCore

Handler for messages originating with the frontend.

Source§

type Notification = CoreNotification

Source§

type Request = CoreRequest

Source§

fn handle_notification(&mut self, ctx: &RpcCtx, rpc: Self::Notification)

Source§

fn handle_request( &mut self, _ctx: &RpcCtx, rpc: Self::Request, ) -> Result<Value, RemoteError>

Source§

fn idle(&mut self, _ctx: &RpcCtx, token: usize)

Auto Trait Implementations§

§

impl Freeze for XiCore

§

impl RefUnwindSafe for XiCore

§

impl Send for XiCore

§

impl Sync for XiCore

§

impl Unpin for XiCore

§

impl UnwindSafe for XiCore

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.