pub trait Layout<P: PeerId>:
Debug
+ Send
+ Sync
+ 'static {
// Required methods
fn scope(&self, peer: &P) -> Prefixes;
fn owner(&self, path: &str) -> Option<P>;
}Expand description
A path convention: where each peer publishes, and which peer owns a path.
The two halves agree: owner of a path that
scope gives a peer names that peer or no one.
Ownership must carry down to sub-paths: every path beneath a path a peer
owns is owned by that peer or by no one. A grant is a set of prefixes,
so a peer that may publish at a path it owns, such as through a ticket
claim, may publish beneath it too. A layout whose owner is a later
segment, such as <name>/<peer>, breaks this: a claim on cam/<bob>
would let Bob publish cam/<bob>/<carol>, which names Carol.
A pair (A, B) is the union of two layouts.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".