pub struct FinanceReader;Expand description
财务文件读取器。
Implementations§
Source§impl FinanceReader
impl FinanceReader
Sourcepub fn column_names(file_type: FileType) -> Option<&'static [&'static str]>
pub fn column_names(file_type: FileType) -> Option<&'static [&'static str]>
返回指定财务文件类型的结构化列名。
当前仅对报表类和比率类文件返回值。
Sourcepub fn read_file(
path: impl AsRef<Path>,
) -> Result<Vec<FinanceRecord>, FinanceError>
pub fn read_file( path: impl AsRef<Path>, ) -> Result<Vec<FinanceRecord>, FinanceError>
读取单个财务文件并解析为 FinanceRecord 列表。
文件类型会从文件名中的 type id 自动识别,例如 002419_7001.DAT。
§Examples
use qmt_parser::finance::FinanceReader;
let records = FinanceReader::read_file("finance/002419_7001.DAT")?;
println!("records = {}", records.len());Auto Trait Implementations§
impl Freeze for FinanceReader
impl RefUnwindSafe for FinanceReader
impl Send for FinanceReader
impl Sync for FinanceReader
impl Unpin for FinanceReader
impl UnsafeUnpin for FinanceReader
impl UnwindSafe for FinanceReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more