Skip to main content

ResourceService

Trait ResourceService 

Source
pub trait ResourceService: Send + Sync {
    // Required methods
    fn source_snapshots(&self) -> &[SourceSnapshot];
    fn resources(
        &self,
        request: &ResourceRequest,
    ) -> Result<Vec<Object>, ResourceError>;
}
Expand description

Trusted adapter seam listing a source’s resource objects by class.

Required Methods§

Source

fn source_snapshots(&self) -> &[SourceSnapshot]

Exact source snapshots this service answers for.

Source

fn resources( &self, request: &ResourceRequest, ) -> Result<Vec<Object>, ResourceError>

Every resource object of the request’s class, complete or refused, sorted by identity.

A class the source does not declare has none. So has a class whose instances are the source’s objects, and, with subtypes, a class one of whose subclasses is: such a class selects objects only. Every answered object is of the request’s source and carries no properties, classifications or relationships of its own; its facts are resolved through the source’s services.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§