pub struct DataBaseFile<T: Reader, M: MValueCompatible = MValue> { /* private fields */ }Expand description
§Database File
§Description
A DBF data class to parse the data from a DBF
§Usage
use gistools::{parsers::FileReader, readers::DataBaseFile};
use s2json::MValue;
use std::path::PathBuf;
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
path.push("tests/readers/shapefile/fixtures/empty.dbf");
let reader = FileReader::new(path).unwrap();
let dbf = DataBaseFile::new(reader, Some("utf-8".into()));
// Get the header data
let header = dbf.get_header();
// grab individual properties
let properties_0: MValue = dbf.get_properties(0).unwrap();
let properties_1: MValue = dbf.get_properties(1).unwrap();Implementations§
Source§impl<T: Reader, M: MValueCompatible> DataBaseFile<T, M>
impl<T: Reader, M: MValueCompatible> DataBaseFile<T, M>
Sourcepub fn new(reader: T, encoding: Option<String>) -> DataBaseFile<T, M>
pub fn new(reader: T, encoding: Option<String>) -> DataBaseFile<T, M>
Create a new DBF data class given an input reader
Sourcepub fn get_header(&self) -> &DBFHeader
pub fn get_header(&self) -> &DBFHeader
Create a copy of the header data
Sourcepub fn get_properties(&self, index: u64) -> Option<M>
pub fn get_properties(&self, index: u64) -> Option<M>
Get the properties for the given index
Sourcepub fn get_all_properties(&self) -> Vec<M>
pub fn get_all_properties(&self) -> Vec<M>
Get all the properties in the DBF
Trait Implementations§
Source§impl<T: Clone + Reader, M: Clone + MValueCompatible> Clone for DataBaseFile<T, M>
impl<T: Clone + Reader, M: Clone + MValueCompatible> Clone for DataBaseFile<T, M>
Source§fn clone(&self) -> DataBaseFile<T, M>
fn clone(&self) -> DataBaseFile<T, M>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T, M> Freeze for DataBaseFile<T, M>where
T: Freeze,
impl<T, M> RefUnwindSafe for DataBaseFile<T, M>where
T: RefUnwindSafe,
M: RefUnwindSafe,
impl<T, M> Send for DataBaseFile<T, M>
impl<T, M> Sync for DataBaseFile<T, M>
impl<T, M> Unpin for DataBaseFile<T, M>
impl<T, M> UnwindSafe for DataBaseFile<T, M>where
T: UnwindSafe,
M: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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