This repository has been archived on 2020-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
Files
not-python-old.2020-08-27/src/obj/mod.rs

45 lines
747 B
Rust
Raw Normal View History

pub mod attrs;
pub mod ctx;
pub mod dict;
pub mod error;
//pub mod native_fun;
//pub mod num;
pub mod str;
pub mod sym {
pub type Sym = usize;
}
//pub mod ty;
pub mod prelude {
pub use crate::{
obj::{
Attrs, Dict, DictRef, Str, StrRef, Sym, ObjCtx, Obj,
},
mem::{
ptr::{ObjRef, DynRef},
intern::Intern,
gc::Gc,
}
};
}
pub use self::{
attrs::Attrs,
dict::{Dict, DictRef},
ctx::ObjCtx,
str::{Str, StrRef},
sym::Sym,
};
use crate::mem::ptr::ObjRef;
use std::any::Any;
pub trait Obj {
fn attrs(&self) -> ObjRef<Attrs>;
fn is_marked(&self) -> bool;
fn mark(&self);
fn unmark(&self);
fn as_any(&self) -> &dyn Any;
}