pub struct TestRecord { /* private fields */ }Expand description
Test record used to document the generated fixed-record API. 生成される fixed-record API のドキュメント用テストレコードです。
Implementations§
Source§impl TestRecord
impl TestRecord
Sourcepub const CLEAR_BYTE: u8 = 32u8
pub const CLEAR_BYTE: u8 = 32u8
Byte value used by set_field_* methods to clear a field before writing.
set_field_* が書き込み前にフィールドをクリアするときのバイト値です。
Sourcepub const FIELD_SIZE_NAME: usize = 10usize
pub const FIELD_SIZE_NAME: usize = 10usize
Byte length constant for the field. フィールドのバイト長定数です。
Sourcepub const FIELD_SIZE_CODE: usize = 5usize
pub const FIELD_SIZE_CODE: usize = 5usize
Byte length constant for the field. フィールドのバイト長定数です。
Sourcepub const FIELD_SIZE_AMOUNT: usize = 8usize
pub const FIELD_SIZE_AMOUNT: usize = 8usize
Byte length constant for the field. フィールドのバイト長定数です。
Sourcepub fn name(&self) -> &[u8] ⓘ
pub fn name(&self) -> &[u8] ⓘ
Name field used by generated API tests. 生成 API テストで使う名前フィールドです。 Returns the field as bytes. フィールドをバイト列として返します。
Sourcepub fn name_str(&self) -> Result<&str, Error>
pub fn name_str(&self) -> Result<&str, Error>
Name field used by generated API tests. 生成 API テストで使う名前フィールドです。 Returns the field as a UTF-8 string. フィールドを UTF-8 文字列として参照します。
Sourcepub fn with_name(self, s: &str) -> Self
pub fn with_name(self, s: &str) -> Self
Name field used by generated API tests. 生成 API テストで使う名前フィールドです。 Overwrites the field from the beginning with a string. フィールドに文字列を先頭から上書きします。 The field is not cleared before writing, so shorter strings leave trailing bytes intact. 書き込み前のクリアは行わないため、短い文字列では後続バイトが残ります。
Sourcepub fn with_name_int(self, val: i64) -> Self
pub fn with_name_int(self, val: i64) -> Self
Name field used by generated API tests. 生成 API テストで使う名前フィールドです。 Sets the field to a zero-padded numeric string. フィールドに数値をゼロ埋め文字列としてセットします。 Values wider than the field are truncated and reported to stderr. 値がフィールド幅を超える場合は切り捨て、stderr に警告を出します。
Sourcepub fn try_with_name_int(self, val: i64) -> Result<Self, Error>
pub fn try_with_name_int(self, val: i64) -> Result<Self, Error>
Name field used by generated API tests.
生成 API テストで使う名前フィールドです。
Sets the field to a zero-padded numeric string.
フィールドに数値をゼロ埋め文字列としてセットします。
Returns Error::FieldOverflow when the value is wider than the field.
値がフィールド幅を超える場合は Error::FieldOverflow を返します。
Sourcepub fn with_name_int_truncated(self, val: i64) -> Self
pub fn with_name_int_truncated(self, val: i64) -> Self
Name field used by generated API tests. 生成 API テストで使う名前フィールドです。 Sets the field to a zero-padded numeric string and keeps only the leading bytes when it overflows. フィールドに数値をゼロ埋め文字列としてセットし、幅を超えた場合は先頭側だけ残します。 Truncation is reported to stderr. 切り捨てが発生した場合は stderr に警告を出します。
Sourcepub fn with_name_int_signed(self, val: i64) -> Self
pub fn with_name_int_signed(self, val: i64) -> Self
Name field used by generated API tests.
生成 API テストで使う名前フィールドです。
Sets the field to a zero-padded signed numeric string prefixed with + or -.
フィールドに符号付き数値を + または - を先頭にしてゼロ埋めでセットします。
Values wider than the field are truncated and reported to stderr.
値がフィールド幅を超える場合は切り捨て、stderr に警告を出します。
Sourcepub fn try_with_name_int_signed(self, val: i64) -> Result<Self, Error>
pub fn try_with_name_int_signed(self, val: i64) -> Result<Self, Error>
Name field used by generated API tests.
生成 API テストで使う名前フィールドです。
Sets the field to a zero-padded signed numeric string prefixed with + or -.
フィールドに符号付き数値を + または - を先頭にしてゼロ埋めでセットします。
Returns Error::FieldOverflow when the value is wider than the field.
値がフィールド幅を超える場合は Error::FieldOverflow を返します。
Sourcepub fn with_name_int_signed_truncated(self, val: i64) -> Self
pub fn with_name_int_signed_truncated(self, val: i64) -> Self
Name field used by generated API tests. 生成 API テストで使う名前フィールドです。 Sets the field to a signed numeric string and keeps only the leading bytes when it overflows. フィールドに符号付き数値をセットし、幅を超えた場合は先頭側だけ残します。 Truncation is reported to stderr. 切り捨てが発生した場合は stderr に警告を出します。
Sourcepub fn code(&self) -> &[u8] ⓘ
pub fn code(&self) -> &[u8] ⓘ
Code field used by generated API tests. 生成 API テストで使うコードフィールドです。 Returns the field as bytes. フィールドをバイト列として返します。
Sourcepub fn code_str(&self) -> Result<&str, Error>
pub fn code_str(&self) -> Result<&str, Error>
Code field used by generated API tests. 生成 API テストで使うコードフィールドです。 Returns the field as a UTF-8 string. フィールドを UTF-8 文字列として参照します。
Sourcepub fn with_code(self, s: &str) -> Self
pub fn with_code(self, s: &str) -> Self
Code field used by generated API tests. 生成 API テストで使うコードフィールドです。 Overwrites the field from the beginning with a string. フィールドに文字列を先頭から上書きします。 The field is not cleared before writing, so shorter strings leave trailing bytes intact. 書き込み前のクリアは行わないため、短い文字列では後続バイトが残ります。
Sourcepub fn with_code_int(self, val: i64) -> Self
pub fn with_code_int(self, val: i64) -> Self
Code field used by generated API tests. 生成 API テストで使うコードフィールドです。 Sets the field to a zero-padded numeric string. フィールドに数値をゼロ埋め文字列としてセットします。 Values wider than the field are truncated and reported to stderr. 値がフィールド幅を超える場合は切り捨て、stderr に警告を出します。
Sourcepub fn try_with_code_int(self, val: i64) -> Result<Self, Error>
pub fn try_with_code_int(self, val: i64) -> Result<Self, Error>
Code field used by generated API tests.
生成 API テストで使うコードフィールドです。
Sets the field to a zero-padded numeric string.
フィールドに数値をゼロ埋め文字列としてセットします。
Returns Error::FieldOverflow when the value is wider than the field.
値がフィールド幅を超える場合は Error::FieldOverflow を返します。
Sourcepub fn with_code_int_truncated(self, val: i64) -> Self
pub fn with_code_int_truncated(self, val: i64) -> Self
Code field used by generated API tests. 生成 API テストで使うコードフィールドです。 Sets the field to a zero-padded numeric string and keeps only the leading bytes when it overflows. フィールドに数値をゼロ埋め文字列としてセットし、幅を超えた場合は先頭側だけ残します。 Truncation is reported to stderr. 切り捨てが発生した場合は stderr に警告を出します。
Sourcepub fn with_code_int_signed(self, val: i64) -> Self
pub fn with_code_int_signed(self, val: i64) -> Self
Code field used by generated API tests.
生成 API テストで使うコードフィールドです。
Sets the field to a zero-padded signed numeric string prefixed with + or -.
フィールドに符号付き数値を + または - を先頭にしてゼロ埋めでセットします。
Values wider than the field are truncated and reported to stderr.
値がフィールド幅を超える場合は切り捨て、stderr に警告を出します。
Sourcepub fn try_with_code_int_signed(self, val: i64) -> Result<Self, Error>
pub fn try_with_code_int_signed(self, val: i64) -> Result<Self, Error>
Code field used by generated API tests.
生成 API テストで使うコードフィールドです。
Sets the field to a zero-padded signed numeric string prefixed with + or -.
フィールドに符号付き数値を + または - を先頭にしてゼロ埋めでセットします。
Returns Error::FieldOverflow when the value is wider than the field.
値がフィールド幅を超える場合は Error::FieldOverflow を返します。
Sourcepub fn with_code_int_signed_truncated(self, val: i64) -> Self
pub fn with_code_int_signed_truncated(self, val: i64) -> Self
Code field used by generated API tests. 生成 API テストで使うコードフィールドです。 Sets the field to a signed numeric string and keeps only the leading bytes when it overflows. フィールドに符号付き数値をセットし、幅を超えた場合は先頭側だけ残します。 Truncation is reported to stderr. 切り捨てが発生した場合は stderr に警告を出します。
Sourcepub fn amount(&self) -> &[u8] ⓘ
pub fn amount(&self) -> &[u8] ⓘ
Amount field used by generated API tests. 生成 API テストで使う金額フィールドです。 Returns the field as bytes. フィールドをバイト列として返します。
Sourcepub fn amount_str(&self) -> Result<&str, Error>
pub fn amount_str(&self) -> Result<&str, Error>
Amount field used by generated API tests. 生成 API テストで使う金額フィールドです。 Returns the field as a UTF-8 string. フィールドを UTF-8 文字列として参照します。
Sourcepub fn with_amount(self, s: &str) -> Self
pub fn with_amount(self, s: &str) -> Self
Amount field used by generated API tests. 生成 API テストで使う金額フィールドです。 Overwrites the field from the beginning with a string. フィールドに文字列を先頭から上書きします。 The field is not cleared before writing, so shorter strings leave trailing bytes intact. 書き込み前のクリアは行わないため、短い文字列では後続バイトが残ります。
Sourcepub fn with_amount_int(self, val: i64) -> Self
pub fn with_amount_int(self, val: i64) -> Self
Amount field used by generated API tests. 生成 API テストで使う金額フィールドです。 Sets the field to a zero-padded numeric string. フィールドに数値をゼロ埋め文字列としてセットします。 Values wider than the field are truncated and reported to stderr. 値がフィールド幅を超える場合は切り捨て、stderr に警告を出します。
Sourcepub fn try_with_amount_int(self, val: i64) -> Result<Self, Error>
pub fn try_with_amount_int(self, val: i64) -> Result<Self, Error>
Amount field used by generated API tests.
生成 API テストで使う金額フィールドです。
Sets the field to a zero-padded numeric string.
フィールドに数値をゼロ埋め文字列としてセットします。
Returns Error::FieldOverflow when the value is wider than the field.
値がフィールド幅を超える場合は Error::FieldOverflow を返します。
Sourcepub fn with_amount_int_truncated(self, val: i64) -> Self
pub fn with_amount_int_truncated(self, val: i64) -> Self
Amount field used by generated API tests. 生成 API テストで使う金額フィールドです。 Sets the field to a zero-padded numeric string and keeps only the leading bytes when it overflows. フィールドに数値をゼロ埋め文字列としてセットし、幅を超えた場合は先頭側だけ残します。 Truncation is reported to stderr. 切り捨てが発生した場合は stderr に警告を出します。
Sourcepub fn with_amount_int_signed(self, val: i64) -> Self
pub fn with_amount_int_signed(self, val: i64) -> Self
Amount field used by generated API tests.
生成 API テストで使う金額フィールドです。
Sets the field to a zero-padded signed numeric string prefixed with + or -.
フィールドに符号付き数値を + または - を先頭にしてゼロ埋めでセットします。
Values wider than the field are truncated and reported to stderr.
値がフィールド幅を超える場合は切り捨て、stderr に警告を出します。
Sourcepub fn try_with_amount_int_signed(self, val: i64) -> Result<Self, Error>
pub fn try_with_amount_int_signed(self, val: i64) -> Result<Self, Error>
Amount field used by generated API tests.
生成 API テストで使う金額フィールドです。
Sets the field to a zero-padded signed numeric string prefixed with + or -.
フィールドに符号付き数値を + または - を先頭にしてゼロ埋めでセットします。
Returns Error::FieldOverflow when the value is wider than the field.
値がフィールド幅を超える場合は Error::FieldOverflow を返します。
Sourcepub fn with_amount_int_signed_truncated(self, val: i64) -> Self
pub fn with_amount_int_signed_truncated(self, val: i64) -> Self
Amount field used by generated API tests. 生成 API テストで使う金額フィールドです。 Sets the field to a signed numeric string and keeps only the leading bytes when it overflows. フィールドに符号付き数値をセットし、幅を超えた場合は先頭側だけ残します。 Truncation is reported to stderr. 切り捨てが発生した場合は stderr に警告を出します。
Sourcepub const fn size_of(field: TestRecordField) -> usize
pub const fn size_of(field: TestRecordField) -> usize
Returns the byte length of the specified field. 指定したフィールドのバイト長を返します。
Sourcepub const fn offset_of(field: TestRecordField) -> usize
pub const fn offset_of(field: TestRecordField) -> usize
Returns the byte offset from the start of the record to the specified field. レコードの先頭から指定したフィールドまでのバイトオフセットを返します。
Sourcepub const fn name_of(field: TestRecordField) -> &'static str
pub const fn name_of(field: TestRecordField) -> &'static str
Returns the declaration name of the specified field. 指定したフィールドの定義名を文字列として返します。
Sourcepub const fn all_fields() -> &'static [TestRecordField]
pub const fn all_fields() -> &'static [TestRecordField]
Returns all fields defined on this struct. この構造体に定義されているすべてのフィールドのリストを返します。
Sourcepub const fn zeroed() -> Self
pub const fn zeroed() -> Self
Creates a new record with every field filled with 0x00.
全フィールドを 0x00 で埋めた新しいインスタンスを生成します。
Sourcepub const fn spaced() -> Self
pub const fn spaced() -> Self
Creates a new record with every field filled with spaces (0x20).
全フィールドをスペース (0x20) で埋めた新しいインスタンスを生成します。
Sourcepub const fn cleared() -> Self
pub const fn cleared() -> Self
Creates a new record with every field filled with CLEAR_BYTE.
全フィールドを CLEAR_BYTE で埋めた新しいインスタンスを生成します。
Sourcepub fn to_bytes(&self) -> [u8; 23]
pub fn to_bytes(&self) -> [u8; 23]
Copies the record into a fixed-width byte array. インスタンスを固定長バイト配列としてコピーして返します。
Sourcepub const fn byte_len(&self) -> usize
pub const fn byte_len(&self) -> usize
Returns the total byte length of this record. インスタンスの合計バイト長を返します。
Sourcepub fn byte_len_fields(fields: &[TestRecordField]) -> usize
pub fn byte_len_fields(fields: &[TestRecordField]) -> usize
Returns the total byte length of the specified fields. 指定されたフィールドリストの合計バイト長を返します。
Sourcepub fn builder() -> Self
pub fn builder() -> Self
Creates a new builder value initialized with CLEAR_BYTE.
CLEAR_BYTE で初期化した新しいビルダーインスタンスを生成します。
Sourcepub fn build(self) -> Self
pub fn build(self) -> Self
Finishes building and returns the record value. ビルドを完了し、インスタンスを返します。
Sourcepub fn parse(src: &[u8]) -> Result<Self, Error>
pub fn parse(src: &[u8]) -> Result<Self, Error>
Reads bytes and creates a new owned record value. バイト列を読み取って、構造体の新しいインスタンス(所有権あり)を作成します。
Sourcepub fn parse_str(src: &str) -> Result<Self, Error>
pub fn parse_str(src: &str) -> Result<Self, Error>
Converts a string into a record by reading it as bytes. 文字列をバイト列として読み取り、構造体へ変換します。
Sourcepub fn ref_from_str(src: &str) -> Result<&Self, Error>
pub fn ref_from_str(src: &str) -> Result<&Self, Error>
Reads a string as a zero-copy shared reference when it is exactly one record wide. 文字列を、ちょうど1レコード分の幅である場合にコピーせず共有参照として読み取ります。
Sourcepub fn ref_from_bytes_prefix(src: &[u8]) -> Result<&Self, Error>
pub fn ref_from_bytes_prefix(src: &[u8]) -> Result<&Self, Error>
Reads the first record-width bytes as a zero-copy shared reference.
先頭の1レコード分のバイト列を、コピーせず共有参照として読み取ります。
Unlike zerocopy::FromBytes::ref_from_bytes, extra trailing bytes are accepted.
zerocopy::FromBytes::ref_from_bytes と異なり、後続の余りバイトを許容します。
Sourcepub fn ref_from_str_prefix(src: &str) -> Result<&Self, Error>
pub fn ref_from_str_prefix(src: &str) -> Result<&Self, Error>
Reads the first record-width bytes of a string as a zero-copy shared reference. 文字列の先頭1レコード分のバイト列を、コピーせず共有参照として読み取ります。
Sourcepub fn get_field_bytes(&self, field: TestRecordField) -> &[u8] ⓘ
pub fn get_field_bytes(&self, field: TestRecordField) -> &[u8] ⓘ
Returns the raw bytes of the specified field. 指定フィールドの生バイト列を返します。
Sourcepub fn get_field_str(&self, field: TestRecordField) -> Result<&str, Error>
pub fn get_field_str(&self, field: TestRecordField) -> Result<&str, Error>
Returns the specified field as a string after UTF-8 validation. 指定フィールドを文字列として取得します(UTF-8チェック)。
Sourcepub fn get_field_trimmed(&self, field: TestRecordField) -> Result<&str, Error>
pub fn get_field_trimmed(&self, field: TestRecordField) -> Result<&str, Error>
Returns a string slice with leading and trailing spaces or NUL bytes removed. フィールドから前後の空白やヌル文字を取り除いた文字列スライスを取得します。
Sourcepub fn get_field_string_trimmed(
&self,
field: TestRecordField,
) -> Result<String, Error>
pub fn get_field_string_trimmed( &self, field: TestRecordField, ) -> Result<String, Error>
Returns the specified field as a trimmed String.
指定フィールドをトリミング済みの String として取得します。
Sourcepub fn get_field_as<T: FromStr>(
&self,
field: TestRecordField,
) -> Result<T, Error>
pub fn get_field_as<T: FromStr>( &self, field: TestRecordField, ) -> Result<T, Error>
Trims the field and parses it into any FromStr type.
フィールドをトリミングした後、任意の FromStr 型にパースして取得します。
Sourcepub fn as_str(&self) -> Result<&str, Error>
pub fn as_str(&self) -> Result<&str, Error>
Returns the whole record as a UTF-8 string slice. レコード全体を UTF-8 文字列スライスとして返します。
Sourcepub fn fill_field_zero(&mut self, field: TestRecordField)
pub fn fill_field_zero(&mut self, field: TestRecordField)
Fills the specified field with 0x00 bytes.
指定したフィールドを 0x00 で埋めます。
Sourcepub fn fill_field_space(&mut self, field: TestRecordField)
pub fn fill_field_space(&mut self, field: TestRecordField)
Fills the specified field with spaces (0x20).
指定したフィールドを半角スペース (0x20) で埋めます。
Sourcepub fn fill_field_clear(&mut self, field: TestRecordField)
pub fn fill_field_clear(&mut self, field: TestRecordField)
Fills the specified field with CLEAR_BYTE.
指定したフィールドを CLEAR_BYTE で埋めます。
Sourcepub fn set_field_bytes(&mut self, field: TestRecordField, data: &[u8])
pub fn set_field_bytes(&mut self, field: TestRecordField, data: &[u8])
Clears the specified field with CLEAR_BYTE and then writes bytes into it.
特定フィールドを CLEAR_BYTE でクリアしてからバイト列を書き込みます。
Sourcepub fn set_field_bytes_no_clear(&mut self, field: TestRecordField, data: &[u8])
pub fn set_field_bytes_no_clear(&mut self, field: TestRecordField, data: &[u8])
Overwrites the specified field from the beginning with bytes. 特定フィールドにバイト列を先頭から上書きします。 The field is not cleared before writing, so shorter inputs leave trailing bytes intact. 書き込み前のクリアは行わないため、短い入力では後続バイトが残ります。
Sourcepub fn set_field_str(&mut self, field: TestRecordField, s: &str)
pub fn set_field_str(&mut self, field: TestRecordField, s: &str)
Clears the specified field with CLEAR_BYTE and then writes a string into it.
特定フィールドを CLEAR_BYTE でクリアしてから文字列を書き込みます。
Sourcepub fn set_field_str_no_clear(&mut self, field: TestRecordField, s: &str)
pub fn set_field_str_no_clear(&mut self, field: TestRecordField, s: &str)
Overwrites the specified field from the beginning with a string. 特定フィールドに文字列を先頭から上書きします。 The field is not cleared before writing, so shorter strings leave trailing bytes intact. 書き込み前のクリアは行わないため、短い文字列では後続バイトが残ります。
Sourcepub fn fill_space(&mut self)
pub fn fill_space(&mut self)
Fills all fields with spaces (0x20).
すべてのフィールドを半角スペース (0x20) で一括上書きします。
Sourcepub fn apply<F>(self, f: F) -> Selfwhere
F: FnOnce(&mut Self),
pub fn apply<F>(self, f: F) -> Selfwhere
F: FnOnce(&mut Self),
Passes self to a closure for method-chain friendly mutation.
自身をクロージャに渡して加工する、メソッドチェーン向けの汎用メソッドです。
Sourcepub fn apply_bytes(self, data: &[u8]) -> Self
pub fn apply_bytes(self, data: &[u8]) -> Self
Applies bytes field by field from the first field. 先頭フィールドから順に、渡されたバイト列を各フィールドの長さ分ずつ流し込みます。
Sourcepub fn apply_str(self, s: &str) -> Self
pub fn apply_str(self, s: &str) -> Self
Applies a string field by field from the first field. 先頭フィールドから順に、渡された文字列を流し込みます。
Sourcepub fn apply_bytes_from(self, start_field: TestRecordField, data: &[u8]) -> Self
pub fn apply_bytes_from(self, start_field: TestRecordField, data: &[u8]) -> Self
Applies bytes sequentially from the specified starting field. 開始フィールドを指定して、そこから順次データを流し込みます。
Sourcepub fn apply_str_from(self, start_field: TestRecordField, s: &str) -> Self
pub fn apply_str_from(self, start_field: TestRecordField, s: &str) -> Self
Applies string data sequentially from the specified starting field. 開始フィールドを指定して、そこから順次文字列データを流し込みます。
Sourcepub fn compare_all_fields(&self, other: &Self) -> Ordering
pub fn compare_all_fields(&self, other: &Self) -> Ordering
Compares all fields in declaration order. 全フィールドを定義順に比較します。
Sourcepub fn compare_by_fields(
&self,
other: &Self,
fields: &[TestRecordField],
) -> Ordering
pub fn compare_by_fields( &self, other: &Self, fields: &[TestRecordField], ) -> Ordering
Compares records using the specified field priority order. 指定されたフィールドの優先順に従って比較します。
Sourcepub fn to_dump_string(&self) -> String
pub fn to_dump_string(&self) -> String
Returns all fields of the record as a dump string. レコードの全フィールドをダンプ文字列として返します。
Trait Implementations§
Source§impl Clone for TestRecord
impl Clone for TestRecord
Source§fn clone(&self) -> TestRecord
fn clone(&self) -> TestRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TestRecord
Source§impl Debug for TestRecord
impl Debug for TestRecord
Source§impl Default for TestRecord
impl Default for TestRecord
impl Eq for TestRecord
Source§impl FixedRecord for TestRecord
impl FixedRecord for TestRecord
Source§fn parse(src: &[u8]) -> Result<Self, Error>
fn parse(src: &[u8]) -> Result<Self, Error>
Creates a record from fixed-width bytes. 固定長バイト列からレコードを作成します。
Source§fn to_bytes(&self) -> Vec<u8> ⓘ
fn to_bytes(&self) -> Vec<u8> ⓘ
Copies the record as fixed-width bytes. レコードを固定長バイト列としてコピーして返します。
Source§fn field_name(field: Self::Field) -> &'static str
fn field_name(field: Self::Field) -> &'static str
Returns the declaration name of the specified field. 指定フィールドの定義名を返します。
Source§fn field_bytes(&self, field: Self::Field) -> &[u8] ⓘ
fn field_bytes(&self, field: Self::Field) -> &[u8] ⓘ
Returns the bytes stored in the specified field. 指定フィールドのバイト列を返します。
Source§const TOTAL_LEN: usize = TestRecord::TOTAL_LEN
const TOTAL_LEN: usize = TestRecord::TOTAL_LEN
Source§type Field = TestRecordField
type Field = TestRecordField
Source§impl FromBytes for TestRecord
impl FromBytes for TestRecord
§fn ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
fn ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
§fn ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
fn ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
§fn ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: Immutable + KnownLayout,
fn ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: Immutable + KnownLayout,
&Self. Read more§fn mut_from_bytes(
source: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_bytes(
source: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
§fn mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
§fn mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
§fn ref_from_bytes_with_elems(
source: &[u8],
count: usize,
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
fn ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
§fn ref_from_prefix_with_elems(
source: &[u8],
count: usize,
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
fn ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
§fn ref_from_suffix_with_elems(
source: &[u8],
count: usize,
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
fn ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
§fn mut_from_bytes_with_elems(
source: &mut [u8],
count: usize,
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
fn mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
§fn mut_from_prefix_with_elems(
source: &mut [u8],
count: usize,
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
fn mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
§fn mut_from_suffix_with_elems(
source: &mut [u8],
count: usize,
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
fn mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
Source§impl FromZeros for TestRecord
impl FromZeros for TestRecord
impl Immutable for TestRecord
Source§impl IntoBytes for TestRecord
impl IntoBytes for TestRecord
§fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
§fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
Source§impl KnownLayout for TestRecordwhere
Fixed<8>: KnownLayout,
impl KnownLayout for TestRecordwhere
Fixed<8>: KnownLayout,
Source§type PointerMetadata = <Fixed<8> as KnownLayout>::PointerMetadata
type PointerMetadata = <Fixed<8> as KnownLayout>::PointerMetadata
Self. Read more§fn size_for_metadata(meta: Self::PointerMetadata) -> Option<usize>
fn size_for_metadata(meta: Self::PointerMetadata) -> Option<usize>
Self with the given pointer
metadata. Read moreSource§impl PartialEq for TestRecord
impl PartialEq for TestRecord
Source§fn eq(&self, other: &TestRecord) -> bool
fn eq(&self, other: &TestRecord) -> bool
self and other values to be equal, and is used by ==.Source§impl RecordWithList for TestRecord
impl RecordWithList for TestRecord
Source§type List = TestRecordList
type List = TestRecordList
Source§impl SequenceFields<TestRecord> for [TestRecordField; 0]
impl SequenceFields<TestRecord> for [TestRecordField; 0]
Source§fn to_sequence_fields(self) -> Vec<TestRecordField>
fn to_sequence_fields(self) -> Vec<TestRecordField>
Returns the fields used by Reader sequence checks as a Vec.
Reader のシーケンスチェック対象フィールドを Vec にして返します。
Source§impl<'a> SequenceFields<TestRecord> for &'a [TestRecordField; 0]
impl<'a> SequenceFields<TestRecord> for &'a [TestRecordField; 0]
Source§fn to_sequence_fields(self) -> Vec<TestRecordField>
fn to_sequence_fields(self) -> Vec<TestRecordField>
Returns the fields used by Reader sequence checks as a Vec.
Reader のシーケンスチェック対象フィールドを Vec にして返します。
Source§impl SequenceFields<TestRecord> for [TestRecordField; 1]
impl SequenceFields<TestRecord> for [TestRecordField; 1]
Source§fn to_sequence_fields(self) -> Vec<TestRecordField>
fn to_sequence_fields(self) -> Vec<TestRecordField>
Returns the fields used by Reader sequence checks as a Vec.
Reader のシーケンスチェック対象フィールドを Vec にして返します。
Source§impl<'a> SequenceFields<TestRecord> for &'a [TestRecordField; 1]
impl<'a> SequenceFields<TestRecord> for &'a [TestRecordField; 1]
Source§fn to_sequence_fields(self) -> Vec<TestRecordField>
fn to_sequence_fields(self) -> Vec<TestRecordField>
Returns the fields used by Reader sequence checks as a Vec.
Reader のシーケンスチェック対象フィールドを Vec にして返します。
Source§impl SequenceFields<TestRecord> for [TestRecordField; 2]
impl SequenceFields<TestRecord> for [TestRecordField; 2]
Source§fn to_sequence_fields(self) -> Vec<TestRecordField>
fn to_sequence_fields(self) -> Vec<TestRecordField>
Returns the fields used by Reader sequence checks as a Vec.
Reader のシーケンスチェック対象フィールドを Vec にして返します。
Source§impl<'a> SequenceFields<TestRecord> for &'a [TestRecordField; 2]
impl<'a> SequenceFields<TestRecord> for &'a [TestRecordField; 2]
Source§fn to_sequence_fields(self) -> Vec<TestRecordField>
fn to_sequence_fields(self) -> Vec<TestRecordField>
Returns the fields used by Reader sequence checks as a Vec.
Reader のシーケンスチェック対象フィールドを Vec にして返します。
Source§impl SequenceFields<TestRecord> for [TestRecordField; 3]
impl SequenceFields<TestRecord> for [TestRecordField; 3]
Source§fn to_sequence_fields(self) -> Vec<TestRecordField>
fn to_sequence_fields(self) -> Vec<TestRecordField>
Returns the fields used by Reader sequence checks as a Vec.
Reader のシーケンスチェック対象フィールドを Vec にして返します。
Source§impl<'a> SequenceFields<TestRecord> for &'a [TestRecordField; 3]
impl<'a> SequenceFields<TestRecord> for &'a [TestRecordField; 3]
Source§fn to_sequence_fields(self) -> Vec<TestRecordField>
fn to_sequence_fields(self) -> Vec<TestRecordField>
Returns the fields used by Reader sequence checks as a Vec.
Reader のシーケンスチェック対象フィールドを Vec にして返します。
impl StructuralPartialEq for TestRecord
Source§impl TryFromBytes for TestRecord
impl TryFromBytes for TestRecord
§fn try_ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
§fn try_ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
§fn try_ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
§fn try_mut_from_bytes(
bytes: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
fn try_mut_from_bytes(
bytes: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
§fn try_mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
fn try_mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
§fn try_mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
fn try_mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
§fn try_ref_from_bytes_with_elems(
source: &[u8],
count: usize,
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
§fn try_ref_from_prefix_with_elems(
source: &[u8],
count: usize,
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
source as a &Self with
a DST length equal to count. Read more§fn try_ref_from_suffix_with_elems(
source: &[u8],
count: usize,
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
source as a &Self with
a DST length equal to count. Read more§fn try_mut_from_bytes_with_elems(
source: &mut [u8],
count: usize,
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
§fn try_mut_from_prefix_with_elems(
source: &mut [u8],
count: usize,
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
source as a &mut Self
with a DST length equal to count. Read more§fn try_mut_from_suffix_with_elems(
source: &mut [u8],
count: usize,
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
source as a &mut Self
with a DST length equal to count. Read more