Skip to main content

Crate api_bones_connect

Crate api_bones_connect 

Source
Expand description

Connect RPC adapter primitives for api-bones services (ADR-0096).

This crate re-exports the api_bones::connect module surface for consumers who want a dedicated dependency rather than enabling the connect feature on api-bones directly.

§Usage

[dependencies]
api-bones-connect = "0.1"
use api_bones_connect::{
    DomainErrorKind, IntoDomainErrorKind, domain_to_connect,
    chrono_to_timestamp, parse_uuid, build_page, ConnectOptionExt as _,
};

Structs§

OffsetPage
Normalized offset-page result.

Enums§

DomainErrorKind
Canonical error-kind shape for domain errors that need to cross the Connect RPC boundary.

Constants§

DEFAULT_LIMIT
Brefwiz standard default page size.
MAX_LIMIT
Brefwiz standard maximum page size.

Traits§

ConnectOptionExt
Extension trait on Result<Option<T>, E> for ergonomic not-found shaping.
IntoDomainErrorKind
Implement this trait on your service’s domain error type to unlock the generic domain_to_connect mapper.

Functions§

build_offset_page
Normalize inputs and build an OffsetPage.
build_page
build_offset_page with brefwiz standard defaults (default=20, max=200).
chrono_opt_to_timestamp
Convert an Option<DateTime<Utc>> to an optional proto Timestamp.
chrono_to_timestamp
Convert a chrono::DateTime<Utc> to a [google.protobuf.Timestamp].
domain_to_connect
Map any domain error implementing IntoDomainErrorKind to a ConnectError.
parse_uuid
Parse a UUID string, returning ConnectError::invalid_argument on failure.