Skip to main content

hara_native/lang/protocol/
iiterator.rs

1use super::IIter;
2use hara_protocol_macros::hara_protocol;
3
4#[hara_protocol(
5    namespace = "std.protocol.iiterator",
6    name = "IIterator",
7    parents = ["IIter"]
8)]
9pub trait IIterator: IIter + Iterator<Item = <Self as IIter>::Item> {
10    #[hara_method(value = "iter-next", arity = 1)]
11    fn iter_next(&mut self) -> Option<<Self as IIter>::Item> {
12        self.next()
13    }
14
15    #[hara_method(value = "iter-next?", arity = 1)]
16    fn iter_next_available(&mut self) -> bool;
17}