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:
Jason Travis Smith
2016-01-07 17:49:21 -05:00
parent 1374ff5e4a
commit 307118412b
7 changed files with 43 additions and 40 deletions

View File

@ -84,6 +84,7 @@ pub trait ByteSized
}
macro_rules! byte_sized_impl
{
($(($varType: ty, $numBytes: expr))*) =>

View File

@ -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;

View File

@ -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)]