pub struct DeserialisedBlock {
pub kind: BlockKind,
pub data_compressed_len: Option<usize>,
pub data_uncompressed_len: usize,
pub compression: CompressionAlgorithm,
pub encoding: Encoding,
pub parameters: Box<[u8]>,
pub data: Box<[u8]>,
}Expand description
A struct representing a deserialised binary gcode block.
Fields§
§kind: BlockKind§data_compressed_len: Option<usize>§data_uncompressed_len: usize§compression: CompressionAlgorithm§encoding: Encoding§parameters: Box<[u8]>§data: Box<[u8]>Implementations§
Source§impl DeserialisedBlock
impl DeserialisedBlock
Sourcepub fn decompress(&self) -> Result<Box<[u8]>, BlockError>
pub fn decompress(&self) -> Result<Box<[u8]>, BlockError>
Internal function to decompress the data given the compression algorithm.
Sourcepub fn to_ascii(
&mut self,
buf: &mut Vec<u8>,
with_block_comments: bool,
) -> Result<(), BinaryGcodeError>
pub fn to_ascii( &mut self, buf: &mut Vec<u8>, with_block_comments: bool, ) -> Result<(), BinaryGcodeError>
Pumps the decompressed ascii representation of the gcode block into a buffer. The user can define whether they want to include our block comments so they can see the decomposition of blocks in the gcode.
Trait Implementations§
Source§impl Debug for DeserialisedBlock
impl Debug for DeserialisedBlock
Auto Trait Implementations§
impl Freeze for DeserialisedBlock
impl RefUnwindSafe for DeserialisedBlock
impl Send for DeserialisedBlock
impl Sync for DeserialisedBlock
impl Unpin for DeserialisedBlock
impl UnwindSafe for DeserialisedBlock
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
Mutably borrows from an owned value. Read more