Skip to main content

Crate mixi2

Crate mixi2 

Source
Expand description

Async Rust SDK for the mixi2 Application API.

This crate combines the complete SDK surface into a single package:

The public API is async-only and designed for Tokio runtimes. Generated protobuf types remain visible so callers can keep full protocol fidelity, while the builders in this crate add validation only where the mixi2 API requires it.

§Quick Start

use std::sync::Arc;
use mixi2::{ApiClientBuilder, ClientCredentialsAuthenticator, GetStampsRequestBuilder};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let authenticator =
        Arc::new(ClientCredentialsAuthenticator::new("client-id", "client-secret").await?);

    let mut client = ApiClientBuilder::new(authenticator).build().await?;

    let _stamps = client
        .get_stamps(GetStampsRequestBuilder::new().build())
        .await?;

    Ok(())
}

§Raw Protocol Types

The generated protobuf and gRPC types are re-exported under social. Reach for them when you need direct access to the mixi2 schema or an RPC/request shape that does not need a convenience builder.

§Event Delivery

Use WebhookService and WebhookServer for signed webhook delivery, or StreamClientBuilder together with EventHandler for long-lived gRPC event streams.

Modules§

social
testutiltestutil
Test helpers that mirror the Go SDK fixtures.

Structs§

AddStampToPostRequestBuilder
Builder for AddStampToPostRequest.
ApiClientapi
Authenticated façade over the raw unary gRPC client.
ApiClientBuilderapi
Builder for an authenticated unary client.
AuthenticatorBuilderclient-credentials-auth
Builder for a client-credentials authenticator.
ClientCredentialsAuthenticatorclient-credentials-auth
OAuth2 client-credentials authenticator for the mixi2 API.
CreatePostRequestBuilder
Builder for CreatePostRequest.
DeletePostRequestBuilder
Builder for DeletePostRequest.
GetStampsRequestBuilder
Builder for GetStampsRequest.
InitiatePostMediaUploadRequestBuilder
Builder for InitiatePostMediaUploadRequest.
SendChatMessageRequestBuilder
Builder for SendChatMessageRequest.
StreamClientBuilderstream
Builder for an authenticated stream watcher.
StreamWatcherstream
Watches the gRPC event stream and dispatches events to the provided handler.
WebhookServerwebhook-axum
Thin Axum server wrapper for webhook delivery.
WebhookServicewebhook-core
Verifies and dispatches incoming webhook requests.

Enums§

AuthError
Errors returned by the mixi2 authentication layer.
ClientBuildErrorapi or stream
Transport setup errors returned by the top-level builders.
DispatchModewebhook-core
Controls whether webhook events are processed inline or spawned onto Tokio.
RequestValidationError
Validation errors returned by the high-level request builders.
StreamWatcherErrorstream
Errors returned by the streaming watcher.
WebhookErrorwebhook-core
Errors returned before a webhook request is acknowledged.

Constants§

DEFAULT_API_ENDPOINTapi
Official mixi2 Application API endpoint for unary SDK clients.
DEFAULT_STREAM_ENDPOINTstream
Official mixi2 Application stream endpoint for event streaming clients.
DEFAULT_TOKEN_URLclient-credentials-auth
Official mixi2 OAuth2 token endpoint for application SDK clients.
FILE_DESCRIPTOR_SET

Traits§

Authenticator
Async token provider used by the gRPC wrappers in this workspace.
EventHandlerstream or webhook-core or testutil
Async handler for mixi2 events.

Type Aliases§

BoxErrorstream or webhook-core or testutil
Boxed error type returned by event handlers.