-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make FixedByteSize a regular trait and move it to ragnarok_bytes
Moving the const FixedByteSize trait to another crate caused the compiler to crash while building. Since I need this trait to be accessible outside of the main crate, I had to make it non-const for now. This is to be reverted once const traits are more stable.
- Loading branch information
Showing
8 changed files
with
35 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
mod implement; | ||
|
||
#[const_trait] | ||
/// Trait for getting the size of Ragnarok Online types. | ||
pub trait FixedByteSize { | ||
/// Get the serialized size in bytes. | ||
fn size_in_bytes() -> usize; | ||
} | ||
|
||
#[const_trait] | ||
pub trait FixedByteSizeWrapper { | ||
/// Trait for collections holding elements that implement [`FixedByteSize`]. | ||
pub trait FixedByteSizeCollection { | ||
/// Get the serialized size of the inner type in bytes. | ||
fn size_in_bytes() -> usize; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters