pub struct ThreadBackend { /* private fields */ }Implementations§
Source§impl ThreadBackend
impl ThreadBackend
pub fn new(max_workers: usize) -> Self
pub fn max_workers(&self) -> usize
pub fn execute<F>(
&self,
_task: &AgentTask,
initial_messages: Vec<Message>,
shared_state: Metadata,
cycle_executor: F,
cancellation_token: Option<&CancellationToken>,
max_cycles: u32,
) -> AgentResultwhere
F: FnMut(u32, &mut Vec<Message>, &mut Vec<CycleRecord>, &mut Metadata, Option<&CancellationToken>) -> Option<AgentResult>,
pub fn submit<R, F>(&self, function: F) -> JoinHandle<R>
pub fn parallel_map<T, R, F>(&self, function: F, items: Vec<T>) -> Vec<R>
Trait Implementations§
Source§impl Clone for ThreadBackend
impl Clone for ThreadBackend
Source§fn clone(&self) -> ThreadBackend
fn clone(&self) -> ThreadBackend
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ThreadBackend
impl Debug for ThreadBackend
Source§impl Default for ThreadBackend
impl Default for ThreadBackend
Source§impl From<ThreadBackend> for RuntimeExecutionBackend
impl From<ThreadBackend> for RuntimeExecutionBackend
Source§fn from(backend: ThreadBackend) -> Self
fn from(backend: ThreadBackend) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ThreadBackend
impl RefUnwindSafe for ThreadBackend
impl Send for ThreadBackend
impl Sync for ThreadBackend
impl Unpin for ThreadBackend
impl UnsafeUnpin for ThreadBackend
impl UnwindSafe for ThreadBackend
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreCreates a shared type from an unshared type.