use crate::errors::ErrorCode; #[derive(Debug)] pub struct ObjectId(pub String); impl ObjectId { pub fn parse(s: String) -> Result { if s.trim().is_empty() { return Err(ErrorCode::UnexpectedEmptyString); } Ok(Self(s)) } } impl AsRef for ObjectId { fn as_ref(&self) -> &str { &self.0 } }