pub struct SearchRec {
pub attr: u8,
pub time: i32,
pub size: i32,
pub name: String,
}Expand description
A directory-listing file-metadata record.
name is an owned String and the struct derives Clone.
attr, time, and size are populated by FileList::raw_from_fs /
FileList::build_listing: size is meta.len() (saturated to i32),
time is the modified() mtime packed into the DOS ftime bitfield by
pack_dos_time, and attr carries FA_DIREC for directories.
§Turbo Vision heritage
Ports TSearchRec (filedial.cpp); its fixed-length char name[] (kept
POD-copyable for the collection) becomes an owned String.
Fields§
§attr: u8DOS file-attribute byte; only FA_DIREC (0x10) is examined here.
Set to FA_DIREC for directories, 0 for plain files. The remaining
DOS attribute bits (archive, hidden, system, read-only, volume) are
not populated or tested in this port.
time: i32Packed DOS ftime timestamp (pack_dos_time layout): high 16 bits are
the date (year-1980/month/day in bits 15–9/8–5/4–0), low 16 bits are
the time (hour/min/sec÷2 in bits 15–11/10–5/4–0). Times are UTC.
Read by FileInfoPane to format the size/date line; synthesized by
FileList::build_listing via pack_dos_time.
size: i32File size in bytes, saturated to i32::MAX for files larger than 2 GiB.
Displayed on the info pane’s size/date line. Directories always carry
size = 0; the ".." entry also carries size = 0.
name: StringThe bare file or directory name — no path component, no trailing /.
Use rec.attr & FA_DIREC != 0 to detect directories. FileList’s
get_text appends / to directory names for display; the raw name
is what FileList’s incremental-search and the input-line broker use.
Trait Implementations§
impl Eq for SearchRec
impl StructuralPartialEq for SearchRec
Auto Trait Implementations§
impl Freeze for SearchRec
impl RefUnwindSafe for SearchRec
impl Send for SearchRec
impl Sync for SearchRec
impl Unpin for SearchRec
impl UnsafeUnpin for SearchRec
impl UnwindSafe for SearchRec
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.