use crate::{DefaultCommitPolicy, ShardError};

use super::commit_policy::InnerCommitPolicy;

pub(super) type ExecuteFn<Data> = Box<dyn FnOnce(Result<&Data, ShardError>) + Send>;

pub(super) type ExecuteMutFn<Data> =
    Box<dyn FnOnce(Result<&mut Data, ShardError>, DefaultCommitPolicy) -> InnerCommitPolicy + Send>;

pub(super) type ExecuteIfCachedFn<Data> = Box<dyn FnOnce(Option<&Data>) + Send>;
