pub struct OwnershipManifest { /* private fields */ }Expand description
PSP-5 Phase 2: Ownership manifest tracking file-to-node bindings
Enforces ownership closure: a node may only modify files it owns, unless it is an Integration node (which may cross ownership boundaries).
Implementations§
Source§impl OwnershipManifest
impl OwnershipManifest
Sourcepub fn new() -> OwnershipManifest
pub fn new() -> OwnershipManifest
Create a new empty manifest with the default fanout limit
Sourcepub fn with_fanout_limit(limit: usize) -> OwnershipManifest
pub fn with_fanout_limit(limit: usize) -> OwnershipManifest
Create with a custom fanout limit
Sourcepub fn assign(
&mut self,
path: impl Into<String>,
owner_node_id: impl Into<String>,
owner_plugin: impl Into<String>,
node_class: NodeClass,
)
pub fn assign( &mut self, path: impl Into<String>, owner_node_id: impl Into<String>, owner_plugin: impl Into<String>, node_class: NodeClass, )
Assign a file to an owning node
Sourcepub fn owner_of(&self, path: &str) -> Option<&OwnershipEntry>
pub fn owner_of(&self, path: &str) -> Option<&OwnershipEntry>
Look up the owner of a file path
Sourcepub fn files_owned_by(&self, node_id: &str) -> Vec<&str>
pub fn files_owned_by(&self, node_id: &str) -> Vec<&str>
List all files owned by a specific node
Sourcepub fn fanout_limit(&self) -> usize
pub fn fanout_limit(&self) -> usize
Get the fanout limit
Sourcepub fn validate_bundle(
&self,
bundle: &ArtifactBundle,
node_id: &str,
node_class: NodeClass,
) -> Result<(), String>
pub fn validate_bundle( &self, bundle: &ArtifactBundle, node_id: &str, node_class: NodeClass, ) -> Result<(), String>
Validate that a bundle respects ownership boundaries
Rules:
- Implementation nodes: all paths must be owned by this node
- Interface nodes: all paths must be owned by this node
- Integration nodes: paths may cross ownership boundaries
- Fanout limit: bundle must not exceed max files per node
- Unregistered paths (new files) are allowed and will be auto-assigned
Sourcepub fn assign_new_paths(
&mut self,
bundle: &ArtifactBundle,
node_id: &str,
owner_plugin: &str,
node_class: NodeClass,
)
pub fn assign_new_paths( &mut self, bundle: &ArtifactBundle, node_id: &str, owner_plugin: &str, node_class: NodeClass, )
Auto-assign unregistered paths from a bundle to a node
Called after validate_bundle succeeds, this registers any new paths in the manifest so future nodes can’t claim them.
Trait Implementations§
Source§impl Clone for OwnershipManifest
impl Clone for OwnershipManifest
Source§fn clone(&self) -> OwnershipManifest
fn clone(&self) -> OwnershipManifest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OwnershipManifest
impl Debug for OwnershipManifest
Source§impl Default for OwnershipManifest
impl Default for OwnershipManifest
Source§fn default() -> OwnershipManifest
fn default() -> OwnershipManifest
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for OwnershipManifest
impl<'de> Deserialize<'de> for OwnershipManifest
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OwnershipManifest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OwnershipManifest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for OwnershipManifest
impl Serialize for OwnershipManifest
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for OwnershipManifest
impl RefUnwindSafe for OwnershipManifest
impl Send for OwnershipManifest
impl Sync for OwnershipManifest
impl Unpin for OwnershipManifest
impl UnsafeUnpin for OwnershipManifest
impl UnwindSafe for OwnershipManifest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more