use std::fmt::Display; pub enum Method { Register, Invite, Ack, Option, Cancel, Bye, } impl Display for Method { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_str(match self { Method::Register => "REGISTER", Method::Invite => "INVITE", Method::Ack => "ACK", Method::Option => "OPTION", Method::Cancel => "CANCEL", Method::Bye => "BYE", }) } }