pub struct Worker {
pub id: WorkerId,
pub capabilities: Capabilities,
/* private fields */
}Expand description
Worker state: manages execution of plans received from a coordinator.
Fields§
§id: WorkerId§capabilities: CapabilitiesImplementations§
Source§impl Worker
impl Worker
pub fn new(id: impl Into<String>, capabilities: Capabilities) -> Self
Sourcepub fn with_cache(self, cache: Arc<dyn CacheStore>) -> Self
pub fn with_cache(self, cache: Arc<dyn CacheStore>) -> Self
Set a custom cache store (e.g. tiered or shared).
Sourcepub fn register_filter(
&mut self,
node_id: impl Into<String>,
filter: Box<dyn Filter>,
)
pub fn register_filter( &mut self, node_id: impl Into<String>, filter: Box<dyn Filter>, )
Register a filter that this worker can execute.
Sourcepub fn registration_message(&self) -> WorkerToCoordinator
pub fn registration_message(&self) -> WorkerToCoordinator
Build a registration message.
Sourcepub fn execute_plan(&mut self, plan: &SerializedPlan) -> PlanResult
pub fn execute_plan(&mut self, plan: &SerializedPlan) -> PlanResult
Execute a serialized plan.
If the plan contains serialized filter definitions, they are registered temporarily for this execution (alongside any pre-registered filters).
Sourcepub fn matches_target(&self, target: &RemoteTarget) -> bool
pub fn matches_target(&self, target: &RemoteTarget) -> bool
Check if this worker matches a remote target.
Auto Trait Implementations§
impl Freeze for Worker
impl !RefUnwindSafe for Worker
impl Send for Worker
impl Sync for Worker
impl Unpin for Worker
impl UnsafeUnpin for Worker
impl !UnwindSafe for Worker
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> 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