Struct rex::StateId

source ·
pub struct StateId<K: Kind> {
    pub kind: K,
    pub uuid: Uuid,
}
Expand description

Implements node::Node Id generics by holding a Kind field and a Uuid to be used as a distinguishing identifier

Fields§

§kind: K§uuid: Uuid

Implementations§

source§

impl<K: Kind> StateId<K>

source

pub fn new(kind: K, uuid: Uuid) -> Self

source

pub fn new_rand(kind: K) -> Self

source

pub fn nil(kind: K) -> Self

source

pub fn is_nil(&self) -> bool

Trait Implementations§

source§

impl<K: Clone + Kind> Clone for StateId<K>

source§

fn clone(&self) -> StateId<K>

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<K: Debug + Kind> Debug for StateId<K>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<K> Deref for StateId<K>
where K: Kind,

source§

type Target = K

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<K> Display for StateId<K>
where K: Kind,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<K: Hash + Kind> Hash for StateId<K>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<K: PartialEq + Kind> PartialEq for StateId<K>

source§

fn eq(&self, other: &StateId<K>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<K: Copy + Kind> Copy for StateId<K>

source§

impl<K: Eq + Kind> Eq for StateId<K>

source§

impl<K: Kind> StructuralPartialEq for StateId<K>

Auto Trait Implementations§

§

impl<K> Freeze for StateId<K>
where K: Freeze,

§

impl<K> RefUnwindSafe for StateId<K>
where K: RefUnwindSafe,

§

impl<K> Send for StateId<K>

§

impl<K> Sync for StateId<K>
where K: Sync,

§

impl<K> Unpin for StateId<K>
where K: Unpin,

§

impl<K> UnwindSafe for StateId<K>
where K: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<Id, K> Kind for Id
where K: Kind, Id: Deref<Target = K> + Send + Debug,

source§

type State = <K as Kind>::State

source§

fn new_state(&self) -> <Id as Kind>::State

source§

fn failed_state(&self) -> <Id as Kind>::State

source§

fn completed_state(&self) -> <Id as Kind>::State

source§

impl<K, Op> Request<K> for Op
where K: Rex, Op: Operation, <K as Rex>::Message: From<UnaryRequest<K, Op>>,

source§

fn request(self, id: StateId<K>) -> UnaryRequest<K, Op>

source§

impl<K, T> RequestInner<K> for T
where K: HashKind,

source§

fn request_inner<Op>(self, id: StateId<K>) -> UnaryRequest<K, Op>
where Op: Operation + From<T>,

source§

impl<T> ToOwned for T
where T: Clone,

source§

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> CoreError for T
where T: Debug + Display + Send + Sync + 'static,

source§

impl<A> Debug for A
where A: Debug + Send + Sync + 'static,

source§

impl<A> Display for A
where A: Display + Debug + Send + Sync + 'static,

source§

impl<K> HashKind for K
where K: Kind + Debug + Hash + Eq + PartialEq + Send + Sync + 'static + Copy,

source§

impl<Op> Operation for Op
where Op: Display + Clone,

source§

impl<T> RexTopic for T
where T: Debug + Hash + Eq + PartialEq + Copy + Send + Sync + 'static,