Skip to main content

NavProperty

Enum NavProperty 

Source
pub enum NavProperty<T: EntityTypeRef> {
    Expanded(Expanded<T>),
    Reference(Reference),
}
Expand description

Navigation property variants. All navigation properties in generated code are wrapped with this type.

Variants§

§

Expanded(Expanded<T>)

Expanded property variant (content included in the response).

§

Reference(Reference)

Reference variant (only @odata.id is included in the response).

Implementations§

Source§

impl<T: EntityTypeRef> NavProperty<T>

Source

pub const fn new_reference(odata_id: ODataId) -> Self

Create a navigation property with a reference using the OData identifier.

Source

pub fn to_reference(self) -> Self

Convert property to reference regardless expanded it or not.

Source

pub fn downcast<D: EntityTypeRef>(&self) -> NavProperty<D>

Downcast to descendant type D.

Source§

impl<T: EntityTypeRef> NavProperty<T>

Source

pub fn id(&self) -> &ODataId

Extract the identifier from a navigation property.

Source§

impl<T: EntityTypeRef + Sized + for<'a> Deserialize<'a> + 'static + Send + Sync> NavProperty<T>

Source

pub async fn get<B: Bmc>(&self, bmc: &B) -> Result<Arc<T>, B::Error>

Get the property value.

§Errors

If the navigation property is already expanded then no error is returned.

If the navigation is a reference then a BMC error may be returned if retrieval of the entity fails.

Source

pub async fn filter<B: Bmc>( &self, bmc: &B, query: FilterQuery, ) -> Result<Arc<T>, B::Error>

Filter the property value using the provided query.

§Errors

Returns a BMC error if filtering the entity fails.

Trait Implementations§

Source§

impl<C, R, T: Creatable<C, R>> Creatable<C, R> for NavProperty<T>
where C: Sync + Send + Sized + Serialize, R: Sync + Send + Sized + for<'de> Deserialize<'de>,

Source§

fn create<B: Bmc>( &self, bmc: &B, create: &V, ) -> impl Future<Output = Result<ModificationResponse<R>, B::Error>> + Send

Create an entity using create as payload.
Source§

impl<T: Debug + EntityTypeRef> Debug for NavProperty<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Deletable> Deletable for NavProperty<T>

Source§

fn delete<B: Bmc>( &self, bmc: &B, ) -> impl Future<Output = Result<ModificationResponse<Self>, B::Error>> + Send

Delete current entity.
Source§

impl<'de, T> Deserialize<'de> for NavProperty<T>
where T: EntityTypeRef + for<'a> Deserialize<'a>,

Source§

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<T: EntityTypeRef> EntityTypeRef for NavProperty<T>

Source§

fn odata_id(&self) -> &ODataId

Value of @odata.id field of the Entity.
Source§

fn etag(&self) -> Option<&ODataETag>

Value of @odata.etag field of the Entity.
Source§

fn refresh<B: Bmc>( &self, bmc: &B, ) -> impl Future<Output = Result<Arc<Self>, B::Error>> + Send
where Self: Sync + Send + 'static + Sized + for<'de> Deserialize<'de>,

Refresh the entity by fetching it again from the BMC.
Source§

impl<T: Expandable> Expandable for NavProperty<T>

Source§

fn expand<B: Bmc>( &self, bmc: &B, query: ExpandQuery, ) -> impl Future<Output = Result<Arc<Self>, B::Error>> + Send

Expand the entity according to the provided query.
Source§

impl<T: EntityTypeRef> From<&NavProperty<T>> for Reference

Source§

fn from(v: &NavProperty<T>) -> Self

Converts to this type from the input type.
Source§

impl<U, T: Updatable<U>> Updatable<U> for NavProperty<T>
where U: Sync + Send + Sized + Serialize,

Source§

fn update<B: Bmc>( &self, bmc: &B, update: &V, ) -> impl Future<Output = Result<ModificationResponse<Self>, B::Error>> + Send

Update an entity using update as payload.

Auto Trait Implementations§

§

impl<T> Freeze for NavProperty<T>

§

impl<T> RefUnwindSafe for NavProperty<T>
where T: RefUnwindSafe,

§

impl<T> Send for NavProperty<T>
where T: Sync + Send,

§

impl<T> Sync for NavProperty<T>
where T: Sync + Send,

§

impl<T> Unpin for NavProperty<T>

§

impl<T> UnsafeUnpin for NavProperty<T>

§

impl<T> UnwindSafe for NavProperty<T>
where T: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,