pub struct ObjectStore { /* private fields */ }
Expand description

A Compute@Edge Object Store.

Keys in the Object Store must follow the following rules:

  • Keys can contain any sequence of valid Unicode characters, of length 1-1024 bytes when UTF-8 encoded.
  • Keys cannot contain Carriage Return or Line Feed characters.
  • Keys cannot start with .well-known/acme-challenge/.
  • Keys cannot be named . or ...

Implementations

Open the Object Store with the given name.

If there is no store by that name, this returns Ok(None).

Look up a value in the Object Store.

Returns Ok(Some(Body)) if the value is found, and Ok(None) if the key was not found.

Look up a value in the Object Store, and return it as a byte vector.

Returns Ok(Some(Vec<u8>)) if the value is found, and Ok(None) if the key was not found.

Look up a value in the Object Store, and return it as a string.

Returns Ok(Some(String)) if the value is found, and Ok(None) if the key was not found.

Panics

Panics if the value is not a valid UTF-8 string.

Insert a value into the Object Store.

If the store already contained a value for this key, it will be overwritten.

The value may be provided as any type that can be converted to Body, such as &[u8], Vec<u8>, &str, or String.

Value sizes

The size of the value must be known when calling this method. In practice, that means that if a Body value contains an external request or response, it must be encoded with Content-Length rather than Transfer-Encoding: chunked.

For the moment, this method will return StoreError::Unexpected(FastlyStatus::INVAL) if the value size is not known. This will be replaced by a more specific error value in a future release.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.