pub struct MCardNamespaceProtocolService {
pub fs: MCardFileSystem,
pub protocol_version: String,
pub allowed_prefixes: Vec<String>,
/* private fields */
}Expand description
9-operation authenticated MCard Namespace Protocol service (version, put, get, stat, resolve, bind, list, history, watch).
Fields§
§fs: MCardFileSystemUnderlying MCardFileSystem.
protocol_version: StringProtocol semantic version string.
allowed_prefixes: Vec<String>Allowed handle prefixes for capability scoping.
Implementations§
Source§impl MCardNamespaceProtocolService
impl MCardNamespaceProtocolService
Sourcepub fn new_in_memory() -> Self
pub fn new_in_memory() -> Self
Creates an in-memory MCardNamespaceProtocolService.
Sourcepub fn version(
&self,
client_version: &str,
sponsor_did: Option<&str>,
) -> ProcessExecutionResult
pub fn version( &self, client_version: &str, sponsor_did: Option<&str>, ) -> ProcessExecutionResult
Negotiates protocol version and returns supported namespace operations.
Sourcepub fn put(
&self,
handle: &str,
content: &[u8],
algorithm: Option<&str>,
sponsor_did: Option<&str>,
) -> ProcessExecutionResult
pub fn put( &self, handle: &str, content: &[u8], algorithm: Option<&str>, sponsor_did: Option<&str>, ) -> ProcessExecutionResult
Stores content at handle and seals an immutable MCardRecord.
Sourcepub fn get(
&self,
handle: &str,
sponsor_did: Option<&str>,
) -> ProcessExecutionResult
pub fn get( &self, handle: &str, sponsor_did: Option<&str>, ) -> ProcessExecutionResult
Retrieves verified content bytes from handle.
Sourcepub fn stat(
&self,
handle: &str,
sponsor_did: Option<&str>,
) -> ProcessExecutionResult
pub fn stat( &self, handle: &str, sponsor_did: Option<&str>, ) -> ProcessExecutionResult
Returns metadata (size_bytes, algorithm, type_uri) for handle.
Sourcepub fn resolve(
&self,
handle: &str,
sponsor_did: Option<&str>,
) -> ProcessExecutionResult
pub fn resolve( &self, handle: &str, sponsor_did: Option<&str>, ) -> ProcessExecutionResult
Resolves handle to its current algorithm-qualified a:hex reference.
Sourcepub fn bind(
&mut self,
handle: &str,
new_ref: &str,
expected_old_ref: Option<&str>,
sponsor_did: Option<&str>,
) -> ProcessExecutionResult
pub fn bind( &mut self, handle: &str, new_ref: &str, expected_old_ref: Option<&str>, sponsor_did: Option<&str>, ) -> ProcessExecutionResult
Atomically compare-and-swaps handle to new_ref given expected_old_ref.
Sourcepub fn list(
&self,
prefix: &str,
sponsor_did: Option<&str>,
) -> ProcessExecutionResult
pub fn list( &self, prefix: &str, sponsor_did: Option<&str>, ) -> ProcessExecutionResult
Lists handles matching prefix.
Auto Trait Implementations§
impl Forget for MCardNamespaceProtocolService
impl Freeze for MCardNamespaceProtocolService
impl RefUnwindSafe for MCardNamespaceProtocolService
impl Send for MCardNamespaceProtocolService
impl Sync for MCardNamespaceProtocolService
impl Unpin for MCardNamespaceProtocolService
impl UnsafeUnpin for MCardNamespaceProtocolService
impl UnwindSafe for MCardNamespaceProtocolService
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