shepherd-rs 0.1.0

Shepherd is a resilient, non-blocking orchestrator that persistently transforms and delivers data—built for remote, compute-heavy workloads.
Documentation
use crate::transform::{TransformAttempt, TransformRequest};

#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) struct MockTransformRequest {
    pub(crate) request_id: u64,
    pub(crate) input: String,
    pub(crate) output: String,
}

impl TransformRequest for MockTransformRequest {
    type Identifier = u64;
    type Input = String;
    type Output = String;

    fn request_id(&self) -> Self::Identifier {
        self.request_id
    }
    fn input(&self) -> &Self::Input {
        &self.input
    }
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) struct MockTransformAttempt {
    pub(crate) request_id: u64,
    pub(crate) attempt_id: u64,
}

impl TransformAttempt for MockTransformAttempt {
    type AttemptCallContext = ();
    // (request_id, attempt_id)
    type AttemptError = ();
    type AttemptIdentifier = (u64, u64);
    type AttemptReturnContext = ();
    type TransformRequest = MockTransformRequest;
}