pub struct Waypoint(pub Address);Expand description
The waypoint component (2 methods).
Provided by OpenComputers’ Waypoint.
Tuple Fields§
§0: AddressImplementations§
Source§impl Waypoint
impl Waypoint
Sourcepub fn get_label(&self) -> Result<OcString>
pub fn get_label(&self) -> Result<OcString>
Get the current label of this waypoint.
Lua: waypoint.getLabel(): string
Indirect call: waits for the next server tick.
Sourcepub async fn get_label_async(&self) -> Result<OcString>
pub async fn get_label_async(&self) -> Result<OcString>
Self::get_label without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn set_label(&self, value: impl AsRef<[u8]>) -> Result<()>
pub fn set_label(&self, value: impl AsRef<[u8]>) -> Result<()>
Set the label for this waypoint.
Lua: waypoint.setLabel(value:string)
Indirect call: waits for the next server tick.
Sourcepub async fn set_label_async(&self, value: impl AsRef<[u8]>) -> Result<()>
pub async fn set_label_async(&self, value: impl AsRef<[u8]>) -> Result<()>
Self::set_label without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Trait Implementations§
Source§impl Component for Waypoint
impl Component for Waypoint
Source§fn from_address(address: Address) -> Self
fn from_address(address: Address) -> Self
Wraps an address without checking what is there.
fn address(&self) -> &Address
Source§fn at(address: impl Into<Address>) -> Option<Self>
fn at(address: impl Into<Address>) -> Option<Self>
The component at
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>>
An untyped call, for methods the wrapper doesn’t know.
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.impl Eq for Waypoint
impl StructuralPartialEq for Waypoint
Auto Trait Implementations§
impl Forget for Waypoint
impl Freeze for Waypoint
impl Move for Waypoint
impl RefUnwindSafe for Waypoint
impl Send for Waypoint
impl Sync for Waypoint
impl Unpin for Waypoint
impl UnsafeUnpin for Waypoint
impl UnwindSafe for Waypoint
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