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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Convert self into a value of type T.

Convert self into a value of type T.

Convert self into a value of type T.

Convert self into a value of type T.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Get the TypeId of this object.