From 2333cc54aa6b9bdeb94a423b4dd311684d0e69f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alja=C5=BE=20Mur=20Er=C5=BEen?= Date: Wed, 10 Jul 2024 17:29:14 +0200 Subject: [PATCH] Derive Debug, Clone and PartialEq for ValueOpt (#332) --- edgedb-protocol/src/client_message.rs | 2 +- edgedb-protocol/src/codec.rs | 2 +- edgedb-protocol/src/descriptors.rs | 2 +- edgedb-protocol/src/lib.rs | 4 ++-- edgedb-protocol/src/query_arg.rs | 2 +- edgedb-protocol/src/queryable.rs | 2 +- edgedb-protocol/src/server_message.rs | 2 +- edgedb-protocol/src/value.rs | 2 +- edgedb-protocol/src/value_opt.rs | 3 ++- flake.nix | 2 +- 10 files changed, 12 insertions(+), 11 deletions(-) diff --git a/edgedb-protocol/src/client_message.rs b/edgedb-protocol/src/client_message.rs index 51d3386a..42c5eeca 100644 --- a/edgedb-protocol/src/client_message.rs +++ b/edgedb-protocol/src/client_message.rs @@ -1,5 +1,5 @@ /*! -([Website reference](https://www.edgedb.com/docs/reference/protocol/messages)) The [ClientMessage](crate::client_message::ClientMessage) enum and related types. +([Website reference](https://www.edgedb.com/docs/reference/protocol/messages)) The [ClientMessage] enum and related types. ```rust,ignore pub enum ClientMessage { diff --git a/edgedb-protocol/src/codec.rs b/edgedb-protocol/src/codec.rs index 7ec8b650..d7107138 100644 --- a/edgedb-protocol/src/codec.rs +++ b/edgedb-protocol/src/codec.rs @@ -1,5 +1,5 @@ /*! -Implementations of the [Codec](crate::codec::Codec) trait into types found in the [Value](crate::value::Value) enum. +Implementations of the [Codec] trait into types found in the [Value] enum. */ use std::any::type_name; diff --git a/edgedb-protocol/src/descriptors.rs b/edgedb-protocol/src/descriptors.rs index f3dd3fda..98705da5 100644 --- a/edgedb-protocol/src/descriptors.rs +++ b/edgedb-protocol/src/descriptors.rs @@ -1,5 +1,5 @@ /*! -([Website reference](https://www.edgedb.com/docs/reference/protocol/typedesc)) Types for the [Descriptor](crate::descriptors::Descriptor) enum. +([Website reference](https://www.edgedb.com/docs/reference/protocol/typedesc)) Types for the [Descriptor] enum. ```rust,ignore pub enum Descriptor { diff --git a/edgedb-protocol/src/lib.rs b/edgedb-protocol/src/lib.rs index 113d84ca..743f618c 100644 --- a/edgedb-protocol/src/lib.rs +++ b/edgedb-protocol/src/lib.rs @@ -1,7 +1,7 @@ /*! ([Website reference](https://www.edgedb.com/docs/reference/protocol/index)) The EdgeDB protocol for Edgedb-Rust. -EdgeDB types used for data modeling can be seen on the [model](crate::model) crate, in which the [Value](crate::value::Value) +EdgeDB types used for data modeling can be seen on the [model] crate, in which the [Value](crate::value::Value) enum provides the quickest overview of all the possible types encountered using the client. Many of the variants hold Rust standard library types while others contain types defined in this protocol. Some types such as [Duration](crate::model::Duration) appear to be standard library types but are unique to the EdgeDB protocol. @@ -12,7 +12,7 @@ for working with the client such as: * [QueryArg](crate::query_arg::QueryArg): a single argument for a query * [QueryArgs](crate::query_arg::QueryArgs): a tuple of query arguments * [Queryable](crate::queryable::Queryable): for the Queryable derive macro -* [QueryResult](crate::query_result::QueryResult): single result from a query (scalars and tuples) +* [QueryResult]: single result from a query (scalars and tuples) The Value enum: diff --git a/edgedb-protocol/src/query_arg.rs b/edgedb-protocol/src/query_arg.rs index 8e8e76d9..1a8c6109 100644 --- a/edgedb-protocol/src/query_arg.rs +++ b/edgedb-protocol/src/query_arg.rs @@ -1,5 +1,5 @@ /*! -Contains the [QueryArg](crate::query_arg::QueryArg) and [QueryArgs](crate::query_arg::QueryArgs) traits. +Contains the [QueryArg] and [QueryArgs] traits. */ use std::convert::{TryFrom, TryInto}; diff --git a/edgedb-protocol/src/queryable.rs b/edgedb-protocol/src/queryable.rs index a84f755d..0c8f09af 100644 --- a/edgedb-protocol/src/queryable.rs +++ b/edgedb-protocol/src/queryable.rs @@ -1,5 +1,5 @@ /*! -Contains the [Queryable](crate::queryable::Queryable) trait. +Contains the [Queryable] trait. */ use snafu::{ensure, Snafu}; use std::default::Default; diff --git a/edgedb-protocol/src/server_message.rs b/edgedb-protocol/src/server_message.rs index 8bb94271..fe499220 100644 --- a/edgedb-protocol/src/server_message.rs +++ b/edgedb-protocol/src/server_message.rs @@ -1,5 +1,5 @@ /*! -The [ServerMessage](crate::server_message::ServerMessage) enum and related types. EdgeDB website documentation on messages [here](https://www.edgedb.com/docs/reference/protocol/messages). +The [ServerMessage] enum and related types. EdgeDB website documentation on messages [here](https://www.edgedb.com/docs/reference/protocol/messages). ```rust,ignore pub enum ServerMessage { diff --git a/edgedb-protocol/src/value.rs b/edgedb-protocol/src/value.rs index 1ca27ae1..27532414 100644 --- a/edgedb-protocol/src/value.rs +++ b/edgedb-protocol/src/value.rs @@ -1,5 +1,5 @@ /*! -Contains the [Value](crate::value::Value) enum. +Contains the [Value] enum. */ use bytes::Bytes; diff --git a/edgedb-protocol/src/value_opt.rs b/edgedb-protocol/src/value_opt.rs index 15bafada..16ced97a 100644 --- a/edgedb-protocol/src/value_opt.rs +++ b/edgedb-protocol/src/value_opt.rs @@ -10,7 +10,8 @@ use crate::value::Value; /// An optional [Value] that can be constructed from `impl Into`, /// `Option>`, `Vec>` or /// `Option>>`. -/// Used by [eargs!] macro. +/// Used by [named_args!](`crate::named_args!`) macro. +#[derive(Clone, Debug, PartialEq)] pub struct ValueOpt(Option); impl> From for ValueOpt { diff --git a/flake.nix b/flake.nix index d0a2a734..637d4aa6 100644 --- a/flake.nix +++ b/flake.nix @@ -65,7 +65,7 @@ buildInputs = [ (fenix_pkgs.toolchainOf { channel = "beta"; - sha256 = "sha256-WtTNSmxfoiHJEwCUnuDNfRNBZjNrzdBV02Hikw+YE+s="; + sha256 = "sha256-q7N1YC9mppPme25wjb81cuOgDXFCkA10Lb1D1GCDv04="; }).defaultToolchain ] ++ common; };