pub struct Leash(pub Address);Expand description
The leash component (2 methods).
Provided by OpenComputers’ UpgradeLeash.
Tuple Fields§
§0: AddressImplementations§
Source§impl Leash
impl Leash
Sourcepub fn leash(&self, side: impl Into<Number>) -> Result<bool>
pub fn leash(&self, side: impl Into<Number>) -> Result<bool>
Tries to put an entity on the specified side of the device onto a leash.
Lua: leash.leash(side:number):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn leash_async(&self, side: impl Into<Number>) -> Result<bool>
pub async fn leash_async(&self, side: impl Into<Number>) -> Result<bool>
Self::leash without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn unleash(&self) -> Result<()>
pub fn unleash(&self) -> Result<()>
Unleashes all currently leashed entities.
Lua: leash.unleash()
Indirect call: waits for the next server tick.
Sourcepub async fn unleash_async(&self) -> Result<()>
pub async fn unleash_async(&self) -> Result<()>
Self::unleash 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 Leash
impl Component for Leash
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 Leash
impl StructuralPartialEq for Leash
Auto Trait Implementations§
impl Forget for Leash
impl Freeze for Leash
impl Move for Leash
impl RefUnwindSafe for Leash
impl Send for Leash
impl Sync for Leash
impl Unpin for Leash
impl UnsafeUnpin for Leash
impl UnwindSafe for Leash
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