[−][src]Struct transit_model::model::Model
The navitia transit model.
Methods
impl Model
[src]
pub fn get_corresponding<T, U>(&self, from: &IdxSet<T>) -> IdxSet<U> where
IdxSet<T>: GetCorresponding<U>,
[src]
IdxSet<T>: GetCorresponding<U>,
Returns the set of U
indices corresponding to the from
set.
pub fn get_corresponding_from_idx<T, U>(&self, from: Idx<T>) -> IdxSet<U> where
IdxSet<T>: GetCorresponding<U>,
[src]
IdxSet<T>: GetCorresponding<U>,
Returns the set of U
indices corresponding to the from
index.
impl Model
[src]
pub fn new(c: Collections) -> Result<Self>
[src]
Constructs a model from the given Collections
. Fails in
case of incoherence, as invalid external references.
Examples
let _: Model = Model::new(Collections::default())?;
let mut collections = Collections::default(); // This transfer is invalid as there is no stop points in collections collections.transfers = Collection::new(vec![Transfer { from_stop_id: "invalid".into(), to_stop_id: "also_invalid".into(), min_transfer_time: None, real_min_transfer_time: None, equipment_id: None, }]); assert!(Model::new(collections).is_err());
pub fn into_collections(self) -> Collections
[src]
Consumes collections,
Examples
let model: Model = Model::new(Collections::default())?; let mut collections = model.into_collections(); collections .feed_infos .insert("foo".to_string(), "bar".to_string()); let feeds: Vec<(_, _)> = collections.feed_infos.into_iter().collect(); assert_eq!( feeds, vec![("foo".to_string(), "bar".to_string())] );
Methods from Deref<Target = Collections>
Trait Implementations
impl Deref for Model
[src]
type Target = Collections
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl<'de> Deserialize<'de> for Model
[src]
fn deserialize<D>(deserializer: D) -> StdResult<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Serialize for Model
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,