pub struct AimxConfig {
pub socket_path: String,
pub security_policy: SecurityPolicy,
pub max_connections: usize,
pub max_subs_per_connection: usize,
pub auth_token: Option<String>,
pub socket_permissions: Option<u32>,
}Expand description
Configuration for AimX remote access
Defines how the remote access layer behaves, including socket path, security policy and connection / subscription limits.
Fields§
§socket_path: StringPath to Unix domain socket
security_policy: SecurityPolicySecurity policy (read-only or read-write)
max_connections: usizeMaximum number of concurrent client connections accepted by the supervisor. When the in-flight connection count reaches this value, newly-accepted Unix sockets are closed immediately (the client sees a closed socket on connect).
max_subs_per_connection: usizeMaximum number of concurrent subscriptions allowed per connection.
Once a connection holds this many subscriptions, further
record.subscribe calls receive a too_many_subscriptions error
until one is released via record.unsubscribe.
auth_token: Option<String>Optional authentication token
socket_permissions: Option<u32>File permissions for the socket (Unix only) Format: octal mode (e.g., 0o600 for owner-only)
Implementations§
Source§impl AimxConfig
impl AimxConfig
Sourcepub fn uds_default() -> Self
pub fn uds_default() -> Self
Creates a default UDS configuration
§Defaults
- Socket path:
/tmp/aimdb.sock - Security policy: Read-only
- Max connections: 16
- Max subscriptions per connection: 32
- No auth token
- Socket permissions: 0o600 (owner-only)
Sourcepub fn socket_path(self, path: impl Into<String>) -> Self
pub fn socket_path(self, path: impl Into<String>) -> Self
Sets the socket path
Sourcepub fn security_policy(self, policy: SecurityPolicy) -> Self
pub fn security_policy(self, policy: SecurityPolicy) -> Self
Sets the security policy
Sourcepub fn max_connections(self, max: usize) -> Self
pub fn max_connections(self, max: usize) -> Self
Sets the maximum number of concurrent connections
Sourcepub fn max_subs_per_connection(self, max: usize) -> Self
pub fn max_subs_per_connection(self, max: usize) -> Self
Sets the maximum number of concurrent subscriptions per connection
Sourcepub fn auth_token(self, token: impl Into<String>) -> Self
pub fn auth_token(self, token: impl Into<String>) -> Self
Sets an authentication token
Sourcepub fn socket_permissions(self, mode: u32) -> Self
pub fn socket_permissions(self, mode: u32) -> Self
Sets the socket file permissions (Unix only)
§Example
let config = AimxConfig::uds_default()
.socket_permissions(0o600); // Owner only (0o660: owner + group)Trait Implementations§
Source§impl Clone for AimxConfig
impl Clone for AimxConfig
Source§fn clone(&self) -> AimxConfig
fn clone(&self) -> AimxConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more