<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/arti.git/crates/tor-rpcbase/src/obj.rs, branch arti-v1.1.13</title>
<subtitle>mirror of https://gitlab.torproject.org/tpo/core/arti
</subtitle>
<id>http://git.dilluti0n.com/mirrors/arti.git/atom?h=arti-v1.1.13</id>
<link rel='self' href='http://git.dilluti0n.com/mirrors/arti.git/atom?h=arti-v1.1.13'/>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/'/>
<updated>2023-08-23T09:34:00Z</updated>
<entry>
<title>Run maint/add_warning to add lint block everywhere</title>
<updated>2023-08-23T09:34:00Z</updated>
<author>
<name>Ian Jackson</name>
<email>ijackson@chiark.greenend.org.uk</email>
</author>
<published>2023-08-22T14:28:12Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=42df88d6bf6dbb460d2e5e1cd4838aafaffbe9ac'/>
<id>urn:sha1:42df88d6bf6dbb460d2e5e1cd4838aafaffbe9ac</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Run maint/add_warning to actually apply new lint allows</title>
<updated>2023-07-10T12:49:51Z</updated>
<author>
<name>Ian Jackson</name>
<email>ijackson@chiark.greenend.org.uk</email>
</author>
<published>2023-07-10T11:19:32Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=473447a82e099fd52a674c28f5bc24b3e05208c0'/>
<id>urn:sha1:473447a82e099fd52a674c28f5bc24b3e05208c0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>RPC: Functionality to downcast dyn Object to a dyn Trait.</title>
<updated>2023-06-12T17:35:28Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-06-07T17:30:36Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=8166a29746b8fa7b447fc0f3929668e35c3314ae'/>
<id>urn:sha1:8166a29746b8fa7b447fc0f3929668e35c3314ae</id>
<content type='text'>
This is a rather tricky piece of functionality.  It works as
follows.

We introduce a `CastTable` type.  Each `CastTable` tells us how to
downcast `dyn Object` for objects of a single concrete type.
The `Object` type now has a `get_casttable` method that returns
an empty `CastTable` by default.

`CastTable` is, internally, a map from the `TypeId` of the target
dyn Trait reference type to a function
`fn(&amp;dyn Object) -&gt; &amp;dyn Trait`.  These functions are stored as
`Box&lt;dyn Any + ...&gt;`.  (They are Boxed because they may refer to
generic functions, which you can't get a static reference to,
and they're Any because the functions have different types.)

The `decl_object!` macro now implements `get_casttable` as
appropriate.  (The syntax is a bit janky, but that's what we get
for not using derive_adhoc.)  For non-generic types, `get_casttable`
uses a Lazy&lt;CastTable&gt;`. to initialize a CastTable exactly once.
For generic types, it use a `Lazy&lt;RwLock&lt;HashMap&lt;..&gt;&gt;` to
build one CastTable per instantiation of the generic type.

This could probably be optimized a bit more, the yaks could be
shaved in a more scintillating hairstyle, and the syntax for
generic `decl_object` could definitely be improved.
</content>
</entry>
<entry>
<title>rpc: make decl_object! responsible for writing impl Object {} blocks.</title>
<updated>2023-06-07T18:37:04Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-06-07T18:36:46Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=999f914e030e77d9439f0cb6910af10def33d518'/>
<id>urn:sha1:999f914e030e77d9439f0cb6910af10def33d518</id>
<content type='text'>
</content>
</entry>
<entry>
<title>RPC: Let objects declare that they need a GlobalId.</title>
<updated>2023-06-05T18:46:51Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-05-30T12:45:51Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=b7feb034a99ff8feafd828944011c97b5a50fe5f'/>
<id>urn:sha1:b7feb034a99ff8feafd828944011c97b5a50fe5f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tor-rpcbase: Rename and rephrase "command" to "method"</title>
<updated>2023-04-12T15:25:03Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-04-12T15:23:13Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=c5b70224b25c42ed8152527e0308bbbbde2b5624'/>
<id>urn:sha1:c5b70224b25c42ed8152527e0308bbbbde2b5624</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rename tor-rpccmd to tor-rpcbase.</title>
<updated>2023-04-12T11:34:57Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-04-11T19:13:19Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=9a5f319a840bbbd906d64803a4992ea1e21b7d1f'/>
<id>urn:sha1:9a5f319a840bbbd906d64803a4992ea1e21b7d1f</id>
<content type='text'>
</content>
</entry>
</feed>
