Trait FetchRequest

Source
trait FetchRequest:
    Copy
    + Debug
    + Send
    + Sync
    + 'static {
    // Provided method
    fn might_exist(self, _heights: Heights) -> bool { ... }
}

Provided Methods§

Source

fn might_exist(self, _heights: Heights) -> bool

Indicate whether it is possible this object could exist.

This can filter out requests quickly for objects that cannot possibly exist, such as requests for objects with a height greater than the current block height. Not only does this let us fail faster for such requests (without touching storage at all), it also helps keep logging quieter when we fail to fetch an object because the user made a bad request, while still being fairly loud when we fail to fetch an object that might have really existed.

This method is conservative: it returns true if it cannot tell whether the given object could exist or not.

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§

Source§

impl FetchRequest for StateCertRequest

Source§

impl<Types> FetchRequest for BlockId<Types>
where Types: NodeType,

Source§

impl<Types> FetchRequest for LeafId<Types>
where Types: NodeType,

Source§

impl<Types> FetchRequest for VidCommonRequest<Types>
where Types: NodeType,

Source§

impl<Types: NodeType> FetchRequest for TransactionRequest<Types>