pub struct Resource<Attribute> {
pub resource_type: String,
pub id: String,
pub links: Option<HashMap<String, String>>,
pub attributes: Attribute,
pub relationships: Option<HashMap<String, Relationships>>,
}Expand description
Some MBTA resource, bundling common metadata with the actual model attributes.
Fields§
§resource_type: StringThe JSON API resource type.
id: StringThe JSON API resource id.
links: Option<HashMap<String, String>>Related endpoint links. This field could use some more documentation.
attributes: AttributeModel attributes.
relationships: Option<HashMap<String, Relationships>>Relationships to other data models.
Trait Implementations§
Source§impl<'de, Attribute> Deserialize<'de> for Resource<Attribute>where
Attribute: Deserialize<'de>,
impl<'de, Attribute> Deserialize<'de> for Resource<Attribute>where
Attribute: Deserialize<'de>,
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
impl<Attribute> StructuralPartialEq for Resource<Attribute>
Auto Trait Implementations§
impl<Attribute> Freeze for Resource<Attribute>where
Attribute: Freeze,
impl<Attribute> RefUnwindSafe for Resource<Attribute>where
Attribute: RefUnwindSafe,
impl<Attribute> Send for Resource<Attribute>where
Attribute: Send,
impl<Attribute> Sync for Resource<Attribute>where
Attribute: Sync,
impl<Attribute> Unpin for Resource<Attribute>where
Attribute: Unpin,
impl<Attribute> UnwindSafe for Resource<Attribute>where
Attribute: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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