pub struct Service {
    pub filter: BoxedFilter<(Response<Vec<u8>>,)>,
    /* private fields */
}
Expand description

This structure represents a hardware service.

Specifically the functionality provided by this struct exists to provide a GraphQL interface over UDP, a means of exposing a subsystem to GraphQL queries and means for persistence throughout GraphQL queries.

Examples

Creating and starting a service.

use kubos_service::Service;

let sub = model::Subsystem::new();
Service::new(
    "example-service",
    sub,
    schema::QueryRoot,
    schema::MutationRoot,
).start();

Fields

filter: BoxedFilter<(Response<Vec<u8>>,)>

Implementations

Creates a new service instance

Arguments

name - The name of the service. This is used to find the appropriate config information subsystem - An instance of the subsystem struct. This one instance will be used by all queries. query - The root query struct holding all other GraphQL queries. mutation - The root mutation struct holding all other GraphQL mutations.

Starts the service’s GraphQL/UDP server. This function runs without return.

Panics

The UDP interface will panic if the ip address and port provided cannot be bound (like if they are already in use), or if for some reason the socket fails to receive a message.

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

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

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.