looklook 0.9.0

Descriptive signal synthesiser.
// Copyright 2026 Gabriel Bjørnager Jensen.
//
// This file is part of LOOKLOOK.
//
// LOOKLOOK is free software: you can redistribute it and/or modify it under the
// terms of the GNU Affero General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later ver-
// sion.
//
// LOOKLOOK is distributed in the hope that it will be useful, but WITHOUT ANY WAR-
// RANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
// PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License along
// with LOOKLOOK. If not, see <https://www.gnu.org/licenses/>.

//! The [`InstructionVtable`] type.

use crate::vm::{Exception, Instruction, InstructionLen, Vm};

use std::fmt::{self, Formatter};

/// An instruction vtable.
#[derive(Debug)]
#[derive_const(Clone)]
pub(super) struct InstructionVtable {
	/// The instruction length.
	pub len: InstructionLen,

	/// The instruction executor.
	pub exec: fn(&Instruction, &mut Vm) -> Result<(), Exception>,

	/// The instruction formatter.
	pub fmt: fn(&Instruction, &mut Formatter) -> fmt::Result,
}