Skip to main content

Crate slim_service

Crate slim_service 

Source
Expand description

SLIM Service - Main service and public API to interact with SLIM data plane.

This crate provides the core service functionality for SLIM, including:

  • Service: Main service component that manages message processing and connections
  • App: Application-level API for session management and messaging

For language bindings (Go, Python, etc.), see the slim_bindings crate.

§Basic Usage

use slim_service::Service;
use slim_config::component::ComponentBuilder;
use slim_auth::shared_secret::SharedSecret;
use slim_datapath::api::ProtoName;

// Create service instance (handles message processing)
let service = Service::builder().build("svc-0".to_string()).expect("Failed to create service");

// Create authentication components
let secret = "test-shared-secret-value-0123456789abcdef";
let provider = SharedSecret::new("myapp", secret).unwrap();
let verifier = SharedSecret::new("myapp", secret).unwrap();

// Create an app for messaging
let app_name = ProtoName::from_strings(["org", "ns", "app"]);
let (app, rx) = service.create_app(&app_name, provider, verifier).expect("Failed to create app");

Re-exports§

pub use errors::ServiceError;
pub use service::ServiceBuilder;
pub use service::KIND;
pub use service::Service;
pub use service::ServiceConfiguration;

Modules§

app
errors
service

Structs§

SlimHeaderFlags
Struct grouping the SLIM header flags for convenience.

Enums§

SubscriptionAckError