pub struct ProtocolRegistry { /* private fields */ }Implementations§
Source§impl ProtocolRegistry
impl ProtocolRegistry
pub fn load(path: &Path) -> Result<Self, String>
pub fn save(&self, path: &Path) -> Result<(), String>
Sourcepub fn publish(
&mut self,
source: &str,
published_by: Option<&str>,
) -> Result<(String, u32), String>
pub fn publish( &mut self, source: &str, published_by: Option<&str>, ) -> Result<(String, u32), String>
parse + check a protocol, then register it (checksummed)
pub fn fetch( &self, name: &str, version: u32, ) -> Result<(String, String), String>
Sourcepub fn fetch_verified(
&self,
name: &str,
version: u32,
) -> Result<ProtocolProgram, String>
pub fn fetch_verified( &self, name: &str, version: u32, ) -> Result<ProtocolProgram, String>
fetch + verify integrity; returns the parsed program
pub fn list(&self) -> Vec<(String, u32, Vec<String>)>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Debug for ProtocolRegistry
impl Debug for ProtocolRegistry
Source§impl Default for ProtocolRegistry
impl Default for ProtocolRegistry
Source§fn default() -> ProtocolRegistry
fn default() -> ProtocolRegistry
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ProtocolRegistry
impl<'de> Deserialize<'de> for ProtocolRegistry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ProtocolRegistry
impl RefUnwindSafe for ProtocolRegistry
impl Send for ProtocolRegistry
impl Sync for ProtocolRegistry
impl Unpin for ProtocolRegistry
impl UnsafeUnpin for ProtocolRegistry
impl UnwindSafe for ProtocolRegistry
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