mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-08-27 02:07:45 +00:00
17 lines
286 B
Rust
17 lines
286 B
Rust
![]() |
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
|
||
|
}
|
||
|
}
|