pub struct CubeTransaction { /* private fields */ }Expand description
A modification to the contents of single cube of a Space.
To make use of this, insert it into a SpaceTransaction to specify which cube is
modified. This type does not function directly as a Transaction (though it does
implement Merge).
Implementations§
Source§impl CubeTransaction
impl CubeTransaction
Sourcepub fn at(self, cube: Cube) -> SpaceTransaction
pub fn at(self, cube: Cube) -> SpaceTransaction
Creates a SpaceTransaction that applies self to the given cube of the space.
Sourcepub fn replacing(old: Option<Block>, new: Option<Block>) -> Self
pub fn replacing(old: Option<Block>, new: Option<Block>) -> Self
Construct a CubeTransaction that may check and may replace the block in the cube.
If old is not None, requires that the existing block is that block or the
transaction will fail.
If new is not None, replaces the existing block with new.
Sourcepub fn overwrite(&mut self, block: Block)
pub fn overwrite(&mut self, block: Block)
Sets the block to be placed at this cube, replacing any existing modification instruction This does not affect a precondition on the existing block, or the conservative option.
This is thus comparable to the effect of a direct Mutation::set() after the rest of the
transaction.
Trait Implementations§
Source§impl Clone for CubeTransaction
impl Clone for CubeTransaction
Source§fn clone(&self) -> CubeTransaction
fn clone(&self) -> CubeTransaction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CubeTransaction
impl Debug for CubeTransaction
Source§impl Default for CubeTransaction
impl Default for CubeTransaction
Source§fn default() -> CubeTransaction
fn default() -> CubeTransaction
Source§impl Merge for CubeTransaction
impl Merge for CubeTransaction
Source§type MergeCheck = CubeMergeCheck
type MergeCheck = CubeMergeCheck
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.Source§type Conflict = CubeConflict
type Conflict = CubeConflict
Source§fn check_merge(&self, other: &Self) -> Result<Self::MergeCheck, Self::Conflict>
fn check_merge(&self, other: &Self) -> Result<Self::MergeCheck, Self::Conflict>
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)
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 PartialEq for CubeTransaction
impl PartialEq for CubeTransaction
Source§impl VisitHandles for CubeTransaction
impl VisitHandles for CubeTransaction
Source§fn visit_handles(&self, visitor: &mut dyn HandleVisitor)
fn visit_handles(&self, visitor: &mut dyn HandleVisitor)
impl Eq for CubeTransaction
impl StructuralPartialEq for CubeTransaction
Auto Trait Implementations§
impl Freeze for CubeTransaction
impl RefUnwindSafe for CubeTransaction
impl Send for CubeTransaction
impl Sync for CubeTransaction
impl Unpin for CubeTransaction
impl UnwindSafe for CubeTransaction
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
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>,
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>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
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>
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>
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 more