From 54413dedeb3265a02de390b37cada8ca4abbd19e Mon Sep 17 00:00:00 2001 From: Jason Paryani Date: Sun, 20 Oct 2013 22:55:41 -0700 Subject: [PATCH] Add `as_builder` method to Struct Reader --- capnp/capnp.pyx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/capnp/capnp.pyx b/capnp/capnp.pyx index d68eb5b..a830c4a 100644 --- a/capnp/capnp.pyx +++ b/capnp/capnp.pyx @@ -655,6 +655,16 @@ cdef class _DynamicStructReader: def to_dict(self): return _to_dict(self) + cpdef as_builder(self): + """A method for casting this Builder to a Reader + + Don't use this method unless you know what you're doing. + + :rtype: :class:`_DynamicStructReader` + """ + builder = _MallocMessageBuilder() + return builder.set_root(self) + cdef class _DynamicStructBuilder: """Builds Cap'n Proto structs