pub struct FuelService {
    pub shared: SharedState,
    pub bound_address: SocketAddr,
    /* private fields */
}

Fields§

§shared: SharedState

The shared state of the service

§bound_address: SocketAddr

The address bound by the system for serving the API

Implementations§

source§

impl FuelService

source

pub fn new(database: Database, config: Config) -> Result<Self>

Creates a FuelService instance from service config

source

pub async fn new_node(config: Config) -> Result<Self>

Creates and starts fuel node instance from service config

source

pub async fn from_database(database: Database, config: Config) -> Result<Self>

Creates and starts fuel node instance from service config and a pre-existing database

Trait Implementations§

source§

impl Service for FuelService

source§

fn start(&self) -> Result<()>

Send a start signal to the service without waiting for it to start. Returns an error if the service was already started.
source§

fn start_and_await<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<State>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Send a start signal to the service and wait for it to start up. Returns an error if the service was already started.
source§

fn await_start_or_stop<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<State>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Wait for service to start or stop (without sending any signal).
source§

fn stop(&self) -> bool

Send a stop signal to the service without waiting for it to shutdown. Returns false if the service was already stopped, true if it is running.
source§

fn stop_and_await<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<State>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Send stop signal to service and wait for it to shutdown.
source§

fn await_stop<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<State>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Wait for service to stop (without sending a stop signal).
source§

fn state(&self) -> State

The current state of the service (i.e. Started, Stopped, etc..)
source§

fn state_watcher(&self) -> StateWatcher

Returns the state watcher of the service.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T> StorageAsMut for T

§

fn storage<Type>(&mut self) -> StorageMut<'_, Self, Type>where Type: Mappable,

§

fn storage_as_mut<Type>(&mut self) -> StorageMut<'_, Self, Type>where Type: Mappable,

§

impl<T> StorageAsRef for T

§

fn storage<Type>(&self) -> StorageRef<'_, Self, Type>where Type: Mappable,

§

fn storage_as_ref<Type>(&self) -> StorageRef<'_, Self, Type>where Type: Mappable,

source§

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

§

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 Twhere U: TryFrom<T>,

§

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 Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more