pub struct JobBuilder<TKey, TMsg, ___State = (Unset<Required>, Unset<Required>, Unset<Optional>, Unset<Optional>)>{ /* private fields */ }Expand description
Use builder syntax to set the required parameters and finish by calling the method Self::build().
Implementations§
Source§impl<TKey, TMsg, __Key, __Msg, __Options, __Accepted> JobBuilder<TKey, TMsg, (__Key, __Msg, __Options, __Accepted)>
impl<TKey, TMsg, __Key, __Msg, __Options, __Accepted> JobBuilder<TKey, TMsg, (__Key, __Msg, __Options, __Accepted)>
Sourcepub fn build(self) -> Job<TKey, TMsg>where
__Key: IntoSet<TKey, JobBuilder__key>,
__Msg: IntoSet<TMsg, JobBuilder__msg>,
__Options: IntoSet<Option<JobOptions>, JobBuilder__options>,
__Accepted: IntoSet<Option<RpcReplyPort<Option<Job<TKey, TMsg>>>>, JobBuilder__accepted>,
pub fn build(self) -> Job<TKey, TMsg>where
__Key: IntoSet<TKey, JobBuilder__key>,
__Msg: IntoSet<TMsg, JobBuilder__msg>,
__Options: IntoSet<Option<JobOptions>, JobBuilder__options>,
__Accepted: IntoSet<Option<RpcReplyPort<Option<Job<TKey, TMsg>>>>, JobBuilder__accepted>,
Finishes building and returns the requested object.
Sourcepub fn key(
self,
value: TKey,
) -> JobBuilder<TKey, TMsg, (Set<TKey>, __Msg, __Options, __Accepted)>where
__Key: IsUnset,
pub fn key(
self,
value: TKey,
) -> JobBuilder<TKey, TMsg, (Set<TKey>, __Msg, __Options, __Accepted)>where
__Key: IsUnset,
The key of the job
Sourcepub fn msg(
self,
value: TMsg,
) -> JobBuilder<TKey, TMsg, (__Key, Set<TMsg>, __Options, __Accepted)>where
__Msg: IsUnset,
pub fn msg(
self,
value: TMsg,
) -> JobBuilder<TKey, TMsg, (__Key, Set<TMsg>, __Options, __Accepted)>where
__Msg: IsUnset,
The message of the job
Sourcepub fn maybe_options(
self,
value: Option<JobOptions>,
) -> JobBuilder<TKey, TMsg, (__Key, __Msg, Set<Option<JobOptions>>, __Accepted)>where
__Options: IsUnset,
pub fn maybe_options(
self,
value: Option<JobOptions>,
) -> JobBuilder<TKey, TMsg, (__Key, __Msg, Set<Option<JobOptions>>, __Accepted)>where
__Options: IsUnset,
Same as Self::options, but accepts an Option as input. See that method’s documentation for more details.
Sourcepub fn options(
self,
value: JobOptions,
) -> JobBuilder<TKey, TMsg, (__Key, __Msg, Set<Option<JobOptions>>, __Accepted)>where
__Options: IsUnset,
pub fn options(
self,
value: JobOptions,
) -> JobBuilder<TKey, TMsg, (__Key, __Msg, Set<Option<JobOptions>>, __Accepted)>where
__Options: IsUnset,
The job’s options, mainly related to timing information of the job
Default = JobOptions::default()
Sourcepub fn maybe_accepted(
self,
value: Option<RpcReplyPort<Option<Job<TKey, TMsg>>>>,
) -> JobBuilder<TKey, TMsg, (__Key, __Msg, __Options, Set<Option<RpcReplyPort<Option<Job<TKey, TMsg>>>>>)>where
__Accepted: IsUnset,
pub fn maybe_accepted(
self,
value: Option<RpcReplyPort<Option<Job<TKey, TMsg>>>>,
) -> JobBuilder<TKey, TMsg, (__Key, __Msg, __Options, Set<Option<RpcReplyPort<Option<Job<TKey, TMsg>>>>>)>where
__Accepted: IsUnset,
Same as Self::accepted, but accepts an Option as input. See that method’s documentation for more details.
Sourcepub fn accepted(
self,
value: RpcReplyPort<Option<Job<TKey, TMsg>>>,
) -> JobBuilder<TKey, TMsg, (__Key, __Msg, __Options, Set<Option<RpcReplyPort<Option<Job<TKey, TMsg>>>>>)>where
__Accepted: IsUnset,
pub fn accepted(
self,
value: RpcReplyPort<Option<Job<TKey, TMsg>>>,
) -> JobBuilder<TKey, TMsg, (__Key, __Msg, __Options, Set<Option<RpcReplyPort<Option<Job<TKey, TMsg>>>>>)>where
__Accepted: IsUnset,
If provided, this channel can be used to block pushes into the factory until the factory can “accept” the message into its internal processing. This can be used to synchronize external threadpools to the Tokio processing pool and prevent overloading the unbounded channel which fronts all actors.
The reply channel return None if the job was accepted, or
[Some(Job)] if it was rejected & loadshed, and then the
job may be retried by the caller at a later time (if desired).
Default = None
Auto Trait Implementations§
impl<TKey, TMsg, ___State> Freeze for JobBuilder<TKey, TMsg, ___State>where
___State: Freeze,
impl<TKey, TMsg, ___State = (Unset<Required>, Unset<Required>, Unset<Optional>, Unset<Optional>)> !RefUnwindSafe for JobBuilder<TKey, TMsg, ___State>
impl<TKey, TMsg, ___State> Send for JobBuilder<TKey, TMsg, ___State>where
___State: Send,
impl<TKey, TMsg, ___State> Sync for JobBuilder<TKey, TMsg, ___State>
impl<TKey, TMsg, ___State> Unpin for JobBuilder<TKey, TMsg, ___State>
impl<TKey, TMsg, ___State> UnsafeUnpin for JobBuilder<TKey, TMsg, ___State>where
___State: UnsafeUnpin,
impl<TKey, TMsg, ___State = (Unset<Required>, Unset<Required>, Unset<Optional>, Unset<Optional>)> !UnwindSafe for JobBuilder<TKey, TMsg, ___State>
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
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 more