doc_view_id.rs 279 B

123456789101112
  1. #[derive(Debug)]
  2. pub struct DocViewId(pub String);
  3. impl DocViewId {
  4. pub fn parse(s: String) -> Result<DocViewId, String> {
  5. if s.trim().is_empty() {
  6. return Err(format!("Doc view id can not be empty or whitespace"));
  7. }
  8. Ok(Self(s))
  9. }
  10. }