[−][src]Struct kubos_service::Service
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>>,)>
Methods
impl Service
[src]
[−]
impl Service
pub fn new<Query, Mutation, S>(
config: Config,
subsystem: S,
query: Query,
mutation: Mutation
) -> Self where
Query: GraphQLType<Context = Context<S>, TypeInfo = ()> + Send + Sync + 'static,
Mutation: GraphQLType<Context = Context<S>, TypeInfo = ()> + Send + Sync + 'static,
S: Send + Sync + Clone + 'static,
[src]
[−]
pub fn new<Query, Mutation, S>(
config: Config,
subsystem: S,
query: Query,
mutation: Mutation
) -> Self where
Query: GraphQLType<Context = Context<S>, TypeInfo = ()> + Send + Sync + 'static,
Mutation: GraphQLType<Context = Context<S>, TypeInfo = ()> + Send + Sync + 'static,
S: Send + Sync + Clone + 'static,
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.
pub fn start(self)
[src]
[−]
pub fn start(self)
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
impl<T, U> Into for T where
U: From<T>,
[src]
[−]
impl<T, U> Into for T where
U: From<T>,
impl<T> From for T
[src]
[−]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
[−]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
[−]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
[−]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
[−]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
[−]
fn get_type_id(&self) -> TypeId
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
[−]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
[−]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
[−]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
[−]
fn borrow_mut(&mut self) -> &mut T
impl<T> Erased for T
impl<T> Erased for T
impl<T> Same for T
impl<T> Same for T
type Output = T
Should always be Self