Struct fuel_core::service::FuelService
source · pub struct FuelService {
pub shared: SharedState,
pub bound_address: SocketAddr,
/* private fields */
}
Fields§
The shared state of the service
bound_address: SocketAddr
The address bound by the system for serving the API
Implementations§
source§impl FuelService
impl FuelService
sourcepub fn new(database: Database, config: Config) -> Result<Self>
pub fn new(database: Database, config: Config) -> Result<Self>
Creates a FuelService
instance from service config
sourcepub async fn new_node(config: Config) -> Result<Self>
pub async fn new_node(config: Config) -> Result<Self>
Creates and starts fuel node instance from service config
sourcepub async fn from_database(database: Database, config: Config) -> Result<Self>
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
impl Service for FuelService
source§fn start(&self) -> Result<()>
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,
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,
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
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,
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,
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_watcher(&self) -> StateWatcher
fn state_watcher(&self) -> StateWatcher
Returns the state watcher of the service.
Auto Trait Implementations§
impl !RefUnwindSafe for FuelService
impl Send for FuelService
impl Sync for FuelService
impl Unpin for FuelService
impl !UnwindSafe for FuelService
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more