use dolang::runtime::{
Args, Error, Object, Result, Slot, Strand, Type, object::TypeBuilder, unpack,
};
pub struct Geometry;
impl<'v> Object<'v> for Geometry {
const NAME: &'v str = "Geometry";
const MODULE: &'v str = "term";
type Annex = ();
type Type = ();
type TypeAnnex = ();
async fn new<'a, 's>(
this: Type<'v, Self>,
strand: &'a mut Strand<'v, 's>,
args: Args<'v, 'a>,
out: Slot<'v, 'a>,
) -> Result<'v, 's, ()> {
let ([], []) = unpack!(strand, args, 0, 0)?;
this.create(strand, Geometry, out);
Ok(())
}
fn build<'a>(builder: TypeBuilder<'v, 'a, Self>) -> TypeBuilder<'v, 'a, Self> {
builder
.get("rows", |_this, strand, _out| {
Err(Error::not_supported(strand))
})
.get("cols", |_this, strand, _out| {
Err(Error::not_supported(strand))
})
}
}