Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
use flowy_error::ErrorCode;
use unicode_segmentation::UnicodeSegmentation;
#[derive(Debug)]
pub struct ViewName(pub String);
impl ViewName {
pub fn parse(s: String) -> Result<ViewName, ErrorCode> {
if s.graphemes(true).count() > 256 {
return Err(ErrorCode::ViewNameTooLong);
}
Ok(Self(s))
}
}
impl AsRef<str> for ViewName {
fn as_ref(&self) -> &str {
&self.0
}
}