Expand description
Async Rust SDK for the mixi2 Application API.
This crate combines the complete SDK surface into a single package:
OAuth2client-credentials authentication viaClientCredentialsAuthenticator- Authenticated unary gRPC access via
ApiClientandApiClientBuilder - Webhook and streaming event helpers via
WebhookService,WebhookServer, andStreamClientBuilder - Raw generated
prostandtonictypes undersocialplusFILE_DESCRIPTOR_SET
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§
Structs§
- AddStamp
ToPost Request Builder - Builder for
AddStampToPostRequest. - ApiClient
api - Authenticated façade over the raw unary gRPC client.
- ApiClient
Builder api - Builder for an authenticated unary client.
- Authenticator
Builder client-credentials-auth - Builder for a client-credentials authenticator.
- Client
Credentials Authenticator client-credentials-auth OAuth2client-credentials authenticator for the mixi2 API.- Create
Post Request Builder - Builder for
CreatePostRequest. - Delete
Post Request Builder - Builder for
DeletePostRequest. - GetStamps
Request Builder - Builder for
GetStampsRequest. - Initiate
Post Media Upload Request Builder - Builder for
InitiatePostMediaUploadRequest. - Send
Chat Message Request Builder - Builder for
SendChatMessageRequest. - Stream
Client Builder stream - Builder for an authenticated stream watcher.
- Stream
Watcher stream - Watches the gRPC event stream and dispatches events to the provided handler.
- Webhook
Server webhook-axum - Thin Axum server wrapper for webhook delivery.
- Webhook
Service webhook-core - Verifies and dispatches incoming webhook requests.
Enums§
- Auth
Error - Errors returned by the mixi2 authentication layer.
- Client
Build Error apiorstream - Transport setup errors returned by the top-level builders.
- Dispatch
Mode webhook-core - Controls whether webhook events are processed inline or spawned onto Tokio.
- Request
Validation Error - Validation errors returned by the high-level request builders.
- Stream
Watcher Error stream - Errors returned by the streaming watcher.
- Webhook
Error webhook-core - Errors returned before a webhook request is acknowledged.
Constants§
- DEFAULT_
API_ ENDPOINT api - Official mixi2 Application API endpoint for unary SDK clients.
- DEFAULT_
STREAM_ ENDPOINT stream - Official mixi2 Application stream endpoint for event streaming clients.
- DEFAULT_
TOKEN_ URL client-credentials-auth - Official mixi2
OAuth2token endpoint for application SDK clients. - FILE_
DESCRIPTOR_ SET
Traits§
- Authenticator
- Async token provider used by the gRPC wrappers in this workspace.
- Event
Handler streamorwebhook-coreortestutil - Async handler for mixi2 events.
Type Aliases§
- BoxError
streamorwebhook-coreortestutil - Boxed error type returned by event handlers.