Skip to main content

WireFunction

Trait WireFunction 

Source
pub trait WireFunction: 'static {
    type Request: Serialize + DeserializeOwned;
    type Response: Serialize + DeserializeOwned;

    const NAME: &'static str;
    const FALLBACK: FallbackPolicy;
    const SUPPORTED_VERSIONS: &'static [u32];

    // Required methods
    fn dry_run_request() -> Self::Request;
    fn dry_run_response() -> Self::Response;
}
Expand description

Type-level specification for a wire function exported by a plugin.

Required Associated Constants§

Source

const NAME: &'static str

Name of the wire function (e.g., “sign”, “observe”).

Source

const FALLBACK: FallbackPolicy

Compile-time fallback policy for this function. Must never be runtime-configurable to prevent security incidents (e.g., skipping signing).

Source

const SUPPORTED_VERSIONS: &'static [u32]

Wire protocol versions this function supports. Host advertises max version, plugin chooses compatible version during handshake.

Required Associated Types§

Source

type Request: Serialize + DeserializeOwned

Request type for this wire function.

Source

type Response: Serialize + DeserializeOwned

Response type for this wire function.

Required Methods§

Source

fn dry_run_request() -> Self::Request

Dry-run request for self_check (skip-handler model: serialize/deserialize round-trip only).

Source

fn dry_run_response() -> Self::Response

Dry-run response for self_check (skip-handler model: serialize/deserialize round-trip only).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl WireFunction for cc_lb_plugin_wire::v1::build_signer::BuildSignerFn

Source§

const NAME: &'static str = "build_signer"

Source§

const FALLBACK: FallbackPolicy = FallbackPolicy::FailRequest

Source§

const SUPPORTED_VERSIONS: &'static [u32]

Source§

type Request = BuildSignerRequest

Source§

type Response = BuildSignerResponse

Source§

impl WireFunction for cc_lb_plugin_wire::v2::build_signer::BuildSignerFn

Source§

const NAME: &'static str = "build_signer"

Source§

const FALLBACK: FallbackPolicy = FallbackPolicy::FailRequest

Source§

const SUPPORTED_VERSIONS: &'static [u32]

Source§

type Request = BuildSignerRequest

Source§

type Response = BuildSignerResponse

Source§

impl WireFunction for FilterFn

Source§

const NAME: &'static str = "filter"

Source§

const FALLBACK: FallbackPolicy = FallbackPolicy::UseDefault

Source§

const SUPPORTED_VERSIONS: &'static [u32]

Source§

type Request = FilterRequest

Source§

type Response = FilterResponse

Source§

impl WireFunction for cc_lb_plugin_wire::v1::normalize_error::NormalizeErrorFn

Source§

const NAME: &'static str = "normalize_error"

Source§

const FALLBACK: FallbackPolicy = FallbackPolicy::PassThrough

Source§

const SUPPORTED_VERSIONS: &'static [u32]

Source§

type Request = NormalizeErrorRequest

Source§

type Response = NormalizeErrorResponse

Source§

impl WireFunction for cc_lb_plugin_wire::v2::normalize_error::NormalizeErrorFn

Source§

const NAME: &'static str = "normalize_error"

Source§

const FALLBACK: FallbackPolicy = FallbackPolicy::PassThrough

Source§

const SUPPORTED_VERSIONS: &'static [u32]

Source§

type Request = NormalizeErrorRequest

Source§

type Response = NormalizeErrorResponse

Source§

impl WireFunction for cc_lb_plugin_wire::v1::observe::ObserveFn

Source§

const NAME: &'static str = "observe"

Source§

const FALLBACK: FallbackPolicy = FallbackPolicy::SilentSkip

Source§

const SUPPORTED_VERSIONS: &'static [u32]

Source§

type Request = ObserveRequest

Source§

type Response = ObserveResponse

Source§

impl WireFunction for cc_lb_plugin_wire::v2::observe::ObserveFn

Source§

const NAME: &'static str = "observe"

Source§

const FALLBACK: FallbackPolicy = FallbackPolicy::SilentSkip

Source§

const SUPPORTED_VERSIONS: &'static [u32]

Source§

type Request = ObserveRequest

Source§

type Response = ObserveResponse

Source§

impl WireFunction for cc_lb_plugin_wire::v1::on_unauthorized::OnUnauthorizedFn

Source§

const NAME: &'static str = "on_unauthorized"

Source§

const FALLBACK: FallbackPolicy = FallbackPolicy::PassThrough

Source§

const SUPPORTED_VERSIONS: &'static [u32]

Source§

type Request = OnUnauthorizedRequest

Source§

type Response = OnUnauthorizedResponse

Source§

impl WireFunction for cc_lb_plugin_wire::v2::on_unauthorized::OnUnauthorizedFn

Source§

const NAME: &'static str = "on_unauthorized"

Source§

const FALLBACK: FallbackPolicy = FallbackPolicy::PassThrough

Source§

const SUPPORTED_VERSIONS: &'static [u32]

Source§

type Request = OnUnauthorizedRequest

Source§

type Response = OnUnauthorizedResponse

Source§

impl WireFunction for cc_lb_plugin_wire::v1::shape::ShapeFn

Source§

const NAME: &'static str = "shape"

Source§

const FALLBACK: FallbackPolicy = FallbackPolicy::FailRequest

Source§

const SUPPORTED_VERSIONS: &'static [u32]

Source§

type Request = ShapeRequest

Source§

type Response = ShapeResponse

Source§

impl WireFunction for cc_lb_plugin_wire::v2::shape::ShapeFn

Source§

const NAME: &'static str = "shape"

Source§

const FALLBACK: FallbackPolicy = FallbackPolicy::FailRequest

Source§

const SUPPORTED_VERSIONS: &'static [u32]

Source§

type Request = ShapeRequest

Source§

type Response = ShapeResponse

Source§

impl WireFunction for cc_lb_plugin_wire::v1::sign::SignFn

Source§

const NAME: &'static str = "sign"

Source§

const FALLBACK: FallbackPolicy = FallbackPolicy::FailRequest

Source§

const SUPPORTED_VERSIONS: &'static [u32]

Source§

type Request = SignRequest

Source§

type Response = SignResponse

Source§

impl WireFunction for cc_lb_plugin_wire::v2::sign::SignFn

Source§

const NAME: &'static str = "sign"

Source§

const FALLBACK: FallbackPolicy = FallbackPolicy::FailRequest

Source§

const SUPPORTED_VERSIONS: &'static [u32]

Source§

type Request = SignRequest

Source§

type Response = SignResponse