Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[derive(Debug)]
- pub struct Jo { ip: String }
- #[derive(Debug)]
- pub enum Data {
- Join(Jo),
- Pos(u8),
- }
- trait Protocols
- {
- fn join(self);
- }
- impl Protocols for Data
- {
- fn join(self) {
- println!("{:?}", self.ip); //<------------- ?
- }
- }
- fn main() {
- let data = Data::Join(Jo{ip:"me".to_string()});
- data.join();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement