Upgraded to latest sigils release.
This added the ability to more easily print Vectors and Quaternions. This also fixes some style issues. Missing documents will now cause warnings when building.
This commit is contained in:
@ -84,6 +84,7 @@ pub trait ByteSized
|
||||
}
|
||||
|
||||
|
||||
|
||||
macro_rules! byte_sized_impl
|
||||
{
|
||||
($(($varType: ty, $numBytes: expr))*) =>
|
||||
|
@ -1,4 +1,8 @@
|
||||
//! The Alchemy library is a data type to byte converter library.
|
||||
//! Alchemy handles converting numbers to and from bytes
|
||||
//! in either big or little endian format.
|
||||
#![feature(associated_consts)]
|
||||
#![warn(missing_docs)]
|
||||
|
||||
extern crate sigils;
|
||||
|
||||
|
@ -8,6 +8,20 @@ use ::endian::{BigEndian, LittleEndian, PlatformEndian, Endianess};
|
||||
|
||||
|
||||
|
||||
// From and Into are not used because we need to also
|
||||
// know the endianess to use for converting.
|
||||
/// A type that can be converted to and from bytes.
|
||||
pub trait Transmutable
|
||||
{
|
||||
/// Transmute this type to an array of bytes.
|
||||
fn to_bytes(&self, buffer: &mut [u8], endianess: Endianess);
|
||||
|
||||
/// Transmute an array of bytes to this type.
|
||||
fn from_bytes(buffer: &[u8], endianess: Endianess) -> Self;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// Handles the repetative endianess matching
|
||||
/// for the primitive number types when converting
|
||||
/// a number to bytes.
|
||||
@ -69,20 +83,6 @@ macro_rules! handle_endianess_from_bytes
|
||||
|
||||
|
||||
|
||||
// From and Into are not used because we need to also
|
||||
// know the endianess to use for converting.
|
||||
/// A type that can be converted to and from bytes.
|
||||
pub trait Transmutable
|
||||
{
|
||||
/// Transmute this type to an array of bytes.
|
||||
fn to_bytes(&self, buffer: &mut [u8], endianess: Endianess);
|
||||
|
||||
/// Transmute an array of bytes to this type.
|
||||
fn from_bytes(buffer: &[u8], endianess: Endianess) -> Self;
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl Transmutable for u8
|
||||
{
|
||||
#[allow(unused_variables)]
|
||||
|
Reference in New Issue
Block a user