pub struct GTFSFareLegRule {
pub leg_group_id: Option<String>,
pub network_id: Option<String>,
pub from_area_id: Option<String>,
pub to_area_id: Option<String>,
pub from_timeframe_group_id: Option<String>,
pub to_timeframe_group_id: Option<String>,
pub fare_product_id: String,
pub rule_priority: i64,
}Expand description
§Fare Leg Rules
Optional Defines more granular fare rules for individual legs of travel (GTFS-Fares V2).
Use these rules by filtering on:
network_idfrom_area_idto_area_idfrom_timeframe_group_idto_timeframe_group_id
Multiple matching strategies exist depending on the presence or absence of rule_priority:
- If
rule_prioritydoes not exist, empty fields represent an inverse match against all possible values except those otherwise specified. - If
rule_prioritydoes exist, empty fields mean the field does not affect matching.
For matching an “effective fare leg” that spans multiple legs, see the specification for rules on using the first vs. last leg’s departure/arrival areas and timeframes.
Fields§
§leg_group_id: Option<String>Optional
Identifies a group of entries in fare_leg_rules.txt that can be referenced
in fare_transfer_rules.from_leg_group_id or fare_transfer_rules.to_leg_group_id.
network_id: Option<String>Optional
Identifies a route network (routes.network_id or networks.network_id) this rule applies to.
- If
rule_priorityis omitted and no matchingnetwork_id, empty matches “all but listed”. - If
rule_priorityexists, empty means network does not affect matching.
from_area_id: Option<String>Optional
Identifies a departure area (areas.area_id) for this fare leg rule.
- If
rule_priorityis omitted and no matchingfrom_area_id, empty matches “all but listed”. - If
rule_priorityexists, empty means departure area does not affect matching.
to_area_id: Option<String>Optional
Identifies an arrival area (areas.area_id) for this fare leg rule.
- If
rule_priorityis omitted and no matchingto_area_id, empty matches “all but listed”. - If
rule_priorityexists, empty means arrival area does not affect matching.
from_timeframe_group_id: Option<String>Optional
References a timeframes.timeframe_group_id for the start of the fare leg.
An empty value means the start time does not affect matching.
to_timeframe_group_id: Option<String>Optional
References a timeframes.timeframe_group_id for the end of the fare leg.
An empty value means the end time does not affect matching.
fare_product_id: StringRequired
References a fare_products.fare_product_id.
The rider must possess/purchase this fare product for the described leg.
rule_priority: i64Optional Defines the order of priority in which matching rules are applied.
- Higher priority overrides lower priority when multiple rules match.
- Empty is treated as zero.
Implementations§
Source§impl GTFSFareLegRule
impl GTFSFareLegRule
Sourcepub fn new(source: &str) -> Vec<GTFSFareLegRule>
pub fn new(source: &str) -> Vec<GTFSFareLegRule>
Create a new GTFSFareLegRule
Trait Implementations§
Source§impl Clone for GTFSFareLegRule
impl Clone for GTFSFareLegRule
Source§fn clone(&self) -> GTFSFareLegRule
fn clone(&self) -> GTFSFareLegRule
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GTFSFareLegRule
impl Debug for GTFSFareLegRule
Source§impl Default for GTFSFareLegRule
impl Default for GTFSFareLegRule
Source§fn default() -> GTFSFareLegRule
fn default() -> GTFSFareLegRule
Source§impl From<&Map<String, ValueType>> for GTFSFareLegRule
Starting from a ref to an MValue, convert to a struct
impl From<&Map<String, ValueType>> for GTFSFareLegRule
Starting from a ref to an MValue, convert to a struct
Source§impl From<&ValueType> for GTFSFareLegRule
If this struct ref is nested into another struct, pull out the MValue and let
From handle
impl From<&ValueType> for GTFSFareLegRule
If this struct ref is nested into another struct, pull out the MValue and let
From
Source§impl From<GTFSFareLegRule> for MValue
Starting from a struct, convert to an MValue
impl From<GTFSFareLegRule> for MValue
Starting from a struct, convert to an MValue
Source§fn from(value: GTFSFareLegRule) -> MValue
fn from(value: GTFSFareLegRule) -> MValue
Source§impl From<GTFSFareLegRule> for ValueType
If this struct is nested into another struct, convert to a ValueType that’s nested
impl From<GTFSFareLegRule> for ValueType
If this struct is nested into another struct, convert to a ValueType that’s nested
Source§fn from(value: GTFSFareLegRule) -> ValueType
fn from(value: GTFSFareLegRule) -> ValueType
Source§impl From<Map<String, ValueType>> for GTFSFareLegRule
Starting from an MValue, convert to a struct
impl From<Map<String, ValueType>> for GTFSFareLegRule
Starting from an MValue, convert to a struct
Source§impl From<ValueType> for GTFSFareLegRule
If this struct is nested into another struct, pull out the MValue and let
From handle
impl From<ValueType> for GTFSFareLegRule
If this struct is nested into another struct, pull out the MValue and let
From
Source§impl PartialEq for GTFSFareLegRule
impl PartialEq for GTFSFareLegRule
impl MValueCompatible for GTFSFareLegRule
Finally implement the MValueCompatible trait
impl StructuralPartialEq for GTFSFareLegRule
Auto Trait Implementations§
impl Freeze for GTFSFareLegRule
impl RefUnwindSafe for GTFSFareLegRule
impl Send for GTFSFareLegRule
impl Sync for GTFSFareLegRule
impl Unpin for GTFSFareLegRule
impl UnwindSafe for GTFSFareLegRule
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
§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)
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().