pub trait ContentPolicy: Send + Sync {
// Required method
fn new_stream_policy(
&self,
digest: &AnyHash,
) -> ContentPolicyResult<Box<dyn ContentStreamPolicy>>;
}Expand description
A trait implemented by content policies.
Required Methods§
Sourcefn new_stream_policy(
&self,
digest: &AnyHash,
) -> ContentPolicyResult<Box<dyn ContentStreamPolicy>>
fn new_stream_policy( &self, digest: &AnyHash, ) -> ContentPolicyResult<Box<dyn ContentStreamPolicy>>
Creates a new stream policy for the given digest.
The digest is provided so that a policy can make decisions based on the content’s digest before any content is received.
Upon success, returns a content stream policy that can be used to check the content as it is received.