doc: Add examples for runtime defined data and Schema

This commit is contained in:
Clément Renault 2018-12-29 12:26:33 +01:00
parent a842e647f7
commit 20b5a6a06e
No known key found for this signature in database
GPG key ID: 0151CDAB43460DAE
5 changed files with 94 additions and 47 deletions

View file

@ -63,10 +63,12 @@ impl Attribute {
}
}
#[inline]
pub fn attribute(&self) -> u16 {
(self.0 >> 22) as u16
}
#[inline]
pub fn word_index(&self) -> u32 {
self.0 & 0b0000_0000_0011_1111_1111_1111_1111
}
@ -129,10 +131,12 @@ impl WordArea {
}
}
#[inline]
pub fn byte_index(&self) -> u32 {
self.0 >> 10
}
#[inline]
pub fn length(&self) -> u16 {
(self.0 & 0b0000_0000_0000_0000_0011_1111_1111) as u16
}