pub struct NodeManager { /* private fields */ }Expand description
Node process manager
Implementations§
Source§impl NodeManager
impl NodeManager
Sourcepub fn new(config: NodeManagerConfig) -> Result<Self>
pub fn new(config: NodeManagerConfig) -> Result<Self>
Create a new node manager
Sourcepub async fn is_running(&self) -> bool
pub async fn is_running(&self) -> bool
Check if a node is currently running
Sourcepub async fn start_node(
&self,
port: Option<u16>,
data_dir: Option<PathBuf>,
peers: Vec<String>,
foreground: bool,
) -> Result<()>
pub async fn start_node( &self, port: Option<u16>, data_dir: Option<PathBuf>, peers: Vec<String>, foreground: bool, ) -> Result<()>
Start the node process
Sourcepub async fn restart_node(&self, force: bool) -> Result<()>
pub async fn restart_node(&self, force: bool) -> Result<()>
Restart the node
Sourcepub async fn get_status(&self) -> Result<NodeStatus>
pub async fn get_status(&self) -> Result<NodeStatus>
Get node status
Sourcepub async fn generate_systemd_service(
&self,
output_path: Option<PathBuf>,
) -> Result<String>
pub async fn generate_systemd_service( &self, output_path: Option<PathBuf>, ) -> Result<String>
Generate systemd service file
Sourcepub async fn rotate_logs(&self) -> Result<()>
pub async fn rotate_logs(&self) -> Result<()>
Rotate log files if needed
Auto Trait Implementations§
impl !Freeze for NodeManager
impl !RefUnwindSafe for NodeManager
impl Send for NodeManager
impl Sync for NodeManager
impl Unpin for NodeManager
impl !UnwindSafe for NodeManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more