Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove generics from persistent.capnp #141

Merged
merged 1 commit into from
Dec 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 3 additions & 33 deletions capnp-rpc-lwt/persistent.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#$import "/capnp/c++.capnp".namespace("capnp");

interface Persistent@0xc8cb212fcd9f5691(SturdyRef, Owner) {
interface Persistent@0xc8cb212fcd9f5691 {
# Interface implemented by capabilities that outlive a single connection. A client may save()
# the capability, producing a SturdyRef. The SturdyRef can be stored to disk, then later used to
# obtain a new reference to the capability on a future connection.
Expand Down Expand Up @@ -95,7 +95,7 @@ interface Persistent@0xc8cb212fcd9f5691(SturdyRef, Owner) {
# this and which do not.

struct SaveParams {
sealFor @0 :Owner;
sealFor @0 :AnyPointer;
# Seal the SturdyRef so that it can only be restored by the specified Owner. This is meant
# to mitigate damage when a SturdyRef is leaked. See comments above.
#
Expand All @@ -104,36 +104,6 @@ interface Persistent@0xc8cb212fcd9f5691(SturdyRef, Owner) {
# ref.
}
struct SaveResults {
sturdyRef @0 :SturdyRef;
sturdyRef @0 :AnyPointer;
}
}

interface RealmGateway(InternalRef, ExternalRef, InternalOwner, ExternalOwner) {
# Interface invoked when a SturdyRef is about to cross realms. The RPC system supports providing
# a RealmGateway as a callback hook when setting up RPC over some VatNetwork.

import @0 (cap :Persistent(ExternalRef, ExternalOwner),
params :Persistent(InternalRef, InternalOwner).SaveParams)
-> Persistent(InternalRef, InternalOwner).SaveResults;
# Given an external capability, save it and return an internal reference. Used when someone
# inside the realm tries to save a capability from outside the realm.

export @1 (cap :Persistent(InternalRef, InternalOwner),
params :Persistent(ExternalRef, ExternalOwner).SaveParams)
-> Persistent(ExternalRef, ExternalOwner).SaveResults;
# Given an internal capability, save it and return an external reference. Used when someone
# outside the realm tries to save a capability from inside the realm.
}

annotation persistent(interface, field) :Void;
# Apply this annotation to interfaces for objects that will always be persistent, instead of
# extending the Persistent capability, since the correct type parameters to Persistent depend on
# the realm, which is orthogonal to the interface type and therefore should not be defined
# along-side it.
#
# You may also apply this annotation to a capability-typed field which will always contain a
# persistent capability, but where the capability's interface itself is not already marked
# persistent.
#
# Note that absence of the $persistent annotation doesn't mean a capability of that type isn't
# persistent; it just means not *all* such capabilities are persistent.