Struct all_is_cubes::behavior::BehaviorSetTransaction
source · pub struct BehaviorSetTransaction<H: BehaviorHost> { /* private fields */ }Expand description
A Transaction that adds or modifies Behaviors in a BehaviorSet.
Implementations§
source§impl<H: BehaviorHost> BehaviorSetTransaction<H>
impl<H: BehaviorHost> BehaviorSetTransaction<H>
sourcepub fn insert(attachment: H::Attachment, behavior: Arc<dyn Behavior<H>>) -> Self
pub fn insert(attachment: H::Attachment, behavior: Arc<dyn Behavior<H>>) -> Self
Constructs a transaction that adds a behavior to the behavior set.
Trait Implementations§
source§impl<H: BehaviorHost> Clone for BehaviorSetTransaction<H>
impl<H: BehaviorHost> Clone for BehaviorSetTransaction<H>
source§impl<H: Debug + BehaviorHost> Debug for BehaviorSetTransaction<H>
impl<H: Debug + BehaviorHost> Debug for BehaviorSetTransaction<H>
source§impl<H: BehaviorHost> Default for BehaviorSetTransaction<H>
impl<H: BehaviorHost> Default for BehaviorSetTransaction<H>
source§impl<H: BehaviorHost> Merge for BehaviorSetTransaction<H>
impl<H: BehaviorHost> Merge for BehaviorSetTransaction<H>
§type MergeCheck = MergeCheck
type MergeCheck = MergeCheck
Type of a value passed from
Merge::check_merge to Merge::commit_merge.
This may be used to pass precalculated values to speed up the merge phase,
but also makes it difficult to accidentally merge without checking.§type Conflict = BehaviorTransactionConflict
type Conflict = BehaviorTransactionConflict
Error type giving the reason why a merge was not possible. Read more
source§fn check_merge(&self, other: &Self) -> Result<Self::MergeCheck, Self::Conflict>
fn check_merge(&self, other: &Self) -> Result<Self::MergeCheck, Self::Conflict>
Checks whether two transactions can be merged into a single transaction.
If so, returns
Ok containing data which may be passed to Self::commit_merge(). Read moresource§fn commit_merge(&mut self, other: Self, _: Self::MergeCheck)
fn commit_merge(&mut self, other: Self, _: Self::MergeCheck)
Combines
other into self so that it has both effects simultaneously.
This operation must be commutative and have Default::default() as the identity. Read moresource§impl<H: BehaviorHost> PartialEq for BehaviorSetTransaction<H>
impl<H: BehaviorHost> PartialEq for BehaviorSetTransaction<H>
source§impl<H: BehaviorHost> Transaction for BehaviorSetTransaction<H>
impl<H: BehaviorHost> Transaction for BehaviorSetTransaction<H>
§type Target = BehaviorSet<H>
type Target = BehaviorSet<H>
Type of the transaction’s target (what it can be used to mutate).
§type CommitCheck = CommitCheck
type CommitCheck = CommitCheck
Type of a value passed from
Transaction::check to Transaction::commit.
This may be used to pass precalculated values to speed up the commit phase,
or even lock guards or similar, but also makes it slightly harder to accidentally
call commit without check.§type Output = Infallible
type Output = Infallible
The results of a
Transaction::commit() or Transaction::execute().
Each commit may produce any number of these messages. Read more§type Mismatch = BehaviorTransactionMismatch
type Mismatch = BehaviorTransactionMismatch
Error type describing a precondition not met, returned by
Self::check(). Read moresource§fn check(
&self,
target: &BehaviorSet<H>,
) -> Result<Self::CommitCheck, Self::Mismatch>
fn check( &self, target: &BehaviorSet<H>, ) -> Result<Self::CommitCheck, Self::Mismatch>
source§fn commit(
&self,
target: &mut BehaviorSet<H>,
_: Self::CommitCheck,
_outputs: &mut dyn FnMut(Self::Output),
) -> Result<(), CommitError>
fn commit( &self, target: &mut BehaviorSet<H>, _: Self::CommitCheck, _outputs: &mut dyn FnMut(Self::Output), ) -> Result<(), CommitError>
Perform the mutations specified by this transaction. The
check value should have
been created by a prior call to Transaction::check(). Read moreimpl<H: BehaviorHost> Eq for BehaviorSetTransaction<H>
Auto Trait Implementations§
impl<H> Freeze for BehaviorSetTransaction<H>
impl<H> !RefUnwindSafe for BehaviorSetTransaction<H>
impl<H> Send for BehaviorSetTransaction<H>
impl<H> Sync for BehaviorSetTransaction<H>
impl<H> Unpin for BehaviorSetTransaction<H>
impl<H> !UnwindSafe for BehaviorSetTransaction<H>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.