Skip to content
8 changes: 8 additions & 0 deletions src/operations/cdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use crate::operations::cdt_context::CdtContext;
use crate::Value;

#[doc(hidden)]
#[derive(Clone)]
pub enum CdtArgument<'a> {
Byte(u8),
Int(i64),
Expand All @@ -34,7 +35,14 @@ pub enum CdtArgument<'a> {
pub type OperationEncoder =
Box<dyn Fn(&mut Option<&mut Buffer>, &CdtOperation, &[CdtContext]) -> Result<usize>>;

impl Clone for Box<dyn OperationEncoder> {
fn clone(&self) -> Self {
self.clone_box()
}
}

#[doc(hidden)]
#[derive(Clone)]
pub struct CdtOperation<'a> {
pub op: u8,
pub encoder: OperationEncoder,
Expand Down
1 change: 1 addition & 0 deletions src/operations/exp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pub enum ExpWriteFlags {
pub type ExpressionEncoder = Box<dyn Fn(&mut Option<&mut Buffer>, &ExpOperation) -> Result<usize>>;

#[doc(hidden)]
#[derive(Clone)]
pub struct ExpOperation<'a> {
pub encoder: ExpressionEncoder,
pub policy: i64,
Expand Down
3 changes: 3 additions & 0 deletions src/operations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pub enum OperationType {
}

#[doc(hidden)]
#[derive(Clone)]
pub enum OperationData<'a> {
None,
Value(&'a Value),
Expand All @@ -68,13 +69,15 @@ pub enum OperationData<'a> {
}

#[doc(hidden)]
#[derive(Clone)]
pub enum OperationBin<'a> {
None,
All,
Name(&'a str),
}

/// Database operation definition. This data type is used in the client's `operate()` method.
#[derive(Clone)]
pub struct Operation<'a> {
// OpType determines type of operation.
#[doc(hidden)]
Expand Down