pub struct CollectListener<T>(pub Vec<T>);Expand description
将所有项收集到 Vec<T> 中的监听器,用于同步读取。
对应 Java: com.alibaba.excel.read.listener.ReadListener 的默认收集行为
Tuple Fields§
§0: Vec<T>Trait Implementations§
Source§impl<T> DocReadListener<T> for CollectListener<T>
impl<T> DocReadListener<T> for CollectListener<T>
Source§fn invoke(&mut self, data: T, _context: &DocReadContext) -> Result<()>
fn invoke(&mut self, data: T, _context: &DocReadContext) -> Result<()>
每解析一个数据项(段落文本或表格行)时调用。 Read more
Source§fn on_complete(&mut self, _context: &DocReadContext)
fn on_complete(&mut self, _context: &DocReadContext)
所有内容解析完成后调用。 Read more
Source§fn invoke_table(
&mut self,
table: &TableData,
context: &DocReadContext,
) -> Result<(), DocError>
fn invoke_table( &mut self, table: &TableData, context: &DocReadContext, ) -> Result<(), DocError>
遇到完整表格时调用。 Read more
Source§fn on_error(
&mut self,
_error: &DocError,
_context: &DocReadContext,
) -> ErrorAction
fn on_error( &mut self, _error: &DocError, _context: &DocReadContext, ) -> ErrorAction
读取过程中发生非致命错误时调用。 Read more
Auto Trait Implementations§
impl<T> Freeze for CollectListener<T>
impl<T> RefUnwindSafe for CollectListener<T>where
Vec<T>: RefUnwindSafe,
impl<T> Send for CollectListener<T>
impl<T> Sync for CollectListener<T>
impl<T> Unpin for CollectListener<T>
impl<T> UnsafeUnpin for CollectListener<T>where
Vec<T>: UnsafeUnpin,
impl<T> UnwindSafe for CollectListener<T>where
Vec<T>: UnwindSafe,
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