pub struct Flights { /* private fields */ }Implementations§
Source§impl Flights
impl Flights
Sourcepub fn add_from_at_strs<S>(&mut self, flights: Vec<S>) -> Result<Vec<String>>
pub fn add_from_at_strs<S>(&mut self, flights: Vec<S>) -> Result<Vec<String>>
Takes strings in the form of @- or @path and creates then adds them to the DB. Only one @- may be used or an Error is returned.
Returns a list of any created IDs
Sourcepub fn remove_indices(&mut self, indices: &[usize]) -> Vec<Flight>
pub fn remove_indices(&mut self, indices: &[usize]) -> Vec<Flight>
Removes any Flight definitions from the matching indices and returns a Vec of all removed Flights
Sourcepub fn indices_of_left_matches(&self, needle: &str) -> Vec<usize>
pub fn indices_of_left_matches(&self, needle: &str) -> Vec<usize>
Returns all indices of where the flight’s Name or ID (as hex) begins with the needle
Sourcepub fn indices_of_matches(&self, needle: &str) -> Vec<usize>
pub fn indices_of_matches(&self, needle: &str) -> Vec<usize>
Returns all indices of where the flight’s Name or ID (as hex) is an exact match of needle
pub fn iter(&self) -> impl Iterator<Item = &Flight>
pub fn clone_flight(&mut self, src: &str, exact: bool) -> Result<Flight>
Sourcepub fn update_or_create_flight(
&mut self,
model: &FlightModel,
) -> Vec<(String, Id)>
pub fn update_or_create_flight( &mut self, model: &FlightModel, ) -> Vec<(String, Id)>
Either updates a matching local flight, or creates a new one. Returns NEW flight names and IDs
pub fn update_flight( &mut self, src: &str, exact: bool, ctx: &FlightCtx, ) -> Result<()>
pub fn add_flight(&mut self, flight: Flight)
pub fn remove_flight(&mut self, src: &str, exact: bool) -> Result<Flight>
pub fn find_name(&self, name: &str) -> Option<&Flight>
pub fn find_name_or_partial_id(&self, needle: &str) -> Option<&Flight>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Flights
impl<'de> Deserialize<'de> for Flights
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromDisk for Flights
impl FromDisk for Flights
Source§fn set_loaded_from<P: AsRef<Path>>(&mut self, p: P)
fn set_loaded_from<P: AsRef<Path>>(&mut self, p: P)
Allows one to save or deserialize what path the item was loaded from
Source§fn loaded_from(&self) -> Option<&Path>
fn loaded_from(&self) -> Option<&Path>
If saved, get the path the item was loaded from
Auto Trait Implementations§
impl Freeze for Flights
impl RefUnwindSafe for Flights
impl Send for Flights
impl Sync for Flights
impl Unpin for Flights
impl UnwindSafe for Flights
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