pub trait VarLongWrite: Write {
// Provided method
fn write_varlong(&mut self, value: i64) -> Result<(), CodecError> { ... }
}Expand description
Extension methods for writing Minecraft protocol VarLong values.
This trait is implemented for every Write type.
§Example
use mcproto_codec::varlong::VarLongWrite;
let mut output = Vec::new();
output.write_varlong(9_223_372_036_854_775_000)?;
Provided Methods§
Sourcefn write_varlong(&mut self, value: i64) -> Result<(), CodecError>
fn write_varlong(&mut self, value: i64) -> Result<(), CodecError>
Writes value to this writer as a VarLong.
§Errors
Returns a CodecError if the underlying writer fails. The error’s
byte count reports how much of this value was written successfully.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".