diff --git a/src/jid/mod.rs b/src/jid/mod.rs index f39a1c3..4baa857 100644 --- a/src/jid/mod.rs +++ b/src/jid/mod.rs @@ -1,21 +1,25 @@ use std::str::FromStr; #[derive(PartialEq, Debug)] -struct JID { +pub struct JID { // TODO: validate localpart (length, char] - localpart: Option, - domainpart: String, - resourcepart: Option, + pub localpart: Option, + pub domainpart: String, + pub resourcepart: Option, } #[derive(Debug)] -enum JIDParseError { +pub enum JIDParseError { Empty, Malformed, } impl JID { - fn new(localpart: Option, domainpart: String, resourcepart: Option) -> Self { + pub fn new( + localpart: Option, + domainpart: String, + resourcepart: Option, + ) -> Self { Self { localpart, domainpart: domainpart.parse().unwrap(),