pub struct NodeAgent { /* private fields */ }Implementations§
Source§impl NodeAgent
impl NodeAgent
pub fn new( daemon: Arc<Daemon>, identity: impl Into<String>, model_name: impl Into<String>, ) -> NodeAgent
pub fn with_max_lanes(self, lanes: u32) -> NodeAgent
pub fn connection(&self) -> NodeAgent
Sourcepub fn with_timeouts(self, handshake: Duration, idle: Duration) -> NodeAgent
pub fn with_timeouts(self, handshake: Duration, idle: Duration) -> NodeAgent
idle is how long the head may be silent before a connection is dropped; zero keeps
every connection. Keep it well above the head’s heartbeat, 5 s.
Sourcepub fn with_tokenizer(self, digest: u64) -> NodeAgent
pub fn with_tokenizer(self, digest: u64) -> NodeAgent
Tells each head the model’s tokenizer by digest (crate::fleet::tokenizer_digest),
so one whose tokenizer differs places nothing here.
Sourcepub fn with_tokenizer_of(self, tok: Arc<dyn Tokenizer>) -> NodeAgent
pub fn with_tokenizer_of(self, tok: Arc<dyn Tokenizer>) -> NodeAgent
Serves the model’s tokenizer to a head: its digest, all it says without encoding, and the text it encodes, so a head with no copy of the model tokenizes as this node does.
Sourcepub fn with_on_control_ask(
self,
dial: impl Fn() + Send + Sync + 'static,
) -> NodeAgent
pub fn with_on_control_ask( self, dial: impl Fn() + Send + Sync + 'static, ) -> NodeAgent
For a node that dials its head: dial is called when the head asks for one connection
more, which it keeps for short calls; it may be called more than once.
pub fn with_auth(self, auth: Vec<u8>) -> NodeAgent
pub fn serve(&mut self, endpoint: Endpoint) -> Result<(), DaemonError>
Auto Trait Implementations§
impl !RefUnwindSafe for NodeAgent
impl !UnwindSafe for NodeAgent
impl Freeze for NodeAgent
impl Send for NodeAgent
impl Sync for NodeAgent
impl Unpin for NodeAgent
impl UnsafeUnpin for NodeAgent
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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