pub fn clean(self) -> Option<Self> {
    match self {
      RealmSetting::Realm { realm, server } => match (parse_server_name(&server), realm.chars().all(|c| c.is_alphanumeric())) {
        (Some(server), true) => Some(RealmSetting::Realm { realm, server }),
        _ => None,
      },
      RealmSetting::Asset(asset) => {
        if asset.chars().all(|c| c.is_alphanumeric()) {
          Some(RealmSetting::Asset(asset))
        } else {
          None
        }
      }
      RealmSetting::AudioStream(stream) => {
        if url::UrlParser::new().parse(&stream).is_ok() {
          Some(RealmSetting::AudioStream(stream))
        } else {
          None
        }
      }
      RealmSetting::VideoStream(stream) => {
        if url::UrlParser::new().parse(&stream).is_ok() {
          Some(RealmSetting::VideoStream(stream))
        } else {
          None
        }
      }
      x => Some(x),
    }
  }
/// Ensure any data in the request looks like valid data
Ensure any data in the request looks like valid data
Ensure any data in the request looks like valid data
pub fn clean(self) -> Option<Self> {
    match self {
      RealmSetting::Realm { realm, server } => match (parse_server_name(&server), realm.chars().all(|c| c.is_alphanumeric())) {
        (Some(server), true) => Some(RealmSetting::Realm { realm, server }),
        _ => None,
      },
      RealmSetting::Asset(asset) => {
        if asset.chars().all(|c| c.is_alphanumeric()) {
          Some(RealmSetting::Asset(asset))
        } else {
          None
        }
      }
      RealmSetting::AudioStream(stream) => {
        if url::UrlParser::new().parse(&stream).is_ok() {
          Some(RealmSetting::AudioStream(stream))
        } else {
          None
        }
      }
      RealmSetting::VideoStream(stream) => {
        if url::UrlParser::new().parse(&stream).is_ok() {
          Some(RealmSetting::VideoStream(stream))
        } else {
          None
        }
      }
      x => Some(x),
    }
  }
pub fn clean ( self ) -> Option < Self > { match self { RealmSetting :: Realm { realm , server } => match ( parse_server_name ( & server ) , realm . chars ( ) . all ( | c | c . is_alphanumeric ( ) ) ) { ( Some ( server ) , true ) => Some ( RealmSetting :: Realm { realm , server } ) , _ => None , } , RealmSetting :: Asset ( asset ) => { if asset . chars ( ) . all ( | c | c . is_alphanumeric ( ) ) { Some ( RealmSetting :: Asset ( asset ) ) } else { None } } RealmSetting :: AudioStream ( stream ) => { if url :: UrlParser :: new ( ) . parse ( & stream ) . is_ok ( ) { Some ( RealmSetting :: AudioStream ( stream ) ) } else { None } } RealmSetting :: VideoStream ( stream ) => { if url :: UrlParser :: new ( ) . parse ( & stream ) . is_ok ( ) { Some ( RealmSetting :: VideoStream ( stream ) ) } else { None } } x => Some ( x ) , } }
Ensure any data in the request looks like valid data
Ensure any data in the request looks like valid data
self
self