Skip to main content

FetchableWithContext

Trait FetchableWithContext 

Source
pub trait FetchableWithContext: SonosProperty {
    type Operation: UPnPOperation;

    // Required methods
    fn build_operation(    ) -> Result<ComposableOperation<Self::Operation>, SdkError>;
    fn from_response_with_context(
        response: <Self::Operation as UPnPOperation>::Response,
        speaker_id: &SpeakerId,
    ) -> Option<Self>;
}
Expand description

Trait for properties that require context (e.g., speaker_id) to interpret the response

Unlike Fetchable, the response contains data for multiple entities and the correct one must be extracted using context.

Required Associated Types§

Source

type Operation: UPnPOperation

The UPnP operation type used to fetch this property

Required Methods§

Source

fn build_operation() -> Result<ComposableOperation<Self::Operation>, SdkError>

Build the operation to fetch this property

Source

fn from_response_with_context( response: <Self::Operation as UPnPOperation>::Response, speaker_id: &SpeakerId, ) -> Option<Self>

Convert the operation response to the property value using speaker context

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FetchableWithContext for GroupMembership

Implementors§