pub struct PatternProvider(pub Address);Expand description
The pattern_provider component.
Tuple Fields§
§0: AddressImplementations§
Source§impl PatternProvider
impl PatternProvider
Sourcepub fn set_patterns(&self, patterns: &[Pattern]) -> Result<usize>
pub fn set_patterns(&self, patterns: &[Pattern]) -> Result<usize>
Replaces every pattern. Returns how many there are.
Sourcepub async fn set_patterns_async(&self, patterns: &[Pattern]) -> Result<usize>
pub async fn set_patterns_async(&self, patterns: &[Pattern]) -> Result<usize>
Self::set_patterns without blocking; see crate::task.
Sourcepub fn add_pattern(&self, pattern: &Pattern) -> Result<i64>
pub fn add_pattern(&self, pattern: &Pattern) -> Result<i64>
Adds a pattern. Returns its index (from 1).
Sourcepub async fn add_pattern_async(&self, pattern: &Pattern) -> Result<i64>
pub async fn add_pattern_async(&self, pattern: &Pattern) -> Result<i64>
Self::add_pattern without blocking; see crate::task.
Sourcepub fn remove_pattern(&self, index: i64) -> Result<bool>
pub fn remove_pattern(&self, index: i64) -> Result<bool>
Removes the pattern at index (from 1); later ones move down. Jobs
already handed over are kept. false if there was none.
Sourcepub async fn remove_pattern_async(&self, index: i64) -> Result<bool>
pub async fn remove_pattern_async(&self, index: i64) -> Result<bool>
Self::remove_pattern without blocking; see crate::task.
Sourcepub async fn patterns_async(&self) -> Result<Vec<Pattern>>
pub async fn patterns_async(&self) -> Result<Vec<Pattern>>
Self::patterns without blocking; see crate::task.
Sourcepub async fn jobs_async(&self) -> Result<Vec<Job>>
pub async fn jobs_async(&self) -> Result<Vec<Job>>
Self::jobs without blocking; see crate::task.
Sourcepub async fn job_async(&self, id: i64) -> Result<Option<Job>>
pub async fn job_async(&self, id: i64) -> Result<Option<Job>>
Self::job without blocking; see crate::task.
Sourcepub fn push_inputs(&self, id: i64, side: Side) -> Result<bool>
pub fn push_inputs(&self, id: i64, side: Side) -> Result<bool>
Moves a job’s inputs into the inventory or tank on side of the
block. true once everything is out, which ends the job; false if
some didn’t fit (it stays held, for another try).
Sourcepub async fn push_inputs_async(&self, id: i64, side: Side) -> Result<bool>
pub async fn push_inputs_async(&self, id: i64, side: Side) -> Result<bool>
Self::push_inputs without blocking; see crate::task.
Sourcepub fn cancel_job(&self, id: i64) -> Result<bool>
pub fn cancel_job(&self, id: i64) -> Result<bool>
Gives up on a job, returning its inputs to the ME network. true if
they all went back, ending the job. AE2’s crafting job keeps waiting
for its outputs until it’s cancelled in a terminal.
Sourcepub async fn cancel_job_async(&self, id: i64) -> Result<bool>
pub async fn cancel_job_async(&self, id: i64) -> Result<bool>
Self::cancel_job without blocking; see crate::task.
Sourcepub fn is_online(&self) -> Result<bool>
pub fn is_online(&self) -> Result<bool>
Whether the block is on a powered ME network with a channel.
Sourcepub async fn is_online_async(&self) -> Result<bool>
pub async fn is_online_async(&self) -> Result<bool>
Self::is_online without blocking; see crate::task.
Trait Implementations§
Source§impl Clone for PatternProvider
impl Clone for PatternProvider
Source§impl Component for PatternProvider
impl Component for PatternProvider
Source§const KIND: &'static str = "pattern_provider"
const KIND: &'static str = "pattern_provider"
"gpu".Source§fn from_address(address: Address) -> Self
fn from_address(address: Address) -> Self
fn address(&self) -> &Address
Source§fn at(address: impl Into<Address>) -> Option<Self>
fn at(address: impl Into<Address>) -> Option<Self>
address, if it is of this type.Source§fn invoke(&self, method: &str, args: Vec<Value>) -> Result<Vec<Value>>
fn invoke(&self, method: &str, args: Vec<Value>) -> Result<Vec<Value>>
Source§fn invoke_async(&self, method: &str, args: Vec<Value>) -> Call ⓘ
fn invoke_async(&self, method: &str, args: Vec<Value>) -> Call ⓘ
Component::invoke without blocking; see invoke_async.