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

46 lines
781 B
Rust
Raw Normal View History

pub mod attrs;
pub mod ctx;
pub mod dict;
pub mod error;
pub mod 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, Fun, NativeFun, Str, StrRef, Sym, ObjCtx, Obj,
},
mem::{
ptr::{ObjRef, DynRef},
intern::Intern,
gc::Gc,
}
};
}
pub use self::{
attrs::Attrs,
ctx::ObjCtx,
dict::{Dict, DictRef},
fun::{NativeFun, Fun},
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;
}