<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/arti.git/crates/arti-rpcserver/src/session.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>2023-06-20T11:38:31Z</updated>
<entry>
<title>rpc: Fix docs typo</title>
<updated>2023-06-20T11:38:31Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-06-20T11:38:31Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=3e704a080ccc051f7058a4d498448ea536dfcc65'/>
<id>urn:sha1:3e704a080ccc051f7058a4d498448ea536dfcc65</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rpc: Document relationship between `Connection` and `RpcSession`</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:07:48Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=0460a4a4d806e07b82bbd9747885a62593a0229d'/>
<id>urn:sha1:0460a4a4d806e07b82bbd9747885a62593a0229d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rpc: revise session initialization a lot.</title>
<updated>2023-06-15T15:44:14Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-06-15T15:40:36Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=2d28402fb796d89277079e6745f4a2908ac0c23a'/>
<id>urn:sha1:2d28402fb796d89277079e6745f4a2908ac0c23a</id>
<content type='text'>
Formerly, every time we wanted to launch a new connection, we had
to give the RpcMgr a TorClient.  The connection would hold that
TorClient until a session was authenticated, and then would wrap
it in a Session and put it in the object map.

Now, the RpcMgr holds a Box&lt;dyn Fn()...&gt; that knows how to
create Sessions.  When a connection is authenticated, it
asks the Mgr to make it a new session.  This lets us make it
clearer that the TorClient simply can't be given out until the
connection is authenticated.  Later, it will let us create
more types of Session objects under more complicated rules.
</content>
</entry>
<entry>
<title>rpc: Rename Session=&gt;RpcSession</title>
<updated>2023-06-15T15:29:57Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-06-15T15:29:57Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=6da1acadab4a39c3a137c5f0a8db083d186f0d98'/>
<id>urn:sha1:6da1acadab4a39c3a137c5f0a8db083d186f0d98</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rpc: Expose Session object.</title>
<updated>2023-06-15T15:28:34Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-06-15T15:28:34Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=269fab7abedaaec5fe5873d36e8cd55e9d5dee7d'/>
<id>urn:sha1:269fab7abedaaec5fe5873d36e8cd55e9d5dee7d</id>
<content type='text'>
We'll want to move the responsibility for creating Sessions outside
the rpcmgr crate.
</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: Make Session objects get a GlobalId.</title>
<updated>2023-06-05T18:46:51Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-05-30T15:48:07Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=3a93c94f4bf6cb593949faa51751f9c3b62d5e24'/>
<id>urn:sha1:3a93c94f4bf6cb593949faa51751f9c3b62d5e24</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>
</feed>
