pub struct Float32(/* private fields */);Implementations§
Source§impl Float32
impl Float32
Sourcepub fn try_new(v: f32) -> Option<Float32>
pub fn try_new(v: f32) -> Option<Float32>
Fallible constructor that rejects non-finite values and normalizes -0.0.
pub const fn get(self) -> f32
pub const fn to_be_bytes(&self) -> [u8; 4]
pub fn try_from_bytes(bytes: &[u8]) -> Result<Float32, Float32DecodeError>
Sourcepub fn try_from_f64(value: f64) -> Option<Float32>
pub fn try_from_f64(value: f64) -> Option<Float32>
Fallible conversion from f64 that rejects non-finite and out-of-range inputs.
Trait Implementations§
Source§impl CandidType for Float32
impl CandidType for Float32
Source§impl<'de> Deserialize<'de> for Float32
impl<'de> Deserialize<'de> for Float32
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Float32, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Float32, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Float32> for InputValue
impl From<Float32> for InputValue
Source§fn from(value: Float32) -> InputValue
fn from(value: Float32) -> InputValue
Converts to this type from the input type.
Source§impl NumericValue for Float32
impl NumericValue for Float32
Source§impl Ord for Float32
impl Ord for Float32
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Float32
impl PartialOrd for Float32
Source§impl PersistedByKindCodec for Float32
impl PersistedByKindCodec for Float32
Source§fn encode_persisted_slot_payload_by_kind(
&self,
kind: FieldKind,
field_name: &'static str,
) -> Result<Vec<u8>, InternalError>
fn encode_persisted_slot_payload_by_kind( &self, kind: FieldKind, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>
Encode one field payload through the explicit
ByKind storage lane.Source§fn decode_persisted_option_slot_payload_by_kind(
bytes: &[u8],
kind: FieldKind,
field_name: &'static str,
) -> Result<Option<Float32>, InternalError>
fn decode_persisted_option_slot_payload_by_kind( bytes: &[u8], kind: FieldKind, field_name: &'static str, ) -> Result<Option<Float32>, InternalError>
Decode one optional field payload through the explicit
ByKind
storage lane, preserving the null sentinel for wrapper-owned optional
handling.Source§impl PersistedFieldSlotCodec for Float32
impl PersistedFieldSlotCodec for Float32
Source§fn encode_persisted_slot(
&self,
field_name: &'static str,
) -> Result<Vec<u8>, InternalError>
fn encode_persisted_slot( &self, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>
Encode one required field slot payload through this type’s storage
contract.
Source§fn decode_persisted_slot(
bytes: &[u8],
field_name: &'static str,
) -> Result<Float32, InternalError>
fn decode_persisted_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Float32, InternalError>
Decode one required field slot payload through this type’s storage
contract.
Source§fn encode_persisted_option_slot(
value: &Option<Float32>,
field_name: &'static str,
) -> Result<Vec<u8>, InternalError>
fn encode_persisted_option_slot( value: &Option<Float32>, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>
Encode one optional field slot payload through this type’s storage
contract while preserving explicit null.
Source§fn decode_persisted_option_slot(
bytes: &[u8],
field_name: &'static str,
) -> Result<Option<Float32>, InternalError>
fn decode_persisted_option_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Option<Float32>, InternalError>
Decode one optional field slot payload through this type’s storage
contract while preserving explicit null.
Source§impl PersistedScalar for Float32
impl PersistedScalar for Float32
Source§const CODEC: ScalarCodec = ScalarCodec::Float32
const CODEC: ScalarCodec = ScalarCodec::Float32
Canonical scalar codec identifier used by schema/runtime metadata.
Source§fn encode_scalar_payload(&self) -> Result<Vec<u8>, InternalError>
fn encode_scalar_payload(&self) -> Result<Vec<u8>, InternalError>
Encode this scalar value into its codec-specific payload bytes.
Source§fn decode_scalar_payload(
bytes: &[u8],
field_name: &'static str,
) -> Result<Float32, InternalError>
fn decode_scalar_payload( bytes: &[u8], field_name: &'static str, ) -> Result<Float32, InternalError>
Decode this scalar value from its codec-specific payload bytes.
Source§impl PersistedStructuredFieldCodec for Float32
impl PersistedStructuredFieldCodec for Float32
Source§fn encode_persisted_structured_payload(&self) -> Result<Vec<u8>, InternalError>
fn encode_persisted_structured_payload(&self) -> Result<Vec<u8>, InternalError>
Encode this typed structured field into persisted structured payload bytes.
Source§fn decode_persisted_structured_payload(
bytes: &[u8],
) -> Result<Float32, InternalError>
fn decode_persisted_structured_payload( bytes: &[u8], ) -> Result<Float32, InternalError>
Decode this typed structured field from persisted structured payload bytes.
Source§impl RuntimeValueDecode for Float32
impl RuntimeValueDecode for Float32
Source§impl RuntimeValueMeta for Float32
impl RuntimeValueMeta for Float32
fn kind() -> RuntimeValueKind
Source§impl SanitizeAuto for Float32
impl SanitizeAuto for Float32
fn sanitize_self(&mut self, _ctx: &mut dyn VisitorContext)
Source§impl SanitizeCustom for Float32
impl SanitizeCustom for Float32
fn sanitize_custom(&mut self, _ctx: &mut dyn VisitorContext)
Source§impl ValidateAuto for Float32
impl ValidateAuto for Float32
fn validate_self(&self, _ctx: &mut dyn VisitorContext)
Source§impl ValidateCustom for Float32
impl ValidateCustom for Float32
fn validate_custom(&self, ctx: &mut dyn VisitorContext)
Source§impl Visitable for Float32
impl Visitable for Float32
fn drive(&self, _: &mut dyn VisitorCore)
fn drive_mut(&mut self, _: &mut dyn VisitorMutCore)
impl Copy for Float32
impl Eq for Float32
Auto Trait Implementations§
impl Freeze for Float32
impl RefUnwindSafe for Float32
impl Send for Float32
impl Sync for Float32
impl Unpin for Float32
impl UnsafeUnpin for Float32
impl UnwindSafe for Float32
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more