Skip to main content

Bmc

Trait Bmc 

Source
pub trait Bmc: Send + Sync {
    type Error: Error + Send + Sync;

    // Required methods
    fn expand<T>(
        &self,
        id: &ODataId,
        query: ExpandQuery,
    ) -> impl Future<Output = Result<Arc<T>, Self::Error>> + Send
       where T: Expandable + Send + Sync + 'static;
    fn get<T>(
        &self,
        id: &ODataId,
    ) -> impl Future<Output = Result<Arc<T>, Self::Error>> + Send
       where T: EntityTypeRef + for<'a> Deserialize<'a> + 'static + Send + Sync;
    fn filter<T>(
        &self,
        id: &ODataId,
        query: FilterQuery,
    ) -> impl Future<Output = Result<Arc<T>, Self::Error>> + Send
       where T: EntityTypeRef + for<'a> Deserialize<'a> + 'static + Send + Sync;
    fn create<V, R>(
        &self,
        id: &ODataId,
        query: &V,
    ) -> impl Future<Output = Result<ModificationResponse<R>, Self::Error>> + Send
       where V: Sync + Send + Serialize,
             R: Send + Sync + for<'a> Deserialize<'a>;
    fn update<V, R>(
        &self,
        id: &ODataId,
        etag: Option<&ODataETag>,
        update: &V,
    ) -> impl Future<Output = Result<ModificationResponse<R>, Self::Error>> + Send
       where V: Sync + Send + Serialize,
             R: Send + Sync + for<'a> Deserialize<'a>;
    fn delete<R>(
        &self,
        id: &ODataId,
    ) -> impl Future<Output = Result<ModificationResponse<R>, Self::Error>> + Send
       where R: EntityTypeRef + Sync + Send + for<'de> Deserialize<'de>;
    fn action<T, R>(
        &self,
        action: &Action<T, R>,
        params: &T,
    ) -> impl Future<Output = Result<ModificationResponse<R>, Self::Error>> + Send
       where T: Send + Sync + Serialize,
             R: Send + Sync + for<'a> Deserialize<'a>;
    fn stream<T>(
        &self,
        uri: &str,
    ) -> impl Future<Output = Result<Pin<Box<dyn TryStream<Ok = T, Error = Self::Error, Item = Result<T, Self::Error>> + Send>>, Self::Error>> + Send
       where T: for<'a> Deserialize<'a> + Send + 'static;
}
Expand description

BMC trait defines access to a Baseboard Management Controller using the Redfish protocol.

Required Associated Types§

Source

type Error: Error + Send + Sync

BMC Error.

Required Methods§

Source

fn expand<T>( &self, id: &ODataId, query: ExpandQuery, ) -> impl Future<Output = Result<Arc<T>, Self::Error>> + Send
where T: Expandable + Send + Sync + 'static,

Expand any expandable object (navigation property or entity).

T is structure that is used for return type.

Source

fn get<T>( &self, id: &ODataId, ) -> impl Future<Output = Result<Arc<T>, Self::Error>> + Send
where T: EntityTypeRef + for<'a> Deserialize<'a> + 'static + Send + Sync,

Get data of the object (navigation property or entity).

T is structure that is used for return type.

Source

fn filter<T>( &self, id: &ODataId, query: FilterQuery, ) -> impl Future<Output = Result<Arc<T>, Self::Error>> + Send
where T: EntityTypeRef + for<'a> Deserialize<'a> + 'static + Send + Sync,

Get and filters data of the object (navigation property or entity).

T is structure that is used for return type.

Source

fn create<V, R>( &self, id: &ODataId, query: &V, ) -> impl Future<Output = Result<ModificationResponse<R>, Self::Error>> + Send
where V: Sync + Send + Serialize, R: Send + Sync + for<'a> Deserialize<'a>,

Creates element of the collection.

V is structure that is used for create. R is structure that is used for return type.

Source

fn update<V, R>( &self, id: &ODataId, etag: Option<&ODataETag>, update: &V, ) -> impl Future<Output = Result<ModificationResponse<R>, Self::Error>> + Send
where V: Sync + Send + Serialize, R: Send + Sync + for<'a> Deserialize<'a>,

Update entity.

V is structure that is used for update. R is structure that is used for return type (updated entity).

Source

fn delete<R>( &self, id: &ODataId, ) -> impl Future<Output = Result<ModificationResponse<R>, Self::Error>> + Send
where R: EntityTypeRef + Sync + Send + for<'de> Deserialize<'de>,

Delete entity.

Source

fn action<T, R>( &self, action: &Action<T, R>, params: &T, ) -> impl Future<Output = Result<ModificationResponse<R>, Self::Error>> + Send
where T: Send + Sync + Serialize, R: Send + Sync + for<'a> Deserialize<'a>,

Run action.

T is structure that contains action parameters. R is structure with return type.

Source

fn stream<T>( &self, uri: &str, ) -> impl Future<Output = Result<Pin<Box<dyn TryStream<Ok = T, Error = Self::Error, Item = Result<T, Self::Error>> + Send>>, Self::Error>> + Send
where T: for<'a> Deserialize<'a> + Send + 'static,

Stream data for the URI.

T is structure that is used for the stream return type.

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.

Implementors§