make JID struct etc. public
This commit is contained in:
parent
9cdf4953fe
commit
e9c742f4a9
|
@ -1,21 +1,25 @@
|
|||
use std::str::FromStr;
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
struct JID {
|
||||
pub struct JID {
|
||||
// TODO: validate localpart (length, char]
|
||||
localpart: Option<String>,
|
||||
domainpart: String,
|
||||
resourcepart: Option<String>,
|
||||
pub localpart: Option<String>,
|
||||
pub domainpart: String,
|
||||
pub resourcepart: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
enum JIDParseError {
|
||||
pub enum JIDParseError {
|
||||
Empty,
|
||||
Malformed,
|
||||
}
|
||||
|
||||
impl JID {
|
||||
fn new(localpart: Option<String>, domainpart: String, resourcepart: Option<String>) -> Self {
|
||||
pub fn new(
|
||||
localpart: Option<String>,
|
||||
domainpart: String,
|
||||
resourcepart: Option<String>,
|
||||
) -> Self {
|
||||
Self {
|
||||
localpart,
|
||||
domainpart: domainpart.parse().unwrap(),
|
||||
|
|
Loading…
Reference in New Issue