[−][src]Macro slimweb::implgets
Impl get_ref and get_mut.
There are only lifetime affected enums that this applies to currently.
Example:
ⓘThis example is not tested
implgets!(Chunky, 'r, (Read, Write));
Becomes:
ⓘThis example is not tested
impl<'r> Chunky<'r> { fn get_ref(&self) -> &Stream { match self { Chunky::Read(s) => s.get_ref(), Chunky::Write(s) => s.get_ref(), } } fn get_mut(&mut self) -> &mut Stream { match self { Chunky::Read(s) => s.get_mut(), Chunky::Write(s) => s.get_mut(), } } }