<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/arti.git/crates/tor-rpcbase/src/dispatch.rs, branch arti-1.2.1</title>
<subtitle>mirror of https://gitlab.torproject.org/tpo/core/arti
</subtitle>
<id>http://git.dilluti0n.com/mirrors/arti.git/atom?h=arti-1.2.1</id>
<link rel='self' href='http://git.dilluti0n.com/mirrors/arti.git/atom?h=arti-1.2.1'/>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/'/>
<updated>2024-03-13T16:30:53Z</updated>
<entry>
<title>Run maint/add_warning.</title>
<updated>2024-03-13T16:30:53Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2024-03-13T16:30:53Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=c0c9bd15d42897825dd0ab3d3b8dd1c17bd6320c'/>
<id>urn:sha1:c0c9bd15d42897825dd0ab3d3b8dd1c17bd6320c</id>
<content type='text'>
</content>
</entry>
<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: Cross-reference up from tor-rpcbase re where DispatchTable lives</title>
<updated>2023-06-16T16:48:59Z</updated>
<author>
<name>Ian Jackson</name>
<email>ijackson@chiark.greenend.org.uk</email>
</author>
<published>2023-06-16T16:48:38Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=85a046e2664253e33c0ab76e56613281bbb232ec'/>
<id>urn:sha1:85a046e2664253e33c0ab76e56613281bbb232ec</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: Remove downgrade_owned for now</title>
<updated>2023-05-24T14:15:56Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-05-24T13:24:45Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=936387efee359a38a22a920568090b204dfd07be'/>
<id>urn:sha1:936387efee359a38a22a920568090b204dfd07be</id>
<content type='text'>
Rationale: Our weak-vs-strong design is a bit confused at the moment
due to concerns about deduplication and  capability semantics.  It's
not clear that a general "change strong to weak" method is
compatible with what we want to provide.
</content>
</entry>
<entry>
<title>rpc: Implement functionality to remove objects from a session</title>
<updated>2023-05-24T14:15:56Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-05-23T14:41:56Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=9713e8d3054aafe3f19afd55693bc3159712e595'/>
<id>urn:sha1:9713e8d3054aafe3f19afd55693bc3159712e595</id>
<content type='text'>
I've made doing some design choices here:
  * Reserving "rpc" as a prefix for post-authentication
    functionality that is not arti-specific.
  * Declaring these to be methods on the session rather than methods
    on the objects themselves.

There's a problem with defining an API to drop a weak reference; see
comment in code.
</content>
</entry>
<entry>
<title>RPC: Add "register" methods to RequestContext.</title>
<updated>2023-05-04T14:35:05Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-04-25T21:08:47Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=9be9ddb9027fef615613118451bc7e98fbc533b5'/>
<id>urn:sha1:9be9ddb9027fef615613118451bc7e98fbc533b5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rpc: New syntax for method declaration</title>
<updated>2023-04-19T16:38:26Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-04-18T21:37:27Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=e6092e99ea356664be8286d17b8e2526576fa6ee'/>
<id>urn:sha1:e6092e99ea356664be8286d17b8e2526576fa6ee</id>
<content type='text'>
Now you just declare your function `my_func` with the right types,
and invoke `rpc_invoke_fn!{ my_func(ObjType, MethodType); }`
</content>
</entry>
</feed>
