TaggedBorrowMut

Trait TaggedBorrowMut 

Source
pub trait TaggedBorrowMut<T, const TAG: u8> {
    // Required method
    fn borrow_mut(&mut self) -> &mut T;
}
Expand description

Designing everything for a pratical system is hard. Designing everything correctly is impossible. That’s why a versioned spec module is prepared.

At any time top level module does wildcard re-exporting from the latest version of spec. To survive from a breaking change, change use crate::* to use crate::spec::v1::*. Some structs need to implement Borrow on non-specific types, e.g. generic parameters or trait’s associate type. Include a tag to prevent these implementations collide with each other.

The value of tag is unlimited. Currently only roles are used as tags, but it could be extended some time.

Required Methods§

Source

fn borrow_mut(&mut self) -> &mut T

Implementors§

Source§

impl<P: Protocol<Self, A, Client = <RecvT<Self, P, A> as Tag<R>>::State>, A, const R: u8> TaggedBorrowMut<<P as Protocol<Engine<P, A, R>, A>>::Client, { Role::Client as u8 }> for Engine<P, A, R>
where RecvT<Self, P, A>: Tag<R>,

Source§

impl<P: Protocol<Self, A, Server = <RecvT<Self, P, A> as Tag<R>>::State>, A, const R: u8> TaggedBorrowMut<<P as Protocol<Engine<P, A, R>, A>>::Server, { Role::Server as u8 }> for Engine<P, A, R>
where RecvT<Self, P, A>: Tag<R>,