pub struct ControllerBuilder { /* private fields */ }Expand description
A builder for creating a Controller instance.
Implementations§
Source§impl ControllerBuilder
impl ControllerBuilder
Sourcepub const fn default_parallel_threshold(&self) -> usize
pub const fn default_parallel_threshold(&self) -> usize
The default parallel threshold when no threshold is specified for the [Datagram] to be sent. The default value is 4.
Sourcepub const fn default_timeout(&self) -> Duration
pub const fn default_timeout(&self) -> Duration
The default timeout when no timeout is specified for the [Datagram] to be sent. The default value is 20ms.
Sourcepub const fn send_interval(&self) -> Duration
pub const fn send_interval(&self) -> Duration
The duration between sending operations. The default value is 1ms.
Sourcepub const fn receive_interval(&self) -> Duration
pub const fn receive_interval(&self) -> Duration
The duration between receiving operations. The default value is 1ms.
Sourcepub const fn timer_strategy(&self) -> &TimerStrategy
pub const fn timer_strategy(&self) -> &TimerStrategy
The strategy used for timing operations. The default value is TimerStrategy::Spin with the default SpinSleeper.
Source§impl ControllerBuilder
impl ControllerBuilder
Sourcepub const fn with_default_parallel_threshold(
self,
default_parallel_threshold: usize,
) -> Self
pub const fn with_default_parallel_threshold( self, default_parallel_threshold: usize, ) -> Self
Set the default_parallel_threshold field.
Sourcepub const fn with_default_timeout(self, default_timeout: Duration) -> Self
pub const fn with_default_timeout(self, default_timeout: Duration) -> Self
Set the default_timeout field.
Sourcepub const fn with_send_interval(self, send_interval: Duration) -> Self
pub const fn with_send_interval(self, send_interval: Duration) -> Self
Set the send_interval field.
Sourcepub const fn with_receive_interval(self, receive_interval: Duration) -> Self
pub const fn with_receive_interval(self, receive_interval: Duration) -> Self
Set the receive_interval field.
Sourcepub const fn with_timer_strategy(self, timer_strategy: TimerStrategy) -> Self
pub const fn with_timer_strategy(self, timer_strategy: TimerStrategy) -> Self
Set the timer_strategy field.
Source§impl ControllerBuilder
impl ControllerBuilder
Sourcepub fn open<B: LinkBuilder>(
self,
link_builder: B,
) -> Result<Controller<B::L>, AUTDError>
pub fn open<B: LinkBuilder>( self, link_builder: B, ) -> Result<Controller<B::L>, AUTDError>
Equivalent to Self::open_with_timeout with a timeout of DEFAULT_TIMEOUT.
Sourcepub fn open_with_timeout<B: LinkBuilder>(
self,
link_builder: B,
timeout: Duration,
) -> Result<Controller<B::L>, AUTDError>
pub fn open_with_timeout<B: LinkBuilder>( self, link_builder: B, timeout: Duration, ) -> Result<Controller<B::L>, AUTDError>
Opens a controller with a timeout.
Opens link, and then initialize and synchronize the devices. The timeout is used to send data for initialization and synchronization.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ControllerBuilder
impl RefUnwindSafe for ControllerBuilder
impl Send for ControllerBuilder
impl Sync for ControllerBuilder
impl Unpin for ControllerBuilder
impl UnwindSafe for ControllerBuilder
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.