pub trait ReadXdrwhere
Self: Sized,{
// Required method
fn read_xdr<R: Read>(r: &mut Limited<R>) -> Result<Self, Error>;
// Provided methods
fn read_xdr_base64<R: Read>(r: &mut Limited<R>) -> Result<Self, Error> { ... }
fn read_xdr_to_end<R: Read>(r: &mut Limited<R>) -> Result<Self, Error> { ... }
fn read_xdr_base64_to_end<R: Read>(
r: &mut Limited<R>,
) -> Result<Self, Error> { ... }
fn read_xdr_into<R: Read>(
&mut self,
r: &mut Limited<R>,
) -> Result<(), Error> { ... }
fn read_xdr_into_to_end<R: Read>(
&mut self,
r: &mut Limited<R>,
) -> Result<(), Error> { ... }
fn read_xdr_iter<R: Read>(r: &mut Limited<R>) -> ReadXdrIter<&mut R, Self> ⓘ { ... }
fn read_xdr_base64_iter<R: Read>(
r: &mut Limited<R>,
) -> ReadXdrIter<DecoderReader<'_, R>, Self> ⓘ { ... }
fn from_xdr(bytes: impl AsRef<[u8]>, limits: Limits) -> Result<Self, Error> { ... }
fn from_xdr_base64(
b64: impl AsRef<[u8]>,
limits: Limits,
) -> Result<Self, Error> { ... }
}
next
only.Required Methods§
Sourcefn read_xdr<R: Read>(r: &mut Limited<R>) -> Result<Self, Error>
Available on crate feature std
only.
fn read_xdr<R: Read>(r: &mut Limited<R>) -> Result<Self, Error>
std
only.Read the XDR and construct the type.
Read bytes from the given read implementation, decoding the bytes as XDR, and construct the type implementing this interface from those bytes.
Just enough bytes are read from the read implementation to construct the type. Any residual bytes remain in the read implementation.
All implementations should continue if the read implementation returns
ErrorKind::Interrupted
.
Use [ReadXdR: Read_xdr_to_end
] when the intent is for all bytes in the
read implementation to be consumed by the read.
Provided Methods§
Sourcefn read_xdr_base64<R: Read>(r: &mut Limited<R>) -> Result<Self, Error>
Available on crate feature base64
only.
fn read_xdr_base64<R: Read>(r: &mut Limited<R>) -> Result<Self, Error>
base64
only.Construct the type from the XDR bytes base64 encoded.
An error is returned if the bytes are not completely consumed by the deserialization.
Sourcefn read_xdr_to_end<R: Read>(r: &mut Limited<R>) -> Result<Self, Error>
Available on crate feature std
only.
fn read_xdr_to_end<R: Read>(r: &mut Limited<R>) -> Result<Self, Error>
std
only.Read the XDR and construct the type, and consider it an error if the read does not completely consume the read implementation.
Read bytes from the given read implementation, decoding the bytes as XDR, and construct the type implementing this interface from those bytes.
Just enough bytes are read from the read implementation to construct the type, and then confirm that no further bytes remain. To confirm no further bytes remain additional bytes are attempted to be read from the read implementation. If it is possible to read any residual bytes from the read implementation an error is returned. The read implementation may not be exhaustively read if there are residual bytes, and it is considered undefined how many residual bytes or how much of the residual buffer are consumed in this case.
All implementations should continue if the read implementation returns
ErrorKind::Interrupted
.
Sourcefn read_xdr_base64_to_end<R: Read>(r: &mut Limited<R>) -> Result<Self, Error>
Available on crate feature base64
only.
fn read_xdr_base64_to_end<R: Read>(r: &mut Limited<R>) -> Result<Self, Error>
base64
only.Construct the type from the XDR bytes base64 encoded.
An error is returned if the bytes are not completely consumed by the deserialization.
Sourcefn read_xdr_into<R: Read>(&mut self, r: &mut Limited<R>) -> Result<(), Error>
Available on crate feature std
only.
fn read_xdr_into<R: Read>(&mut self, r: &mut Limited<R>) -> Result<(), Error>
std
only.Read the XDR and construct the type.
Read bytes from the given read implementation, decoding the bytes as XDR, and construct the type implementing this interface from those bytes.
Just enough bytes are read from the read implementation to construct the type. Any residual bytes remain in the read implementation.
All implementations should continue if the read implementation returns
ErrorKind::Interrupted
.
Use [ReadXdR: Read_xdr_into_to_end
] when the intent is for all bytes
in the read implementation to be consumed by the read.
Sourcefn read_xdr_into_to_end<R: Read>(
&mut self,
r: &mut Limited<R>,
) -> Result<(), Error>
Available on crate feature std
only.
fn read_xdr_into_to_end<R: Read>( &mut self, r: &mut Limited<R>, ) -> Result<(), Error>
std
only.Read the XDR into the existing value, and consider it an error if the read does not completely consume the read implementation.
Read bytes from the given read implementation, decoding the bytes as XDR, and construct the type implementing this interface from those bytes.
Just enough bytes are read from the read implementation to construct the type, and then confirm that no further bytes remain. To confirm no further bytes remain additional bytes are attempted to be read from the read implementation. If it is possible to read any residual bytes from the read implementation an error is returned. The read implementation may not be exhaustively read if there are residual bytes, and it is considered undefined how many residual bytes or how much of the residual buffer are consumed in this case.
All implementations should continue if the read implementation returns
ErrorKind::Interrupted
.
Sourcefn read_xdr_iter<R: Read>(r: &mut Limited<R>) -> ReadXdrIter<&mut R, Self> ⓘ
Available on crate feature std
only.
fn read_xdr_iter<R: Read>(r: &mut Limited<R>) -> ReadXdrIter<&mut R, Self> ⓘ
std
only.Create an iterator that reads the read implementation as a stream of values that are read into the implementing type.
Read bytes from the given read implementation, decoding the bytes as XDR, and construct the type implementing this interface from those bytes.
Just enough bytes are read from the read implementation to construct the type, and then confirm that no further bytes remain. To confirm no further bytes remain additional bytes are attempted to be read from the read implementation. If it is possible to read any residual bytes from the read implementation an error is returned. The read implementation may not be exhaustively read if there are residual bytes, and it is considered undefined how many residual bytes or how much of the residual buffer are consumed in this case.
All implementations should continue if the read implementation returns
ErrorKind::Interrupted
.
Sourcefn read_xdr_base64_iter<R: Read>(
r: &mut Limited<R>,
) -> ReadXdrIter<DecoderReader<'_, R>, Self> ⓘ
Available on crate feature base64
only.
fn read_xdr_base64_iter<R: Read>( r: &mut Limited<R>, ) -> ReadXdrIter<DecoderReader<'_, R>, Self> ⓘ
base64
only.Create an iterator that reads the read implementation as a stream of values that are read into the implementing type.
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.