pub struct F64NonNegative(/* private fields */);Expand description
Contract type for non-negative f64 values (>= 0.0).
Validates on construction, then can unwrap to stdlib f64 via into_inner().
Implementations§
Source§impl F64NonNegative
impl F64NonNegative
Sourcepub fn new(value: f64) -> Result<Self, ValidationError>
pub fn new(value: f64) -> Result<Self, ValidationError>
Constructs a non-negative f64 value.
§Errors
Returns ValidationError::NotFinite if value is NaN or infinite.
Returns ValidationError::FloatNegative if value < 0.0.
Sourcepub fn into_inner(self) -> f64
pub fn into_inner(self) -> f64
Unwraps to stdlib f64 (trenchcoat off).
Trait Implementations§
Source§impl Clone for F64NonNegative
impl Clone for F64NonNegative
Source§fn clone(&self) -> F64NonNegative
fn clone(&self) -> F64NonNegative
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for F64NonNegative
impl Debug for F64NonNegative
Source§impl<'de> Deserialize<'de> for F64NonNegative
impl<'de> Deserialize<'de> for F64NonNegative
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl ElicitSpec for F64NonNegative
impl ElicitSpec for F64NonNegative
Source§impl Elicitation for F64NonNegative
impl Elicitation for F64NonNegative
Source§async fn elicit<C: ElicitCommunicator>(communicator: &C) -> ElicitResult<Self>
async fn elicit<C: ElicitCommunicator>(communicator: &C) -> ElicitResult<Self>
Elicit a value of this type from the user via style-aware client. Read more
Source§fn kani_proof() -> TokenStream
fn kani_proof() -> TokenStream
Generate a Kani symbolic execution proof harness for this type. Read more
Source§fn verus_proof() -> TokenStream
fn verus_proof() -> TokenStream
Generate a Verus specification proof for this type. Read more
Source§fn creusot_proof() -> TokenStream
fn creusot_proof() -> TokenStream
Generate a Creusot contract proof for this type. Read more
Source§fn elicit_checked(
peer: Peer<RoleServer>,
) -> impl Future<Output = ElicitResult<Self>> + Send
fn elicit_checked( peer: Peer<RoleServer>, ) -> impl Future<Output = ElicitResult<Self>> + Send
Server-side elicitation via MCP peer. Read more
Source§fn with_style(style: Self::Style) -> ElicitBuilder<Self>
fn with_style(style: Self::Style) -> ElicitBuilder<Self>
Create a builder for one-off style override. Read more
Source§fn elicit_proven<C: ElicitCommunicator>(
communicator: &C,
) -> impl Future<Output = ElicitResult<(Self, Established<Is<Self>>)>> + Send
fn elicit_proven<C: ElicitCommunicator>( communicator: &C, ) -> impl Future<Output = ElicitResult<(Self, Established<Is<Self>>)>> + Send
Elicit a value with proof it inhabits type Self. Read more
Source§fn prusti_proof() -> TokenStream
fn prusti_proof() -> TokenStream
Generate a Prusti separation logic proof for this type. Read more
Source§impl JsonSchema for F64NonNegative
impl JsonSchema for F64NonNegative
Source§fn json_schema(_gen: &mut SchemaGenerator) -> Schema
fn json_schema(_gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for F64NonNegative
impl PartialEq for F64NonNegative
Source§impl PartialOrd for F64NonNegative
impl PartialOrd for F64NonNegative
Source§impl Prompt for F64NonNegative
impl Prompt for F64NonNegative
Source§impl Serialize for F64NonNegative
impl Serialize for F64NonNegative
impl Copy for F64NonNegative
impl StructuralPartialEq for F64NonNegative
Auto Trait Implementations§
impl Freeze for F64NonNegative
impl RefUnwindSafe for F64NonNegative
impl Send for F64NonNegative
impl Sync for F64NonNegative
impl Unpin for F64NonNegative
impl UnsafeUnpin for F64NonNegative
impl UnwindSafe for F64NonNegative
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ElicitJson for T
impl<T> ElicitJson for T
Source§async fn elicit_json<C>(communicator: &C) -> Result<T, ElicitError>where
C: ElicitCommunicator,
async fn elicit_json<C>(communicator: &C) -> Result<T, ElicitError>where
C: ElicitCommunicator,
Elicit a value by presenting the JSON schema and parsing the response.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> WithContract for T
impl<T> WithContract for T
Source§fn with_contract<C>(contract: C) -> ContractedElicitation<Self, C>
fn with_contract<C>(contract: C) -> ContractedElicitation<Self, C>
Attach a contract to this type’s elicitation. Read more