pub struct RootHandler { /* private fields */ }
Expand description

Protocol handler

Implementations§

source§

impl RootHandler

source

pub fn channel_balance(&self) -> ChannelBalance

Get the channel balances

source

pub fn get_chain_height(&self) -> u32

Get the current chain height based on the tracker

Trait Implementations§

source§

impl Clone for RootHandler

source§

fn clone(&self) -> RootHandler

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Handler for RootHandler

source§

fn do_handle(&self, msg: Message) -> Result<Box<dyn SerBolt>>

Actual handling
source§

fn client_id(&self) -> u64

Unused
source§

fn for_new_client( &self, client_id: u64, peer_id: PubKey, dbid: u64 ) -> ChannelHandler

Create a channel handler
source§

fn node(&self) -> &Arc<Node>

Get the associated signing node. Note that if you want to perform an operation that can result in a mutation of the node state requiring a persist, and your persister writes to the cloud, you must use Handler::with_persist instead.
source§

fn handle(&self, msg: Message) -> Result<(Box<dyn SerBolt>, Mutations)>

Handle a message
source§

fn commit(&self)

Commit the persister transaction if any
source§

fn with_persist(&self, f: impl FnOnce(&Node) -> Result<()>) -> Result<Mutations>

Perform an operation on the Node that requires persistence. The operation must not mutate if it fails (returns an error). You must call Handler::commit after you persist the mutations in the cloud.

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
§

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

§

fn as_any(&self) -> &(dyn Any + 'static)

§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

§

fn type_name(&self) -> &'static str

Gets the type name of self
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
§

impl<T> Downcast for T
where T: AsAny + ?Sized,

§

fn is<T>(&self) -> bool
where T: AsAny,

Returns true if the boxed type is the same as T. Read more
§

fn downcast_ref<T>(&self) -> Option<&T>
where T: AsAny,

Forward to the method defined on the type Any.
§

fn downcast_mut<T>(&mut self) -> Option<&mut T>
where T: AsAny,

Forward to the method defined on the type Any.
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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V