Struct flatgeobuf::FgbReader
source · [−]pub struct FgbReader<'a, R, State = Initial> { /* private fields */ }
Expand description
FlatGeobuf dataset reader
Implementations
sourceimpl<'a, R: Read> FgbReader<'a, R, Open>
impl<'a, R: Read> FgbReader<'a, R, Open>
sourcepub fn select_all_seq(self) -> Result<FgbReader<'a, R, FeaturesSelected>>
pub fn select_all_seq(self) -> Result<FgbReader<'a, R, FeaturesSelected>>
Select all features without using seek.
sourceimpl<'a, R: Read> FgbReader<'a, R, FeaturesSelected>
impl<'a, R: Read> FgbReader<'a, R, FeaturesSelected>
sourcepub fn cur_feature(&self) -> &FgbFeature
pub fn cur_feature(&self) -> &FgbFeature
Return current feature
sourcepub fn process_features<W: FeatureProcessor>(
&mut self,
out: &mut W
) -> Result<()>
pub fn process_features<W: FeatureProcessor>(
&mut self,
out: &mut W
) -> Result<()>
Read and process all selected features
sourceimpl<'a, R: Read + Seek> FgbReader<'a, R, FeaturesSelectedSeek>
impl<'a, R: Read + Seek> FgbReader<'a, R, FeaturesSelectedSeek>
sourcepub fn cur_feature(&self) -> &FgbFeature
pub fn cur_feature(&self) -> &FgbFeature
Return current feature
sourcepub fn process_features<W: FeatureProcessor>(
&mut self,
out: &mut W
) -> Result<()>
pub fn process_features<W: FeatureProcessor>(
&mut self,
out: &mut W
) -> Result<()>
Read and process all selected features
Trait Implementations
sourceimpl<'a, R: Read> FallibleStreamingIterator for FgbReader<'a, R, FeaturesSelected>
impl<'a, R: Read> FallibleStreamingIterator for FgbReader<'a, R, FeaturesSelected>
FallibleStreamingIterator
differs from the standard library’s Iterator
in two ways:
- each call to
next
can fail. - returned
FgbFeature
is valid untilnext
is called again orFgbReader
is reset or finalized.
While these iterators cannot be used with Rust for
loops, while let
loops offer a similar level of ergonomics:
use flatgeobuf::*;
while let Some(feature) = fgb.next()? {
let props = feature.properties()?;
println!("{}", props["name"]);
}
type Error = GeozeroError
type Error = GeozeroError
The error type of iteration.
type Item = FgbFeature
type Item = FgbFeature
The type being iterated over.
sourcefn get(&self) -> Option<&FgbFeature>
fn get(&self) -> Option<&FgbFeature>
Returns the current element. Read more
sourcefn size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
Returns bounds on the number of remaining elements in the iterator.
sourcefn next(&mut self) -> Result<Option<&Self::Item>, Self::Error>
fn next(&mut self) -> Result<Option<&Self::Item>, Self::Error>
Advances the iterator, returning the next element. Read more
sourcefn all<F>(&mut self, f: F) -> Result<bool, Self::Error> where
F: FnMut(&Self::Item) -> bool,
fn all<F>(&mut self, f: F) -> Result<bool, Self::Error> where
F: FnMut(&Self::Item) -> bool,
Determines if all elements of the iterator satisfy a predicate.
sourcefn any<F>(&mut self, f: F) -> Result<bool, Self::Error> where
F: FnMut(&Self::Item) -> bool,
fn any<F>(&mut self, f: F) -> Result<bool, Self::Error> where
F: FnMut(&Self::Item) -> bool,
Determines if any elements of the iterator satisfy a predicate.
sourcefn count(self) -> Result<usize, Self::Error>
fn count(self) -> Result<usize, Self::Error>
Returns the number of remaining elements in the iterator.
sourcefn filter<F>(self, f: F) -> Filter<Self, F> where
F: FnMut(&Self::Item) -> bool,
fn filter<F>(self, f: F) -> Filter<Self, F> where
F: FnMut(&Self::Item) -> bool,
Returns an iterator which filters elements by a predicate.
sourcefn find<F>(&mut self, f: F) -> Result<Option<&Self::Item>, Self::Error> where
F: FnMut(&Self::Item) -> bool,
fn find<F>(&mut self, f: F) -> Result<Option<&Self::Item>, Self::Error> where
F: FnMut(&Self::Item) -> bool,
Returns the first element of the iterator which satisfies a predicate.
sourcefn for_each<F>(self, f: F) -> Result<(), Self::Error> where
F: FnMut(&Self::Item),
fn for_each<F>(self, f: F) -> Result<(), Self::Error> where
F: FnMut(&Self::Item),
Calls a closure on each element of an iterator.
sourcefn fuse(self) -> Fuse<Self>
fn fuse(self) -> Fuse<Self>
Returns an iterator which is well-behaved at the beginning and end of iteration.
sourcefn map<F, B>(self, f: F) -> Map<Self, F, B> where
F: FnMut(&Self::Item) -> B,
fn map<F, B>(self, f: F) -> Map<Self, F, B> where
F: FnMut(&Self::Item) -> B,
Returns an iterator which applies a transform to elements.
sourcefn map_ref<F, B>(self, f: F) -> MapRef<Self, F> where
F: Fn(&Self::Item) -> &B,
B: ?Sized,
fn map_ref<F, B>(self, f: F) -> MapRef<Self, F> where
F: Fn(&Self::Item) -> &B,
B: ?Sized,
Returns an iterator which applies a transform to elements. Read more
sourcefn map_err<F, B>(self, f: F) -> MapErr<Self, F> where
F: Fn(Self::Error) -> B,
fn map_err<F, B>(self, f: F) -> MapErr<Self, F> where
F: Fn(Self::Error) -> B,
Returns an iterator that applies a transform to errors.
sourcefn nth(&mut self, n: usize) -> Result<Option<&Self::Item>, Self::Error>
fn nth(&mut self, n: usize) -> Result<Option<&Self::Item>, Self::Error>
Returns the nth
element of the iterator.
sourcefn position<F>(&mut self, f: F) -> Result<Option<usize>, Self::Error> where
F: FnMut(&Self::Item) -> bool,
fn position<F>(&mut self, f: F) -> Result<Option<usize>, Self::Error> where
F: FnMut(&Self::Item) -> bool,
Returns the position of the first element matching a predicate.
sourcefn skip_while<F>(self, f: F) -> SkipWhile<Self, F> where
F: FnMut(&Self::Item) -> bool,
fn skip_while<F>(self, f: F) -> SkipWhile<Self, F> where
F: FnMut(&Self::Item) -> bool,
Returns an iterator which skips the first sequence of elements matching a predicate.
sourceimpl<'a, R: Read + Seek> FallibleStreamingIterator for FgbReader<'a, R, FeaturesSelectedSeek>
impl<'a, R: Read + Seek> FallibleStreamingIterator for FgbReader<'a, R, FeaturesSelectedSeek>
FallibleStreamingIterator
differs from the standard library’s Iterator
in two ways:
- each call to
next
can fail. - returned
FgbFeature
is valid untilnext
is called again orFgbReader
is reset or finalized.
While these iterators cannot be used with Rust for
loops, while let
loops offer a similar level of ergonomics:
use flatgeobuf::*;
while let Some(feature) = fgb.next()? {
let props = feature.properties()?;
println!("{}", props["name"]);
}
type Error = GeozeroError
type Error = GeozeroError
The error type of iteration.
type Item = FgbFeature
type Item = FgbFeature
The type being iterated over.
sourcefn get(&self) -> Option<&FgbFeature>
fn get(&self) -> Option<&FgbFeature>
Returns the current element. Read more
sourcefn size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
Returns bounds on the number of remaining elements in the iterator.
sourcefn next(&mut self) -> Result<Option<&Self::Item>, Self::Error>
fn next(&mut self) -> Result<Option<&Self::Item>, Self::Error>
Advances the iterator, returning the next element. Read more
sourcefn all<F>(&mut self, f: F) -> Result<bool, Self::Error> where
F: FnMut(&Self::Item) -> bool,
fn all<F>(&mut self, f: F) -> Result<bool, Self::Error> where
F: FnMut(&Self::Item) -> bool,
Determines if all elements of the iterator satisfy a predicate.
sourcefn any<F>(&mut self, f: F) -> Result<bool, Self::Error> where
F: FnMut(&Self::Item) -> bool,
fn any<F>(&mut self, f: F) -> Result<bool, Self::Error> where
F: FnMut(&Self::Item) -> bool,
Determines if any elements of the iterator satisfy a predicate.
sourcefn count(self) -> Result<usize, Self::Error>
fn count(self) -> Result<usize, Self::Error>
Returns the number of remaining elements in the iterator.
sourcefn filter<F>(self, f: F) -> Filter<Self, F> where
F: FnMut(&Self::Item) -> bool,
fn filter<F>(self, f: F) -> Filter<Self, F> where
F: FnMut(&Self::Item) -> bool,
Returns an iterator which filters elements by a predicate.
sourcefn find<F>(&mut self, f: F) -> Result<Option<&Self::Item>, Self::Error> where
F: FnMut(&Self::Item) -> bool,
fn find<F>(&mut self, f: F) -> Result<Option<&Self::Item>, Self::Error> where
F: FnMut(&Self::Item) -> bool,
Returns the first element of the iterator which satisfies a predicate.
sourcefn for_each<F>(self, f: F) -> Result<(), Self::Error> where
F: FnMut(&Self::Item),
fn for_each<F>(self, f: F) -> Result<(), Self::Error> where
F: FnMut(&Self::Item),
Calls a closure on each element of an iterator.
sourcefn fuse(self) -> Fuse<Self>
fn fuse(self) -> Fuse<Self>
Returns an iterator which is well-behaved at the beginning and end of iteration.
sourcefn map<F, B>(self, f: F) -> Map<Self, F, B> where
F: FnMut(&Self::Item) -> B,
fn map<F, B>(self, f: F) -> Map<Self, F, B> where
F: FnMut(&Self::Item) -> B,
Returns an iterator which applies a transform to elements.
sourcefn map_ref<F, B>(self, f: F) -> MapRef<Self, F> where
F: Fn(&Self::Item) -> &B,
B: ?Sized,
fn map_ref<F, B>(self, f: F) -> MapRef<Self, F> where
F: Fn(&Self::Item) -> &B,
B: ?Sized,
Returns an iterator which applies a transform to elements. Read more
sourcefn map_err<F, B>(self, f: F) -> MapErr<Self, F> where
F: Fn(Self::Error) -> B,
fn map_err<F, B>(self, f: F) -> MapErr<Self, F> where
F: Fn(Self::Error) -> B,
Returns an iterator that applies a transform to errors.
sourcefn nth(&mut self, n: usize) -> Result<Option<&Self::Item>, Self::Error>
fn nth(&mut self, n: usize) -> Result<Option<&Self::Item>, Self::Error>
Returns the nth
element of the iterator.
sourcefn position<F>(&mut self, f: F) -> Result<Option<usize>, Self::Error> where
F: FnMut(&Self::Item) -> bool,
fn position<F>(&mut self, f: F) -> Result<Option<usize>, Self::Error> where
F: FnMut(&Self::Item) -> bool,
Returns the position of the first element matching a predicate.
sourcefn skip_while<F>(self, f: F) -> SkipWhile<Self, F> where
F: FnMut(&Self::Item) -> bool,
fn skip_while<F>(self, f: F) -> SkipWhile<Self, F> where
F: FnMut(&Self::Item) -> bool,
Returns an iterator which skips the first sequence of elements matching a predicate.
sourceimpl<'a, T: Read> GeozeroDatasource for FgbReader<'a, T, FeaturesSelected>
impl<'a, T: Read> GeozeroDatasource for FgbReader<'a, T, FeaturesSelected>
sourcefn process<P: FeatureProcessor>(&mut self, processor: &mut P) -> Result<()>
fn process<P: FeatureProcessor>(&mut self, processor: &mut P) -> Result<()>
Consume and process all selected features.
sourcefn process_geom<P>(&mut self, processor: &mut P) -> Result<(), GeozeroError> where
P: GeomProcessor,
fn process_geom<P>(&mut self, processor: &mut P) -> Result<(), GeozeroError> where
P: GeomProcessor,
Consume and process geometries of all selected features.
sourceimpl<'a, T: Read + Seek> GeozeroDatasource for FgbReader<'a, T, FeaturesSelectedSeek>
impl<'a, T: Read + Seek> GeozeroDatasource for FgbReader<'a, T, FeaturesSelectedSeek>
sourcefn process<P: FeatureProcessor>(&mut self, processor: &mut P) -> Result<()>
fn process<P: FeatureProcessor>(&mut self, processor: &mut P) -> Result<()>
Consume and process all selected features.
sourcefn process_geom<P>(&mut self, processor: &mut P) -> Result<(), GeozeroError> where
P: GeomProcessor,
fn process_geom<P>(&mut self, processor: &mut P) -> Result<(), GeozeroError> where
P: GeomProcessor,
Consume and process geometries of all selected features.
Auto Trait Implementations
impl<'a, R, State> RefUnwindSafe for FgbReader<'a, R, State> where
R: RefUnwindSafe,
State: RefUnwindSafe,
impl<'a, R, State> Send for FgbReader<'a, R, State> where
R: Send,
State: Send,
impl<'a, R, State> Sync for FgbReader<'a, R, State> where
R: Sync,
State: Sync,
impl<'a, R, State> Unpin for FgbReader<'a, R, State> where
State: Unpin,
impl<'a, R, State = Initial> !UnwindSafe for FgbReader<'a, R, State>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ProcessToJson for T where
T: GeozeroDatasource,
impl<T> ProcessToJson for T where
T: GeozeroDatasource,
sourcefn to_json(&mut self) -> Result<String, GeozeroError>
fn to_json(&mut self) -> Result<String, GeozeroError>
Consume features as GeoJSON String.
sourceimpl<T> ProcessToSvg for T where
T: GeozeroDatasource,
impl<T> ProcessToSvg for T where
T: GeozeroDatasource,
sourcefn to_svg(&mut self) -> Result<String, GeozeroError>
fn to_svg(&mut self) -> Result<String, GeozeroError>
Consume features as SVG String.
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more