vtse/vtse-common/src/stock.rs

20 lines
430 B
Rust

use serde::Deserialize;
use std::str::FromStr;
use thiserror::Error;
#[derive(Deserialize, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)]
pub struct StockName(String);
#[derive(Error, Debug)]
pub enum StockNameParseError {}
impl FromStr for StockName {
type Err = StockNameParseError;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(Self(s.to_string()))
}
}
pub(crate) struct Stock {}