/// Convert an `EntityOperation` into the corresponding `EntityChange`.
/// `Set` and `Update` operations are mapped to that `EntityChange`.
/// `AbortUnless` operations are mapped to `None`, as they do not represent
///  a change to any entity.
Convert an `EntityOperation` into the corresponding `EntityChange`.
Convert an ` EntityOperation ` into the corresponding ` EntityChange ` .
pub fn from_entity_operation(operation: EntityOperation) -> Option<Self> {
        use self::EntityOperation::*;
        match operation {
            Set { key, .. } | Update { key, .. } => {
                Some(Self::from_key(key, EntityChangeOperation::Set))
            }
            Remove { key } => Some(Self::from_key(key, EntityChangeOperation::Removed)),
            // AbortUnless is uninteresting for when we need an EntityChange
            AbortUnless { .. } => None,
        }
    }
pub fn from_entity_operation ( operation : EntityOperation ) -> Option < Self > { use self :: EntityOperation :: * ; match operation { Set { key , .. } | Update { key , .. } => { Some ( Self :: from_key ( key , EntityChangeOperation :: Set ) ) } Remove { key } => Some ( Self :: from_key ( key , EntityChangeOperation :: Removed ) ) , // AbortUnless is uninteresting for when we need an EntityChange AbortUnless { .. } => None , } }
Convert an `EntityOperation` into the corresponding `EntityChange`.
Convert an ` EntityOperation ` into the corresponding ` EntityChange ` .
operation
EntityOperation