pub struct WriteContentRequest {
pub action: i32,
pub ref: String,
pub total: i64,
pub expected: String,
pub offset: i64,
pub data: Vec<u8>,
pub labels: HashMap<String, String>,
}
Expand description
WriteContentRequest writes data to the request ref at offset.
Fields§
§action: i32
Action sets the behavior of the write.
When this is a write and the ref is not yet allocated, the ref will be allocated and the data will be written at offset.
If the action is write and the ref is allocated, it will accept data to an offset that has not yet been written.
If the action is write and there is no data, the current write status will be returned. This works differently from status because the stream holds a lock.
ref: String
Ref identifies the pre-commit object to write to.
total: i64
Total can be set to have the service validate the total size of the committed content.
The latest value before or with the commit action message will be use to validate the content. If the offset overflows total, the service may report an error. It is only required on one message for the write.
If the value is zero or less, no validation of the final content will be performed.
expected: String
Expected can be set to have the service validate the final content against the provided digest.
If the digest is already present in the object store, an AlreadyExists error will be returned.
Only the latest version will be used to check the content against the digest. It is only required to include it on a single message, before or with the commit action message.
offset: i64
Offset specifies the number of bytes from the start at which to begin the write. For most implementations, this means from the start of the file. This uses standard, zero-indexed semantics.
If the action is write, the remote may remove all previously written data after the offset. Implementations may support arbitrary offsets but MUST support reseting this value to zero with a write. If an implementation does not support a write at a particular offset, an OutOfRange error must be returned.
data: Vec<u8>
Data is the actual bytes to be written.
If this is empty and the message is not a commit, a response will be returned with the current write state.
labels: HashMap<String, String>
Labels are arbitrary data on snapshots.
The combined size of a key/value pair cannot exceed 4096 bytes.
Implementations§
source§impl WriteContentRequest
impl WriteContentRequest
sourcepub fn action(&self) -> WriteAction
pub fn action(&self) -> WriteAction
Returns the enum value of action
, or the default if the field is set to an invalid enum value.
sourcepub fn set_action(&mut self, value: WriteAction)
pub fn set_action(&mut self, value: WriteAction)
Sets action
to the provided enum value.
Trait Implementations§
source§impl Clone for WriteContentRequest
impl Clone for WriteContentRequest
source§fn clone(&self) -> WriteContentRequest
fn clone(&self) -> WriteContentRequest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WriteContentRequest
impl Debug for WriteContentRequest
source§impl Default for WriteContentRequest
impl Default for WriteContentRequest
source§impl Message for WriteContentRequest
impl Message for WriteContentRequest
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl Name for WriteContentRequest
impl Name for WriteContentRequest
source§const NAME: &'static str = "WriteContentRequest"
const NAME: &'static str = "WriteContentRequest"
Message
.
This name is the same as it appears in the source .proto file, e.g. FooBar
.source§const PACKAGE: &'static str = "containerd.services.content.v1"
const PACKAGE: &'static str = "containerd.services.content.v1"
.
, e.g. google.protobuf
.source§fn full_name() -> String
fn full_name() -> String
Message
.
It’s prefixed with the package name and names of any parent messages,
e.g. google.rpc.BadRequest.FieldViolation
.
By default, this is the package name followed by the message name.
Fully-qualified names must be unique within a domain of Type URLs.source§impl PartialEq for WriteContentRequest
impl PartialEq for WriteContentRequest
impl StructuralPartialEq for WriteContentRequest
Auto Trait Implementations§
impl Freeze for WriteContentRequest
impl RefUnwindSafe for WriteContentRequest
impl Send for WriteContentRequest
impl Sync for WriteContentRequest
impl Unpin for WriteContentRequest
impl UnwindSafe for WriteContentRequest
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request