mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-03 18:24:05 +02:00
Merge pull request #26 from Gcommer/from_const
Add SendPropIdentifier::from_const
This commit is contained in:
commit
e7451375c2
1 changed files with 6 additions and 0 deletions
|
|
@ -1113,6 +1113,12 @@ impl SendPropIdentifier {
|
||||||
SendPropIdentifier(hasher.finish())
|
SendPropIdentifier(hasher.finish())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Construct a SendPropIdentifier from a u64; like std::convert::From<u64> but marked as
|
||||||
|
/// const.
|
||||||
|
pub const fn from_const(raw: u64) -> Self {
|
||||||
|
SendPropIdentifier(raw)
|
||||||
|
}
|
||||||
|
|
||||||
/// This returns an option because only props known at compile time will return a name here
|
/// This returns an option because only props known at compile time will return a name here
|
||||||
///
|
///
|
||||||
/// If you need to know the name of every property you need to keep a map yourself
|
/// If you need to know the name of every property you need to keep a map yourself
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue