[][src]Struct transsecs::transsecs_wrapper::TransSecsWrapper

pub struct TransSecsWrapper { /* fields omitted */ }

Wrapper around all TransSecs functions that also contains and manages the JVM

Implementations

impl TransSecsWrapper[src]

pub fn new<'a, S>(classpath: S) -> Result<TransSecsWrapper, Error> where
    S: Into<String>, 
[src]

Create a new TransSecsWrapper, using a classpath which must include the runtime jar

pub fn subscribe<'a, S, F>(&self, topic: S, callback: F) -> Result<u128, Error> where
    S: Into<String>,
    F: FnMut(String, ValueObject) + Send + 'static, 
[src]

Add a new listener to the broker. Returns the listener uuid which is necessary to unsubscribe, or an error.

pub fn unsubscribe(&self, listener_uuid: u128) -> Result<(), Error>[src]

Unsubscribe from a topic, using the listener_uuid that is returned from a subscription

pub fn start_main<S>(&self, package_name: S) -> Result<(), Error> where
    S: Into<String>, 
[src]

Start the main class for the wrapper

pub fn add_test_values_to_broker(&self) -> Result<(), Error>[src]

Add a few test values to the broker

pub fn get<S>(&self, topic: S) -> Result<ValueObject, Error> where
    S: Into<String>, 
[src]

Return the latest value associated with a topic. Will return Error::NoSuchTopic if the topic does not exist.

pub fn publish_int<S, I>(&self, topic: S, value: I) -> Result<(), Error> where
    S: Into<String>,
    I: Into<i64>, 
[src]

Publish an int to a topic. Will create the topic if it does not exist.

pub fn publish_bool<S, I>(&self, topic: S, value: I) -> Result<(), Error> where
    S: Into<String>,
    I: Into<bool>, 
[src]

Publish a bool to a topic. Will create the topic if it does not exist.

pub fn publish_string<S, I>(&self, topic: S, value: I) -> Result<(), Error> where
    S: Into<String>,
    I: Into<String>, 
[src]

Publish a string to a topic. Will create the topic if it does not exist.

pub fn publish_json<S, I>(&self, topic: S, value: I) -> Result<(), Error> where
    S: Into<String>,
    I: Into<String>, 
[src]

Publish an object in json format to a topic. Will create the topic if it does not exist.

pub fn publish_bytes<S>(&self, topic: S, value: &[u8]) -> Result<(), Error> where
    S: Into<String>, 
[src]

Publish a byte slice to a topic. Will create the topic if it does not exist.

pub fn publish_float<S, I>(&self, topic: S, value: I) -> Result<(), Error> where
    S: Into<String>,
    I: Into<f64>, 
[src]

Publish a float to a topic. Will create the topic if it does not exist.

pub fn alarm<S>(&self, alarm_name: S, set: bool) -> Result<(), Error> where
    S: Into<String>, 
[src]

Set an alarm

pub fn trigger<S>(&self, event_name: S, ceid_trigger: S) -> Result<(), Error> where
    S: Into<String>, 
[src]

Trigger an event

Trait Implementations

impl Clone for TransSecsWrapper[src]

Auto Trait Implementations

impl RefUnwindSafe for TransSecsWrapper

impl Send for TransSecsWrapper

impl Sync for TransSecsWrapper

impl Unpin for TransSecsWrapper

impl UnwindSafe for TransSecsWrapper

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> Desc<'a, T> for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.