MAP Docs
MIMESIS

Internals

Crate path, key types, adjacent protocols for MIMESIS.

MIMESIS (Convention · Custom · Precedent) lives in protocols/mimesis-lib. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols.

Source

PathContains
protocols/mimesis-lib/src/lib.rsProtocolModule impl, operation dispatch
protocols/mimesis-lib/src/protocol.rscore protocol logic
protocols/mimesis-lib/src/types.rsrequest/response types (derive schemars::JsonSchema)
protocols/mimesis-lib/tests/unit + integration tests
schemas/mimesis/v1/published JSON Schemas

ProtocolModule contract

impl ProtocolModule for MimesisProtocol {
    fn protocol_name(&self) -> &'static str { "MIMESIS" }
    fn version(&self) -> &'static str { "v1.0.0" }

    fn operations(&self) -> Vec<&'static str> {
        vec![
            "surface",
            "precedent",
            "formalize",
        ]
    }

    async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext)
        -> Result<Response, ProtocolError>
    {
        match op {
            "surface" => self.surface(payload, ctx).await,
            "precedent" => self.precedent(payload, ctx).await,
            "formalize" => self.formalize(payload, ctx).await,
            _ => Err(ProtocolError::UnknownOperation(op.into())),
        }
    }
}

Adjacent

RelationMembers
Consults
Records toMAX · MOTET · MOMENT
Subject toMAXIM · MOAT (cross-org) · MOOT (disputes)
Settled withMEAL · MANA · MADE

Status

Implemented · production-grade.

Tests

cargo test -p mimesis-lib --all-features

See also

On this page