From a4e07f693b5fc53f6d12e3f7f8c3d022cf7d0247 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Sun, 1 May 2022 23:25:53 +0100 Subject: [PATCH] Make certain functions private to crate --- lib/src/dbs/channel.rs | 10 +++++----- lib/src/dbs/iterate.rs | 10 +++++----- lib/src/doc/compute.rs | 2 +- lib/src/sql/array.rs | 2 +- lib/src/sql/expression.rs | 6 +++--- lib/src/sql/function.rs | 2 +- lib/src/sql/idiom.rs | 2 +- lib/src/sql/object.rs | 2 +- lib/src/sql/param.rs | 2 +- lib/src/sql/statement.rs | 2 +- lib/src/sql/statements/create.rs | 2 +- lib/src/sql/statements/define.rs | 20 ++++++++++---------- lib/src/sql/statements/delete.rs | 2 +- lib/src/sql/statements/ifelse.rs | 2 +- lib/src/sql/statements/info.rs | 2 +- lib/src/sql/statements/insert.rs | 2 +- lib/src/sql/statements/kill.rs | 2 +- lib/src/sql/statements/live.rs | 2 +- lib/src/sql/statements/output.rs | 2 +- lib/src/sql/statements/relate.rs | 2 +- lib/src/sql/statements/remove.rs | 20 ++++++++++---------- lib/src/sql/statements/select.rs | 2 +- lib/src/sql/statements/set.rs | 2 +- lib/src/sql/statements/update.rs | 2 +- lib/src/sql/subquery.rs | 2 +- lib/src/sql/value/value.rs | 2 +- 26 files changed, 54 insertions(+), 54 deletions(-) diff --git a/lib/src/dbs/channel.rs b/lib/src/dbs/channel.rs index b5499898..035fbe1e 100644 --- a/lib/src/dbs/channel.rs +++ b/lib/src/dbs/channel.rs @@ -14,7 +14,7 @@ use async_recursion::async_recursion; use tokio::sync::mpsc::Sender; impl Value { - pub async fn channel( + pub(crate) async fn channel( self, ctx: Runtime, opt: Options, @@ -37,7 +37,7 @@ impl Value { impl Array { #[async_recursion] - pub async fn process( + pub(crate) async fn process( self, ctx: &Runtime, opt: &Options, @@ -61,7 +61,7 @@ impl Array { } impl Model { - pub async fn process( + pub(crate) async fn process( self, ctx: &Runtime, opt: &Options, @@ -96,7 +96,7 @@ impl Model { } impl Thing { - pub async fn process( + pub(crate) async fn process( self, ctx: &Runtime, opt: &Options, @@ -118,7 +118,7 @@ impl Thing { } impl Table { - pub async fn process( + pub(crate) async fn process( self, ctx: &Runtime, opt: &Options, diff --git a/lib/src/dbs/iterate.rs b/lib/src/dbs/iterate.rs index cfb92a69..e6672070 100644 --- a/lib/src/dbs/iterate.rs +++ b/lib/src/dbs/iterate.rs @@ -15,7 +15,7 @@ use async_recursion::async_recursion; impl Value { #[cfg_attr(feature = "parallel", async_recursion)] #[cfg_attr(not(feature = "parallel"), async_recursion(?Send))] - pub async fn iterate( + pub(crate) async fn iterate( self, ctx: &Runtime, opt: &Options, @@ -38,7 +38,7 @@ impl Value { impl Array { #[cfg_attr(feature = "parallel", async_recursion)] #[cfg_attr(not(feature = "parallel"), async_recursion(?Send))] - pub async fn iterate( + pub(crate) async fn iterate( self, ctx: &Runtime, opt: &Options, @@ -61,7 +61,7 @@ impl Array { } impl Model { - pub async fn iterate( + pub(crate) async fn iterate( self, ctx: &Runtime, opt: &Options, @@ -95,7 +95,7 @@ impl Model { } impl Thing { - pub async fn iterate( + pub(crate) async fn iterate( self, ctx: &Runtime, opt: &Options, @@ -116,7 +116,7 @@ impl Thing { } impl Table { - pub async fn iterate( + pub(crate) async fn iterate( self, ctx: &Runtime, opt: &Options, diff --git a/lib/src/doc/compute.rs b/lib/src/doc/compute.rs index 5ddf97ee..f7ded613 100644 --- a/lib/src/doc/compute.rs +++ b/lib/src/doc/compute.rs @@ -9,7 +9,7 @@ use crate::sql::value::Value; use tokio::sync::mpsc::Sender; impl<'a> Document<'a> { - pub async fn compute( + pub(crate) async fn compute( ctx: Runtime, opt: Options, txn: Transaction, diff --git a/lib/src/sql/array.rs b/lib/src/sql/array.rs index 0117e302..5085ebe9 100644 --- a/lib/src/sql/array.rs +++ b/lib/src/sql/array.rs @@ -137,7 +137,7 @@ impl Array { } impl Array { - pub async fn compute( + pub(crate) async fn compute( &self, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/expression.rs b/lib/src/sql/expression.rs index e263aa19..22be732d 100644 --- a/lib/src/sql/expression.rs +++ b/lib/src/sql/expression.rs @@ -29,7 +29,7 @@ impl Default for Expression { impl Expression { // Create a new expression - pub fn new(l: Value, o: Operator, r: Value) -> Expression { + fn new(l: Value, o: Operator, r: Value) -> Expression { Expression { l, o, @@ -37,7 +37,7 @@ impl Expression { } } // Augment an existing expression - pub fn augment(mut self, l: Value, o: Operator) -> Expression { + fn augment(mut self, l: Value, o: Operator) -> Expression { if o.precedence() >= self.o.precedence() { match self.l { Value::Expression(x) => { @@ -57,7 +57,7 @@ impl Expression { } impl Expression { - pub async fn compute( + pub(crate) async fn compute( &self, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/function.rs b/lib/src/sql/function.rs index d986b7ac..5c80736e 100644 --- a/lib/src/sql/function.rs +++ b/lib/src/sql/function.rs @@ -102,7 +102,7 @@ impl Function { } impl Function { - pub async fn compute( + pub(crate) async fn compute( &self, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/idiom.rs b/lib/src/sql/idiom.rs index f849f8a6..10ca8575 100644 --- a/lib/src/sql/idiom.rs +++ b/lib/src/sql/idiom.rs @@ -84,7 +84,7 @@ impl Idiom { } impl Idiom { - pub async fn compute( + pub(crate) async fn compute( &self, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/object.rs b/lib/src/sql/object.rs index d1153cb6..50a0acc6 100644 --- a/lib/src/sql/object.rs +++ b/lib/src/sql/object.rs @@ -90,7 +90,7 @@ impl Object { } impl Object { - pub async fn compute( + pub(crate) async fn compute( &self, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/param.rs b/lib/src/sql/param.rs index b5f4f1ed..786ad749 100644 --- a/lib/src/sql/param.rs +++ b/lib/src/sql/param.rs @@ -27,7 +27,7 @@ impl From for Param { } impl Param { - pub async fn compute( + pub(crate) async fn compute( &self, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/statement.rs b/lib/src/sql/statement.rs index 5d163162..4a8d2f1f 100644 --- a/lib/src/sql/statement.rs +++ b/lib/src/sql/statement.rs @@ -88,7 +88,7 @@ impl Statement { } impl Statement { - pub async fn compute( + pub(crate) async fn compute( &self, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/statements/create.rs b/lib/src/sql/statements/create.rs index de2df279..9becfd09 100644 --- a/lib/src/sql/statements/create.rs +++ b/lib/src/sql/statements/create.rs @@ -28,7 +28,7 @@ pub struct CreateStatement { } impl CreateStatement { - pub async fn compute( + pub(crate) async fn compute( self: &Arc, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/statements/define.rs b/lib/src/sql/statements/define.rs index 2a1ac30c..731c0a2f 100644 --- a/lib/src/sql/statements/define.rs +++ b/lib/src/sql/statements/define.rs @@ -46,7 +46,7 @@ pub enum DefineStatement { } impl DefineStatement { - pub async fn compute( + pub(crate) async fn compute( &self, ctx: &Runtime, opt: &Options, @@ -107,7 +107,7 @@ pub struct DefineNamespaceStatement { } impl DefineNamespaceStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, @@ -154,7 +154,7 @@ pub struct DefineDatabaseStatement { } impl DefineDatabaseStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, @@ -209,7 +209,7 @@ pub struct DefineLoginStatement { } impl DefineLoginStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, @@ -328,7 +328,7 @@ pub struct DefineTokenStatement { } impl DefineTokenStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, @@ -424,7 +424,7 @@ pub struct DefineScopeStatement { } impl DefineScopeStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, @@ -560,7 +560,7 @@ pub struct DefineTableStatement { } impl DefineTableStatement { - pub async fn compute( + pub(crate) async fn compute( &self, ctx: &Runtime, opt: &Options, @@ -725,7 +725,7 @@ pub struct DefineEventStatement { } impl DefineEventStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, @@ -804,7 +804,7 @@ pub struct DefineFieldStatement { } impl DefineFieldStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, @@ -942,7 +942,7 @@ pub struct DefineIndexStatement { } impl DefineIndexStatement { - pub async fn compute( + pub(crate) async fn compute( &self, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/statements/delete.rs b/lib/src/sql/statements/delete.rs index ce70c081..e322a5b0 100644 --- a/lib/src/sql/statements/delete.rs +++ b/lib/src/sql/statements/delete.rs @@ -29,7 +29,7 @@ pub struct DeleteStatement { } impl DeleteStatement { - pub async fn compute( + pub(crate) async fn compute( self: &Arc, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/statements/ifelse.rs b/lib/src/sql/statements/ifelse.rs index f16a8fc4..3973b9d2 100644 --- a/lib/src/sql/statements/ifelse.rs +++ b/lib/src/sql/statements/ifelse.rs @@ -19,7 +19,7 @@ pub struct IfelseStatement { } impl IfelseStatement { - pub async fn compute( + pub(crate) async fn compute( &self, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/statements/info.rs b/lib/src/sql/statements/info.rs index db0006d4..6941fa78 100644 --- a/lib/src/sql/statements/info.rs +++ b/lib/src/sql/statements/info.rs @@ -24,7 +24,7 @@ pub enum InfoStatement { } impl InfoStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/statements/insert.rs b/lib/src/sql/statements/insert.rs index eea2d70c..635cc44d 100644 --- a/lib/src/sql/statements/insert.rs +++ b/lib/src/sql/statements/insert.rs @@ -32,7 +32,7 @@ pub struct InsertStatement { } impl InsertStatement { - pub async fn compute( + pub(crate) async fn compute( self: &Arc, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/statements/kill.rs b/lib/src/sql/statements/kill.rs index f0fdfaff..833285eb 100644 --- a/lib/src/sql/statements/kill.rs +++ b/lib/src/sql/statements/kill.rs @@ -17,7 +17,7 @@ pub struct KillStatement { } impl KillStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, _opt: &Options, diff --git a/lib/src/sql/statements/live.rs b/lib/src/sql/statements/live.rs index 7cf16e61..7091a952 100644 --- a/lib/src/sql/statements/live.rs +++ b/lib/src/sql/statements/live.rs @@ -25,7 +25,7 @@ pub struct LiveStatement { } impl LiveStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, _opt: &Options, diff --git a/lib/src/sql/statements/output.rs b/lib/src/sql/statements/output.rs index 5ecd48d5..20f6052b 100644 --- a/lib/src/sql/statements/output.rs +++ b/lib/src/sql/statements/output.rs @@ -16,7 +16,7 @@ pub struct OutputStatement { } impl OutputStatement { - pub async fn compute( + pub(crate) async fn compute( &self, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/statements/relate.rs b/lib/src/sql/statements/relate.rs index 1bec09cb..383c6119 100644 --- a/lib/src/sql/statements/relate.rs +++ b/lib/src/sql/statements/relate.rs @@ -35,7 +35,7 @@ pub struct RelateStatement { } impl RelateStatement { - pub async fn compute( + pub(crate) async fn compute( self: &Arc, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/statements/remove.rs b/lib/src/sql/statements/remove.rs index 1808c9ef..9d091c43 100644 --- a/lib/src/sql/statements/remove.rs +++ b/lib/src/sql/statements/remove.rs @@ -30,7 +30,7 @@ pub enum RemoveStatement { } impl RemoveStatement { - pub async fn compute( + pub(crate) async fn compute( &self, ctx: &Runtime, opt: &Options, @@ -91,7 +91,7 @@ pub struct RemoveNamespaceStatement { } impl RemoveNamespaceStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, @@ -145,7 +145,7 @@ pub struct RemoveDatabaseStatement { } impl RemoveDatabaseStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, @@ -200,7 +200,7 @@ pub struct RemoveLoginStatement { } impl RemoveLoginStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, @@ -275,7 +275,7 @@ pub struct RemoveTokenStatement { } impl RemoveTokenStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, @@ -349,7 +349,7 @@ pub struct RemoveScopeStatement { } impl RemoveScopeStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, @@ -400,7 +400,7 @@ pub struct RemoveTableStatement { } impl RemoveTableStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, @@ -455,7 +455,7 @@ pub struct RemoveEventStatement { } impl RemoveEventStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, @@ -513,7 +513,7 @@ pub struct RemoveFieldStatement { } impl RemoveFieldStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, @@ -571,7 +571,7 @@ pub struct RemoveIndexStatement { } impl RemoveIndexStatement { - pub async fn compute( + pub(crate) async fn compute( &self, _ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/statements/select.rs b/lib/src/sql/statements/select.rs index e8f4fa6f..c066222d 100644 --- a/lib/src/sql/statements/select.rs +++ b/lib/src/sql/statements/select.rs @@ -57,7 +57,7 @@ impl SelectStatement { } impl SelectStatement { - pub async fn compute( + pub(crate) async fn compute( self: &Arc, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/statements/set.rs b/lib/src/sql/statements/set.rs index 8d46c8ad..50a2011c 100644 --- a/lib/src/sql/statements/set.rs +++ b/lib/src/sql/statements/set.rs @@ -21,7 +21,7 @@ pub struct SetStatement { } impl SetStatement { - pub async fn compute( + pub(crate) async fn compute( &self, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/statements/update.rs b/lib/src/sql/statements/update.rs index 7dd6e4bb..239003b5 100644 --- a/lib/src/sql/statements/update.rs +++ b/lib/src/sql/statements/update.rs @@ -30,7 +30,7 @@ pub struct UpdateStatement { } impl UpdateStatement { - pub async fn compute( + pub(crate) async fn compute( self: &Arc, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/subquery.rs b/lib/src/sql/subquery.rs index cb1c49b6..186fac64 100644 --- a/lib/src/sql/subquery.rs +++ b/lib/src/sql/subquery.rs @@ -40,7 +40,7 @@ impl PartialOrd for Subquery { } impl Subquery { - pub async fn compute( + pub(crate) async fn compute( &self, ctx: &Runtime, opt: &Options, diff --git a/lib/src/sql/value/value.rs b/lib/src/sql/value/value.rs index eeaec141..8199bfe8 100644 --- a/lib/src/sql/value/value.rs +++ b/lib/src/sql/value/value.rs @@ -977,7 +977,7 @@ impl fmt::Display for Value { impl Value { #[cfg_attr(feature = "parallel", async_recursion)] #[cfg_attr(not(feature = "parallel"), async_recursion(?Send))] - pub async fn compute( + pub(crate) async fn compute( &self, ctx: &Runtime, opt: &Options,