pub struct NodeBuilder { /* private fields */ }Expand description
Configurable Node construction. See module docs.
All fields are immutable after construction. Each with_* setter
returns a fresh Arc<NodeBuilder> that shares ownership of any
previously-installed modifiers via Arc<dyn …>. No interior
mutability, no locks — the builder is a value, not a state
machine.
Implementations§
Source§impl NodeBuilder
impl NodeBuilder
Sourcepub fn new(config: &Config) -> Arc<Self>
pub fn new(config: &Config) -> Arc<Self>
Create a builder for a Node with config. No I/O happens
until you call connect / register / recover /
register_or_recover.
Sourcepub fn with_event_listener(
self: Arc<Self>,
listener: Box<dyn NodeEventListener>,
) -> Arc<Self>
pub fn with_event_listener( self: Arc<Self>, listener: Box<dyn NodeEventListener>, ) -> Arc<Self>
Install a node event listener. Events fire from the moment the
gRPC stream is established by the build call (register /
recover / connect / …), so attach the listener via the
builder rather than after the fact to capture events from the
very first moment.
Returns a new builder that shares the rest of the configuration. Build calls on the returned builder will install the listener; the original builder is unchanged.
Sourcepub fn register(
&self,
mnemonic: String,
invite_code: Option<String>,
) -> Result<Arc<Node>, Error>
pub fn register( &self, mnemonic: String, invite_code: Option<String>, ) -> Result<Arc<Node>, Error>
Register a new Greenlight node and return a connected Node with the SDK signer running and any configured modifiers applied.
mnemonic is required — registration drives the signer to
sign the registration challenge, so the SDK must hold the
seed for this call.
Sourcepub fn recover(&self, mnemonic: String) -> Result<Arc<Node>, Error>
pub fn recover(&self, mnemonic: String) -> Result<Arc<Node>, Error>
Recover credentials for an existing node and return a connected Node with any configured modifiers applied.
mnemonic is required — recovery drives the signer to
authenticate.
Sourcepub fn connect(
&self,
credentials: Vec<u8>,
mnemonic: Option<String>,
) -> Result<Arc<Node>, Error>
pub fn connect( &self, credentials: Vec<u8>, mnemonic: Option<String>, ) -> Result<Arc<Node>, Error>
Connect to an existing node using saved credentials and return a connected Node with any configured modifiers applied.
If mnemonic is Some(...), the SDK spawns a signer for the
connected Node. If None, the Node is signerless and signing
happens elsewhere (paired device, CLN node’s local signer,
hardware signer).
Trait Implementations§
Source§impl<UT> LiftRef<UT> for NodeBuilder
impl<UT> LiftRef<UT> for NodeBuilder
type LiftType = Arc<NodeBuilder>
Source§impl<UT> LowerError<UT> for NodeBuilder
impl<UT> LowerError<UT> for NodeBuilder
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for NodeBuilder
impl<UT> LowerReturn<UT> for NodeBuilder
Source§type ReturnType = <Arc<NodeBuilder> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<NodeBuilder> as LowerReturn<UniFfiTag>>::ReturnType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
Source§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl<UT> TypeId<UT> for NodeBuilder
impl<UT> TypeId<UT> for NodeBuilder
Auto Trait Implementations§
impl Freeze for NodeBuilder
impl !RefUnwindSafe for NodeBuilder
impl Send for NodeBuilder
impl Sync for NodeBuilder
impl Unpin for NodeBuilder
impl UnsafeUnpin for NodeBuilder
impl !UnwindSafe for NodeBuilder
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> 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
Source§impl<T> Downcast for T
impl<T> Downcast for T
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request