pub struct Protocol {
pub name: Arc<str>,
pub ns: Arc<str>,
pub methods: Vec<ProtocolMethod>,
pub impls: Mutex<HashMap<Arc<str>, MethodMap>>,
pub extend_via_metadata: bool,
}Expand description
A Clojure protocol — an interface-like construct with named methods.
Fields§
§name: Arc<str>§ns: Arc<str>§methods: Vec<ProtocolMethod>§impls: Mutex<HashMap<Arc<str>, MethodMap>>type_tag → { method_name → impl fn }
extend_via_metadata: bool(defprotocol Name :extend-via-metadata true ...) — when set, protocol
dispatch consults the dispatch value’s metadata (keyed by this
protocol’s ProtocolFns) before falling back to type-tag impls.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Protocol
impl !Send for Protocol
impl !Sync for Protocol
impl RefUnwindSafe for Protocol
impl Unpin for Protocol
impl UnsafeUnpin for Protocol
impl UnwindSafe for Protocol
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