AppFlowy/shared-lib/user-model/src/parser/user_openai_key.rs

17 lines
286 B
Rust
Raw Normal View History

use crate::errors::UserErrorCode;
#[derive(Debug)]
pub struct UserOpenaiKey(pub String);
impl UserOpenaiKey {
pub fn parse(s: String) -> Result<UserOpenaiKey, UserErrorCode> {
Ok(Self(s))
}
}
impl AsRef<str> for UserOpenaiKey {
fn as_ref(&self) -> &str {
&self.0
}
}