Skip to main content

hara_native/lang/protocol/
ifind.rs

1use hara_protocol_macros::hara_protocol;
2
3#[hara_protocol(namespace = "std.protocol.ifind", name = "IFind")]
4pub trait IFind<K> {
5    type Output;
6
7    #[hara_method(value = "find", arity = 2)]
8    fn find(&self, key: &K) -> Option<Self::Output>;
9
10    fn has(&self, key: &K) -> bool {
11        self.find(key).is_some()
12    }
13}