Draft methods for Token object

This commit is contained in:
Padraic Fanning committed 2022-01-29 20:17:37 -05:00
1 parent 667680945c
commit 307fac7802
1 file changed
+34 -1
+34 -1
View File
@@ -150,8 +150,41 @@ mod _contextvars {
#[derive(Debug, PyValue)]
struct ContextToken {}
#[derive(FromArgs)]
struct ContextTokenOptions {
#[pyarg(positional)]
#[allow(dead_code)] // TODO: RUSTPYTHON
context: PyObjectRef,
#[pyarg(positional)]
#[allow(dead_code)] // TODO: RUSTPYTHON
var: PyObjectRef,
#[pyarg(positional)]
#[allow(dead_code)] // TODO: RUSTPYTHON
old_value: PyObjectRef,
}
#[pyimpl]
impl ContextToken {}
impl ContextToken {
#[pymethod(magic)]
fn init(&self, _args: ContextTokenOptions, _vm: &VirtualMachine) -> PyResult<()> {
unimplemented!("Token.__init__() is currently under construction")
}
#[pyproperty]
fn var(&self, _vm: &VirtualMachine) -> PyObjectRef {
unimplemented!("Token.var() is currently under construction")
}
#[pyproperty]
fn old_value(&self, _vm: &VirtualMachine) -> PyObjectRef {
unimplemented!("Token.old_value() is currently under construction")
}
#[pymethod(magic)]
fn repr(_zelf: PyRef<Self>, _vm: &VirtualMachine) -> String {
unimplemented!("<Token {{}}var={{}} at {{}}>")
}
}
#[pyfunction]
fn copy_context() {}