pub struct ProtocolRegistry { /* private fields */ }Implementations§
Source§impl ProtocolRegistry
impl ProtocolRegistry
pub fn new() -> Self
pub fn register<F>( &mut self, protocol: impl Into<String>, method: impl Into<String>, function: F, )
pub fn register_marker<S>(&mut self, protocol: impl Into<String>, supports: S)
pub fn register_when<S, F>( &mut self, protocol: impl Into<String>, method: impl Into<String>, supports: S, function: F, )
Sourcepub fn register_extension<F>(
&mut self,
provider: impl Into<String>,
type_name: impl Into<String>,
protocol: impl Into<String>,
method: impl Into<String>,
function: F,
)
pub fn register_extension<F>( &mut self, provider: impl Into<String>, type_name: impl Into<String>, protocol: impl Into<String>, method: impl Into<String>, function: F, )
Registers a protocol implementation for one opaque extension type.
Extension methods are kept separate from the ordinary protocol fallback chain so collection primitives can dispatch without recursively entering their own built-in protocol implementation.
Sourcepub fn register_extension_category(
&mut self,
provider: impl Into<String>,
type_name: impl Into<String>,
category: impl Into<String>,
)
pub fn register_extension_category( &mut self, provider: impl Into<String>, type_name: impl Into<String>, category: impl Into<String>, )
Marks an opaque extension type as a logical collection category such as
map. Predicates can then preserve the guest-language collection model.
pub fn invoke_extension( &self, receiver: &ExtensionValue, protocol: &str, method: &str, arguments: &[Value], ) -> Result<Value, String>
pub fn extension_has_category( &self, receiver: &ExtensionValue, category: &str, ) -> bool
pub fn register_guest( &self, protocol: impl Into<String>, type_name: impl Into<String>, method: impl Into<String>, function: Rc<Function>, )
pub fn declare_guest( &self, protocol: impl Into<String>, method: impl Into<String>, )
pub fn register_guest_protocol(&self, protocol: Rc<GuestProtocol>)
pub fn guest_protocol_reaches(&self, source: &str, target: &str) -> bool
pub fn replace_guest_protocol(&self, protocol: impl Into<String>)
pub fn invoke( &self, protocol: &str, method: &str, arguments: &[Value], ) -> Result<Value, String>
pub fn contains(&self, protocol: &str, method: &str) -> bool
pub fn satisfies(&self, protocol: &GuestProtocol, value: &Value) -> bool
Trait Implementations§
Source§impl Clone for ProtocolRegistry
impl Clone for ProtocolRegistry
Source§fn clone(&self) -> ProtocolRegistry
fn clone(&self) -> ProtocolRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for ProtocolRegistry
impl Default for ProtocolRegistry
Source§fn default() -> ProtocolRegistry
fn default() -> ProtocolRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ProtocolRegistry
impl !Send for ProtocolRegistry
impl !Sync for ProtocolRegistry
impl !UnwindSafe for ProtocolRegistry
impl Freeze for ProtocolRegistry
impl Unpin for ProtocolRegistry
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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