Skip to main content

GCGatewayControllerBuilder

Struct GCGatewayControllerBuilder 

pub struct GCGatewayControllerBuilder {
    realtime_db: Option<GCArcRealtimeDatabase>,
    message_broker: GCMessageBrokerBuilder,
    plugins_path: PathBuf,
    timeseries_builder: GCTimeseriesBuilder,
    build_timeseries: bool,
    flush_interval_ms: u64,
}
Expand description

The GCGatewayControllerBuilder is a builder for the GCGatewayController Setting that cannot be changed at runtime need be set here.

Fields§

§realtime_db: Option<GCArcRealtimeDatabase>§message_broker: GCMessageBrokerBuilder§plugins_path: PathBuf§timeseries_builder: GCTimeseriesBuilder§build_timeseries: bool§flush_interval_ms: u64

Implementations§

§

impl GCGatewayControllerBuilder

pub fn new() -> Self

Initializes the gateway builder

pub fn set_plugins_path(&mut self, plugins_path: PathBuf) -> &mut Self

Set the path where the plugin manager will look for plugins, by default it uses the current directory.

pub fn set_concurrent_queue_size(&mut self, queue_size: usize) -> &mut Self

pub fn set_concurrent_threads(&mut self, sub_thread_count: u16) -> &mut Self

pub fn set_concurrent_blocking(&mut self, is_blocking: bool) -> &mut Self

pub fn set_realtime_database( &mut self, realtime_db: GCArcRealtimeDatabase, ) -> &mut Self

Set an external realtime database

pub fn register_broadcast_subscriber( &mut self, subscriber: Arc<dyn GCDatapointSubscriber>, is_concurrent: bool, ) -> &mut Self

Register a subscriber to all datapoints

pub fn set_timeseries_host( &mut self, host: impl Into<String>, port: u16, ) -> &mut Self

Set TimeSeries Database fields

pub fn set_timeseries_flush_interval(&mut self, ms: u64) -> &mut Self

Set timeseries database flush interval

pub fn set_timeseries_sender( self, sender: Box<dyn TimeseriesSender>, ) -> GCGatewayController

pub fn build_with_sender( self, sender: Box<dyn TimeseriesSender>, ) -> GCGatewayController

Build the controller with a custom timeseries sender (useful for testing).

pub fn build(self) -> GCGatewayController

Build the controller

Trait Implementations§

§

impl Default for GCGatewayControllerBuilder

§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V