Skip to main content

Hologram

Struct Hologram 

Source
pub struct Hologram(pub Address);
Expand description

The hologram component (16 methods).

Provided by OpenComputers’ Hologram.

Tuple Fields§

§0: Address

Implementations§

Source§

impl Hologram

Source

pub fn clear(&self) -> Result<()>

Clears the hologram.

Lua: hologram.clear() Indirect call: waits for the next server tick.

Source

pub async fn clear_async(&self) -> Result<()>

Self::clear without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn copy( &self, x: impl Into<Number>, z: impl Into<Number>, sx: impl Into<Number>, sz: impl Into<Number>, tx: impl Into<Number>, tz: impl Into<Number>, ) -> Result<()>

Copies an area of columns by the specified translation.

Lua: hologram.copy(x:number, z:number, sx:number, sz:number, tx:number, tz:number) Indirect call: waits for the next server tick.

Source

pub async fn copy_async( &self, x: impl Into<Number>, z: impl Into<Number>, sx: impl Into<Number>, sz: impl Into<Number>, tx: impl Into<Number>, tz: impl Into<Number>, ) -> Result<()>

Self::copy without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn fill( &self, x: impl Into<Number>, z: impl Into<Number>, min_y: Option<Number>, max_y: Option<Number>, value: Option<Value>, ) -> Result<()>

Fills an interval of a column with the specified value.

Lua: hologram.fill(x:number, z:number[, minY:number], maxY:number, value:number or boolean) Direct call (runs immediately, drawing on the per-tick budget; OC’s limit 128).

Source

pub async fn fill_async( &self, x: impl Into<Number>, z: impl Into<Number>, min_y: Option<Number>, max_y: Option<Number>, value: Option<Value>, ) -> Result<()>

Self::fill without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get( &self, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, ) -> Result<Number>

Returns the value for the specified voxel.

Lua: hologram.get(x:number, y:number, z:number):number Direct call (runs immediately, drawing on the per-tick budget).

Source

pub async fn get_async( &self, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, ) -> Result<Number>

Self::get without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_dimensions(&self) -> Result<(Number, Number, Number)>

Get the dimension of the x,y,z axes.

Lua: hologram.getDimensions():number, number, number Direct call (runs immediately, drawing on the per-tick budget).

Source

pub async fn get_dimensions_async(&self) -> Result<(Number, Number, Number)>

Self::get_dimensions without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_palette_color(&self, index: impl Into<Number>) -> Result<Number>

Get the color defined for the specified value.

Lua: hologram.getPaletteColor(index:number):number Indirect call: waits for the next server tick.

Source

pub async fn get_palette_color_async( &self, index: impl Into<Number>, ) -> Result<Number>

Self::get_palette_color without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_scale(&self) -> Result<Number>

Returns the render scale of the hologram.

Lua: hologram.getScale():number Direct call (runs immediately, drawing on the per-tick budget).

Source

pub async fn get_scale_async(&self) -> Result<Number>

Self::get_scale without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_translation(&self) -> Result<(Number, Number, Number)>

Returns the relative render projection offsets of the hologram.

Lua: hologram.getTranslation():number, number, number Direct call (runs immediately, drawing on the per-tick budget).

Source

pub async fn get_translation_async(&self) -> Result<(Number, Number, Number)>

Self::get_translation without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn max_depth(&self) -> Result<Number>

The color depth supported by the hologram.

Lua: hologram.maxDepth():number Direct call (runs immediately, drawing on the per-tick budget).

Source

pub async fn max_depth_async(&self) -> Result<Number>

Self::max_depth without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn set( &self, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, value: impl Into<Value>, ) -> Result<()>

Set the value for the specified voxel.

Lua: hologram.set(x:number, y:number, z:number, value:number or boolean) Direct call (runs immediately, drawing on the per-tick budget; OC’s limit 256).

Source

pub async fn set_async( &self, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, value: impl Into<Value>, ) -> Result<()>

Self::set without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn set_palette_color( &self, index: impl Into<Number>, value: impl Into<Number>, ) -> Result<Number>

Set the color defined for the specified value.

Lua: hologram.setPaletteColor(index:number, value:number):number Indirect call: waits for the next server tick.

Source

pub async fn set_palette_color_async( &self, index: impl Into<Number>, value: impl Into<Number>, ) -> Result<Number>

Self::set_palette_color without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn set_raw(&self, data: impl AsRef<[u8]>) -> Result<()>

Set the raw buffer to the specified byte array, where each byte represents a voxel color. Nesting is x,z,y.

Lua: hologram.setRaw(data:string) Indirect call: waits for the next server tick.

Source

pub async fn set_raw_async(&self, data: impl AsRef<[u8]>) -> Result<()>

Self::set_raw without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn set_rotation( &self, angle: impl Into<Number>, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, ) -> Result<bool>

Set the base rotation of the displayed hologram.

Lua: hologram.setRotation(angle:number, x:number, y:number, z:number):boolean Indirect call: waits for the next server tick.

Source

pub async fn set_rotation_async( &self, angle: impl Into<Number>, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, ) -> Result<bool>

Self::set_rotation without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn set_rotation_speed( &self, speed: impl Into<Number>, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, ) -> Result<bool>

Set the rotation speed of the displayed hologram.

Lua: hologram.setRotationSpeed(speed:number, x:number, y:number, z:number):boolean Indirect call: waits for the next server tick.

Source

pub async fn set_rotation_speed_async( &self, speed: impl Into<Number>, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, ) -> Result<bool>

Self::set_rotation_speed without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn set_scale(&self, value: impl Into<Number>) -> Result<()>

Set the render scale. A larger scale consumes more energy.

Lua: hologram.setScale(value:number) Indirect call: waits for the next server tick.

Source

pub async fn set_scale_async(&self, value: impl Into<Number>) -> Result<()>

Self::set_scale without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn set_translation( &self, tx: impl Into<Number>, ty: impl Into<Number>, tz: impl Into<Number>, ) -> Result<()>

Sets the relative render projection offsets of the hologram.

Lua: hologram.setTranslation(tx:number, ty:number, tz:number) Indirect call: waits for the next server tick.

Source

pub async fn set_translation_async( &self, tx: impl Into<Number>, ty: impl Into<Number>, tz: impl Into<Number>, ) -> Result<()>

Self::set_translation without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Trait Implementations§

Source§

impl Clone for Hologram

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Component for Hologram

Source§

const KIND: &'static str = "hologram"

The OpenComputers component type, such as "gpu".
Source§

fn from_address(address: Address) -> Self

Wraps an address without checking what is there.
Source§

fn address(&self) -> &Address

Source§

fn first() -> Option<Self>

The first component of this type, by address order.
Source§

fn all() -> Vec<Self>

Every component of this type, by address order.
Source§

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>>

An untyped call, for methods the wrapper doesn’t know.
Source§

fn invoke_async(&self, method: &str, args: Vec<Value>) -> Call ⓘ

Component::invoke without blocking; see invoke_async.
Source§

impl Debug for Hologram

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Hologram

Source§

impl Hash for Hologram

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Hologram

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Hologram

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.