Skip to main content

ContentGets

Trait ContentGets 

pub trait ContentGets: Send + Sync {
    // Required method
    fn get(
        &self,
        caller: &Caller,
        content: &str,
        offset: u64,
        length: u64,
    ) -> Result<ContentPiece, ActionHostError>;
}
Expand description

A workspace’s content store as a caller reads it.

Required Methods§

fn get( &self, caller: &Caller, content: &str, offset: u64, length: u64, ) -> Result<ContentPiece, ActionHostError>

The bytes of content (tilo.content:<hash>) from offset, at most length of them; length of zero asks for as many as one piece carries.

§Errors

ActionHostError::InvalidRequest for a reference that is not one, content the caller’s workspace does not hold, an offset past its end, or a piece longer than super::MAX_CONTENT_FRAME_BYTES.

Implementors§