Trait sn0int::engine::ctx::State

source ·
pub trait State {
Show 40 methods // Required methods fn clear_error(&self); fn last_error(&self) -> Option<String>; fn set_error(&self, err: Error) -> Error; fn send(&self, msg: &Event); fn recv(&self) -> Result<Value>; fn verbose(&self) -> u8; fn keyring(&self, namespace: &str) -> Vec<&KeyRingEntry>; fn dns_config(&self) -> &Resolver; fn proxy(&self) -> Option<&SocketAddr>; fn getopt(&self, key: &str) -> Option<&String>; fn psl(&self) -> Result<Arc<Psl>>; fn geoip(&self) -> Result<Arc<GeoIP>>; fn asn(&self) -> Result<Arc<AsnDB>>; fn sock_connect( &self, host: &str, port: u16, options: &SocketOptions ) -> Result<String>; fn get_sock(&self, id: &str) -> Arc<Mutex<Socket>>; fn sock_upgrade_tls( &self, id: &str, options: &SocketOptions ) -> Result<TlsData>; fn ws_connect(&self, url: Url, options: &WebSocketOptions) -> Result<String>; fn get_ws(&self, id: &str) -> Arc<Mutex<WebSocket>>; fn mqtt_connect(&self, url: Url, options: &MqttOptions) -> Result<String>; fn get_mqtt(&self, id: &str) -> Arc<Mutex<MqttClient>>; fn http_mksession(&self) -> String; fn http_request( &self, session_id: &str, method: String, url: String, options: RequestOptions ) -> HttpRequest; fn get_blob(&self, id: &str) -> Result<Arc<Blob>>; // Provided methods fn info(&self, msg: String) { ... } fn debug(&self, msg: String) { ... } fn error(&self, msg: String) { ... } fn warn(&self, msg: String) { ... } fn warn_once(&self, msg: String) { ... } fn status(&self, msg: String) { ... } fn db_recv(&self) -> Result<DatabaseResponse> { ... } fn db_insert(&self, object: Insert) -> Result<DatabaseResponse> { ... } fn db_insert_ttl( &self, object: Insert, ttl: i32 ) -> Result<DatabaseResponse> { ... } fn db_activity(&self, activity: InsertActivity) -> Result<bool> { ... } fn db_select( &self, family: Family, value: String ) -> Result<DatabaseResponse> { ... } fn db_update( &self, family: Family, value: String, update: Update ) -> Result<DatabaseResponse> { ... } fn stdin_read_line(&self) -> Result<Option<String>> { ... } fn stdin_read_to_end(&self) -> Result<Option<String>> { ... } fn ratelimit(&self, key: String, passes: u32, time: u32) -> Result<()> { ... } fn random_id(&self) -> String { ... } fn persist_blob(&self, id: &str) -> Result<()> { ... }
}

Required Methods§

source

fn clear_error(&self)

source

fn last_error(&self) -> Option<String>

source

fn set_error(&self, err: Error) -> Error

source

fn send(&self, msg: &Event)

source

fn recv(&self) -> Result<Value>

source

fn verbose(&self) -> u8

source

fn keyring(&self, namespace: &str) -> Vec<&KeyRingEntry>

source

fn dns_config(&self) -> &Resolver

source

fn proxy(&self) -> Option<&SocketAddr>

source

fn getopt(&self, key: &str) -> Option<&String>

source

fn psl(&self) -> Result<Arc<Psl>>

source

fn geoip(&self) -> Result<Arc<GeoIP>>

source

fn asn(&self) -> Result<Arc<AsnDB>>

source

fn sock_connect( &self, host: &str, port: u16, options: &SocketOptions ) -> Result<String>

source

fn get_sock(&self, id: &str) -> Arc<Mutex<Socket>>

source

fn sock_upgrade_tls(&self, id: &str, options: &SocketOptions) -> Result<TlsData>

source

fn ws_connect(&self, url: Url, options: &WebSocketOptions) -> Result<String>

source

fn get_ws(&self, id: &str) -> Arc<Mutex<WebSocket>>

source

fn mqtt_connect(&self, url: Url, options: &MqttOptions) -> Result<String>

source

fn get_mqtt(&self, id: &str) -> Arc<Mutex<MqttClient>>

source

fn http_mksession(&self) -> String

source

fn http_request( &self, session_id: &str, method: String, url: String, options: RequestOptions ) -> HttpRequest

source

fn get_blob(&self, id: &str) -> Result<Arc<Blob>>

Provided Methods§

source

fn info(&self, msg: String)

source

fn debug(&self, msg: String)

source

fn error(&self, msg: String)

source

fn warn(&self, msg: String)

source

fn warn_once(&self, msg: String)

source

fn status(&self, msg: String)

source

fn db_recv(&self) -> Result<DatabaseResponse>

source

fn db_insert(&self, object: Insert) -> Result<DatabaseResponse>

source

fn db_insert_ttl(&self, object: Insert, ttl: i32) -> Result<DatabaseResponse>

source

fn db_activity(&self, activity: InsertActivity) -> Result<bool>

source

fn db_select(&self, family: Family, value: String) -> Result<DatabaseResponse>

source

fn db_update( &self, family: Family, value: String, update: Update ) -> Result<DatabaseResponse>

source

fn stdin_read_line(&self) -> Result<Option<String>>

source

fn stdin_read_to_end(&self) -> Result<Option<String>>

source

fn ratelimit(&self, key: String, passes: u32, time: u32) -> Result<()>

source

fn random_id(&self) -> String

source

fn persist_blob(&self, id: &str) -> Result<()>

Implementors§