Struct spaceapi_server::SpaceapiServerBuilder [−][src]
pub struct SpaceapiServerBuilder { /* fields omitted */ }
Expand description
Builder to create a new SpaceapiServer
instance.
Implementations
Create a new builder instance based on the provided static status data.
Specify a Redis connection string.
This can be any object that implements
redis::IntoConnectionInfo
,
e.g. a connection string:
...
.redis_connection_info("redis://127.0.0.1/")
...
Use this as an alternative to
redis_connection_info
if you want to initialize the Redis connection pool yourself, to have
full control over the connection parameters.
See
examples/with_custom_redis_pool.rs
for a real example.
Add a status modifier, that modifies the status dynamically per request.
This can be an instance of
modifiers::StateFromPeopleNowPresent
,
or your own implementation that uses the dynamic sensor data and/or
external data.
Add a new sensor.
The first argument is a api::SensorTemplate
instance containing all static data.
The second argument specifies how to get the actual sensor value from Redis.
Build a server instance.
This can fail if not all required data has been provided.
Auto Trait Implementations
impl !RefUnwindSafe for SpaceapiServerBuilder
impl Send for SpaceapiServerBuilder
impl Sync for SpaceapiServerBuilder
impl Unpin for SpaceapiServerBuilder
impl !UnwindSafe for SpaceapiServerBuilder
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn persistent_into(self) -> Arc<Mutex<T>>
pub fn persistent_into(self) -> Arc<Mutex<T>>
Convert self
into a value of type T
.
pub fn persistent_into(self) -> Arc<RwLock<T>>
pub fn persistent_into(self) -> Arc<RwLock<T>>
Convert self
into a value of type T
.
impl<T> PersistentInto<Arc<T>> for T
impl<T> PersistentInto<Arc<T>> for T
pub fn persistent_into(self) -> Arc<T>
pub fn persistent_into(self) -> Arc<T>
Convert self
into a value of type T
.
pub fn persistent_into(self) -> T
pub fn persistent_into(self) -> T
Convert self
into a value of type T
.