File tree Expand file tree Collapse file tree 1 file changed +34
-1
lines changed
Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -150,8 +150,41 @@ mod _contextvars {
150150 #[ derive( Debug , PyValue ) ]
151151 struct ContextToken { }
152152
153+ #[ derive( FromArgs ) ]
154+ struct ContextTokenOptions {
155+ #[ pyarg( positional) ]
156+ #[ allow( dead_code) ] // TODO: RUSTPYTHON
157+ context : PyObjectRef ,
158+ #[ pyarg( positional) ]
159+ #[ allow( dead_code) ] // TODO: RUSTPYTHON
160+ var : PyObjectRef ,
161+ #[ pyarg( positional) ]
162+ #[ allow( dead_code) ] // TODO: RUSTPYTHON
163+ old_value : PyObjectRef ,
164+ }
165+
153166 #[ pyimpl]
154- impl ContextToken { }
167+ impl ContextToken {
168+ #[ pymethod( magic) ]
169+ fn init ( & self , _args : ContextTokenOptions , _vm : & VirtualMachine ) -> PyResult < ( ) > {
170+ unimplemented ! ( "Token.__init__() is currently under construction" )
171+ }
172+
173+ #[ pyproperty]
174+ fn var ( & self , _vm : & VirtualMachine ) -> PyObjectRef {
175+ unimplemented ! ( "Token.var() is currently under construction" )
176+ }
177+
178+ #[ pyproperty]
179+ fn old_value ( & self , _vm : & VirtualMachine ) -> PyObjectRef {
180+ unimplemented ! ( "Token.old_value() is currently under construction" )
181+ }
182+
183+ #[ pymethod( magic) ]
184+ fn repr ( _zelf : PyRef < Self > , _vm : & VirtualMachine ) -> String {
185+ unimplemented ! ( "<Token {{}}var={{}} at {{}}>" )
186+ }
187+ }
155188
156189 #[ pyfunction]
157190 fn copy_context ( ) { }
You can’t perform that action at this time.
0 commit comments