pub(crate) struct FstExportData {
pub(crate) hierarchy: Arc<Hierarchy>,
pub(crate) time_table: Arc<TimeTable>,
pub(crate) root: FstExportNode,
pub(crate) signals: AHashMap<SignalRef, Arc<Signal>>,
pub(crate) version: String,
pub(crate) date: String,
pub(crate) timescale_exponent: i8,
pub(crate) time_scale_divisor: u128,
pub(crate) start_time: Time,
pub(crate) end_time: Time,
}Expand description
A self-contained snapshot of everything needed to write a set of variables (and only the hierarchy needed to reach them) to an FST file.
Kept separate from WellenContainer so that the actual (potentially slow) file
writing can be handed off to a background task without holding a borrow of it.
Fields§
§hierarchy: Arc<Hierarchy>Full source hierarchy, needed to resolve scope/var metadata when writing.
time_table: Arc<TimeTable>Full source time table; only entries referenced by the exported signals are used.
root: FstExportNodeMinimal scope tree containing only the exported variables.
signals: AHashMap<SignalRef, Arc<Signal>>Only the signals that are actually referenced by root.
version: StringFST header version string, copied from the source hierarchy.
date: StringFST header date string, copied from the source hierarchy.
timescale_exponent: i8Final FST timescale exponent: the source unit’s exponent plus the multiplier’s and time stamps’ folded-in digits.
time_scale_divisor: u12810.pow(time_scale_shift), precomputed so scale_time doesn’t need to redo it
for every time stamp. See common_power_of_ten.
start_time: TimeScaled first time stamp of the source simulation, written into the FST header.
end_time: TimeThe last time stamp of the source simulation, so the export can cover the same time span even if no exported signal changes at that point.
Implementations§
Source§impl FstExportData
impl FstExportData
Sourcepub(crate) fn write_to_file(&self, path: &Utf8Path) -> Result<()>
pub(crate) fn write_to_file(&self, path: &Utf8Path) -> Result<()>
Writes the previously selected variables to an FST file at path.
Sourcefn write_fst_value_changes<W: Write + Seek>(
&self,
out: &mut FstBodyWriter<W>,
signals: &[(FstSignalId, Arc<Signal>)],
) -> Result<()>
fn write_fst_value_changes<W: Write + Seek>( &self, out: &mut FstBodyWriter<W>, signals: &[(FstSignalId, Arc<Signal>)], ) -> Result<()>
Merges the value changes of signals in time order and writes them to out, rescaling
each time stamp with scale_time (see time_scale_divisor).
Auto Trait Implementations§
impl Freeze for FstExportData
impl RefUnwindSafe for FstExportData
impl Send for FstExportData
impl Sync for FstExportData
impl Unpin for FstExportData
impl UnsafeUnpin for FstExportData
impl UnwindSafe for FstExportData
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
self file descriptor. Read moreSource§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> ⓘ
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> ⓘ
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