diff --git a/README.md b/README.md index c25e2914..e8602d5c 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ Mentat aims to offer many of the advantages of SQLite — single-file use, embed Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. -See [CONTRIBUTING.md](/CONTRIBUTING.md) for further notes. +See [CONTRIBUTING.md](CONTRIBUTING.md) for further notes. This project is very new, so we'll probably revise these guidelines. Please comment on an issue before putting significant effort in if you'd like to diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..45c15053 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,3 @@ +_site +.sass-cache +.jekyll-metadata diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 00000000..c472b4ea --- /dev/null +++ b/docs/404.html @@ -0,0 +1,24 @@ +--- +layout: default +--- + + + +
+

404

+ +

Page not found :(

+

The requested page could not be found.

+
diff --git a/CONTRIBUTING.md b/docs/CONTRIBUTING.md similarity index 99% rename from CONTRIBUTING.md rename to docs/CONTRIBUTING.md index 13448601..42d2c924 100644 --- a/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,3 +1,9 @@ +--- +layout: page +title: Contributing +permalink: /contributing/ +--- + # How to contribute to Project Mentat This project is very new, so we'll probably revise these guidelines. Please diff --git a/docs/Gemfile b/docs/Gemfile new file mode 100644 index 00000000..3a09b036 --- /dev/null +++ b/docs/Gemfile @@ -0,0 +1,30 @@ +source "https://rubygems.org" + +# Hello! This is where you manage which Jekyll version is used to run. +# When you want to use a different version, change it below, save the +# file and run `bundle install`. Run Jekyll with `bundle exec`, like so: +# +# bundle exec jekyll serve +# +# This will help ensure the proper Jekyll version is running. +# Happy Jekylling! +gem "jekyll", "~> 3.8.3" + +# This is the default theme for new Jekyll sites. You may change this to anything you like. +gem "minima", "~> 2.0" + +# If you want to use GitHub Pages, remove the "gem "jekyll"" above and +# uncomment the line below. To upgrade, run `bundle update github-pages`. +# gem "github-pages", group: :jekyll_plugins + +# If you have any plugins, put them here! +group :jekyll_plugins do + gem "jekyll-feed", "~> 0.6" +end + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby] + +# Performance-booster for watching directories on Windows +gem "wdm", "~> 0.1.0" if Gem.win_platform? + diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock new file mode 100644 index 00000000..d54c3e3a --- /dev/null +++ b/docs/Gemfile.lock @@ -0,0 +1,74 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + colorator (1.1.0) + concurrent-ruby (1.0.5) + em-websocket (0.5.1) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0.6.0) + eventmachine (1.2.7) + ffi (1.9.25) + forwardable-extended (2.6.0) + http_parser.rb (0.6.0) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + jekyll (3.8.3) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 0.7) + jekyll-sass-converter (~> 1.0) + jekyll-watch (~> 2.0) + kramdown (~> 1.14) + liquid (~> 4.0) + mercenary (~> 0.3.3) + pathutil (~> 0.9) + rouge (>= 1.7, < 4) + safe_yaml (~> 1.0) + jekyll-feed (0.10.0) + jekyll (~> 3.3) + jekyll-sass-converter (1.5.2) + sass (~> 3.4) + jekyll-seo-tag (2.5.0) + jekyll (~> 3.3) + jekyll-watch (2.0.0) + listen (~> 3.0) + kramdown (1.17.0) + liquid (4.0.0) + listen (3.1.5) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) + mercenary (0.3.6) + minima (2.5.0) + jekyll (~> 3.5) + jekyll-feed (~> 0.9) + jekyll-seo-tag (~> 2.1) + pathutil (0.16.1) + forwardable-extended (~> 2.6) + public_suffix (3.0.2) + rb-fsevent (0.10.3) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) + rouge (3.1.1) + ruby_dep (1.5.0) + safe_yaml (1.0.4) + sass (3.5.6) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + +PLATFORMS + ruby + +DEPENDENCIES + jekyll (~> 3.8.3) + jekyll-feed (~> 0.6) + minima (~> 2.0) + tzinfo-data + +BUNDLED WITH + 1.16.2 diff --git a/docs/_config.yml b/docs/_config.yml index 259a24e4..3b272417 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1 +1,43 @@ -theme: jekyll-theme-tactile \ No newline at end of file +# Welcome to Jekyll! +# +# This config file is meant for settings that affect your whole blog, values +# which you are expected to set up once and rarely edit after that. If you find +# yourself editing this file very often, consider using Jekyll's data files +# feature for the data you need to update frequently. +# +# For technical reasons, this file is *NOT* reloaded automatically when you use +# 'bundle exec jekyll serve'. If you change this file, please restart the server process. + +# Site settings +# These are used to personalize your new site. If you look in the HTML files, +# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on. +# You can create any custom variable you would like, and they will be accessible +# in the templates via {{ site.myvariable }}. +title: Mentat +description: >- # this means to ignore newlines until "baseurl:" + Project Mentat is a persistent, embedded knowledge base. It draws heavily on DataScript and Datomic. + Mentat is intended to be a flexible relational (not key-value, not document-oriented) store that makes + it easy to describe, grow, and reuse your domain schema. +baseurl: "" # the subpath of your site, e.g. /blog +url: "" # the base hostname & protocol for your site, e.g. http://example.com + +api_heading: API Documentation +list_title: Examples + +# Build settings +markdown: kramdown +theme: minima +plugins: + - jekyll-feed + +# Exclude from processing. +# The following items will not be processed, by default. Create a custom list +# to override the default setting. +# exclude: +# - Gemfile +# - Gemfile.lock +# - node_modules +# - vendor/bundle/ +# - vendor/cache/ +# - vendor/gems/ +# - vendor/ruby/ diff --git a/docs/_includes/footer.html b/docs/_includes/footer.html new file mode 100644 index 00000000..f2dfefa6 --- /dev/null +++ b/docs/_includes/footer.html @@ -0,0 +1,24 @@ + diff --git a/docs/_includes/header.html b/docs/_includes/header.html new file mode 100644 index 00000000..658531d8 --- /dev/null +++ b/docs/_includes/header.html @@ -0,0 +1,30 @@ + diff --git a/docs/_layouts/home.html b/docs/_layouts/home.html new file mode 100644 index 00000000..b2203af2 --- /dev/null +++ b/docs/_layouts/home.html @@ -0,0 +1,24 @@ +--- +layout: default +--- + +
+ {%- if page.title -%} +

{{ page.title }}

+ {%- endif -%} + + {{ content }} + + {%- if site.posts.size > 0 -%} + {% assign posts_by_cat = site.posts | group_by:"category" %} + {% for category in posts_by_cat %} +

{{category.name | capitalize}}

+ + {% endfor %} + {%- endif -%} + +
diff --git a/docs/_layouts/page.html b/docs/_layouts/page.html new file mode 100644 index 00000000..01e4b2a9 --- /dev/null +++ b/docs/_layouts/page.html @@ -0,0 +1,14 @@ +--- +layout: default +--- +
+ +
+

{{ page.title | escape }}

+
+ +
+ {{ content }} +
+ +
diff --git a/docs/_layouts/post.html b/docs/_layouts/post.html new file mode 100644 index 00000000..abf9696d --- /dev/null +++ b/docs/_layouts/post.html @@ -0,0 +1,27 @@ +--- +layout: default +--- +
+ +
+

{{ page.title | escape }}

+ +
+ +
+ {{ content }} +
+ + {%- if site.disqus.shortname -%} + {%- include disqus_comments.html -%} + {%- endif -%} + + +
diff --git a/docs/worked-examples.md b/docs/_posts/2018-04-17-worked-examples.md similarity index 99% rename from docs/worked-examples.md rename to docs/_posts/2018-04-17-worked-examples.md index b1632e3d..a297a747 100644 --- a/docs/worked-examples.md +++ b/docs/_posts/2018-04-17-worked-examples.md @@ -1,3 +1,10 @@ +--- +layout: post +list_title: Examples +title: "Modeling data using Mentat" +date: 2018-04-17 16:07:37 +0100 +category: examples +--- # Worked examples of modeling data using Mentat Used correctly, Mentat makes it easy for you to grow to accommodate new kinds of data, for data to synchronize between devices, for multiple consumers to share data, and even for errors to be fixed. diff --git a/docs/about.md b/docs/about.md new file mode 100644 index 00000000..96031ddc --- /dev/null +++ b/docs/about.md @@ -0,0 +1,122 @@ +--- +layout: page +title: About +permalink: /about/ +--- + +# Project Mentat + +Project Mentat is a persistent, embedded knowledge base. It draws heavily on [DataScript](https://github.com/tonsky/datascript) and [Datomic](http://datomic.com). + +Mentat is implemented in Rust. + +The first version of Project Mentat, named Datomish, [was written in ClojureScript](https://github.com/mozilla/mentat/tree/clojure), targeting both Node (on top of `promise_sqlite`) and Firefox (on top of `Sqlite.jsm`). It also worked in pure Clojure on the JVM on top of `jdbc-sqlite`. The name was changed to avoid confusion with [Datomic](http://datomic.com). + +The Rust implementation gives us a smaller compiled output, better performance, more type safety, better tooling, and easier deployment into Firefox and mobile platforms. + +--- + +## Motivation + +Mentat is intended to be a flexible relational (not key-value, not document-oriented) store that makes it easy to describe, grow, and reuse your domain schema. + +By abstracting away the storage schema, and by exposing change listeners outside the database (not via triggers), we hope to make domain schemas stable, and allow both the data store itself and embedding applications to use better architectures, meeting performance goals in a way that allows future evolution. + +## Data storage is hard + +We've observed that data storage is a particular area of difficulty for software development teams: + +- It's hard to define storage schemas well. A developer must: + - Model their domain entities and relationships. + - Encode that model _efficiently_ and _correctly_ using the features available in the database. + - Plan for future extensions and performance tuning. + + In a SQL database, the same schema definition defines everything from high-level domain relationships through to numeric field sizes in the same smear of keywords. It's difficult for someone unfamiliar with the domain to determine from such a schema what's a domain fact and what's an implementation concession — are all part numbers always 16 characters long, or are we trying to save space? — or, indeed, whether a missing constraint is deliberate or a bug. + + The developer must think about foreign key constraints, compound uniqueness, and nullability. They must consider indexing, synchronizing, and stable identifiers. Most developers simply don't do enough work in SQL to get all of these things right. Storage thus becomes the specialty of a few individuals. + + Which one of these is correct? + + ```edn + {:db/id :person/email + :db/valueType :db.type/string + :db/cardinality :db.cardinality/many ; People can have multiple email addresses. + :db/unique :db.unique/identity ; For our purposes, each email identifies one person. + :db/index true} ; We want fast lookups by email. + {:db/id :person/friend + :db/valueType :db.type/ref + :db/cardinality :db.cardinality/many} ; People can have many friends. + ``` + ```sql + CREATE TABLE people ( + id INTEGER PRIMARY KEY, -- Bug: because of the primary key, each person can have no more than 1 email. + email VARCHAR(64), -- Bug?: no NOT NULL, so a person can have no email. + -- Bug: nobody will ever have a long email address, right? + ); + CREATE TABLE friendships ( + FOREIGN KEY person REFERENCES people(id), -- Bug?: no indexing, so lookups by friend or person will be slow. + FOREIGN KEY friend REFERENCES people(id), -- Bug: no compound uniqueness constraint, so we can have dupe friendships. + ); + ``` + + They both have limitations — the Mentat schema allows only for an open world (it's possible to declare friendships with people whose email isn't known), and requires validation code to enforce email string correctness — but we think that even such a tiny SQL example is harder to understand and obscures important domain decisions. + +- Queries are intimately tied to structural storage choices. That not only hides the declarative domain-level meaning of the query — it's hard to tell what a query is trying to do when it's a 100-line mess of subqueries and `LEFT OUTER JOIN`s — but it also means a simple structural schema change requires auditing _every query_ for correctness. + +- Developers often capture less event-shaped than they perhaps should, simply because their initial requirements don't warrant it. It's quite common to later want to [know when a fact was recorded](https://bugzilla.mozilla.org/show_bug.cgi?id=1341939), or _in which order_ two facts were recorded (particularly for migrations), or on which device an event took place… or even that a fact was _ever_ recorded and then deleted. + +- Common queries are hard. Storing values only once, upserts, complicated joins, and group-wise maxima are all difficult for non-expert developers to get right. + +- It's hard to evolve storage schemas. Writing a robust SQL schema migration is hard, particularly if a bad migration has ever escaped into the wild! Teams learn to fear and avoid schema changes, and eventually they ship a table called `metadata`, with three `TEXT` columns, so they never have to write a migration again. That decision pushes storage complexity into application code. (Or they start storing unversioned JSON blobs in the database…) + +- It's hard to share storage with another component, let alone share _data_ with another component. Conway's Law applies: your software system will often grow to have one database per team. + +- It's hard to build efficient storage and querying architectures. Materialized views require knowledge of triggers, or the implementation of bottleneck APIs. _Ad hoc_ caches are often wrong, are almost never formally designed (do you want a write-back, write-through, or write-around cache? Do you know the difference?), and often aren't reusable. The average developer, faced with a SQL database, has little choice but to build a simple table that tries to meet every need. + + +## Comparison to DataScript + +DataScript asks the question: "What if creating a database were as cheap as creating a Hashmap?" + +Mentat is not interested in that. Instead, it's strongly interested in persistence and performance, with very little interest in immutable databases/databases as values or throwaway use. + +One might say that Mentat's question is: "What if an SQLite database could store arbitrary relations, for arbitrary consumers, without them having to coordinate an up-front storage-level schema?" + +(Note that [domain-level schemas are very valuable](http://martinfowler.com/articles/schemaless/).) + +Another possible question would be: "What if we could bake some of the concepts of [CQRS and event sourcing](http://www.baeldung.com/cqrs-event-sourced-architecture-resources) into a persistent relational store, such that the transaction log itself were of value to queries?" + +Some thought has been given to how databases as values — long-term references to a snapshot of the store at an instant in time — could work in this model. It's not impossible; it simply has different performance characteristics. + +Just like DataScript, Mentat speaks Datalog for querying and takes additions and retractions as input to a transaction. + +Unlike DataScript, Mentat exposes free-text indexing, thanks to SQLite. + + +## Comparison to Datomic + +Datomic is a server-side, enterprise-grade data storage system. Datomic has a beautiful conceptual model. It's intended to be backed by a storage cluster, in which it keeps index chunks forever. Index chunks are replicated to peers, allowing it to run queries at the edges. Writes are serialized through a transactor. + +Many of these design decisions are inapplicable to deployed desktop software; indeed, the use of multiple JVM processes makes Datomic's use in a small desktop app, or a mobile device, prohibitive. + +Mentat was designed for embedding, initially in an experimental Electron app ([Tofino](https://github.com/mozilla/tofino)). It is less concerned with exposing consistent database states outside transaction boundaries, because that's less important here, and dropping some of these requirements allows us to leverage SQLite itself. + + +## Comparison to SQLite + +SQLite is a traditional SQL database in most respects: schemas conflate semantic, structural, and datatype concerns, as described above; the main interface with the database is human-first textual queries; sparse and graph-structured data are 'unnatural', if not always inefficient; experimenting with and evolving data models are error-prone and complicated activities; and so on. + +Mentat aims to offer many of the advantages of SQLite — single-file use, embeddability, and good performance — while building a more relaxed, reusable, and expressive data model on top. + +--- + +## Contributing + +Please note that this project is released with a Contributor Code of Conduct. +By participating in this project you agree to abide by its terms. + +See [CONTRIBUTING.md](/CONTRIBUTING/) for further notes. + +This project is very new, so we'll probably revise these guidelines. Please +comment on an issue before putting significant effort in if you'd like to +contribute. diff --git a/docs/apis/java/0.1/allclasses-frame.html b/docs/apis/java/0.1/allclasses-frame.html new file mode 100644 index 00000000..c4131ebb --- /dev/null +++ b/docs/apis/java/0.1/allclasses-frame.html @@ -0,0 +1,52 @@ + + + + + +All Classes + + + + + +

All Classes

+
+ +
+ + diff --git a/docs/apis/java/0.1/allclasses-noframe.html b/docs/apis/java/0.1/allclasses-noframe.html new file mode 100644 index 00000000..4375e053 --- /dev/null +++ b/docs/apis/java/0.1/allclasses-noframe.html @@ -0,0 +1,52 @@ + + + + + +All Classes + + + + + +

All Classes

+
+ +
+ + diff --git a/docs/apis/java/0.1/constant-values.html b/docs/apis/java/0.1/constant-values.html new file mode 100644 index 00000000..25fc4adc --- /dev/null +++ b/docs/apis/java/0.1/constant-values.html @@ -0,0 +1,149 @@ + + + + + +Constant Field Values + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Constant Field Values

+

Contents

+ +
+
+ + +

org.mozilla.*

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/deprecated-list.html b/docs/apis/java/0.1/deprecated-list.html new file mode 100644 index 00000000..62ed55b2 --- /dev/null +++ b/docs/apis/java/0.1/deprecated-list.html @@ -0,0 +1,120 @@ + + + + + +Deprecated List + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/help-doc.html b/docs/apis/java/0.1/help-doc.html new file mode 100644 index 00000000..58f3c5c5 --- /dev/null +++ b/docs/apis/java/0.1/help-doc.html @@ -0,0 +1,217 @@ + + + + + +API Help + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+ +This help file applies to API documentation generated using the standard doclet.
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-1.html b/docs/apis/java/0.1/index-files/index-1.html new file mode 100644 index 00000000..c7f57c91 --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-1.html @@ -0,0 +1,264 @@ + + + + + +A-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

A

+
+
add(String, long) - Method in class org.mozilla.mentat.EntityBuilder
+
+
Asserts the value of attribute `keyword` to be the provided `value`.
+
+
add(String, boolean) - Method in class org.mozilla.mentat.EntityBuilder
+
+
Asserts the value of attribute `keyword` to be the provided `value`.
+
+
add(String, double) - Method in class org.mozilla.mentat.EntityBuilder
+
+
Asserts the value of attribute `keyword` to be the provided `value`.
+
+
add(String, Date) - Method in class org.mozilla.mentat.EntityBuilder
+
+
Asserts the value of attribute `keyword` to be the provided `value`.
+
+
add(String, String) - Method in class org.mozilla.mentat.EntityBuilder
+
+
Asserts the value of attribute `keyword` to be the provided `value`.
+
+
add(String, UUID) - Method in class org.mozilla.mentat.EntityBuilder
+
+
Asserts the value of attribute `keyword` to be the provided `value`.
+
+
add(long, String, long) - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Asserts the value of attribute `keyword` to be the provided `value`.
+
+
add(long, String, boolean) - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Asserts the value of attribute `keyword` to be the provided `value`.
+
+
add(long, String, double) - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Asserts the value of attribute `keyword` to be the provided `value`.
+
+
add(long, String, Date) - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Asserts the value of attribute `keyword` to be the provided `value`.
+
+
add(long, String, String) - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Asserts the value of attribute `keyword` to be the provided `value`.
+
+
add(long, String, UUID) - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Asserts the value of attribute `keyword` to be the provided `value`.
+
+
addKeyword(String, String) - Method in class org.mozilla.mentat.EntityBuilder
+
+
Asserts the value of attribute `keyword` to be the provided `value`.
+
+
addKeyword(long, String, String) - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Asserts the value of attribute `keyword` to be the provided `value`.
+
+
addRef(String, long) - Method in class org.mozilla.mentat.EntityBuilder
+
+
Asserts the value of attribute `keyword` to be the provided `value`.
+
+
addRef(long, String, long) - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Asserts the value of attribute `keyword` to be the provided `value`.
+
+
asBool(Integer) - Method in class org.mozilla.mentat.TupleResult
+
+
Return the Boolean at the specified index.
+
+
asBoolean() - Method in class org.mozilla.mentat.TypedValue
+
+
This value as a Boolean.
+
+
asDate(Integer) - Method in class org.mozilla.mentat.TupleResult
+
+
Return the Date at the specified index.
+
+
asDate() - Method in class org.mozilla.mentat.TypedValue
+
+
This value as a Date.
+
+
asDouble(Integer) - Method in class org.mozilla.mentat.TupleResult
+
+
Return the Double at the specified index.
+
+
asDouble() - Method in class org.mozilla.mentat.TypedValue
+
+
This value as a Double.
+
+
asEntid(Integer) - Method in class org.mozilla.mentat.TupleResult
+
+
Return the Entid at the specified index.
+
+
asEntid() - Method in class org.mozilla.mentat.TypedValue
+
+
This value as a Entid.
+
+
asKeyword(Integer) - Method in class org.mozilla.mentat.TupleResult
+
+
Return the keyword String at the specified index.
+
+
asKeyword() - Method in class org.mozilla.mentat.TypedValue
+
+
This value as a keyword String.
+
+
asLong(Integer) - Method in class org.mozilla.mentat.TupleResult
+
+
Return the Long at the specified index.
+
+
asLong() - Method in class org.mozilla.mentat.TypedValue
+
+
This value as a Long.
+
+
asString(Integer) - Method in class org.mozilla.mentat.TupleResult
+
+
Return the String at the specified index.
+
+
asString() - Method in class org.mozilla.mentat.TypedValue
+
+
This value as a String.
+
+
asUUID(Integer) - Method in class org.mozilla.mentat.TupleResult
+
+
Return the UUID at the specified index.
+
+
asUUID() - Method in class org.mozilla.mentat.TypedValue
+
+
This value as a UUID.
+
+
AttributeList - Class in org.mozilla.mentat
+
+
Represents a C struct of a list of Strings containing attributes in the format + `:namespace/name`.
+
+
AttributeList() - Constructor for class org.mozilla.mentat.AttributeList
+
 
+
AttributeList.ByReference - Class in org.mozilla.mentat
+
 
+
AttributeList.ByValue - Class in org.mozilla.mentat
+
 
+
attributes - Variable in class org.mozilla.mentat.AttributeList
+
 
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-10.html b/docs/apis/java/0.1/index-files/index-10.html new file mode 100644 index 00000000..1bbe2066 --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-10.html @@ -0,0 +1,127 @@ + + + + + +L-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

L

+
+
len - Variable in class org.mozilla.mentat.AttributeList
+
 
+
len - Variable in class org.mozilla.mentat.TxChangeList
+
 
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-11.html b/docs/apis/java/0.1/index-files/index-11.html new file mode 100644 index 00000000..3b6b1f4b --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-11.html @@ -0,0 +1,142 @@ + + + + + +M-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

M

+
+
Mentat - Class in org.mozilla.mentat
+
+
The primary class for accessing Mentat's API.
+ This class provides all of the basic API that can be found in Mentat's Store struct.
+ The raw pointer it holds is a pointer to a Store.
+
+
Mentat(String) - Constructor for class org.mozilla.mentat.Mentat
+
+
Open a connection to a Store in a given location.
+ If the store does not already exist, one will be created.
+
+
Mentat() - Constructor for class org.mozilla.mentat.Mentat
+
+
Open a connection to an in-memory Store.
+
+
Mentat(Pointer) - Constructor for class org.mozilla.mentat.Mentat
+
+
Create a new Mentat with the provided pointer to a Mentat Store
+
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-12.html b/docs/apis/java/0.1/index-files/index-12.html new file mode 100644 index 00000000..e366d518 --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-12.html @@ -0,0 +1,133 @@ + + + + + +N-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

N

+
+
next() - Method in class org.mozilla.mentat.ColResultIterator
+
 
+
next() - Method in class org.mozilla.mentat.RelResultIterator
+
 
+
numberOfItems - Variable in class org.mozilla.mentat.AttributeList
+
 
+
numberOfItems - Variable in class org.mozilla.mentat.TxChange
+
 
+
numberOfItems - Variable in class org.mozilla.mentat.TxChangeList
+
 
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-13.html b/docs/apis/java/0.1/index-files/index-13.html new file mode 100644 index 00000000..453a5bd0 --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-13.html @@ -0,0 +1,127 @@ + + + + + +O-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

O

+
+
ok - Variable in class org.mozilla.mentat.RustResult
+
 
+
org.mozilla.mentat - package org.mozilla.mentat
+
 
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-14.html b/docs/apis/java/0.1/index-files/index-14.html new file mode 100644 index 00000000..41bb4d2e --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-14.html @@ -0,0 +1,161 @@ + + + + + +Q-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

Q

+
+
query(String) - Method in class org.mozilla.mentat.Mentat
+
+
Start a query.
+
+
Query - Class in org.mozilla.mentat
+
+
This class allows you to construct a query, bind values to variables and run those queries against a mentat DB.
+
+
Query(Pointer) - Constructor for class org.mozilla.mentat.Query
+
 
+
query_builder_bind_boolean(Pointer, String, int) - Method in interface org.mozilla.mentat.JNA
+
 
+
query_builder_bind_double(Pointer, String, double) - Method in interface org.mozilla.mentat.JNA
+
 
+
query_builder_bind_kw(Pointer, String, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
query_builder_bind_long(Pointer, String, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
query_builder_bind_ref(Pointer, String, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
query_builder_bind_ref_kw(Pointer, String, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
query_builder_bind_string(Pointer, String, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
query_builder_bind_timestamp(Pointer, String, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
query_builder_bind_uuid(Pointer, String, Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
query_builder_destroy(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
query_builder_execute(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
query_builder_execute_coll(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
query_builder_execute_scalar(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
query_builder_execute_tuple(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-15.html b/docs/apis/java/0.1/index-files/index-15.html new file mode 100644 index 00000000..07365e49 --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-15.html @@ -0,0 +1,230 @@ + + + + + +R-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

R

+
+
registerObserver(String, String[], TxObserverCallback) - Method in class org.mozilla.mentat.Mentat
+
+
Register an callback and a set of attributes to observer for transaction observation.
+
+
RelResult - Class in org.mozilla.mentat
+
+
Wraps a `Rel` result from a Mentat query.
+
+
RelResult(Pointer) - Constructor for class org.mozilla.mentat.RelResult
+
 
+
RelResultHandler - Interface in org.mozilla.mentat
+
+
Interface defining the structure of a callback from a query returning a RelResult.
+
+
RelResultIterator - Class in org.mozilla.mentat
+
+
Iterator for a RelResult
+
+
reports - Variable in class org.mozilla.mentat.TxChangeList
+
 
+
result - Variable in class org.mozilla.mentat.InProgressTransactionResult
+
 
+
retract(String, long) - Method in class org.mozilla.mentat.EntityBuilder
+
+
Retracts the value of attribute `keyword` from the provided `value`.
+
+
retract(String, boolean) - Method in class org.mozilla.mentat.EntityBuilder
+
+
Retracts the value of attribute `keyword` from the provided `value`.
+
+
retract(String, double) - Method in class org.mozilla.mentat.EntityBuilder
+
+
Retracts the value of attribute `keyword` from the provided `value`.
+
+
retract(String, Date) - Method in class org.mozilla.mentat.EntityBuilder
+
+
Retracts the value of attribute `keyword` from the provided `value`.
+
+
retract(String, String) - Method in class org.mozilla.mentat.EntityBuilder
+
+
Retracts the value of attribute `keyword` from the provided `value`.
+
+
retract(String, UUID) - Method in class org.mozilla.mentat.EntityBuilder
+
+
Retracts the value of attribute `keyword` from the provided `value`.
+
+
retract(long, String, long) - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Retracts the value of attribute `keyword` from the provided `value`.
+
+
retract(long, String, boolean) - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Retracts the value of attribute `keyword` from the provided `value`.
+
+
retract(long, String, double) - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Retracts the value of attribute `keyword` from the provided `value`.
+
+
retract(long, String, Date) - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Retracts the value of attribute `keyword` from the provided `value`.
+
+
retract(long, String, String) - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Retracts the value of attribute `keyword` from the provided `value`.
+
+
retract(long, String, UUID) - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Retracts the value of attribute `keyword` from the provided `value`.
+
+
retractKeyword(String, String) - Method in class org.mozilla.mentat.EntityBuilder
+
+
Retracts the value of attribute `keyword` from the provided `value`.
+
+
retractKeyword(long, String, String) - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Retracts the value of attribute `keyword` from the provided `value`.
+
+
retractRef(String, long) - Method in class org.mozilla.mentat.EntityBuilder
+
+
Retracts the value of attribute `keyword` from the provided `value`.
+
+
retractRef(long, String, long) - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Retracts the value of attribute `keyword` from the provided `value`.
+
+
rollback() - Method in class org.mozilla.mentat.InProgress
+
+
Rolls back all the transacts that have been performed on this `InProgress`, either directly + or through a Builder.
+
+
row_at_index(Pointer, int) - Method in interface org.mozilla.mentat.JNA
+
 
+
rowAtIndex(int) - Method in class org.mozilla.mentat.RelResult
+
+
Fetch the row at the requested index.
+
+
RustResult - Class in org.mozilla.mentat
+
+
Represents a C struct containing a Pointers and String that map to a Rust Result.
+
+
RustResult() - Constructor for class org.mozilla.mentat.RustResult
+
 
+
RustResult.ByReference - Class in org.mozilla.mentat
+
 
+
RustResult.ByValue - Class in org.mozilla.mentat
+
 
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-16.html b/docs/apis/java/0.1/index-files/index-16.html new file mode 100644 index 00000000..270c4787 --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-16.html @@ -0,0 +1,159 @@ + + + + + +S-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

S

+
+
ScalarResultHandler - Interface in org.mozilla.mentat
+
+
Interface defining the structure of a callback from a query returning a single TypedValue.
+
+
store_begin_transaction(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
store_cache_attribute_bi_directional(Pointer, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
store_cache_attribute_forward(Pointer, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
store_cache_attribute_reverse(Pointer, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
store_destroy(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
store_entid_for_attribute(Pointer, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
store_entity_builder_from_entid(Pointer, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
store_entity_builder_from_temp_id(Pointer, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
store_in_progress_builder(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
store_open(String) - Method in interface org.mozilla.mentat.JNA
+
 
+
store_query(Pointer, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
store_register_observer(Pointer, String, Pointer, int, TxObserverCallback) - Method in interface org.mozilla.mentat.JNA
+
 
+
store_sync(Pointer, String, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
store_transact(Pointer, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
store_unregister_observer(Pointer, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
store_value_for_attribute(Pointer, long, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-17.html b/docs/apis/java/0.1/index-files/index-17.html new file mode 100644 index 00000000..e36b7ca4 --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-17.html @@ -0,0 +1,235 @@ + + + + + +T-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

T

+
+
transact() - Method in class org.mozilla.mentat.EntityBuilder
+
+
Transacts the added assertions.
+
+
transact(String) - Method in class org.mozilla.mentat.InProgress
+
+
Transacts the `transaction` + + This does not commit the transaction.
+
+
transact() - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Transacts the added assertions.
+
+
transact(String) - Method in class org.mozilla.mentat.Mentat
+
+
Simple transact of an EDN string.
+
+
transactionObserverCalled(String, TxChangeList.ByReference) - Method in interface org.mozilla.mentat.TxObserverCallback
+
 
+
TupleResult - Class in org.mozilla.mentat
+
+
Wraps a `Tuple` result from a Mentat query.
+
+
TupleResult(Pointer) - Constructor for class org.mozilla.mentat.TupleResult
+
 
+
TupleResultHandler - Interface in org.mozilla.mentat
+
+
Interface defining the structure of a callback from a query returning a TupleResult.
+
+
tx_report_destroy(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
tx_report_entity_for_temp_id(Pointer, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
tx_report_get_entid(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
tx_report_get_tx_instant(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
TxChange - Class in org.mozilla.mentat
+
+
Represents a C struct representing changes that occured during a transaction.
+
+
TxChange() - Constructor for class org.mozilla.mentat.TxChange
+
 
+
TxChange.ByReference - Class in org.mozilla.mentat
+
 
+
TxChange.ByValue - Class in org.mozilla.mentat
+
 
+
TxChangeList - Class in org.mozilla.mentat
+
+
Represents a C struct containing a list of TxChanges that occured.
+
+
TxChangeList() - Constructor for class org.mozilla.mentat.TxChangeList
+
 
+
TxChangeList.ByReference - Class in org.mozilla.mentat
+
 
+
TxChangeList.ByValue - Class in org.mozilla.mentat
+
 
+
txid - Variable in class org.mozilla.mentat.TxChange
+
 
+
TxObserverCallback - Interface in org.mozilla.mentat
+
+
Protocol to be implemented by any object that wishes to register for transaction observation
+
+
TxReport - Class in org.mozilla.mentat
+
+
This class wraps a raw pointer than points to a Rust `TxReport` object.
+
+
TxReport(Pointer) - Constructor for class org.mozilla.mentat.TxReport
+
 
+
typed_value_destroy(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_into_boolean(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_into_double(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_into_entid(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_into_kw(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_into_long(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_into_string(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_into_timestamp(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_into_uuid(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_list_destroy(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_list_into_iter(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_list_iter_destroy(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_list_iter_next(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_result_set_destroy(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_result_set_into_iter(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_result_set_iter_destroy(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_result_set_iter_next(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
typed_value_value_type(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
TypedValue - Class in org.mozilla.mentat
+
+
A wrapper around Mentat's `TypedValue` Rust object.
+
+
TypedValue(Pointer) - Constructor for class org.mozilla.mentat.TypedValue
+
 
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-18.html b/docs/apis/java/0.1/index-files/index-18.html new file mode 100644 index 00000000..33fbd552 --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-18.html @@ -0,0 +1,128 @@ + + + + + +U-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

U

+
+
unregisterObserver(String) - Method in class org.mozilla.mentat.Mentat
+
+
Unregister the observer that was registered with the provided key such that it will no longer be called + if a transaction occurs that affects the attributes that the observer was registered to observe.
+
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-19.html b/docs/apis/java/0.1/index-files/index-19.html new file mode 100644 index 00000000..5d0f6898 --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-19.html @@ -0,0 +1,155 @@ + + + + + +V-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

V

+
+
value_at_index(Pointer, int) - Method in interface org.mozilla.mentat.JNA
+
 
+
value_at_index_into_boolean(Pointer, int) - Method in interface org.mozilla.mentat.JNA
+
 
+
value_at_index_into_double(Pointer, int) - Method in interface org.mozilla.mentat.JNA
+
 
+
value_at_index_into_entid(Pointer, int) - Method in interface org.mozilla.mentat.JNA
+
 
+
value_at_index_into_kw(Pointer, int) - Method in interface org.mozilla.mentat.JNA
+
 
+
value_at_index_into_long(Pointer, int) - Method in interface org.mozilla.mentat.JNA
+
 
+
value_at_index_into_string(Pointer, int) - Method in interface org.mozilla.mentat.JNA
+
 
+
value_at_index_into_timestamp(Pointer, int) - Method in interface org.mozilla.mentat.JNA
+
 
+
value_at_index_into_uuid(Pointer, int) - Method in interface org.mozilla.mentat.JNA
+
 
+
valueForAttributeOfEntity(String, long) - Method in class org.mozilla.mentat.Mentat
+
+
Retrieve a single value of an attribute for an Entity + TODO: Throw an exception if the result contains an error.
+
+
valueOf(String) - Static method in enum org.mozilla.mentat.CacheDirection
+
+
Returns the enum constant of this type with the specified name.
+
+
values() - Static method in enum org.mozilla.mentat.CacheDirection
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-2.html b/docs/apis/java/0.1/index-files/index-2.html new file mode 100644 index 00000000..6255fc94 --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-2.html @@ -0,0 +1,161 @@ + + + + + +B-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

B

+
+
beginTransaction() - Method in class org.mozilla.mentat.Mentat
+
+
Start a new transaction + + TODO: Throw an exception if the result contains an error.
+
+
builder() - Method in class org.mozilla.mentat.InProgress
+
+
Creates an InProgressBuilder using this InProgress .
+
+
builderForEntid(long) - Method in class org.mozilla.mentat.InProgress
+
+
Creates an `EntityBuilder` using this `InProgress` for the entity with `entid`.
+
+
builderForTempid(String) - Method in class org.mozilla.mentat.InProgress
+
+
Creates an `EntityBuilder` using this `InProgress` for a new entity with `tempid`.
+
+
ByReference() - Constructor for class org.mozilla.mentat.AttributeList.ByReference
+
 
+
ByReference() - Constructor for class org.mozilla.mentat.InProgressTransactionResult.ByReference
+
 
+
ByReference() - Constructor for class org.mozilla.mentat.RustResult.ByReference
+
 
+
ByReference() - Constructor for class org.mozilla.mentat.TxChange.ByReference
+
 
+
ByReference() - Constructor for class org.mozilla.mentat.TxChangeList.ByReference
+
 
+
ByValue() - Constructor for class org.mozilla.mentat.AttributeList.ByValue
+
 
+
ByValue() - Constructor for class org.mozilla.mentat.InProgressTransactionResult.ByValue
+
 
+
ByValue() - Constructor for class org.mozilla.mentat.RustResult.ByValue
+
 
+
ByValue() - Constructor for class org.mozilla.mentat.TxChange.ByValue
+
 
+
ByValue() - Constructor for class org.mozilla.mentat.TxChangeList.ByValue
+
 
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-3.html b/docs/apis/java/0.1/index-files/index-3.html new file mode 100644 index 00000000..f1f84418 --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-3.html @@ -0,0 +1,194 @@ + + + + + +C-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

C

+
+
cache(String, CacheDirection) - Method in class org.mozilla.mentat.Mentat
+
+
Add an attribute to the cache.
+
+
CacheDirection - Enum in org.mozilla.mentat
+
 
+
changes - Variable in class org.mozilla.mentat.TxChange
+
 
+
changes_len - Variable in class org.mozilla.mentat.TxChange
+
 
+
close() - Method in class org.mozilla.mentat.AttributeList
+
 
+
close() - Method in class org.mozilla.mentat.CollResult
+
 
+
close() - Method in class org.mozilla.mentat.ColResultIterator
+
 
+
close() - Method in class org.mozilla.mentat.EntityBuilder
+
 
+
close() - Method in class org.mozilla.mentat.InProgress
+
 
+
close() - Method in class org.mozilla.mentat.InProgressBuilder
+
 
+
close() - Method in class org.mozilla.mentat.InProgressTransactionResult
+
 
+
close() - Method in class org.mozilla.mentat.Mentat
+
 
+
close() - Method in class org.mozilla.mentat.Query
+
 
+
close() - Method in class org.mozilla.mentat.RelResult
+
 
+
close() - Method in class org.mozilla.mentat.RelResultIterator
+
 
+
close() - Method in class org.mozilla.mentat.RustResult
+
 
+
close() - Method in class org.mozilla.mentat.TupleResult
+
 
+
close() - Method in class org.mozilla.mentat.TxChange
+
 
+
close() - Method in class org.mozilla.mentat.TxChangeList
+
 
+
close() - Method in class org.mozilla.mentat.TxReport
+
 
+
close() - Method in class org.mozilla.mentat.TypedValue
+
 
+
CollResult - Class in org.mozilla.mentat
+
+
Wraps a `Coll` result from a Mentat query.
+
+
CollResult(Pointer) - Constructor for class org.mozilla.mentat.CollResult
+
 
+
CollResultHandler - Interface in org.mozilla.mentat
+
+
Interface defining the structure of a callback from a query returning a CollResult.
+
+
ColResultIterator - Class in org.mozilla.mentat
+
+
Iterator for a CollResult
+
+
commit() - Method in class org.mozilla.mentat.EntityBuilder
+
+
Transacts the added assertions and commits.
+
+
commit() - Method in class org.mozilla.mentat.InProgress
+
+
Commits all the transacts that have been performed on this `InProgress`, either directly + or through a Builder.
+
+
commit() - Method in class org.mozilla.mentat.InProgressBuilder
+
+
Transacts the added assertions and commits.
+
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-4.html b/docs/apis/java/0.1/index-files/index-4.html new file mode 100644 index 00000000..3b67fbad --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-4.html @@ -0,0 +1,125 @@ + + + + + +D-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

D

+
+
destroy(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-5.html b/docs/apis/java/0.1/index-files/index-5.html new file mode 100644 index 00000000..a7b86334 --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-5.html @@ -0,0 +1,188 @@ + + + + + +E-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

E

+
+
entIdForAttribute(String) - Method in class org.mozilla.mentat.Mentat
+
+
Get the the `Entid` of the attribute
+
+
entity_builder_add_boolean(Pointer, String, int) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_add_double(Pointer, String, double) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_add_keyword(Pointer, String, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_add_long(Pointer, String, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_add_ref(Pointer, String, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_add_string(Pointer, String, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_add_timestamp(Pointer, String, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_add_uuid(Pointer, String, Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_commit(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_destroy(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_retract_boolean(Pointer, String, int) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_retract_double(Pointer, String, double) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_retract_keyword(Pointer, String, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_retract_long(Pointer, String, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_retract_ref(Pointer, String, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_retract_string(Pointer, String, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_retract_timestamp(Pointer, String, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_retract_uuid(Pointer, String, Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
entity_builder_transact(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
EntityBuilder - Class in org.mozilla.mentat
+
+
This class wraps a raw pointer that points to a Rust `EntityBuilder` object.
+
+
EntityBuilder(Pointer) - Constructor for class org.mozilla.mentat.EntityBuilder
+
 
+
entityBuilder() - Method in class org.mozilla.mentat.Mentat
+
+
Creates a new transaction (InProgress) and returns an InProgressBuilder for + that transaction.
+
+
entityBuilder(long) - Method in class org.mozilla.mentat.Mentat
+
+
Creates a new transaction (InProgress) and returns an EntityBuilder for the + entity with `entid` for that transaction.
+
+
entityBuilder(String) - Method in class org.mozilla.mentat.Mentat
+
+
Creates a new transaction (InProgress) and returns an EntityBuilder for a new + entity with `tempId` for that transaction.
+
+
err - Variable in class org.mozilla.mentat.RustResult
+
 
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-6.html b/docs/apis/java/0.1/index-files/index-6.html new file mode 100644 index 00000000..30c440b2 --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-6.html @@ -0,0 +1,161 @@ + + + + + +G-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

G

+
+
get(Integer) - Method in class org.mozilla.mentat.TupleResult
+
+
Return the TypedValue at the specified index.
+
+
getChanges() - Method in class org.mozilla.mentat.TxChange
+
+
Get the affected attributes for this transaction
+
+
getEntidForTempId(String) - Method in class org.mozilla.mentat.TxReport
+
+
Access an `Entid` for a temporary identifier that was provided in the transaction.
+
+
getFieldOrder() - Method in class org.mozilla.mentat.AttributeList
+
 
+
getFieldOrder() - Method in class org.mozilla.mentat.InProgressTransactionResult
+
 
+
getFieldOrder() - Method in class org.mozilla.mentat.RustResult
+
 
+
getFieldOrder() - Method in class org.mozilla.mentat.TxChange
+
 
+
getFieldOrder() - Method in class org.mozilla.mentat.TxChangeList
+
 
+
getInProgress() - Method in class org.mozilla.mentat.InProgressTransactionResult
+
 
+
getReport() - Method in class org.mozilla.mentat.InProgressTransactionResult
+
 
+
getReports() - Method in class org.mozilla.mentat.TxChangeList
+
+
Get the changes that occured
+
+
getTxId() - Method in class org.mozilla.mentat.TxReport
+
+
Get the identifier for the transaction.
+
+
getTxInstant() - Method in class org.mozilla.mentat.TxReport
+
+
Get the time that the transaction occured.
+
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-7.html b/docs/apis/java/0.1/index-files/index-7.html new file mode 100644 index 00000000..2bf37adf --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-7.html @@ -0,0 +1,135 @@ + + + + + +H-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

H

+
+
handleList(CollResult) - Method in interface org.mozilla.mentat.CollResultHandler
+
 
+
handleRow(TupleResult) - Method in interface org.mozilla.mentat.TupleResultHandler
+
 
+
handleRows(RelResult) - Method in interface org.mozilla.mentat.RelResultHandler
+
 
+
handleValue(TypedValue) - Method in interface org.mozilla.mentat.ScalarResultHandler
+
 
+
hasNext() - Method in class org.mozilla.mentat.ColResultIterator
+
 
+
hasNext() - Method in class org.mozilla.mentat.RelResultIterator
+
 
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-8.html b/docs/apis/java/0.1/index-files/index-8.html new file mode 100644 index 00000000..9e27d799 --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-8.html @@ -0,0 +1,211 @@ + + + + + +I-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

I

+
+
in_progress_builder(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_add_boolean(Pointer, long, String, int) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_add_double(Pointer, long, String, double) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_add_keyword(Pointer, long, String, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_add_long(Pointer, long, String, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_add_ref(Pointer, long, String, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_add_string(Pointer, long, String, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_add_timestamp(Pointer, long, String, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_add_uuid(Pointer, long, String, Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_commit(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_destroy(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_retract_boolean(Pointer, long, String, int) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_retract_double(Pointer, long, String, double) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_retract_keyword(Pointer, long, String, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_retract_long(Pointer, long, String, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_retract_ref(Pointer, long, String, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_retract_string(Pointer, long, String, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_retract_timestamp(Pointer, long, String, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_retract_uuid(Pointer, long, String, Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_builder_transact(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_commit(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_destroy(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_entity_builder_from_entid(Pointer, long) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_entity_builder_from_temp_id(Pointer, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_rollback(Pointer) - Method in interface org.mozilla.mentat.JNA
+
 
+
in_progress_transact(Pointer, String) - Method in interface org.mozilla.mentat.JNA
+
 
+
InProgress - Class in org.mozilla.mentat
+
+
This class wraps a raw pointer that points to a Rust InProgress object.
+
+
InProgress(Pointer) - Constructor for class org.mozilla.mentat.InProgress
+
 
+
inProgress - Variable in class org.mozilla.mentat.InProgressTransactionResult
+
 
+
InProgressBuilder - Class in org.mozilla.mentat
+
+
This class wraps a raw pointer that points to a Rust `InProgressBuilder` object.
+
+
InProgressBuilder(Pointer) - Constructor for class org.mozilla.mentat.InProgressBuilder
+
 
+
InProgressTransactionResult - Class in org.mozilla.mentat
+
 
+
InProgressTransactionResult() - Constructor for class org.mozilla.mentat.InProgressTransactionResult
+
 
+
InProgressTransactionResult.ByReference - Class in org.mozilla.mentat
+
 
+
InProgressTransactionResult.ByValue - Class in org.mozilla.mentat
+
 
+
INSTANCE - Static variable in interface org.mozilla.mentat.JNA
+
 
+
isFailure() - Method in class org.mozilla.mentat.RustResult
+
+
Is there an error attached to this result?
+
+
isSuccess() - Method in class org.mozilla.mentat.RustResult
+
+
Is there an value attached to this result
+
+
iterator() - Method in class org.mozilla.mentat.CollResult
+
 
+
iterator() - Method in class org.mozilla.mentat.RelResult
+
 
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index-files/index-9.html b/docs/apis/java/0.1/index-files/index-9.html new file mode 100644 index 00000000..285dea05 --- /dev/null +++ b/docs/apis/java/0.1/index-files/index-9.html @@ -0,0 +1,132 @@ + + + + + +J-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A B C D E G H I J L M N O Q R S T U V  + + +

J

+
+
JNA - Interface in org.mozilla.mentat
+
+
JNA interface for FFI to Mentat's Rust library + Each function definition here link directly to a function in Mentat's FFI crate.
+
+
JNA_LIBRARY_NAME - Static variable in interface org.mozilla.mentat.JNA
+
 
+
JNA_NATIVE_LIB - Static variable in interface org.mozilla.mentat.JNA
+
 
+
+A B C D E G H I J L M N O Q R S T U V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/index.html b/docs/apis/java/0.1/index.html new file mode 100644 index 00000000..d14c400d --- /dev/null +++ b/docs/apis/java/0.1/index.html @@ -0,0 +1,72 @@ + + + + + +Generated Documentation (Untitled) + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="org/mozilla/mentat/package-summary.html">Non-frame version</a>.</p> + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/AttributeList.ByReference.html b/docs/apis/java/0.1/org/mozilla/mentat/AttributeList.ByReference.html new file mode 100644 index 00000000..b4694ec3 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/AttributeList.ByReference.html @@ -0,0 +1,310 @@ + + + + + +AttributeList.ByReference + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class AttributeList.ByReference

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/AttributeList.ByValue.html b/docs/apis/java/0.1/org/mozilla/mentat/AttributeList.ByValue.html new file mode 100644 index 00000000..bb6b9e08 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/AttributeList.ByValue.html @@ -0,0 +1,310 @@ + + + + + +AttributeList.ByValue + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class AttributeList.ByValue

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/AttributeList.html b/docs/apis/java/0.1/org/mozilla/mentat/AttributeList.html new file mode 100644 index 00000000..e362c4d7 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/AttributeList.html @@ -0,0 +1,438 @@ + + + + + +AttributeList + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class AttributeList

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/CacheDirection.html b/docs/apis/java/0.1/org/mozilla/mentat/CacheDirection.html new file mode 100644 index 00000000..3e7ca532 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/CacheDirection.html @@ -0,0 +1,349 @@ + + + + + +CacheDirection + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Enum CacheDirection

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/ColResultIterator.html b/docs/apis/java/0.1/org/mozilla/mentat/ColResultIterator.html new file mode 100644 index 00000000..6dfa60f5 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/ColResultIterator.html @@ -0,0 +1,312 @@ + + + + + +ColResultIterator + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class ColResultIterator

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/CollResult.html b/docs/apis/java/0.1/org/mozilla/mentat/CollResult.html new file mode 100644 index 00000000..7b599909 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/CollResult.html @@ -0,0 +1,360 @@ + + + + + +CollResult + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class CollResult

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/CollResultHandler.html b/docs/apis/java/0.1/org/mozilla/mentat/CollResultHandler.html new file mode 100644 index 00000000..f01d02ba --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/CollResultHandler.html @@ -0,0 +1,218 @@ + + + + + +CollResultHandler + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Interface CollResultHandler

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/EntityBuilder.html b/docs/apis/java/0.1/org/mozilla/mentat/EntityBuilder.html new file mode 100644 index 00000000..17470bd7 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/EntityBuilder.html @@ -0,0 +1,783 @@ + + + + + +EntityBuilder + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class EntityBuilder

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/InProgress.html b/docs/apis/java/0.1/org/mozilla/mentat/InProgress.html new file mode 100644 index 00000000..60f2707e --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/InProgress.html @@ -0,0 +1,494 @@ + + + + + +InProgress + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class InProgress

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/InProgressBuilder.html b/docs/apis/java/0.1/org/mozilla/mentat/InProgressBuilder.html new file mode 100644 index 00000000..785575d5 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/InProgressBuilder.html @@ -0,0 +1,835 @@ + + + + + +InProgressBuilder + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class InProgressBuilder

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/InProgressTransactionResult.ByReference.html b/docs/apis/java/0.1/org/mozilla/mentat/InProgressTransactionResult.ByReference.html new file mode 100644 index 00000000..57fa8a94 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/InProgressTransactionResult.ByReference.html @@ -0,0 +1,310 @@ + + + + + +InProgressTransactionResult.ByReference + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class InProgressTransactionResult.ByReference

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/InProgressTransactionResult.ByValue.html b/docs/apis/java/0.1/org/mozilla/mentat/InProgressTransactionResult.ByValue.html new file mode 100644 index 00000000..331b920b --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/InProgressTransactionResult.ByValue.html @@ -0,0 +1,310 @@ + + + + + +InProgressTransactionResult.ByValue + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class InProgressTransactionResult.ByValue

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/InProgressTransactionResult.html b/docs/apis/java/0.1/org/mozilla/mentat/InProgressTransactionResult.html new file mode 100644 index 00000000..b63a89a3 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/InProgressTransactionResult.html @@ -0,0 +1,452 @@ + + + + + +InProgressTransactionResult + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class InProgressTransactionResult

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/JNA.html b/docs/apis/java/0.1/org/mozilla/mentat/JNA.html new file mode 100644 index 00000000..7537b2b4 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/JNA.html @@ -0,0 +1,1962 @@ + + + + + +JNA + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Interface JNA

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/Mentat.html b/docs/apis/java/0.1/org/mozilla/mentat/Mentat.html new file mode 100644 index 00000000..bd9a3558 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/Mentat.html @@ -0,0 +1,621 @@ + + + + + +Mentat + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class Mentat

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/Query.html b/docs/apis/java/0.1/org/mozilla/mentat/Query.html new file mode 100644 index 00000000..75728c42 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/Query.html @@ -0,0 +1,325 @@ + + + + + +Query + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class Query

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/RelResult.html b/docs/apis/java/0.1/org/mozilla/mentat/RelResult.html new file mode 100644 index 00000000..bdb5bcc0 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/RelResult.html @@ -0,0 +1,359 @@ + + + + + +RelResult + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class RelResult

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/RelResultHandler.html b/docs/apis/java/0.1/org/mozilla/mentat/RelResultHandler.html new file mode 100644 index 00000000..26ee89b4 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/RelResultHandler.html @@ -0,0 +1,218 @@ + + + + + +RelResultHandler + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Interface RelResultHandler

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/RelResultIterator.html b/docs/apis/java/0.1/org/mozilla/mentat/RelResultIterator.html new file mode 100644 index 00000000..429fdc3c --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/RelResultIterator.html @@ -0,0 +1,312 @@ + + + + + +RelResultIterator + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class RelResultIterator

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/RustResult.ByReference.html b/docs/apis/java/0.1/org/mozilla/mentat/RustResult.ByReference.html new file mode 100644 index 00000000..475588e0 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/RustResult.ByReference.html @@ -0,0 +1,310 @@ + + + + + +RustResult.ByReference + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class RustResult.ByReference

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/RustResult.ByValue.html b/docs/apis/java/0.1/org/mozilla/mentat/RustResult.ByValue.html new file mode 100644 index 00000000..a4d83d8b --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/RustResult.ByValue.html @@ -0,0 +1,310 @@ + + + + + +RustResult.ByValue + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class RustResult.ByValue

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/RustResult.html b/docs/apis/java/0.1/org/mozilla/mentat/RustResult.html new file mode 100644 index 00000000..e00e08e0 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/RustResult.html @@ -0,0 +1,468 @@ + + + + + +RustResult + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class RustResult

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/ScalarResultHandler.html b/docs/apis/java/0.1/org/mozilla/mentat/ScalarResultHandler.html new file mode 100644 index 00000000..5fa470df --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/ScalarResultHandler.html @@ -0,0 +1,218 @@ + + + + + +ScalarResultHandler + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Interface ScalarResultHandler

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/TupleResult.html b/docs/apis/java/0.1/org/mozilla/mentat/TupleResult.html new file mode 100644 index 00000000..8e1031a9 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/TupleResult.html @@ -0,0 +1,534 @@ + + + + + +TupleResult + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class TupleResult

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/TupleResultHandler.html b/docs/apis/java/0.1/org/mozilla/mentat/TupleResultHandler.html new file mode 100644 index 00000000..c01eef40 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/TupleResultHandler.html @@ -0,0 +1,218 @@ + + + + + +TupleResultHandler + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Interface TupleResultHandler

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/TxChange.ByReference.html b/docs/apis/java/0.1/org/mozilla/mentat/TxChange.ByReference.html new file mode 100644 index 00000000..2fb85ad1 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/TxChange.ByReference.html @@ -0,0 +1,310 @@ + + + + + +TxChange.ByReference + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class TxChange.ByReference

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/TxChange.ByValue.html b/docs/apis/java/0.1/org/mozilla/mentat/TxChange.ByValue.html new file mode 100644 index 00000000..2ea41ae5 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/TxChange.ByValue.html @@ -0,0 +1,310 @@ + + + + + +TxChange.ByValue + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class TxChange.ByValue

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/TxChange.html b/docs/apis/java/0.1/org/mozilla/mentat/TxChange.html new file mode 100644 index 00000000..5c01423e --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/TxChange.html @@ -0,0 +1,472 @@ + + + + + +TxChange + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class TxChange

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/TxChangeList.ByReference.html b/docs/apis/java/0.1/org/mozilla/mentat/TxChangeList.ByReference.html new file mode 100644 index 00000000..8991c845 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/TxChangeList.ByReference.html @@ -0,0 +1,310 @@ + + + + + +TxChangeList.ByReference + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class TxChangeList.ByReference

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/TxChangeList.ByValue.html b/docs/apis/java/0.1/org/mozilla/mentat/TxChangeList.ByValue.html new file mode 100644 index 00000000..9c991597 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/TxChangeList.ByValue.html @@ -0,0 +1,310 @@ + + + + + +TxChangeList.ByValue + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class TxChangeList.ByValue

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/TxChangeList.html b/docs/apis/java/0.1/org/mozilla/mentat/TxChangeList.html new file mode 100644 index 00000000..237ebfc9 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/TxChangeList.html @@ -0,0 +1,457 @@ + + + + + +TxChangeList + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class TxChangeList

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/TxObserverCallback.html b/docs/apis/java/0.1/org/mozilla/mentat/TxObserverCallback.html new file mode 100644 index 00000000..4f3d722c --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/TxObserverCallback.html @@ -0,0 +1,255 @@ + + + + + +TxObserverCallback + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Interface TxObserverCallback

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/TxReport.html b/docs/apis/java/0.1/org/mozilla/mentat/TxReport.html new file mode 100644 index 00000000..ad29227c --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/TxReport.html @@ -0,0 +1,376 @@ + + + + + +TxReport + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class TxReport

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/TypedValue.html b/docs/apis/java/0.1/org/mozilla/mentat/TypedValue.html new file mode 100644 index 00000000..3dfdc128 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/TypedValue.html @@ -0,0 +1,473 @@ + + + + + +TypedValue + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
org.mozilla.mentat
+

Class TypedValue

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/package-frame.html b/docs/apis/java/0.1/org/mozilla/mentat/package-frame.html new file mode 100644 index 00000000..fde88f52 --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/package-frame.html @@ -0,0 +1,59 @@ + + + + + +org.mozilla.mentat + + + + + +

org.mozilla.mentat

+
+

Interfaces

+ +

Classes

+ +

Enums

+ +
+ + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/package-summary.html b/docs/apis/java/0.1/org/mozilla/mentat/package-summary.html new file mode 100644 index 00000000..76b1604d --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/package-summary.html @@ -0,0 +1,340 @@ + + + + + +org.mozilla.mentat + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Package org.mozilla.mentat

+
+
+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/org/mozilla/mentat/package-tree.html b/docs/apis/java/0.1/org/mozilla/mentat/package-tree.html new file mode 100644 index 00000000..fec23c9f --- /dev/null +++ b/docs/apis/java/0.1/org/mozilla/mentat/package-tree.html @@ -0,0 +1,206 @@ + + + + + +org.mozilla.mentat Class Hierarchy + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Hierarchy For Package org.mozilla.mentat

+
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/overview-tree.html b/docs/apis/java/0.1/overview-tree.html new file mode 100644 index 00000000..ab9534be --- /dev/null +++ b/docs/apis/java/0.1/overview-tree.html @@ -0,0 +1,210 @@ + + + + + +Class Hierarchy + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/docs/apis/java/0.1/package-list b/docs/apis/java/0.1/package-list new file mode 100644 index 00000000..02fdff27 --- /dev/null +++ b/docs/apis/java/0.1/package-list @@ -0,0 +1 @@ +org.mozilla.mentat diff --git a/docs/apis/java/0.1/script.js b/docs/apis/java/0.1/script.js new file mode 100644 index 00000000..b3463569 --- /dev/null +++ b/docs/apis/java/0.1/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/docs/apis/java/0.1/stylesheet.css b/docs/apis/java/0.1/stylesheet.css new file mode 100644 index 00000000..98055b22 --- /dev/null +++ b/docs/apis/java/0.1/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/docs/apis/rust/0.7.0/COPYRIGHT.txt b/docs/apis/rust/0.7.0/COPYRIGHT.txt new file mode 100644 index 00000000..c69861aa --- /dev/null +++ b/docs/apis/rust/0.7.0/COPYRIGHT.txt @@ -0,0 +1,59 @@ +These documentation pages include resources by third parties. This copyright +file applies only to those resources. The following third party resources are +included, and carry their own copyright notices and license terms: + +* Fira Sans (FiraSans-Regular.woff, FiraSans-Medium.woff): + + Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ + with Reserved Font Name Fira Sans. + + Copyright (c) 2014, Telefonica S.A. + + Licensed under the SIL Open Font License, Version 1.1. + See FiraSans-LICENSE.txt. + +* Heuristica (Heuristica-Italic.woff): + + Copyright 1989, 1991 Adobe Systems Incorporated. All rights reserved. + Utopia is either a registered trademark or trademark of Adobe Systems + Incorporated in the United States and/or other countries. Used under + license. + + Copyright 2006 Han The Thanh, Vntopia font family, http://vntex.sf.net + + Copyright (c) 2008-2012, Andrey V. Panov (panov@canopus.iacp.dvo.ru), + with Reserved Font Name Heuristica. + + Licensed under the SIL Open Font License, Version 1.1. + See Heuristica-LICENSE.txt. + +* rustdoc.css, main.js, and playpen.js: + + Copyright 2015 The Rust Developers. + Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or + the MIT license (LICENSE-MIT.txt) at your option. + +* normalize.css: + + Copyright (c) Nicolas Gallagher and Jonathan Neal. + Licensed under the MIT license (see LICENSE-MIT.txt). + +* Source Code Pro (SourceCodePro-Regular.woff, SourceCodePro-Semibold.woff): + + Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), + with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark + of Adobe Systems Incorporated in the United States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceCodePro-LICENSE.txt. + +* Source Serif Pro (SourceSerifPro-Regular.woff, SourceSerifPro-Bold.woff): + + Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/), with + Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of + Adobe Systems Incorporated in the United States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceSerifPro-LICENSE.txt. + +This copyright file is intended to be distributed with rustdoc output. diff --git a/docs/apis/rust/0.7.0/FiraSans-LICENSE.txt b/docs/apis/rust/0.7.0/FiraSans-LICENSE.txt new file mode 100644 index 00000000..b4a39671 --- /dev/null +++ b/docs/apis/rust/0.7.0/FiraSans-LICENSE.txt @@ -0,0 +1,99 @@ +Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ +with Reserved Font Name Fira Sans. + +Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ +with Reserved Font Name Fira Mono. + +Copyright (c) 2014, Telefonica S.A. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/docs/apis/rust/0.7.0/FiraSans-Medium.woff b/docs/apis/rust/0.7.0/FiraSans-Medium.woff new file mode 100644 index 00000000..56272277 Binary files /dev/null and b/docs/apis/rust/0.7.0/FiraSans-Medium.woff differ diff --git a/docs/apis/rust/0.7.0/FiraSans-Regular.woff b/docs/apis/rust/0.7.0/FiraSans-Regular.woff new file mode 100644 index 00000000..9ff40445 Binary files /dev/null and b/docs/apis/rust/0.7.0/FiraSans-Regular.woff differ diff --git a/docs/apis/rust/0.7.0/Heuristica-Italic.woff b/docs/apis/rust/0.7.0/Heuristica-Italic.woff new file mode 100644 index 00000000..b0cebf01 Binary files /dev/null and b/docs/apis/rust/0.7.0/Heuristica-Italic.woff differ diff --git a/docs/apis/rust/0.7.0/Heuristica-LICENSE.txt b/docs/apis/rust/0.7.0/Heuristica-LICENSE.txt new file mode 100644 index 00000000..dd85e40e --- /dev/null +++ b/docs/apis/rust/0.7.0/Heuristica-LICENSE.txt @@ -0,0 +1,101 @@ +Copyright 1989, 1991 Adobe Systems Incorporated. All rights reserved. +Utopia is either a registered trademark or trademark of Adobe Systems +Incorporated in the United States and/or other countries. Used under +license. + +Copyright 2006 Han The Thanh, Vntopia font family, http://vntex.sf.net + +Copyright (c) 2008-2012, Andrey V. Panov (panov@canopus.iacp.dvo.ru), +with Reserved Font Name Heuristica. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/docs/apis/rust/0.7.0/LICENSE-APACHE.txt b/docs/apis/rust/0.7.0/LICENSE-APACHE.txt new file mode 100644 index 00000000..16fe87b0 --- /dev/null +++ b/docs/apis/rust/0.7.0/LICENSE-APACHE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/docs/apis/rust/0.7.0/LICENSE-MIT.txt b/docs/apis/rust/0.7.0/LICENSE-MIT.txt new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/docs/apis/rust/0.7.0/LICENSE-MIT.txt @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/docs/apis/rust/0.7.0/SourceCodePro-LICENSE.txt b/docs/apis/rust/0.7.0/SourceCodePro-LICENSE.txt new file mode 100644 index 00000000..07542572 --- /dev/null +++ b/docs/apis/rust/0.7.0/SourceCodePro-LICENSE.txt @@ -0,0 +1,93 @@ +Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/docs/apis/rust/0.7.0/SourceCodePro-Regular.woff b/docs/apis/rust/0.7.0/SourceCodePro-Regular.woff new file mode 100644 index 00000000..55766709 Binary files /dev/null and b/docs/apis/rust/0.7.0/SourceCodePro-Regular.woff differ diff --git a/docs/apis/rust/0.7.0/SourceCodePro-Semibold.woff b/docs/apis/rust/0.7.0/SourceCodePro-Semibold.woff new file mode 100644 index 00000000..ca972a11 Binary files /dev/null and b/docs/apis/rust/0.7.0/SourceCodePro-Semibold.woff differ diff --git a/docs/apis/rust/0.7.0/SourceSerifPro-Bold.woff b/docs/apis/rust/0.7.0/SourceSerifPro-Bold.woff new file mode 100644 index 00000000..ac1b1b3a Binary files /dev/null and b/docs/apis/rust/0.7.0/SourceSerifPro-Bold.woff differ diff --git a/docs/apis/rust/0.7.0/SourceSerifPro-LICENSE.txt b/docs/apis/rust/0.7.0/SourceSerifPro-LICENSE.txt new file mode 100644 index 00000000..b77d653a --- /dev/null +++ b/docs/apis/rust/0.7.0/SourceSerifPro-LICENSE.txt @@ -0,0 +1,93 @@ +Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/docs/apis/rust/0.7.0/SourceSerifPro-Regular.woff b/docs/apis/rust/0.7.0/SourceSerifPro-Regular.woff new file mode 100644 index 00000000..e8c43b85 Binary files /dev/null and b/docs/apis/rust/0.7.0/SourceSerifPro-Regular.woff differ diff --git a/docs/apis/rust/0.7.0/brush.svg b/docs/apis/rust/0.7.0/brush.svg new file mode 100644 index 00000000..072264a6 --- /dev/null +++ b/docs/apis/rust/0.7.0/brush.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/dark.css b/docs/apis/rust/0.7.0/dark.css new file mode 100644 index 00000000..2d0fe55f --- /dev/null +++ b/docs/apis/rust/0.7.0/dark.css @@ -0,0 +1,391 @@ +/** + * Copyright 2015 The Rust Project Developers. See the COPYRIGHT + * file at the top-level directory of this distribution and at + * http://rust-lang.org/COPYRIGHT. + * + * Licensed under the Apache License, Version 2.0 or the MIT license + * , at your + * option. This file may not be copied, modified, or distributed + * except according to those terms. + */ + +body { + background-color: #353535; + color: #ddd; +} + +h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { + color: #ddd; +} +h1.fqn { + border-bottom-color: #d2d2d2; +} +h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { + border-bottom-color: #d2d2d2; +} + +.in-band { + background-color: #353535; +} + +.invisible { + background: rgba(0, 0, 0, 0); +} + +.docblock code, .docblock-short code { + background-color: #2A2A2A; +} +pre { + background-color: #2A2A2A; +} + +.sidebar { + background-color: #505050; +} + +.sidebar .current { + background-color: #333; +} + +.source .sidebar { + background-color: #353535; +} + +.sidebar .location { + border-color: #fff; + background: #575757; + color: #DDD; +} + +.sidebar .version { + border-bottom-color: #DDD; +} + +.sidebar-title { + border-top-color: #777; + border-bottom-color: #777; +} + +.block a:hover { + background: #444; +} + +.line-numbers span { color: #3B91E2; } +.line-numbers .line-highlighted { + background-color: #0a042f !important; +} + +.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 { + border-bottom-color: #DDD; +} + +.docblock table { + border-color: #ddd; +} + +.docblock table td { + border-top-color: #ddd; + border-bottom-color: #ddd; +} + +.docblock table th { + border-top-color: #ddd; + border-bottom-color: #ddd; +} + +:target { background: #494a3d; } + +:target > .in-band { + background: #494a3d; +} + +.content .method .where, +.content .fn .where, +.content .where.fmt-newline { + color: #ddd; +} + +.content .highlighted { + color: #eee !important; + background-color: #333; +} +.content .highlighted a, .content .highlighted span { color: #eee !important; } +.content .highlighted.trait { background-color: #013191; } +.content .highlighted.mod, +.content .highlighted.externcrate { background-color: #afc6e4; } +.content .highlighted.mod { background-color: #803a1b; } +.content .highlighted.externcrate { background-color: #396bac; } +.content .highlighted.enum { background-color: #5b4e68; } +.content .highlighted.struct { background-color: #194e9f; } +.content .highlighted.union { background-color: #b7bd49; } +.content .highlighted.fn, +.content .highlighted.method, +.content .highlighted.tymethod { background-color: #4950ed; } +.content .highlighted.type { background-color: #38902c; } +.content .highlighted.foreigntype { background-color: #b200d6; } +.content .highlighted.macro { background-color: #217d1c; } +.content .highlighted.constant, +.content .highlighted.static { background-color: #0063cc; } +.content .highlighted.primitive { background-color: #00708a; } + +.content span.enum, .content a.enum, .block a.current.enum { color: #82b089; } +.content span.struct, .content a.struct, .block a.current.struct { color: #2dbfb8; } +.content span.type, .content a.type, .block a.current.type { color: #ff7f00; } +.content span.foreigntype, .content a.foreigntype, .block a.current.foreigntype { color: #dd7de8; } +.content span.macro, .content a.macro, .block a.current.macro { color: #09bd00; } +.content span.union, .content a.union, .block a.current.union { color: #a6ae37; } +.content span.constant, .content a.constant, .block a.current.constant, +.content span.static, .content a.static, .block a.current.static { color: #82a5c9; } +.content span.primitive, .content a.primitive, .block a.current.primitive { color: #43aec7; } +.content span.externcrate, +.content span.mod, .content a.mod, .block a.current.mod { color: #bda000; } +.content span.trait, .content a.trait, .block a.current.trait { color: #b78cf2; } +.content span.fn, .content a.fn, .block a.current.fn, +.content span.method, .content a.method, .block a.current.method, +.content span.tymethod, .content a.tymethod, .block a.current.tymethod, +.content .fnname{ color: #2BAB63; } + +pre.rust .comment { color: #8d8d8b; } +pre.rust .doccomment { color: #8ca375; } + +nav { + border-bottom-color: #4e4e4e; +} +nav.main .current { + border-top-color: #eee; + border-bottom-color: #eee; +} +nav.main .separator { + border-color: #eee; +} +a { + color: #ddd; +} + +.docblock a, .docblock-short a, .stability a { + color: #D2991D; +} + +a.test-arrow { + color: #dedede; +} + +.collapse-toggle { + color: #999; +} + +.search-input { + color: #111; + box-shadow: 0 0 0 1px #000, 0 0 0 2px transparent; + background-color: #f0f0f0; +} + +.search-input:focus { + border-color: #008dfd; +} + +.stab.unstable { background: #FFF5D6; border-color: #FFC600; color: #404040; } +.stab.deprecated { background: #F3DFFF; border-color: #7F0087; color: #404040; } +.stab.portability { background: #C4ECFF; border-color: #7BA5DB; color: #404040; } + +.module-item .stab { + color: #ddd; +} + +#help > div { + background: #4d4d4d; + border-color: #bfbfbf; +} + +#help dt { + border-color: #bfbfbf; + background: rgba(0,0,0,0); + color: black; +} + +.since { + color: grey; +} + +tr.result span.primitive::after { + color: #ddd; +} + +.line-numbers :target { background-color: transparent; } + +/* Code highlighting */ +pre.rust .kw { color: #ab8ac1; } +pre.rust .kw-2, pre.rust .prelude-ty { color: #769acb; } +pre.rust .number, pre.rust .string { color: #83a300; } +pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val, +pre.rust .attribute, pre.rust .attribute .ident { color: #ee6868; } +pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; } +pre.rust .lifetime { color: #d97f26; } +pre.rust .question-mark { + color: #ff9011; +} + +a.test-arrow { + background-color: rgba(78, 139, 202, 0.2); +} + +a.test-arrow:hover{ + background-color: #4e8bca; +} + +.toggle-label { + color: #999; +} + +:target > code { + background: #FDFFD3; +} + +pre.compile_fail { + border-left: 2px solid rgba(255,0,0,.6); +} + +pre.compile_fail:hover, .information:hover + pre.compile_fail { + border-left: 2px solid #f00; +} + +pre.ignore { + border-left: 2px solid rgba(255,142,0,.6); +} + +pre.ignore:hover, .information:hover + pre.ignore { + border-left: 2px solid #ff9200; +} + +.tooltip.compile_fail { + color: rgba(255,0,0,.6); +} + +.information > .compile_fail:hover { + color: #f00; +} + +.tooltip.ignore { + color: rgba(255,142,0,.6); +} + +.information > .ignore:hover { + color: rgba(255,142,0,1); +} + +.search-failed > a { + color: #0089ff; +} + +.tooltip .tooltiptext { + background-color: black; + color: #fff; +} + +.tooltip .tooltiptext::after { + border-color: transparent black transparent transparent; +} + +.important-traits .tooltip .tooltiptext { + background-color: white; + color: black; + border-color: black; +} + +#titles > div { + border-bottom-color: #ccc; +} + +#titles > div.selected { + border-bottom-color: #0078ee; +} + +#titles > div:hover { + border-bottom-color: #0089ff; +} + +#titles > div > div.count { + color: #888; +} + +.modal { + background-color: rgba(0,0,0,0.3); +} + +.modal-content { + background-color: #272727; + border-color: #999; +} + +.modal-content > .close { + background-color: #272727; + border-color: #999; +} + +.modal-content > .close:hover { + background-color: #ff1f1f; + color: white; +} + +.modal-content > .whiter { + background-color: #272727; +} + +.modal-content > .close:hover + .whiter { + background-color: #ff1f1f; +} + +@media (max-width: 700px) { + .sidebar-menu { + background-color: #505050; + border-bottom-color: #e0e0e0; + border-right-color: #e0e0e0; + } + + .sidebar-elems { + background-color: #505050; + border-right-color: #000; + } + + #sidebar-filler { + background-color: #505050; + border-bottom-color: #e0e0e0; + } +} + +kbd { + color: #000; + background-color: #fafbfc; + border-color: #d1d5da; + border-bottom-color: #c6cbd1; + box-shadow-color: #c6cbd1; +} + +#theme-picker { + border-color: #e0e0e0; + background: #f0f0f0; +} + +#theme-picker:hover, #theme-picker:focus { + border-color: #ffb900; +} + +#theme-choices { + border-color: #e0e0e0; + background-color: #353535; +} + +#theme-choices > button:not(:first-child) { + border-top-color: #e0e0e0; +} + +#theme-choices > button:hover, #theme-choices > button:focus { + background-color: #444; +} + +@media (max-width: 700px) { + #theme-picker { + background: #f0f0f0; + } +} diff --git a/docs/apis/rust/0.7.0/edn/BigInt.t.html b/docs/apis/rust/0.7.0/edn/BigInt.t.html new file mode 100644 index 00000000..aa27d2bb --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/BigInt.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.BigInt.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/DateTime.t.html b/docs/apis/rust/0.7.0/edn/DateTime.t.html new file mode 100644 index 00000000..4f28f679 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/DateTime.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DateTime.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/OrderedFloat.t.html b/docs/apis/rust/0.7.0/edn/OrderedFloat.t.html new file mode 100644 index 00000000..561e6ad5 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/OrderedFloat.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.OrderedFloat.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/Utc.t.html b/docs/apis/rust/0.7.0/edn/Utc.t.html new file mode 100644 index 00000000..dda32b3b --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/Utc.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Utc.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/Uuid.t.html b/docs/apis/rust/0.7.0/edn/Uuid.t.html new file mode 100644 index 00000000..60b8c2f7 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/Uuid.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Uuid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/UuidParseError.t.html b/docs/apis/rust/0.7.0/edn/UuidParseError.t.html new file mode 100644 index 00000000..10c33e20 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/UuidParseError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.UuidParseError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/AttributePlace.t.html b/docs/apis/rust/0.7.0/edn/entities/AttributePlace.t.html new file mode 100644 index 00000000..2520621a --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/AttributePlace.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.AttributePlace.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/Entid.t.html b/docs/apis/rust/0.7.0/edn/entities/Entid.t.html new file mode 100644 index 00000000..8d61826d --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/Entid.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Entid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/Entity.t.html b/docs/apis/rust/0.7.0/edn/entities/Entity.t.html new file mode 100644 index 00000000..acc55a67 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/Entity.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Entity.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/EntityPlace.t.html b/docs/apis/rust/0.7.0/edn/entities/EntityPlace.t.html new file mode 100644 index 00000000..caa7250c --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/EntityPlace.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.EntityPlace.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/LookupRef.t.html b/docs/apis/rust/0.7.0/edn/entities/LookupRef.t.html new file mode 100644 index 00000000..3afa6fd5 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/LookupRef.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.LookupRef.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/MapNotation.t.html b/docs/apis/rust/0.7.0/edn/entities/MapNotation.t.html new file mode 100644 index 00000000..e344790d --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/MapNotation.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.MapNotation.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/OpType.t.html b/docs/apis/rust/0.7.0/edn/entities/OpType.t.html new file mode 100644 index 00000000..1aec0003 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/OpType.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.OpType.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/TempId.t.html b/docs/apis/rust/0.7.0/edn/entities/TempId.t.html new file mode 100644 index 00000000..e1b817b6 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/TempId.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.TempId.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/TxFunction.t.html b/docs/apis/rust/0.7.0/edn/entities/TxFunction.t.html new file mode 100644 index 00000000..e0f0bfb3 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/TxFunction.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.TxFunction.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/ValuePlace.t.html b/docs/apis/rust/0.7.0/edn/entities/ValuePlace.t.html new file mode 100644 index 00000000..5233aa4a --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/ValuePlace.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.ValuePlace.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/enum.AttributePlace.html b/docs/apis/rust/0.7.0/edn/entities/enum.AttributePlace.html new file mode 100644 index 00000000..8ce256dc --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/enum.AttributePlace.html @@ -0,0 +1,155 @@ + + + + + + + + + + edn::entities::AttributePlace - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::entities::AttributePlace + + [] + + [src]

pub enum AttributePlace {
+    Entid(Entid),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Clone for AttributePlace
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for AttributePlace
[src]

Formats the value using the given formatter. Read more

+

impl Eq for AttributePlace
[src]

impl Hash for AttributePlace
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for AttributePlace
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for AttributePlace
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for AttributePlace
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/enum.Entid.html b/docs/apis/rust/0.7.0/edn/entities/enum.Entid.html new file mode 100644 index 00000000..8cb1e633 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/enum.Entid.html @@ -0,0 +1,160 @@ + + + + + + + + + + edn::entities::Entid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::entities::Entid + + [] + + [src]

pub enum Entid {
+    Entid(i64),
+    Ident(Keyword),
+}

+ Variants

+ +

+ Methods +

+

impl Entid
[src]

+

+ Trait Implementations +

+
+

impl Clone for Entid
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for Entid
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Entid
[src]

impl Hash for Entid
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for Entid
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for Entid
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for Entid
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for Entid

impl Sync for Entid

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/enum.Entity.html b/docs/apis/rust/0.7.0/edn/entities/enum.Entity.html new file mode 100644 index 00000000..4b95a0d6 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/enum.Entity.html @@ -0,0 +1,163 @@ + + + + + + + + + + edn::entities::Entity - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::entities::Entity + + [] + + [src]

pub enum Entity<V> {
+    AddOrRetract {
+        op: OpType,
+        e: EntityPlace<V>,
+        a: AttributePlace,
+        v: ValuePlace<V>,
+    },
+    MapNotation(MapNotation<V>),
+}

+ Variants

+

Fields of AddOrRetract

+ +
+

+ Trait Implementations +

+
+

impl<V: Clone> Clone for Entity<V>
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<V: Debug> Debug for Entity<V>
[src]

Formats the value using the given formatter. Read more

+

impl<V: Eq> Eq for Entity<V>
[src]

impl<V: Hash> Hash for Entity<V>
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl<V: Ord> Ord for Entity<V>
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<V: PartialOrd> PartialOrd for Entity<V>
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl<V: PartialEq> PartialEq for Entity<V>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl<V> Send for Entity<V> where
    V: Send

impl<V> Sync for Entity<V> where
    V: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/enum.EntityPlace.html b/docs/apis/rust/0.7.0/edn/entities/enum.EntityPlace.html new file mode 100644 index 00000000..7f76bfcb --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/enum.EntityPlace.html @@ -0,0 +1,158 @@ + + + + + + + + + + edn::entities::EntityPlace - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::entities::EntityPlace + + [] + + [src]

pub enum EntityPlace<V> {
+    Entid(Entid),
+    TempId(TempId),
+    LookupRef(LookupRef<V>),
+    TxFunction(TxFunction),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl<V: Clone> Clone for EntityPlace<V>
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<V: Debug> Debug for EntityPlace<V>
[src]

Formats the value using the given formatter. Read more

+

impl<V: Eq> Eq for EntityPlace<V>
[src]

impl<V: Hash> Hash for EntityPlace<V>
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl<V: Ord> Ord for EntityPlace<V>
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<V: PartialOrd> PartialOrd for EntityPlace<V>
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl<V: PartialEq> PartialEq for EntityPlace<V>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl<V> Send for EntityPlace<V> where
    V: Send

impl<V> Sync for EntityPlace<V> where
    V: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/enum.OpType.html b/docs/apis/rust/0.7.0/edn/entities/enum.OpType.html new file mode 100644 index 00000000..8f675975 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/enum.OpType.html @@ -0,0 +1,156 @@ + + + + + + + + + + edn::entities::OpType - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::entities::OpType + + [] + + [src]

pub enum OpType {
+    Add,
+    Retract,
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Clone for OpType
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for OpType
[src]

impl Debug for OpType
[src]

Formats the value using the given formatter. Read more

+

impl Eq for OpType
[src]

impl Hash for OpType
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for OpType
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for OpType
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for OpType
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for OpType

impl Sync for OpType

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/enum.TempId.html b/docs/apis/rust/0.7.0/edn/entities/enum.TempId.html new file mode 100644 index 00000000..7d1a94a9 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/enum.TempId.html @@ -0,0 +1,163 @@ + + + + + + + + + + edn::entities::TempId - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::entities::TempId + + [] + + [src]

pub enum TempId {
+    External(String),
+    Internal(i64),
+}

A tempid, either an external tempid given in a transaction (usually as an Value::Text), +or an internal tempid allocated by Mentat itself.

+

+ Variants

+ +

+ Methods +

+

impl TempId
[src]

+

+ Trait Implementations +

+
+

impl Clone for TempId
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for TempId
[src]

Formats the value using the given formatter. Read more

+

impl Eq for TempId
[src]

impl Hash for TempId
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for TempId
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for TempId
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for TempId
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for TempId
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for TempId

impl Sync for TempId

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/enum.ValuePlace.html b/docs/apis/rust/0.7.0/edn/entities/enum.ValuePlace.html new file mode 100644 index 00000000..549f69f8 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/enum.ValuePlace.html @@ -0,0 +1,161 @@ + + + + + + + + + + edn::entities::ValuePlace - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::entities::ValuePlace + + [] + + [src]

pub enum ValuePlace<V> {
+    Entid(Entid),
+    TempId(TempId),
+    LookupRef(LookupRef<V>),
+    TxFunction(TxFunction),
+    Vector(Vec<ValuePlace<V>>),
+    Atom(V),
+    MapNotation(MapNotation<V>),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl<V: Clone> Clone for ValuePlace<V>
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<V: Debug> Debug for ValuePlace<V>
[src]

Formats the value using the given formatter. Read more

+

impl<V: Eq> Eq for ValuePlace<V>
[src]

impl<V: Hash> Hash for ValuePlace<V>
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl<V: Ord> Ord for ValuePlace<V>
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<V: PartialOrd> PartialOrd for ValuePlace<V>
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl<V: PartialEq> PartialEq for ValuePlace<V>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl<V> Send for ValuePlace<V> where
    V: Send

impl<V> Sync for ValuePlace<V> where
    V: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/index.html b/docs/apis/rust/0.7.0/edn/entities/index.html new file mode 100644 index 00000000..7bf7e839 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/index.html @@ -0,0 +1,204 @@ + + + + + + + + + + edn::entities - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module edn::entities + + [] + + [src]

This module defines core types that support the transaction processor.

+

Structs

+ + + + + + + + +
LookupRef + +
TxFunction +

A "transaction function" that exposes some value determined by the current transaction. The +prototypical example is the current transaction ID, (transaction-tx).

+ +

Enums

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributePlace + +
Entid + +
Entity + +
EntityPlace + +
OpType + +
TempId +

A tempid, either an external tempid given in a transaction (usually as an Value::Text), +or an internal tempid allocated by Mentat itself.

+ +
ValuePlace + +

Type Definitions

+ + + + +
MapNotation + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/sidebar-items.js b/docs/apis/rust/0.7.0/edn/entities/sidebar-items.js new file mode 100644 index 00000000..a4e35632 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["AttributePlace",""],["Entid",""],["Entity",""],["EntityPlace",""],["OpType",""],["TempId","A tempid, either an external tempid given in a transaction (usually as an `Value::Text`), or an internal tempid allocated by Mentat itself."],["ValuePlace",""]],"struct":[["LookupRef",""],["TxFunction","A \"transaction function\" that exposes some value determined by the current transaction. The prototypical example is the current transaction ID, `(transaction-tx)`."]],"type":[["MapNotation",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/struct.LookupRef.html b/docs/apis/rust/0.7.0/edn/entities/struct.LookupRef.html new file mode 100644 index 00000000..7770dc4a --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/struct.LookupRef.html @@ -0,0 +1,163 @@ + + + + + + + + + + edn::entities::LookupRef - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::entities::LookupRef + + [] + + [src]

pub struct LookupRef<V> {
+    pub a: AttributePlace,
+    pub v: V,
+}

+ Fields

+ + + + +

+ Trait Implementations +

+
+

impl<V: Clone> Clone for LookupRef<V>
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<V: Debug> Debug for LookupRef<V>
[src]

Formats the value using the given formatter. Read more

+

impl<V: Eq> Eq for LookupRef<V>
[src]

impl<V: Hash> Hash for LookupRef<V>
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl<V: Ord> Ord for LookupRef<V>
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<V: PartialOrd> PartialOrd for LookupRef<V>
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl<V: PartialEq> PartialEq for LookupRef<V>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl<V> Send for LookupRef<V> where
    V: Send

impl<V> Sync for LookupRef<V> where
    V: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/struct.TxFunction.html b/docs/apis/rust/0.7.0/edn/entities/struct.TxFunction.html new file mode 100644 index 00000000..34a3227f --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/struct.TxFunction.html @@ -0,0 +1,167 @@ + + + + + + + + + + edn::entities::TxFunction - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::entities::TxFunction + + [] + + [src]

pub struct TxFunction {
+    pub op: PlainSymbol,
+}

A "transaction function" that exposes some value determined by the current transaction. The +prototypical example is the current transaction ID, (transaction-tx).

+

A natural next step might be to expose the current transaction instant (transaction-instant), +but that's more difficult: the transaction itself can set the transaction instant (with some +restrictions), so the transaction function must be late-binding. Right now, that's difficult to +arrange in the transactor.

+

In the future, we might accept arguments; for example, perhaps we might expose (ancestor (transaction-tx) n) to find the n-th ancestor of the current transaction. If we do accept +arguments, then the special case of (lookup-ref a v) should be handled as part of the +generalization.

+

+ Fields

+ + +

+ Trait Implementations +

+
+

impl Clone for TxFunction
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for TxFunction
[src]

Formats the value using the given formatter. Read more

+

impl Eq for TxFunction
[src]

impl Hash for TxFunction
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for TxFunction
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for TxFunction
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for TxFunction
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for TxFunction

impl Sync for TxFunction

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/entities/type.MapNotation.html b/docs/apis/rust/0.7.0/edn/entities/type.MapNotation.html new file mode 100644 index 00000000..ab46f9af --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/entities/type.MapNotation.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::entities::MapNotation - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition edn::entities::MapNotation + + [] + + [src]

type MapNotation<V> = BTreeMap<Entid, ValuePlace<V>>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/enum.UuidParseError.html b/docs/apis/rust/0.7.0/edn/enum.UuidParseError.html new file mode 100644 index 00000000..cb719052 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/enum.UuidParseError.html @@ -0,0 +1,153 @@ + + + + + + + + + + edn::UuidParseError - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::UuidParseError + + [] + + [src]

pub enum UuidParseError {
+    InvalidLength(usize),
+    InvalidCharacter(charusize),
+    InvalidGroups(usize),
+    InvalidGroupLength(usizeusizeu8),
+}

Error details for string parsing failures.

+

+ Variants

+ +

+ Trait Implementations +

+
+

impl Debug for ParseError
[src]

Formats the value using the given formatter. Read more

+

impl Display for ParseError
[src]

Converts a ParseError to a string.

+

Formats the value using the given formatter. Read more

+

impl PartialEq<ParseError> for ParseError
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for ParseError
[src]

impl Clone for ParseError
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for ParseError
[src]

impl Error for ParseError
[src]

A short description of the error. Read more

+

The lower-level cause of this error, if any. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for ParseError

impl Sync for ParseError

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/index.html b/docs/apis/rust/0.7.0/edn/index.html new file mode 100644 index 00000000..6e0dff5a --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/index.html @@ -0,0 +1,251 @@ + + + + + + + + + + edn - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Crate edn + + [] + + [src]

Re-exports

+
pub use value_rc::Cloned;
pub use value_rc::FromRc;
pub use value_rc::ValueRc;
pub use parse::ParseError;
pub use types::FromMicros;
pub use types::Span;
pub use types::SpannedValue;
pub use types::ToMicros;
pub use types::Value;
pub use types::ValueAndSpan;
pub use symbols::Keyword;
pub use symbols::NamespacedSymbol;
pub use symbols::PlainSymbol;

Modules

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
entities +

This module defines core types that support the transaction processor.

+ +
matcher + +
parse + +
pretty_print + +
query + +
symbols + +
types + +
utils + +
value_rc + +

Macros

+ + + + +
ns_keyword + +

Structs

+ + + + + + + + + + + + + + + + + + + + +
BigInt +

A big signed integer type.

+ +
DateTime +

ISO 8601 combined date and time with time zone.

+ +
OrderedFloat +

A wrapper around Floats providing an implementation of Ord and Hash.

+ +
Utc +

The UTC time zone. This is the most efficient time zone when you don't need the local time. +It is also used as an offset (which is also a dummy type).

+ +
Uuid +

A Universally Unique Identifier (UUID).

+ +

Enums

+ + + + +
UuidParseError +

Error details for string parsing failures.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/macro.ns_keyword!.html b/docs/apis/rust/0.7.0/edn/macro.ns_keyword!.html new file mode 100644 index 00000000..6e47e82e --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/macro.ns_keyword!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.ns_keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/macro.ns_keyword.html b/docs/apis/rust/0.7.0/edn/macro.ns_keyword.html new file mode 100644 index 00000000..95127ab0 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/macro.ns_keyword.html @@ -0,0 +1,130 @@ + + + + + + + + + + edn::ns_keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro edn::ns_keyword + + [] + + [src]

+macro_rules! ns_keyword {
+    ($ns: expr, $name: expr) => { ... };
+}
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/matcher/index.html b/docs/apis/rust/0.7.0/edn/matcher/index.html new file mode 100644 index 00000000..0898bf3a --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/matcher/index.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::matcher - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module edn::matcher + + [] + + [src]

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/matcher/sidebar-items.js b/docs/apis/rust/0.7.0/edn/matcher/sidebar-items.js new file mode 100644 index 00000000..48333d31 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/matcher/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/ns_keyword.m.html b/docs/apis/rust/0.7.0/edn/ns_keyword.m.html new file mode 100644 index 00000000..6e47e82e --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/ns_keyword.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.ns_keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/ParseError.t.html b/docs/apis/rust/0.7.0/edn/parse/ParseError.t.html new file mode 100644 index 00000000..ccbc2450 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/ParseError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ParseError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/ParseResult.t.html b/docs/apis/rust/0.7.0/edn/parse/ParseResult.t.html new file mode 100644 index 00000000..00363e8e --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/ParseResult.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.ParseResult.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/basedinteger.v.html b/docs/apis/rust/0.7.0/edn/parse/basedinteger.v.html new file mode 100644 index 00000000..c796de99 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/basedinteger.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.basedinteger.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/bigint.v.html b/docs/apis/rust/0.7.0/edn/parse/bigint.v.html new file mode 100644 index 00000000..08c60449 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/bigint.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.bigint.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/boolean.v.html b/docs/apis/rust/0.7.0/edn/parse/boolean.v.html new file mode 100644 index 00000000..b3e1cb5e --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/boolean.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.boolean.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/entities.v.html b/docs/apis/rust/0.7.0/edn/parse/entities.v.html new file mode 100644 index 00000000..e872e5c7 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/entities.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entities.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/entity.v.html b/docs/apis/rust/0.7.0/edn/parse/entity.v.html new file mode 100644 index 00000000..db1adbad --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/entity.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/float.v.html b/docs/apis/rust/0.7.0/edn/parse/float.v.html new file mode 100644 index 00000000..4d2977e2 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/float.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.float.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.basedinteger.html b/docs/apis/rust/0.7.0/edn/parse/fn.basedinteger.html new file mode 100644 index 00000000..ea06e37a --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.basedinteger.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::basedinteger - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::basedinteger + + [] + + [src]

pub fn basedinteger<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.bigint.html b/docs/apis/rust/0.7.0/edn/parse/fn.bigint.html new file mode 100644 index 00000000..ff67a213 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.bigint.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::bigint - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::bigint + + [] + + [src]

pub fn bigint<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.boolean.html b/docs/apis/rust/0.7.0/edn/parse/fn.boolean.html new file mode 100644 index 00000000..6cf5527d --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.boolean.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::boolean - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::boolean + + [] + + [src]

pub fn boolean<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.entities.html b/docs/apis/rust/0.7.0/edn/parse/fn.entities.html new file mode 100644 index 00000000..9e335353 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.entities.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::entities - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::entities + + [] + + [src]

pub fn entities<'input>(
    __input: &'input str
) -> ParseResult<Vec<Entity<ValueAndSpan>>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.entity.html b/docs/apis/rust/0.7.0/edn/parse/fn.entity.html new file mode 100644 index 00000000..65d7261b --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.entity.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::entity - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::entity + + [] + + [src]

pub fn entity<'input>(__input: &'input str) -> ParseResult<Entity<ValueAndSpan>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.float.html b/docs/apis/rust/0.7.0/edn/parse/fn.float.html new file mode 100644 index 00000000..535d9a3d --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.float.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::float - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::float + + [] + + [src]

pub fn float<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.hexinteger.html b/docs/apis/rust/0.7.0/edn/parse/fn.hexinteger.html new file mode 100644 index 00000000..fb151d61 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.hexinteger.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::hexinteger - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::hexinteger + + [] + + [src]

pub fn hexinteger<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.infinity.html b/docs/apis/rust/0.7.0/edn/parse/fn.infinity.html new file mode 100644 index 00000000..b7258b7b --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.infinity.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::infinity - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::infinity + + [] + + [src]

pub fn infinity<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.integer.html b/docs/apis/rust/0.7.0/edn/parse/fn.integer.html new file mode 100644 index 00000000..8d34014e --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.integer.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::integer - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::integer + + [] + + [src]

pub fn integer<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.keyword.html b/docs/apis/rust/0.7.0/edn/parse/fn.keyword.html new file mode 100644 index 00000000..45ce1fd7 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.keyword.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::keyword + + [] + + [src]

pub fn keyword<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.list.html b/docs/apis/rust/0.7.0/edn/parse/fn.list.html new file mode 100644 index 00000000..4c568dd7 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.list.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::list - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::list + + [] + + [src]

pub fn list<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.map.html b/docs/apis/rust/0.7.0/edn/parse/fn.map.html new file mode 100644 index 00000000..1c55c385 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.map.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::map - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::map + + [] + + [src]

pub fn map<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.nan.html b/docs/apis/rust/0.7.0/edn/parse/fn.nan.html new file mode 100644 index 00000000..3115712e --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.nan.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::nan - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::nan + + [] + + [src]

pub fn nan<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.nil.html b/docs/apis/rust/0.7.0/edn/parse/fn.nil.html new file mode 100644 index 00000000..99ef0f58 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.nil.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::nil - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::nil + + [] + + [src]

pub fn nil<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.octalinteger.html b/docs/apis/rust/0.7.0/edn/parse/fn.octalinteger.html new file mode 100644 index 00000000..690c6b85 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.octalinteger.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::octalinteger - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::octalinteger + + [] + + [src]

pub fn octalinteger<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.op.html b/docs/apis/rust/0.7.0/edn/parse/fn.op.html new file mode 100644 index 00000000..6e804422 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.op.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::op - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::op + + [] + + [src]

pub fn op<'input>(__input: &'input str) -> ParseResult<OpType>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.parse_query.html b/docs/apis/rust/0.7.0/edn/parse/fn.parse_query.html new file mode 100644 index 00000000..e42c06df --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.parse_query.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::parse_query - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::parse_query + + [] + + [src]

pub fn parse_query<'input>(__input: &'input str) -> ParseResult<ParsedQuery>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.raw_basedinteger.html b/docs/apis/rust/0.7.0/edn/parse/fn.raw_basedinteger.html new file mode 100644 index 00000000..b1b3995b --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.raw_basedinteger.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::raw_basedinteger - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::raw_basedinteger + + [] + + [src]

pub fn raw_basedinteger<'input>(__input: &'input str) -> ParseResult<i64>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.raw_bigint.html b/docs/apis/rust/0.7.0/edn/parse/fn.raw_bigint.html new file mode 100644 index 00000000..0f519159 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.raw_bigint.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::raw_bigint - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::raw_bigint + + [] + + [src]

pub fn raw_bigint<'input>(__input: &'input str) -> ParseResult<BigInt>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.raw_float.html b/docs/apis/rust/0.7.0/edn/parse/fn.raw_float.html new file mode 100644 index 00000000..1b370597 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.raw_float.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::raw_float - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::raw_float + + [] + + [src]

pub fn raw_float<'input>(__input: &'input str) -> ParseResult<OrderedFloat<f64>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.raw_hexinteger.html b/docs/apis/rust/0.7.0/edn/parse/fn.raw_hexinteger.html new file mode 100644 index 00000000..b826b39d --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.raw_hexinteger.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::raw_hexinteger - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::raw_hexinteger + + [] + + [src]

pub fn raw_hexinteger<'input>(__input: &'input str) -> ParseResult<i64>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.raw_integer.html b/docs/apis/rust/0.7.0/edn/parse/fn.raw_integer.html new file mode 100644 index 00000000..83853e68 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.raw_integer.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::raw_integer - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::raw_integer + + [] + + [src]

pub fn raw_integer<'input>(__input: &'input str) -> ParseResult<i64>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.raw_octalinteger.html b/docs/apis/rust/0.7.0/edn/parse/fn.raw_octalinteger.html new file mode 100644 index 00000000..0d019197 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.raw_octalinteger.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::raw_octalinteger - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::raw_octalinteger + + [] + + [src]

pub fn raw_octalinteger<'input>(__input: &'input str) -> ParseResult<i64>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.raw_text.html b/docs/apis/rust/0.7.0/edn/parse/fn.raw_text.html new file mode 100644 index 00000000..b70a9ea6 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.raw_text.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::raw_text - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::raw_text + + [] + + [src]

pub fn raw_text<'input>(__input: &'input str) -> ParseResult<String>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.set.html b/docs/apis/rust/0.7.0/edn/parse/fn.set.html new file mode 100644 index 00000000..5db56cf7 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.set.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::set - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::set + + [] + + [src]

pub fn set<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.symbol.html b/docs/apis/rust/0.7.0/edn/parse/fn.symbol.html new file mode 100644 index 00000000..1cb58e45 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.symbol.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::symbol - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::symbol + + [] + + [src]

pub fn symbol<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.text.html b/docs/apis/rust/0.7.0/edn/parse/fn.text.html new file mode 100644 index 00000000..facbac33 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.text.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::text - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::text + + [] + + [src]

pub fn text<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.uuid.html b/docs/apis/rust/0.7.0/edn/parse/fn.uuid.html new file mode 100644 index 00000000..c080e7a5 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.uuid.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::uuid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::uuid + + [] + + [src]

pub fn uuid<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.value.html b/docs/apis/rust/0.7.0/edn/parse/fn.value.html new file mode 100644 index 00000000..3b9de528 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.value.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::value - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::value + + [] + + [src]

pub fn value<'input>(__input: &'input str) -> ParseResult<ValueAndSpan>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.vector.html b/docs/apis/rust/0.7.0/edn/parse/fn.vector.html new file mode 100644 index 00000000..e8dc9d2a --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.vector.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::vector - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::vector + + [] + + [src]

pub fn vector<'input>(__input: &'input str) -> ParseResult<SpannedValue>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/fn.where_fn.html b/docs/apis/rust/0.7.0/edn/parse/fn.where_fn.html new file mode 100644 index 00000000..109afbba --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/fn.where_fn.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::where_fn - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::parse::where_fn + + [] + + [src]

pub fn where_fn<'input>(__input: &'input str) -> ParseResult<WhereClause>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/hexinteger.v.html b/docs/apis/rust/0.7.0/edn/parse/hexinteger.v.html new file mode 100644 index 00000000..1bda2480 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/hexinteger.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.hexinteger.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/index.html b/docs/apis/rust/0.7.0/edn/parse/index.html new file mode 100644 index 00000000..9f8a4ddb --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/index.html @@ -0,0 +1,360 @@ + + + + + + + + + + edn::parse - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module edn::parse + + [] + + [src]

Structs

+ + + + +
ParseError + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
basedinteger + +
bigint + +
boolean + +
entities + +
entity + +
float + +
hexinteger + +
infinity + +
integer + +
keyword + +
list + +
map + +
nan + +
nil + +
octalinteger + +
op + +
parse_query + +
raw_basedinteger + +
raw_bigint + +
raw_float + +
raw_hexinteger + +
raw_integer + +
raw_octalinteger + +
raw_text + +
set + +
symbol + +
text + +
uuid + +
value + +
vector + +
where_fn + +

Type Definitions

+ + + + +
ParseResult + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/infinity.v.html b/docs/apis/rust/0.7.0/edn/parse/infinity.v.html new file mode 100644 index 00000000..e8d06f77 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/infinity.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.infinity.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/integer.v.html b/docs/apis/rust/0.7.0/edn/parse/integer.v.html new file mode 100644 index 00000000..1f80a598 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/integer.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.integer.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/keyword.v.html b/docs/apis/rust/0.7.0/edn/parse/keyword.v.html new file mode 100644 index 00000000..8e783d9c --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/keyword.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/list.v.html b/docs/apis/rust/0.7.0/edn/parse/list.v.html new file mode 100644 index 00000000..6763be69 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/list.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.list.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/map.v.html b/docs/apis/rust/0.7.0/edn/parse/map.v.html new file mode 100644 index 00000000..66016236 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/map.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.map.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/nan.v.html b/docs/apis/rust/0.7.0/edn/parse/nan.v.html new file mode 100644 index 00000000..8db9137c --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/nan.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.nan.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/nil.v.html b/docs/apis/rust/0.7.0/edn/parse/nil.v.html new file mode 100644 index 00000000..dd520d2d --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/nil.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.nil.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/octalinteger.v.html b/docs/apis/rust/0.7.0/edn/parse/octalinteger.v.html new file mode 100644 index 00000000..74ac607d --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/octalinteger.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.octalinteger.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/op.v.html b/docs/apis/rust/0.7.0/edn/parse/op.v.html new file mode 100644 index 00000000..ea26f83d --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/op.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.op.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/parse_query.v.html b/docs/apis/rust/0.7.0/edn/parse/parse_query.v.html new file mode 100644 index 00000000..4eb8e1d6 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/parse_query.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.parse_query.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/raw_basedinteger.v.html b/docs/apis/rust/0.7.0/edn/parse/raw_basedinteger.v.html new file mode 100644 index 00000000..e68ed203 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/raw_basedinteger.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.raw_basedinteger.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/raw_bigint.v.html b/docs/apis/rust/0.7.0/edn/parse/raw_bigint.v.html new file mode 100644 index 00000000..e8ea3516 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/raw_bigint.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.raw_bigint.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/raw_float.v.html b/docs/apis/rust/0.7.0/edn/parse/raw_float.v.html new file mode 100644 index 00000000..e6f1e998 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/raw_float.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.raw_float.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/raw_hexinteger.v.html b/docs/apis/rust/0.7.0/edn/parse/raw_hexinteger.v.html new file mode 100644 index 00000000..3e716f7c --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/raw_hexinteger.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.raw_hexinteger.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/raw_integer.v.html b/docs/apis/rust/0.7.0/edn/parse/raw_integer.v.html new file mode 100644 index 00000000..1160c758 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/raw_integer.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.raw_integer.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/raw_octalinteger.v.html b/docs/apis/rust/0.7.0/edn/parse/raw_octalinteger.v.html new file mode 100644 index 00000000..3009c40d --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/raw_octalinteger.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.raw_octalinteger.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/raw_text.v.html b/docs/apis/rust/0.7.0/edn/parse/raw_text.v.html new file mode 100644 index 00000000..ec324025 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/raw_text.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.raw_text.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/set.v.html b/docs/apis/rust/0.7.0/edn/parse/set.v.html new file mode 100644 index 00000000..9da7492b --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/set.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.set.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/sidebar-items.js b/docs/apis/rust/0.7.0/edn/parse/sidebar-items.js new file mode 100644 index 00000000..14b64292 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"fn":[["basedinteger",""],["bigint",""],["boolean",""],["entities",""],["entity",""],["float",""],["hexinteger",""],["infinity",""],["integer",""],["keyword",""],["list",""],["map",""],["nan",""],["nil",""],["octalinteger",""],["op",""],["parse_query",""],["raw_basedinteger",""],["raw_bigint",""],["raw_float",""],["raw_hexinteger",""],["raw_integer",""],["raw_octalinteger",""],["raw_text",""],["set",""],["symbol",""],["text",""],["uuid",""],["value",""],["vector",""],["where_fn",""]],"struct":[["ParseError",""]],"type":[["ParseResult",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/struct.ParseError.html b/docs/apis/rust/0.7.0/edn/parse/struct.ParseError.html new file mode 100644 index 00000000..b40fb607 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/struct.ParseError.html @@ -0,0 +1,166 @@ + + + + + + + + + + edn::parse::ParseError - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::parse::ParseError + + [] + + [src]

pub struct ParseError {
+    pub line: usize,
+    pub column: usize,
+    pub offset: usize,
+    pub expected: HashSet<&'static str>,
+}

+ Fields

+ + + + + + + + +

+ Trait Implementations +

+
+

impl PartialEq for ParseError
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for ParseError
[src]

impl Debug for ParseError
[src]

Formats the value using the given formatter. Read more

+

impl Clone for ParseError
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Display for ParseError
[src]

Formats the value using the given formatter. Read more

+

impl Error for ParseError
[src]

A short description of the error. Read more

+

The lower-level cause of this error, if any. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for ParseError

impl Sync for ParseError

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/symbol.v.html b/docs/apis/rust/0.7.0/edn/parse/symbol.v.html new file mode 100644 index 00000000..1b4c6e3c --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/symbol.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.symbol.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/text.v.html b/docs/apis/rust/0.7.0/edn/parse/text.v.html new file mode 100644 index 00000000..3f48aa18 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/text.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.text.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/type.ParseResult.html b/docs/apis/rust/0.7.0/edn/parse/type.ParseResult.html new file mode 100644 index 00000000..10d46c75 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/type.ParseResult.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::parse::ParseResult - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition edn::parse::ParseResult + + [] + + [src]

type ParseResult<T> = Result<T, ParseError>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/uuid.v.html b/docs/apis/rust/0.7.0/edn/parse/uuid.v.html new file mode 100644 index 00000000..ec7b4d6e --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/uuid.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.uuid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/value.v.html b/docs/apis/rust/0.7.0/edn/parse/value.v.html new file mode 100644 index 00000000..9def4f65 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/value.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.value.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/vector.v.html b/docs/apis/rust/0.7.0/edn/parse/vector.v.html new file mode 100644 index 00000000..75aff001 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/vector.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.vector.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/parse/where_fn.v.html b/docs/apis/rust/0.7.0/edn/parse/where_fn.v.html new file mode 100644 index 00000000..b728d4e7 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/parse/where_fn.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.where_fn.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/pretty_print/index.html b/docs/apis/rust/0.7.0/edn/pretty_print/index.html new file mode 100644 index 00000000..6569dec7 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/pretty_print/index.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::pretty_print - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module edn::pretty_print + + [] + + [src]

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/pretty_print/sidebar-items.js b/docs/apis/rust/0.7.0/edn/pretty_print/sidebar-items.js new file mode 100644 index 00000000..48333d31 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/pretty_print/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/Aggregate.t.html b/docs/apis/rust/0.7.0/edn/query/Aggregate.t.html new file mode 100644 index 00000000..2cd5c9e9 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/Aggregate.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Aggregate.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/Binding.t.html b/docs/apis/rust/0.7.0/edn/query/Binding.t.html new file mode 100644 index 00000000..04563187 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/Binding.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Binding.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/ContainsVariables.t.html b/docs/apis/rust/0.7.0/edn/query/ContainsVariables.t.html new file mode 100644 index 00000000..15c54202 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/ContainsVariables.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.ContainsVariables.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/Direction.t.html b/docs/apis/rust/0.7.0/edn/query/Direction.t.html new file mode 100644 index 00000000..03027a1f --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/Direction.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Direction.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/Element.t.html b/docs/apis/rust/0.7.0/edn/query/Element.t.html new file mode 100644 index 00000000..9e80ab48 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/Element.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Element.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/FindSpec.t.html b/docs/apis/rust/0.7.0/edn/query/FindSpec.t.html new file mode 100644 index 00000000..85d8eec4 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/FindSpec.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.FindSpec.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/FnArg.t.html b/docs/apis/rust/0.7.0/edn/query/FnArg.t.html new file mode 100644 index 00000000..99d30c0c --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/FnArg.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.FnArg.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/FromValue.t.html b/docs/apis/rust/0.7.0/edn/query/FromValue.t.html new file mode 100644 index 00000000..cb3f12c3 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/FromValue.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.FromValue.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/IdentOrEntid.t.html b/docs/apis/rust/0.7.0/edn/query/IdentOrEntid.t.html new file mode 100644 index 00000000..5a8e4eea --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/IdentOrEntid.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.IdentOrEntid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/Limit.t.html b/docs/apis/rust/0.7.0/edn/query/Limit.t.html new file mode 100644 index 00000000..c0f35449 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/Limit.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Limit.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/NamedPullAttribute.t.html b/docs/apis/rust/0.7.0/edn/query/NamedPullAttribute.t.html new file mode 100644 index 00000000..e522a2f8 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/NamedPullAttribute.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.NamedPullAttribute.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/NonIntegerConstant.t.html b/docs/apis/rust/0.7.0/edn/query/NonIntegerConstant.t.html new file mode 100644 index 00000000..2e3e3b29 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/NonIntegerConstant.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.NonIntegerConstant.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/NotJoin.t.html b/docs/apis/rust/0.7.0/edn/query/NotJoin.t.html new file mode 100644 index 00000000..ae799567 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/NotJoin.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.NotJoin.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/OrJoin.t.html b/docs/apis/rust/0.7.0/edn/query/OrJoin.t.html new file mode 100644 index 00000000..9f5702e7 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/OrJoin.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.OrJoin.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/OrWhereClause.t.html b/docs/apis/rust/0.7.0/edn/query/OrWhereClause.t.html new file mode 100644 index 00000000..a309b3d9 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/OrWhereClause.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.OrWhereClause.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/Order.t.html b/docs/apis/rust/0.7.0/edn/query/Order.t.html new file mode 100644 index 00000000..424a63ab --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/Order.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Order.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/ParsedQuery.t.html b/docs/apis/rust/0.7.0/edn/query/ParsedQuery.t.html new file mode 100644 index 00000000..3898f787 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/ParsedQuery.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ParsedQuery.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/Pattern.t.html b/docs/apis/rust/0.7.0/edn/query/Pattern.t.html new file mode 100644 index 00000000..d2cb2086 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/Pattern.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Pattern.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/PatternNonValuePlace.t.html b/docs/apis/rust/0.7.0/edn/query/PatternNonValuePlace.t.html new file mode 100644 index 00000000..fdfae7d2 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/PatternNonValuePlace.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.PatternNonValuePlace.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/PatternValuePlace.t.html b/docs/apis/rust/0.7.0/edn/query/PatternValuePlace.t.html new file mode 100644 index 00000000..25355d06 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/PatternValuePlace.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.PatternValuePlace.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/Predicate.t.html b/docs/apis/rust/0.7.0/edn/query/Predicate.t.html new file mode 100644 index 00000000..6e691064 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/Predicate.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Predicate.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/Pull.t.html b/docs/apis/rust/0.7.0/edn/query/Pull.t.html new file mode 100644 index 00000000..081cf5d3 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/Pull.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Pull.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/PullAttributeSpec.t.html b/docs/apis/rust/0.7.0/edn/query/PullAttributeSpec.t.html new file mode 100644 index 00000000..2fc37146 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/PullAttributeSpec.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.PullAttributeSpec.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/PullConcreteAttribute.t.html b/docs/apis/rust/0.7.0/edn/query/PullConcreteAttribute.t.html new file mode 100644 index 00000000..629972d8 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/PullConcreteAttribute.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.PullConcreteAttribute.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/QueryFunction.t.html b/docs/apis/rust/0.7.0/edn/query/QueryFunction.t.html new file mode 100644 index 00000000..bf7a6a20 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/QueryFunction.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.QueryFunction.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/SrcVar.t.html b/docs/apis/rust/0.7.0/edn/query/SrcVar.t.html new file mode 100644 index 00000000..3b5c2bd5 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/SrcVar.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.SrcVar.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/SrcVarName.t.html b/docs/apis/rust/0.7.0/edn/query/SrcVarName.t.html new file mode 100644 index 00000000..e65b4884 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/SrcVarName.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.SrcVarName.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/TypeAnnotation.t.html b/docs/apis/rust/0.7.0/edn/query/TypeAnnotation.t.html new file mode 100644 index 00000000..a2effc44 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/TypeAnnotation.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.TypeAnnotation.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/UnifyVars.t.html b/docs/apis/rust/0.7.0/edn/query/UnifyVars.t.html new file mode 100644 index 00000000..0de79115 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/UnifyVars.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.UnifyVars.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/Variable.t.html b/docs/apis/rust/0.7.0/edn/query/Variable.t.html new file mode 100644 index 00000000..37fb069f --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/Variable.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Variable.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/VariableOrPlaceholder.t.html b/docs/apis/rust/0.7.0/edn/query/VariableOrPlaceholder.t.html new file mode 100644 index 00000000..36305ca2 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/VariableOrPlaceholder.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.VariableOrPlaceholder.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/WhereClause.t.html b/docs/apis/rust/0.7.0/edn/query/WhereClause.t.html new file mode 100644 index 00000000..f85d7146 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/WhereClause.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.WhereClause.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/WhereFn.t.html b/docs/apis/rust/0.7.0/edn/query/WhereFn.t.html new file mode 100644 index 00000000..c0b3ed5a --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/WhereFn.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.WhereFn.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.Binding.html b/docs/apis/rust/0.7.0/edn/query/enum.Binding.html new file mode 100644 index 00000000..58a397ae --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.Binding.html @@ -0,0 +1,171 @@ + + + + + + + + + + edn::query::Binding - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::Binding + + [] + + [src]

pub enum Binding {
+    BindScalar(Variable),
+    BindColl(Variable),
+    BindRel(Vec<VariableOrPlaceholder>),
+    BindTuple(Vec<VariableOrPlaceholder>),
+}

+ Variants

+ +

+ Methods +

+

impl Binding
[src]

Important traits for Vec<u8>

Return each variable or None, in order.

+

Return true if no variables are bound, i.e., all binding entries are placeholders.

+

Return true if no variable is bound twice, i.e., each binding entry is either a +placeholder or unique.

+ +
+use edn::query::{Binding,Variable,VariableOrPlaceholder};
+use std::rc::Rc;
+
+let v = Variable::from_valid_name("?foo");
+let vv = VariableOrPlaceholder::Variable(v);
+let p = VariableOrPlaceholder::Placeholder;
+
+let e = Binding::BindTuple(vec![p.clone()]);
+let b = Binding::BindTuple(vec![p.clone(), vv.clone()]);
+let d = Binding::BindTuple(vec![vv.clone(), p, vv]);
+assert!(b.is_valid());          // One var, one placeholder: OK.
+assert!(!e.is_valid());         // Empty: not OK.
+assert!(!d.is_valid());         // Duplicate var: not OK.
+
+

+ Trait Implementations +

+
+

impl Clone for Binding
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for Binding
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Binding
[src]

impl PartialEq for Binding
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl ContainsVariables for Binding
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for Binding

impl !Sync for Binding

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.Direction.html b/docs/apis/rust/0.7.0/edn/query/enum.Direction.html new file mode 100644 index 00000000..57bc73b5 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.Direction.html @@ -0,0 +1,146 @@ + + + + + + + + + + edn::query::Direction - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::Direction + + [] + + [src]

pub enum Direction {
+    Ascending,
+    Descending,
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Clone for Direction
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for Direction
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Direction
[src]

impl PartialEq for Direction
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for Direction

impl Sync for Direction

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.Element.html b/docs/apis/rust/0.7.0/edn/query/enum.Element.html new file mode 100644 index 00000000..6ab2a0f8 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.Element.html @@ -0,0 +1,158 @@ + + + + + + + + + + edn::query::Element - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::Element + + [] + + [src]

pub enum Element {
+    Variable(Variable),
+    Aggregate(Aggregate),
+    Corresponding(Variable),
+    Pull(Pull),
+}

+ Variants

+

In a query with a max or min aggregate, a corresponding variable +(indicated in the query with (the ?var), is guaranteed to come from +the row that provided the max or min value. Queries with more than one +max or min cannot yield predictable behavior, and will err during +algebrizing.

+
+

+ Methods +

+

impl Element
[src]

Returns true if the element must yield only one value.

+
+

+ Trait Implementations +

+
+

impl Debug for Element
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Element
[src]

impl PartialEq for Element
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl From<Variable> for Element
[src]

Performs the conversion.

+

impl Display for Element
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for Element

impl !Sync for Element

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.FindSpec.html b/docs/apis/rust/0.7.0/edn/query/enum.FindSpec.html new file mode 100644 index 00000000..15aa8f38 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.FindSpec.html @@ -0,0 +1,192 @@ + + + + + + + + + + edn::query::FindSpec - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::FindSpec + + [] + + [src]

pub enum FindSpec {
+    FindRel(Vec<Element>),
+    FindColl(Element),
+    FindTuple(Vec<Element>),
+    FindScalar(Element),
+}

A definition of the first part of a find query: the +[:find ?foo ?bar…] bit.

+

There are four different kinds of find specs, allowing you to query for +a single value, a collection of values from different entities, a single +tuple (relation), or a collection of tuples.

+

Examples:

+ +
+
+
+  let elements = vec![
+    Element::Variable(Variable::from_valid_name("?foo")),
+    Element::Variable(Variable::from_valid_name("?bar")),
+  ];
+  let rel = FindSpec::FindRel(elements);
+
+  if let FindSpec::FindRel(elements) = rel {
+    assert_eq!(2, elements.len());
+  }
+
+

+ Variants

+

Returns an array of arrays, represented as a single array with length a multiple of width.

+

Returns an array of scalars, usually homogeneous. +This is equivalent to mapping over the results of a FindRel, +returning the first value of each.

+

Returns a single tuple: a heterogeneous array of scalars. Equivalent to +taking the first result from a FindRel.

+

Returns a single scalar value. Equivalent to taking the first result +from a FindColl.

+
+

+ Methods +

+

impl FindSpec
[src]

Returns true if the provided FindSpec returns at most one result.

+

Returns true if the provided FindSpec cares about distinct results.

+

I use the words "cares about" because find is generally defined in terms of producing distinct +results at the Datalog level.

+

Two of the find specs (scalar and tuple) produce only a single result. Those don't need to be +run with SELECT DISTINCT, because we're only consuming a single result. Those queries will be +run with LIMIT 1.

+

Additionally, some projections cannot produce duplicate results: [:find (max ?x) …], for +example.

+

This function gives us the hook to add that logic when we're ready.

+

Beyond this, DISTINCT is not always needed. For example, in some kinds of accumulation or +sampling projections we might not need to do it at the SQL level because we're consuming into +a dupe-eliminating data structure like a Set, or we know that a particular query cannot produce +duplicate results.

+

Important traits for Box<R>

+

+ Trait Implementations +

+
+

impl Debug for FindSpec
[src]

Formats the value using the given formatter. Read more

+

impl Eq for FindSpec
[src]

impl PartialEq for FindSpec
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl !Send for FindSpec

impl !Sync for FindSpec

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.FnArg.html b/docs/apis/rust/0.7.0/edn/query/enum.FnArg.html new file mode 100644 index 00000000..11d959ec --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.FnArg.html @@ -0,0 +1,155 @@ + + + + + + + + + + edn::query::FnArg - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::FnArg + + [] + + [src]

pub enum FnArg {
+    Variable(Variable),
+    SrcVar(SrcVar),
+    EntidOrInteger(i64),
+    IdentOrKeyword(Keyword),
+    Constant(NonIntegerConstant),
+    Vector(Vec<FnArg>),
+}

+ Variants

+ +

+ Methods +

+

impl FnArg
[src]

+

+ Trait Implementations +

+
+

impl Clone for FnArg
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for FnArg
[src]

Formats the value using the given formatter. Read more

+

impl Eq for FnArg
[src]

impl PartialEq for FnArg
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl FromValue<FnArg> for FnArg
[src]

impl Display for FnArg
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for FnArg

impl !Sync for FnArg

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.IdentOrEntid.html b/docs/apis/rust/0.7.0/edn/query/enum.IdentOrEntid.html new file mode 100644 index 00000000..da5bc2e3 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.IdentOrEntid.html @@ -0,0 +1,146 @@ + + + + + + + + + + edn::query::IdentOrEntid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::IdentOrEntid + + [] + + [src]

pub enum IdentOrEntid {
+    Ident(Keyword),
+    Entid(i64),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Clone for IdentOrEntid
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for IdentOrEntid
[src]

Formats the value using the given formatter. Read more

+

impl Eq for IdentOrEntid
[src]

impl PartialEq for IdentOrEntid
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for IdentOrEntid

impl Sync for IdentOrEntid

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.Limit.html b/docs/apis/rust/0.7.0/edn/query/enum.Limit.html new file mode 100644 index 00000000..5f1d9e15 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.Limit.html @@ -0,0 +1,147 @@ + + + + + + + + + + edn::query::Limit - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::Limit + + [] + + [src]

pub enum Limit {
+    None,
+    Fixed(u64),
+    Variable(Variable),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Clone for Limit
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for Limit
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Limit
[src]

impl PartialEq for Limit
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl !Send for Limit

impl !Sync for Limit

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.NonIntegerConstant.html b/docs/apis/rust/0.7.0/edn/query/enum.NonIntegerConstant.html new file mode 100644 index 00000000..99d6b262 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.NonIntegerConstant.html @@ -0,0 +1,153 @@ + + + + + + + + + + edn::query::NonIntegerConstant - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::NonIntegerConstant + + [] + + [src]

pub enum NonIntegerConstant {
+    Boolean(bool),
+    BigInteger(BigInt),
+    Float(OrderedFloat<f64>),
+    Text(ValueRc<String>),
+    Instant(DateTime<Utc>),
+    Uuid(Uuid),
+}

These are the scalar values representable in EDN.

+

+ Variants

+ +

+ Trait Implementations +

+
+

impl Clone for NonIntegerConstant
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for NonIntegerConstant
[src]

Formats the value using the given formatter. Read more

+

impl Eq for NonIntegerConstant
[src]

impl PartialEq for NonIntegerConstant
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl<'a> From<&'a str> for NonIntegerConstant
[src]

Performs the conversion.

+

impl From<String> for NonIntegerConstant
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.OrWhereClause.html b/docs/apis/rust/0.7.0/edn/query/enum.OrWhereClause.html new file mode 100644 index 00000000..61eb556f --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.OrWhereClause.html @@ -0,0 +1,150 @@ + + + + + + + + + + edn::query::OrWhereClause - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::OrWhereClause + + [] + + [src]

pub enum OrWhereClause {
+    Clause(WhereClause),
+    And(Vec<WhereClause>),
+}

+ Variants

+ +

+ Methods +

+

impl OrWhereClause
[src]

+

+ Trait Implementations +

+
+

impl Clone for OrWhereClause
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for OrWhereClause
[src]

Formats the value using the given formatter. Read more

+

impl Eq for OrWhereClause
[src]

impl PartialEq for OrWhereClause
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl ContainsVariables for OrWhereClause
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for OrWhereClause

impl !Sync for OrWhereClause

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.PatternNonValuePlace.html b/docs/apis/rust/0.7.0/edn/query/enum.PatternNonValuePlace.html new file mode 100644 index 00000000..3929e49c --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.PatternNonValuePlace.html @@ -0,0 +1,156 @@ + + + + + + + + + + edn::query::PatternNonValuePlace - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::PatternNonValuePlace + + [] + + [src]

pub enum PatternNonValuePlace {
+    Placeholder,
+    Variable(Variable),
+    Entid(i64),
+    Ident(ValueRc<Keyword>),
+}

e, a, tx can't be values -- no strings, no floats -- and so +they can only be variables, entity IDs, ident keywords, or +placeholders. +This encoding allows us to represent integers that aren't +entity IDs. That'll get filtered out in the context of the +database.

+

+ Variants

+ +

+ Trait Implementations +

+
+

impl Clone for PatternNonValuePlace
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for PatternNonValuePlace
[src]

Formats the value using the given formatter. Read more

+

impl Eq for PatternNonValuePlace
[src]

impl PartialEq for PatternNonValuePlace
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl From<Rc<Keyword>> for PatternNonValuePlace
[src]

Performs the conversion.

+

impl From<Keyword> for PatternNonValuePlace
[src]

Performs the conversion.

+

impl FromValue<PatternNonValuePlace> for PatternNonValuePlace
[src]

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.PatternValuePlace.html b/docs/apis/rust/0.7.0/edn/query/enum.PatternValuePlace.html new file mode 100644 index 00000000..e2ed0580 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.PatternValuePlace.html @@ -0,0 +1,154 @@ + + + + + + + + + + edn::query::PatternValuePlace - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::PatternValuePlace + + [] + + [src]

pub enum PatternValuePlace {
+    Placeholder,
+    Variable(Variable),
+    EntidOrInteger(i64),
+    IdentOrKeyword(ValueRc<Keyword>),
+    Constant(NonIntegerConstant),
+}

The v part of a pattern can be much broader: it can represent +integers that aren't entity IDs (particularly negative integers), +strings, and all the rest. We group those under Constant.

+

+ Variants

+ +

+ Trait Implementations +

+
+

impl Clone for PatternValuePlace
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for PatternValuePlace
[src]

Formats the value using the given formatter. Read more

+

impl Eq for PatternValuePlace
[src]

impl PartialEq for PatternValuePlace
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl From<Rc<Keyword>> for PatternValuePlace
[src]

Performs the conversion.

+

impl From<Keyword> for PatternValuePlace
[src]

Performs the conversion.

+

impl FromValue<PatternValuePlace> for PatternValuePlace
[src]

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.PullAttributeSpec.html b/docs/apis/rust/0.7.0/edn/query/enum.PullAttributeSpec.html new file mode 100644 index 00000000..db170100 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.PullAttributeSpec.html @@ -0,0 +1,147 @@ + + + + + + + + + + edn::query::PullAttributeSpec - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::PullAttributeSpec + + [] + + [src]

pub enum PullAttributeSpec {
+    Wildcard,
+    Attribute(NamedPullAttribute),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Clone for PullAttributeSpec
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for PullAttributeSpec
[src]

Formats the value using the given formatter. Read more

+

impl Eq for PullAttributeSpec
[src]

impl PartialEq for PullAttributeSpec
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for PullAttributeSpec
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.PullConcreteAttribute.html b/docs/apis/rust/0.7.0/edn/query/enum.PullConcreteAttribute.html new file mode 100644 index 00000000..be8b5330 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.PullConcreteAttribute.html @@ -0,0 +1,148 @@ + + + + + + + + + + edn::query::PullConcreteAttribute - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::PullConcreteAttribute + + [] + + [src]

pub enum PullConcreteAttribute {
+    Ident(Rc<Keyword>),
+    Entid(i64),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Clone for PullConcreteAttribute
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for PullConcreteAttribute
[src]

Formats the value using the given formatter. Read more

+

impl Eq for PullConcreteAttribute
[src]

impl PartialEq for PullConcreteAttribute
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl From<PullConcreteAttribute> for NamedPullAttribute
[src]

Performs the conversion.

+

impl Display for PullConcreteAttribute
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.SrcVar.html b/docs/apis/rust/0.7.0/edn/query/enum.SrcVar.html new file mode 100644 index 00000000..8bfccbbb --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.SrcVar.html @@ -0,0 +1,158 @@ + + + + + + + + + + edn::query::SrcVar - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::SrcVar + + [] + + [src]

pub enum SrcVar {
+    DefaultSrc,
+    NamedSrc(SrcVarName),
+}

+ Variants

+ +

+ Methods +

+

impl SrcVar
[src]

+

+ Trait Implementations +

+
+

impl Clone for SrcVar
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for SrcVar
[src]

Formats the value using the given formatter. Read more

+

impl PartialEq for SrcVar
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for SrcVar
[src]

impl PartialOrd for SrcVar
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Ord for SrcVar
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl FromValue<SrcVar> for SrcVar
[src]

+

+ Auto Trait Implementations +

+
+

impl Send for SrcVar

impl Sync for SrcVar

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.UnifyVars.html b/docs/apis/rust/0.7.0/edn/query/enum.UnifyVars.html new file mode 100644 index 00000000..6f8852cf --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.UnifyVars.html @@ -0,0 +1,163 @@ + + + + + + + + + + edn::query::UnifyVars - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::UnifyVars + + [] + + [src]

pub enum UnifyVars {
+    Implicit,
+    Explicit(BTreeSet<Variable>),
+}

+ Variants

+

Implicit means the variables in an or or not are derived from the enclosed pattern. +DataScript regards these vars as 'free': these variables don't need to be bound by the +enclosing environment.

+

Datomic's documentation implies that all implicit variables are required:

+
+

Datomic will attempt to push the or clause down until all necessary variables are bound, +and will throw an exception if that is not possible.

+
+

but that would render top-level or expressions (as used in Datomic's own examples!) +impossible, so we assume that this is an error in the documentation.

+

All contained 'arms' in an or with implicit variables must bind the same vars.

+

Explicit means the variables in an or-join or not-join are explicitly listed, +specified with required-vars syntax.

+

DataScript parses these as free, but allows (incorrectly) the use of more complicated +rule-vars syntax.

+

Only the named variables will be unified with the enclosing query.

+

Every 'arm' in an or-join must mention the entire set of explicit vars.

+
+

+ Trait Implementations +

+
+

impl Clone for UnifyVars
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for UnifyVars
[src]

Formats the value using the given formatter. Read more

+

impl Eq for UnifyVars
[src]

impl PartialEq for UnifyVars
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl !Send for UnifyVars

impl !Sync for UnifyVars

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.VariableOrPlaceholder.html b/docs/apis/rust/0.7.0/edn/query/enum.VariableOrPlaceholder.html new file mode 100644 index 00000000..af5c5bcd --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.VariableOrPlaceholder.html @@ -0,0 +1,152 @@ + + + + + + + + + + edn::query::VariableOrPlaceholder - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::VariableOrPlaceholder + + [] + + [src]

pub enum VariableOrPlaceholder {
+    Placeholder,
+    Variable(Variable),
+}

+ Variants

+ +

+ Methods +

+

impl VariableOrPlaceholder
[src]

+

+ Trait Implementations +

+
+

impl Clone for VariableOrPlaceholder
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for VariableOrPlaceholder
[src]

Formats the value using the given formatter. Read more

+

impl Eq for VariableOrPlaceholder
[src]

impl Hash for VariableOrPlaceholder
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl PartialEq for VariableOrPlaceholder
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/enum.WhereClause.html b/docs/apis/rust/0.7.0/edn/query/enum.WhereClause.html new file mode 100644 index 00000000..74e301b9 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/enum.WhereClause.html @@ -0,0 +1,155 @@ + + + + + + + + + + edn::query::WhereClause - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::query::WhereClause + + [] + + [src]

pub enum WhereClause {
+    NotJoin(NotJoin),
+    OrJoin(OrJoin),
+    Pred(Predicate),
+    WhereFn(WhereFn),
+    RuleExpr,
+    Pattern(Pattern),
+    TypeAnnotation(TypeAnnotation),
+}

+ Variants

+ +

+ Methods +

+

impl WhereClause
[src]

+

+ Trait Implementations +

+
+

impl Clone for WhereClause
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for WhereClause
[src]

Formats the value using the given formatter. Read more

+

impl Eq for WhereClause
[src]

impl PartialEq for WhereClause
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl ContainsVariables for WhereClause
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for WhereClause

impl !Sync for WhereClause

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/index.html b/docs/apis/rust/0.7.0/edn/query/index.html new file mode 100644 index 00000000..ea821350 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/index.html @@ -0,0 +1,375 @@ + + + + + + + + + + edn::query - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module edn::query + + [] + + [src]

Re-exports

+
pub use Keyword;
pub use PlainSymbol;

Structs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Aggregate + +
NamedPullAttribute + +
NotJoin + +
OrJoin + +
Order +

An abstract declaration of ordering: direction and variable.

+ +
ParsedQuery + +
Pattern + +
Predicate + +
Pull + +
QueryFunction + +
TypeAnnotation + +
Variable + +
WhereFn + +

Enums

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Binding + +
Direction + +
Element + +
FindSpec +

A definition of the first part of a find query: the +[:find ?foo ?bar…] bit.

+ +
FnArg + +
IdentOrEntid + +
Limit + +
NonIntegerConstant +

These are the scalar values representable in EDN.

+ +
OrWhereClause + +
PatternNonValuePlace +

e, a, tx can't be values -- no strings, no floats -- and so +they can only be variables, entity IDs, ident keywords, or +placeholders. +This encoding allows us to represent integers that aren't +entity IDs. That'll get filtered out in the context of the +database.

+ +
PatternValuePlace +

The v part of a pattern can be much broader: it can represent +integers that aren't entity IDs (particularly negative integers), +strings, and all the rest. We group those under Constant.

+ +
PullAttributeSpec + +
PullConcreteAttribute + +
SrcVar + +
UnifyVars + +
VariableOrPlaceholder + +
WhereClause + +

Traits

+ + + + + + + + +
ContainsVariables + +
FromValue + +

Type Definitions

+ + + + +
SrcVarName + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/sidebar-items.js b/docs/apis/rust/0.7.0/edn/query/sidebar-items.js new file mode 100644 index 00000000..6a325fa8 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["Binding",""],["Direction",""],["Element",""],["FindSpec","A definition of the first part of a find query: the `[:find ?foo ?bar…]` bit."],["FnArg",""],["IdentOrEntid",""],["Limit",""],["NonIntegerConstant","These are the scalar values representable in EDN."],["OrWhereClause",""],["PatternNonValuePlace","e, a, tx can't be values -- no strings, no floats -- and so they can only be variables, entity IDs, ident keywords, or placeholders. This encoding allows us to represent integers that aren't entity IDs. That'll get filtered out in the context of the database."],["PatternValuePlace","The `v` part of a pattern can be much broader: it can represent integers that aren't entity IDs (particularly negative integers), strings, and all the rest. We group those under `Constant`."],["PullAttributeSpec",""],["PullConcreteAttribute",""],["SrcVar",""],["UnifyVars",""],["VariableOrPlaceholder",""],["WhereClause",""]],"struct":[["Aggregate",""],["NamedPullAttribute",""],["NotJoin",""],["OrJoin",""],["Order","An abstract declaration of ordering: direction and variable."],["ParsedQuery",""],["Pattern",""],["Predicate",""],["Pull",""],["QueryFunction",""],["TypeAnnotation",""],["Variable",""],["WhereFn",""]],"trait":[["ContainsVariables",""],["FromValue",""]],"type":[["SrcVarName",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/struct.Aggregate.html b/docs/apis/rust/0.7.0/edn/query/struct.Aggregate.html new file mode 100644 index 00000000..ce67588d --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/struct.Aggregate.html @@ -0,0 +1,151 @@ + + + + + + + + + + edn::query::Aggregate - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::query::Aggregate + + [] + + [src]

pub struct Aggregate {
+    pub func: QueryFunction,
+    pub args: Vec<FnArg>,
+}

+ Fields

+ + + + +

+ Trait Implementations +

+
+

impl Debug for Aggregate
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Aggregate
[src]

impl PartialEq for Aggregate
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl !Send for Aggregate

impl !Sync for Aggregate

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/struct.NamedPullAttribute.html b/docs/apis/rust/0.7.0/edn/query/struct.NamedPullAttribute.html new file mode 100644 index 00000000..0381ad6c --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/struct.NamedPullAttribute.html @@ -0,0 +1,155 @@ + + + + + + + + + + edn::query::NamedPullAttribute - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::query::NamedPullAttribute + + [] + + [src]

pub struct NamedPullAttribute {
+    pub attribute: PullConcreteAttribute,
+    pub alias: Option<Rc<Keyword>>,
+}

+ Fields

+ + + + +

+ Trait Implementations +

+
+

impl Clone for NamedPullAttribute
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for NamedPullAttribute
[src]

Formats the value using the given formatter. Read more

+

impl Eq for NamedPullAttribute
[src]

impl PartialEq for NamedPullAttribute
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl From<PullConcreteAttribute> for NamedPullAttribute
[src]

Performs the conversion.

+

impl Display for NamedPullAttribute
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/struct.NotJoin.html b/docs/apis/rust/0.7.0/edn/query/struct.NotJoin.html new file mode 100644 index 00000000..14cbf2ab --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/struct.NotJoin.html @@ -0,0 +1,157 @@ + + + + + + + + + + edn::query::NotJoin - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::query::NotJoin + + [] + + [src]

pub struct NotJoin {
+    pub unify_vars: UnifyVars,
+    pub clauses: Vec<WhereClause>,
+}

+ Fields

+ + + + +

+ Methods +

+

impl NotJoin
[src]

+

+ Trait Implementations +

+
+

impl Clone for NotJoin
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for NotJoin
[src]

Formats the value using the given formatter. Read more

+

impl Eq for NotJoin
[src]

impl PartialEq for NotJoin
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl ContainsVariables for NotJoin
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for NotJoin

impl !Sync for NotJoin

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/struct.OrJoin.html b/docs/apis/rust/0.7.0/edn/query/struct.OrJoin.html new file mode 100644 index 00000000..2c245c4b --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/struct.OrJoin.html @@ -0,0 +1,160 @@ + + + + + + + + + + edn::query::OrJoin - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::query::OrJoin + + [] + + [src]

pub struct OrJoin {
+    pub unify_vars: UnifyVars,
+    pub clauses: Vec<OrWhereClause>,
+    // some fields omitted
+}

+ Fields

+ + + + +

+ Methods +

+

impl OrJoin
[src]

Return true if either the OrJoin is UnifyVars::Implicit, or if +every variable mentioned inside the join is also mentioned in the UnifyVars list.

+

impl OrJoin
[src]

+

+ Trait Implementations +

+
+

impl Clone for OrJoin
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for OrJoin
[src]

Formats the value using the given formatter. Read more

+

impl Eq for OrJoin
[src]

impl PartialEq for OrJoin
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl ContainsVariables for OrJoin
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for OrJoin

impl !Sync for OrJoin

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/struct.Order.html b/docs/apis/rust/0.7.0/edn/query/struct.Order.html new file mode 100644 index 00000000..47cf1601 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/struct.Order.html @@ -0,0 +1,142 @@ + + + + + + + + + + edn::query::Order - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::query::Order + + [] + + [src]

pub struct Order(pub Direction, pub Variable);

An abstract declaration of ordering: direction and variable.

+
+

+ Trait Implementations +

+
+

impl Clone for Order
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for Order
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Order
[src]

impl PartialEq for Order
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl !Send for Order

impl !Sync for Order

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/struct.ParsedQuery.html b/docs/apis/rust/0.7.0/edn/query/struct.ParsedQuery.html new file mode 100644 index 00000000..35f4ad3e --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/struct.ParsedQuery.html @@ -0,0 +1,181 @@ + + + + + + + + + + edn::query::ParsedQuery - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::query::ParsedQuery + + [] + + [src]

pub struct ParsedQuery {
+    pub find_spec: FindSpec,
+    pub default_source: SrcVar,
+    pub with: Vec<Variable>,
+    pub in_vars: Vec<Variable>,
+    pub in_sources: BTreeSet<SrcVar>,
+    pub limit: Limit,
+    pub where_clauses: Vec<WhereClause>,
+    pub order: Option<Vec<Order>>,
+}

+ Fields

+ + + + + + + + + + + + + + + + +

+ Trait Implementations +

+
+

impl Debug for ParsedQuery
[src]

Formats the value using the given formatter. Read more

+

impl Eq for ParsedQuery
[src]

impl PartialEq for ParsedQuery
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl !Send for ParsedQuery

impl !Sync for ParsedQuery

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/struct.Pattern.html b/docs/apis/rust/0.7.0/edn/query/struct.Pattern.html new file mode 100644 index 00000000..cbadf089 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/struct.Pattern.html @@ -0,0 +1,172 @@ + + + + + + + + + + edn::query::Pattern - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::query::Pattern + + [] + + [src]

pub struct Pattern {
+    pub source: Option<SrcVar>,
+    pub entity: PatternNonValuePlace,
+    pub attribute: PatternNonValuePlace,
+    pub value: PatternValuePlace,
+    pub tx: PatternNonValuePlace,
+}

+ Fields

+ + + + + + + + + + +

+ Methods +

+

impl Pattern
[src]

+

+ Trait Implementations +

+
+

impl Clone for Pattern
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for Pattern
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Pattern
[src]

impl PartialEq for Pattern
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl ContainsVariables for Pattern
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for Pattern

impl !Sync for Pattern

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/struct.Predicate.html b/docs/apis/rust/0.7.0/edn/query/struct.Predicate.html new file mode 100644 index 00000000..c492be8d --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/struct.Predicate.html @@ -0,0 +1,153 @@ + + + + + + + + + + edn::query::Predicate - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::query::Predicate + + [] + + [src]

pub struct Predicate {
+    pub operator: PlainSymbol,
+    pub args: Vec<FnArg>,
+}

+ Fields

+ + + + +

+ Trait Implementations +

+
+

impl Clone for Predicate
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for Predicate
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Predicate
[src]

impl PartialEq for Predicate
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl ContainsVariables for Predicate
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for Predicate

impl !Sync for Predicate

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/struct.Pull.html b/docs/apis/rust/0.7.0/edn/query/struct.Pull.html new file mode 100644 index 00000000..848f1883 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/struct.Pull.html @@ -0,0 +1,151 @@ + + + + + + + + + + edn::query::Pull - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::query::Pull + + [] + + [src]

pub struct Pull {
+    pub var: Variable,
+    pub patterns: Vec<PullAttributeSpec>,
+}

+ Fields

+ + + + +

+ Trait Implementations +

+
+

impl Debug for Pull
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Pull
[src]

impl PartialEq for Pull
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl !Send for Pull

impl !Sync for Pull

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/struct.QueryFunction.html b/docs/apis/rust/0.7.0/edn/query/struct.QueryFunction.html new file mode 100644 index 00000000..4eb0471b --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/struct.QueryFunction.html @@ -0,0 +1,154 @@ + + + + + + + + + + edn::query::QueryFunction - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::query::QueryFunction + + [] + + [src]

pub struct QueryFunction(pub PlainSymbol);
+

+ Methods +

+

impl QueryFunction
[src]

+

+ Trait Implementations +

+
+

impl Clone for QueryFunction
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for QueryFunction
[src]

Formats the value using the given formatter. Read more

+

impl PartialEq for QueryFunction
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for QueryFunction
[src]

impl PartialOrd for QueryFunction
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Ord for QueryFunction
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl FromValue<QueryFunction> for QueryFunction
[src]

impl Display for QueryFunction
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for QueryFunction

impl Sync for QueryFunction

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/struct.TypeAnnotation.html b/docs/apis/rust/0.7.0/edn/query/struct.TypeAnnotation.html new file mode 100644 index 00000000..87b4f1fa --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/struct.TypeAnnotation.html @@ -0,0 +1,153 @@ + + + + + + + + + + edn::query::TypeAnnotation - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::query::TypeAnnotation + + [] + + [src]

pub struct TypeAnnotation {
+    pub value_type: Keyword,
+    pub variable: Variable,
+}

+ Fields

+ + + + +

+ Trait Implementations +

+
+

impl Clone for TypeAnnotation
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for TypeAnnotation
[src]

Formats the value using the given formatter. Read more

+

impl Eq for TypeAnnotation
[src]

impl PartialEq for TypeAnnotation
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl ContainsVariables for TypeAnnotation
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for TypeAnnotation

impl !Sync for TypeAnnotation

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/struct.Variable.html b/docs/apis/rust/0.7.0/edn/query/struct.Variable.html new file mode 100644 index 00000000..fb89c127 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/struct.Variable.html @@ -0,0 +1,162 @@ + + + + + + + + + + edn::query::Variable - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::query::Variable + + [] + + [src]

pub struct Variable(pub Rc<PlainSymbol>);
+

+ Methods +

+

impl Variable
[src]

Return a new Variable, assuming that the provided string is a valid name.

+

impl Variable
[src]

TODO: intern strings. #398.

+
+

+ Trait Implementations +

+
+

impl Clone for Variable
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl PartialEq for Variable
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for Variable
[src]

impl Hash for Variable
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl PartialOrd for Variable
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Ord for Variable
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl FromValue<Variable> for Variable
[src]

If the provided EDN value is a PlainSymbol beginning with '?', return +it wrapped in a Variable. If not, return None. +TODO: intern strings. #398.

+

impl Debug for Variable
[src]

Formats the value using the given formatter. Read more

+

impl Display for Variable
[src]

Formats the value using the given formatter. Read more

+

impl From<Variable> for Element
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl !Send for Variable

impl !Sync for Variable

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/struct.WhereFn.html b/docs/apis/rust/0.7.0/edn/query/struct.WhereFn.html new file mode 100644 index 00000000..4856c2c9 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/struct.WhereFn.html @@ -0,0 +1,158 @@ + + + + + + + + + + edn::query::WhereFn - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::query::WhereFn + + [] + + [src]

pub struct WhereFn {
+    pub operator: PlainSymbol,
+    pub args: Vec<FnArg>,
+    pub binding: Binding,
+}

+ Fields

+ + + + + + +

+ Trait Implementations +

+
+

impl Clone for WhereFn
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for WhereFn
[src]

Formats the value using the given formatter. Read more

+

impl Eq for WhereFn
[src]

impl PartialEq for WhereFn
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl ContainsVariables for WhereFn
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for WhereFn

impl !Sync for WhereFn

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/trait.ContainsVariables.html b/docs/apis/rust/0.7.0/edn/query/trait.ContainsVariables.html new file mode 100644 index 00000000..a0ca14c3 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/trait.ContainsVariables.html @@ -0,0 +1,156 @@ + + + + + + + + + + edn::query::ContainsVariables - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait edn::query::ContainsVariables + + [] + + [src]

pub trait ContainsVariables {
+    fn accumulate_mentioned_variables(&self, acc: &mut BTreeSet<Variable>);
+
+    fn collect_mentioned_variables(&self) -> BTreeSet<Variable> { ... }
+}
+

+ Required Methods +

+ +

+ Provided Methods +

+ +

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/trait.FromValue.html b/docs/apis/rust/0.7.0/edn/query/trait.FromValue.html new file mode 100644 index 00000000..de27ccd8 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/trait.FromValue.html @@ -0,0 +1,146 @@ + + + + + + + + + + edn::query::FromValue - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait edn::query::FromValue + + [] + + [src]

pub trait FromValue<T> {
+    fn from_value(v: &ValueAndSpan) -> Option<T>;
+}
+

+ Required Methods +

+
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/query/type.SrcVarName.html b/docs/apis/rust/0.7.0/edn/query/type.SrcVarName.html new file mode 100644 index 00000000..86d0f867 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/query/type.SrcVarName.html @@ -0,0 +1,126 @@ + + + + + + + + + + edn::query::SrcVarName - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition edn::query::SrcVarName + + [] + + [src]

type SrcVarName = String;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/sidebar-items.js b/docs/apis/rust/0.7.0/edn/sidebar-items.js new file mode 100644 index 00000000..5232b9ed --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["UuidParseError","Error details for string parsing failures."]],"macro":[["ns_keyword",""]],"mod":[["entities","This module defines core types that support the transaction processor."],["matcher",""],["parse",""],["pretty_print",""],["query",""],["symbols",""],["types",""],["utils",""],["value_rc",""]],"struct":[["BigInt","A big signed integer type."],["DateTime","ISO 8601 combined date and time with time zone."],["OrderedFloat","A wrapper around Floats providing an implementation of Ord and Hash."],["Utc","The UTC time zone. This is the most efficient time zone when you don't need the local time. It is also used as an offset (which is also a dummy type)."],["Uuid","A Universally Unique Identifier (UUID)."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/struct.BigInt.html b/docs/apis/rust/0.7.0/edn/struct.BigInt.html new file mode 100644 index 00000000..a240092b --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/struct.BigInt.html @@ -0,0 +1,1646 @@ + + + + + + + + + + edn::BigInt - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::BigInt + + [] + + [src]

pub struct BigInt { /* fields omitted */ }

A big signed integer type.

+
+

+ Methods +

+

impl BigInt
[src]

Creates and initializes a BigInt.

+

The digits are in little-endian base 232.

+

Creates and initializes a BigInt.

+

The digits are in little-endian base 232.

+

Creates and initializes a BigInt.

+

Reinitializes a BigInt.

+

Creates and initializes a BigInt.

+

The bytes are in big-endian byte order.

+

Examples

+
+use num_bigint::{BigInt, Sign};
+
+assert_eq!(BigInt::from_bytes_be(Sign::Plus, b"A"),
+           BigInt::parse_bytes(b"65", 10).unwrap());
+assert_eq!(BigInt::from_bytes_be(Sign::Plus, b"AA"),
+           BigInt::parse_bytes(b"16705", 10).unwrap());
+assert_eq!(BigInt::from_bytes_be(Sign::Plus, b"AB"),
+           BigInt::parse_bytes(b"16706", 10).unwrap());
+assert_eq!(BigInt::from_bytes_be(Sign::Plus, b"Hello world!"),
+           BigInt::parse_bytes(b"22405534230753963835153736737", 10).unwrap());
+

Creates and initializes a BigInt.

+

The bytes are in little-endian byte order.

+

Creates and initializes a BigInt from an array of bytes in +two's complement binary representation.

+

The digits are in big-endian base 28.

+

Creates and initializes a BigInt from an array of bytes in two's complement.

+

The digits are in little-endian base 28.

+

Creates and initializes a BigInt.

+

Examples

+
+use num_bigint::{BigInt, ToBigInt};
+
+assert_eq!(BigInt::parse_bytes(b"1234", 10), ToBigInt::to_bigint(&1234));
+assert_eq!(BigInt::parse_bytes(b"ABCD", 16), ToBigInt::to_bigint(&0xABCD));
+assert_eq!(BigInt::parse_bytes(b"G", 16), None);
+

Creates and initializes a BigInt. Each u8 of the input slice is +interpreted as one digit of the number +and must therefore be less than radix.

+

The bytes are in big-endian byte order. +radix must be in the range 2...256.

+

Examples

+
+use num_bigint::{BigInt, Sign};
+
+let inbase190 = vec![15, 33, 125, 12, 14];
+let a = BigInt::from_radix_be(Sign::Minus, &inbase190, 190).unwrap();
+assert_eq!(a.to_radix_be(190), (Sign:: Minus, inbase190));
+

Creates and initializes a BigInt. Each u8 of the input slice is +interpreted as one digit of the number +and must therefore be less than radix.

+

The bytes are in little-endian byte order. +radix must be in the range 2...256.

+

Examples

+
+use num_bigint::{BigInt, Sign};
+
+let inbase190 = vec![14, 12, 125, 33, 15];
+let a = BigInt::from_radix_be(Sign::Minus, &inbase190, 190).unwrap();
+assert_eq!(a.to_radix_be(190), (Sign::Minus, inbase190));
+

Returns the sign and the byte representation of the BigInt in big-endian byte order.

+

Examples

+
+use num_bigint::{ToBigInt, Sign};
+
+let i = -1125.to_bigint().unwrap();
+assert_eq!(i.to_bytes_be(), (Sign::Minus, vec![4, 101]));
+

Returns the sign and the byte representation of the BigInt in little-endian byte order.

+

Examples

+
+use num_bigint::{ToBigInt, Sign};
+
+let i = -1125.to_bigint().unwrap();
+assert_eq!(i.to_bytes_le(), (Sign::Minus, vec![101, 4]));
+

Important traits for Vec<u8>

Returns the two's complement byte representation of the BigInt in big-endian byte order.

+

Examples

+
+use num_bigint::ToBigInt;
+
+let i = -1125.to_bigint().unwrap();
+assert_eq!(i.to_signed_bytes_be(), vec![251, 155]);
+

Important traits for Vec<u8>

Returns the two's complement byte representation of the BigInt in little-endian byte order.

+

Examples

+
+use num_bigint::ToBigInt;
+
+let i = -1125.to_bigint().unwrap();
+assert_eq!(i.to_signed_bytes_le(), vec![155, 251]);
+

Returns the integer formatted as a string in the given radix. +radix must be in the range 2...36.

+

Examples

+
+use num_bigint::BigInt;
+
+let i = BigInt::parse_bytes(b"ff", 16).unwrap();
+assert_eq!(i.to_str_radix(16), "ff");
+

Returns the integer in the requested base in big-endian digit order. +The output is not given in a human readable alphabet but as a zero +based u8 number. +radix must be in the range 2...256.

+

Examples

+
+use num_bigint::{BigInt, Sign};
+
+assert_eq!(BigInt::from(-0xFFFFi64).to_radix_be(159),
+           (Sign::Minus, vec![2, 94, 27]));
+// 0xFFFF = 65535 = 2*(159^2) + 94*159 + 27
+

Returns the integer in the requested base in little-endian digit order. +The output is not given in a human readable alphabet but as a zero +based u8 number. +radix must be in the range 2...256.

+

Examples

+
+use num_bigint::{BigInt, Sign};
+
+assert_eq!(BigInt::from(-0xFFFFi64).to_radix_le(159),
+           (Sign::Minus, vec![27, 94, 2]));
+// 0xFFFF = 65535 = 27 + 94*159 + 2*(159^2)
+

Returns the sign of the BigInt as a Sign.

+

Examples

+
+use num_bigint::{ToBigInt, Sign};
+
+assert_eq!(ToBigInt::to_bigint(&1234).unwrap().sign(), Sign::Plus);
+assert_eq!(ToBigInt::to_bigint(&-4321).unwrap().sign(), Sign::Minus);
+assert_eq!(ToBigInt::to_bigint(&0).unwrap().sign(), Sign::NoSign);
+

Determines the fewest bits necessary to express the BigInt, +not including the sign.

+

Converts this BigInt into a BigUint, if it's not negative.

+

Returns (self ^ exponent) mod modulus

+

Note that this rounds like mod_floor, not like the % operator, +which makes a difference when given a negative self or modulus. +The result will be in the interval [0, modulus) for modulus > 0, +or in the interval (modulus, 0] for modulus < 0

+

Panics if the exponent is negative or the modulus is zero.

+
+

+ Trait Implementations +

+
+

impl Shl<usize> for BigInt
[src]

+

The resulting type after applying the << operator.

+

Performs the << operation.

+

impl<'a> Shl<usize> for &'a BigInt
[src]

+

The resulting type after applying the << operator.

+

Performs the << operation.

+

impl ToBigInt for BigInt
[src]

Converts the value of self to a BigInt.

+

impl CheckedAdd for BigInt
[src]

Adds two numbers, checking for overflow. If overflow happens, None is returned. Read more

+

impl CheckedMul for BigInt
[src]

Multiplies two numbers, checking for underflow or overflow. If underflow or overflow happens, None is returned. Read more

+

impl Clone for BigInt
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl LowerHex for BigInt
[src]

Formats the value using the given formatter.

+

impl<'a> Rem<&'a BigInt> for u32
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<BigInt> for &'a i64
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a u64> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'a BigInt> for &'b u8
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'b u8> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<BigInt> for i16
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a isize> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<BigInt> for usize
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'a BigInt> for &'b i64
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a i8> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'a BigInt> for &'b u64
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a BigInt> for u64
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<i64> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<BigInt> for &'a usize
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<BigInt> for &'a i16
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<u32> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<i16> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'a BigInt> for &'b u32
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<i64> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<BigInt> for &'a u16
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'b BigInt> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<BigInt> for u16
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<BigInt> for &'a i8
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a i32> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a u16> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<i32> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'a BigInt> for &'b i32
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'a BigInt> for &'b i16
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a BigInt> for u16
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a BigInt> for isize
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'b i64> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'b u64> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a BigInt> for i8
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'b isize> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<u16> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<isize> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<u8> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'b i8> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'a BigInt> for &'b usize
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<BigInt> for &'a u8
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<BigInt> for isize
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a BigInt> for u8
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<u64> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'b i16> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a BigInt> for i64
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<BigInt> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<i8> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a BigInt> for i16
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<isize> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<u32> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<BigInt> for &'a isize
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<BigInt> for u8
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a BigInt> for usize
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'b i32> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<i16> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<BigInt> for i8
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'a BigInt> for &'b u16
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<BigInt> for &'a i32
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'a BigInt> for &'b isize
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'a BigInt> for &'b i8
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<i8> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<u16> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a i64> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<BigInt> for i64
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a i16> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<BigInt> for i32
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'b u32> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a BigInt> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<BigInt> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<BigInt> for u32
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<BigInt> for u64
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a BigInt> for i32
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<BigInt> for &'a u32
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a u8> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<usize> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'b usize> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a, 'b> Rem<&'b u16> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<u8> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<i32> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<usize> for &'a BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a u32> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<&'a usize> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl Rem<u64> for BigInt
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl<'a> Rem<BigInt> for &'a u64
[src]

+

The resulting type after applying the % operator.

+

Performs the % operation.

+

impl FromPrimitive for BigInt
[src]

Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

+

Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

+

Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

+

Convert an isize to return an optional value of this type. If the value cannot be represented by this value, the None is returned. Read more

+

Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

+

Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

+

Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

+

Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

+

Convert a usize to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

+

Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

+

Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

+

Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

+

Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

+

Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, the None is returned. Read more

+

impl FromStr for BigInt
[src]

+

The associated error which can be returned from parsing.

+

Parses a string s to return a value of this type. Read more

+

impl Hash for BigInt
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for BigInt
[src]

impl Signed for BigInt
[src]

Computes the absolute value. Read more

+

The positive difference of two numbers. Read more

+

Returns the sign of the number. Read more

+

Returns true if the number is positive and false if the number is zero or negative.

+

Returns true if the number is negative and false if the number is zero or positive.

+

impl ToPrimitive for BigInt
[src]

Converts the value of self to an i64.

+

Converts the value of self to an u64.

+

Converts the value of self to an f32.

+

Converts the value of self to an f64.

+

Converts the value of self to an isize.

+

Converts the value of self to an i8.

+

Converts the value of self to an i16.

+

Converts the value of self to an i32.

+

Converts the value of self to an i128. Read more

+

Converts the value of self to a usize.

+

Converts the value of self to an u8.

+

Converts the value of self to an u16.

+

Converts the value of self to an u32.

+

Converts the value of self to an u128. Read more

+

impl Num for BigInt
[src]

+

Creates and initializes a BigInt.

+

impl<'a, 'b> Mul<&'b i16> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a BigInt> for isize
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<u32> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<isize> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'b BigInt> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<BigInt> for &'a i16
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<BigInt> for i32
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a BigInt> for u32
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<BigInt> for u8
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a i8> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'a BigInt> for &'b u64
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<BigInt> for &'a u32
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a u64> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<u16> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'a BigInt> for &'b u16
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<isize> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<u64> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a isize> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'b u8> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<BigInt> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<BigInt> for i16
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<BigInt> for u32
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'b u16> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a i16> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'a BigInt> for &'b isize
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<BigInt> for &'a usize
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<BigInt> for isize
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'a BigInt> for &'b i16
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<i32> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<u8> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<BigInt> for i64
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a i32> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'a BigInt> for &'b i8
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a BigInt> for u16
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a usize> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a u16> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<BigInt> for &'a u16
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<i8> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<BigInt> for &'a i64
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<BigInt> for &'a u64
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<i64> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'b isize> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a BigInt> for u8
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'a BigInt> for &'b u8
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<i32> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'a BigInt> for &'b usize
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a u32> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<i8> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'a BigInt> for &'b u32
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'a BigInt> for &'b i32
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<i64> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<i16> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a BigInt> for i8
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<usize> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'b i64> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<u64> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'b i32> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<BigInt> for usize
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a BigInt> for usize
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<BigInt> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<BigInt> for &'a isize
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a i64> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<u32> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<BigInt> for u64
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<i16> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'b u32> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'b u64> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a BigInt> for i64
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<BigInt> for i8
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a BigInt> for i32
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'a BigInt> for &'b i64
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<BigInt> for &'a i8
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<BigInt> for &'a i32
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a BigInt> for i16
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a BigInt> for u64
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<BigInt> for u16
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<u16> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<usize> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a BigInt> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'b i8> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<BigInt> for &'a u8
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a, 'b> Mul<&'b usize> for &'a BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl<'a> Mul<&'a u8> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl Mul<u8> for BigInt
[src]

+

The resulting type after applying the * operator.

+

Performs the * operation.

+

impl CheckedDiv for BigInt
[src]

Divides two numbers, checking for underflow, overflow and division by zero. If any of that happens, None is returned. Read more

+

impl Debug for BigInt
[src]

Formats the value using the given formatter. Read more

+

impl Zero for BigInt
[src]

Returns the additive identity element of Self, 0. Read more

+

Returns true if self is equal to the additive identity.

+

impl Binary for BigInt
[src]

Formats the value using the given formatter.

+

impl Decodable for BigInt
[src]

Deserialize a value using a Decoder.

+

impl<'a> Div<&'a u16> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'b BigInt> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'b u8> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<i8> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<isize> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<BigInt> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<BigInt> for isize
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'a BigInt> for &'b u16
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<BigInt> for u32
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<BigInt> for u8
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<i16> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<u64> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<BigInt> for &'a i32
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'b i16> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<u64> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<u16> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'a BigInt> for &'b i32
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<BigInt> for &'a u8
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'b u16> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a i64> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<BigInt> for i32
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<BigInt> for &'a i64
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'b u64> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a BigInt> for u32
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a BigInt> for isize
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<i8> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a BigInt> for i32
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<BigInt> for usize
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'a BigInt> for &'b u32
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a BigInt> for i64
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a BigInt> for u8
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<BigInt> for i8
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a BigInt> for u16
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a u32> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<u8> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'a BigInt> for &'b i64
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a i16> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'a BigInt> for &'b u64
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<u32> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<i64> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'a BigInt> for &'b i8
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a u8> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'b isize> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<BigInt> for &'a u64
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<i32> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<usize> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'b usize> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<i16> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<BigInt> for i16
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<BigInt> for u64
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'b u32> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<BigInt> for &'a i8
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a BigInt> for usize
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<BigInt> for &'a usize
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'a BigInt> for &'b isize
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<i32> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a isize> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<BigInt> for &'a isize
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<usize> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'b i8> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<u8> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'a BigInt> for &'b usize
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<BigInt> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<u16> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<i64> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a u64> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a BigInt> for i16
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a usize> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a i8> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a BigInt> for i8
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<BigInt> for i64
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a i32> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<isize> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<BigInt> for &'a u16
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<BigInt> for &'a u32
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a BigInt> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<BigInt> for &'a i16
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a> Div<&'a BigInt> for u64
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'b i32> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'a BigInt> for &'b i16
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<BigInt> for u16
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'a BigInt> for &'b u8
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl<'a, 'b> Div<&'b i64> for &'a BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl Div<u32> for BigInt
[src]

+

The resulting type after applying the / operator.

+

Performs the / operation.

+

impl One for BigInt
[src]

Returns the multiplicative identity element of Self, 1. Read more

+

Returns true if self is equal to the multiplicative identity. Read more

+

impl PartialOrd<BigInt> for BigInt
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Encodable for BigInt
[src]

Serialize a value using an Encoder.

+

impl Octal for BigInt
[src]

Formats the value using the given formatter.

+

impl Integer for BigInt
[src]

Simultaneous truncated integer division and modulus. Returns (quotient, remainder). Read more

+

Floored integer division. Read more

+

Floored integer modulo, satisfying: Read more

+

Simultaneous floored integer division and modulus. Returns (quotient, remainder). Read more

+

Calculates the Greatest Common Divisor (GCD) of the number and other.

+

The result is always positive.

+

Calculates the Lowest Common Multiple (LCM) of the number and other.

+

Deprecated, use is_multiple_of instead.

+

Returns true if the number is a multiple of other.

+

Returns true if the number is divisible by 2.

+

Returns true if the number is not divisible by 2.

+

impl UpperHex for BigInt
[src]

Formats the value using the given formatter.

+

impl ToBigUint for BigInt
[src]

Converts the value of self to a BigUint.

+

impl From<i16> for BigInt
[src]

Performs the conversion.

+

impl From<usize> for BigInt
[src]

Performs the conversion.

+

impl From<i32> for BigInt
[src]

Performs the conversion.

+

impl From<u64> for BigInt
[src]

Performs the conversion.

+

impl From<BigUint> for BigInt
[src]

Performs the conversion.

+

impl From<i8> for BigInt
[src]

Performs the conversion.

+

impl From<u16> for BigInt
[src]

Performs the conversion.

+

impl From<isize> for BigInt
[src]

Performs the conversion.

+

impl From<i64> for BigInt
[src]

Performs the conversion.

+

impl From<u8> for BigInt
[src]

Performs the conversion.

+

impl From<u32> for BigInt
[src]

Performs the conversion.

+

impl<'a, 'b> Add<&'a BigInt> for &'b usize
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<isize> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<u32> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'a BigInt> for &'b u64
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'a BigInt> for &'b u8
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<i8> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<BigInt> for usize
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'b usize> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a u32> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<BigInt> for u64
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<i32> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a u8> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<BigInt> for &'a u8
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'a BigInt> for &'b isize
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a BigInt> for i32
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'b i16> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'b BigInt> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'b u64> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<u8> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<i16> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<BigInt> for &'a u16
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<i32> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a BigInt> for u32
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'a BigInt> for &'b u16
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'b i32> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'b i8> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<BigInt> for i16
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a isize> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a i32> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a BigInt> for i8
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<BigInt> for &'a u32
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'b u16> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a i8> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<i8> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<BigInt> for isize
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a i64> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<BigInt> for &'a isize
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<BigInt> for &'a i8
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<BigInt> for i64
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a i16> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<u64> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a BigInt> for isize
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<isize> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<u8> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<BigInt> for i8
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<u16> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<i64> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a usize> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<i64> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<u64> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<BigInt> for u32
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'a BigInt> for &'b u32
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'b u32> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'b i64> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<BigInt> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'a BigInt> for &'b i8
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'b u8> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<BigInt> for &'a i32
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'a BigInt> for &'b i64
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a BigInt> for i16
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<i16> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a BigInt> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<u16> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a BigInt> for u16
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a u64> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<BigInt> for &'a i16
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<BigInt> for &'a usize
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a BigInt> for usize
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<BigInt> for u16
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a BigInt> for u8
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<u32> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<usize> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<BigInt> for &'a u64
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<BigInt> for i32
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a u16> for BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<usize> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl Add<BigInt> for u8
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<BigInt> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'a BigInt> for &'b i16
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a BigInt> for i64
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<&'a BigInt> for u64
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'a BigInt> for &'b i32
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a, 'b> Add<&'b isize> for &'a BigInt
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Add<BigInt> for &'a i64
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<'a> Shr<usize> for &'a BigInt
[src]

+

The resulting type after applying the >> operator.

+

Performs the >> operation.

+

impl Shr<usize> for BigInt
[src]

+

The resulting type after applying the >> operator.

+

Performs the >> operation.

+

impl Sub<BigInt> for u32
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<BigInt> for &'a u16
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'a BigInt> for &'b i16
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<BigInt> for i64
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'a BigInt> for &'b u32
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a u32> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<u64> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a BigInt> for u32
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<u16> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<BigInt> for &'a i8
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<i8> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a BigInt> for i32
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<BigInt> for &'a u8
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<u16> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'b i64> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<i64> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'b BigInt> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<isize> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<BigInt> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'a BigInt> for &'b u64
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<u64> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a BigInt> for u8
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a BigInt> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a BigInt> for i64
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'a BigInt> for &'b i32
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<BigInt> for &'a isize
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'b i8> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'b u16> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a BigInt> for usize
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'a BigInt> for &'b usize
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a i16> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<BigInt> for u16
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a BigInt> for u16
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a i8> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'b u8> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a isize> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<BigInt> for u64
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<i16> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'a BigInt> for &'b isize
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'b u64> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a i64> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a usize> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<BigInt> for &'a u32
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'b u32> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<BigInt> for &'a usize
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<BigInt> for i32
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<BigInt> for &'a i32
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<BigInt> for &'a i64
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<isize> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'b isize> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<i32> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a BigInt> for isize
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<usize> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a BigInt> for i16
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<u8> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'a BigInt> for &'b u8
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'a BigInt> for &'b i64
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<BigInt> for i16
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'b i16> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<u32> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a BigInt> for u64
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'a BigInt> for &'b i8
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a i32> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<i64> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a BigInt> for i8
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a u8> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<BigInt> for usize
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a u16> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<i16> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'a BigInt> for &'b u16
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'b i32> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<BigInt> for u8
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<&'a u64> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<i8> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<u8> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<usize> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<BigInt> for i8
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<BigInt> for isize
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<BigInt> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<BigInt> for &'a i16
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<i32> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a> Sub<BigInt> for &'a u64
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<'a, 'b> Sub<&'b usize> for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Sub<u32> for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl Ord for BigInt
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialEq<BigInt> for BigInt
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for BigInt
[src]

Formats the value using the given formatter. Read more

+

impl Default for BigInt
[src]

Returns the "default value" for a type. Read more

+

impl Neg for BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the unary - operation.

+

impl<'a> Neg for &'a BigInt
[src]

+

The resulting type after applying the - operator.

+

Performs the unary - operation.

+

impl CheckedSub for BigInt
[src]

Subtracts two numbers, checking for underflow. If underflow happens, None is returned. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for BigInt

impl Sync for BigInt

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/struct.DateTime.html b/docs/apis/rust/0.7.0/edn/struct.DateTime.html new file mode 100644 index 00000000..610769ab --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/struct.DateTime.html @@ -0,0 +1,346 @@ + + + + + + + + + + edn::DateTime - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::DateTime + + [] + + [src]

pub struct DateTime<Tz> where
    Tz: TimeZone
{ /* fields omitted */ }

ISO 8601 combined date and time with time zone.

+

There are some constructors implemented here (the from_* methods), but +the general-purpose constructors are all via the methods on the +TimeZone implementations.

+
+

+ Methods +

+

impl<Tz> DateTime<Tz> where
    Tz: TimeZone
[src]

Makes a new DateTime with given UTC datetime and offset. +The local datetime should be constructed via the TimeZone trait.

+

Example

+
+use chrono::{DateTime, TimeZone, NaiveDateTime, Utc};
+
+let dt = DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(61, 0), Utc);
+assert_eq!(Utc.timestamp(61, 0), dt);
+

Retrieves a date component.

+

Retrieves a time component. +Unlike date, this is not associated to the time zone.

+

Returns the number of non-leap seconds since January 1, 1970 0:00:00 UTC +(aka "UNIX timestamp").

+

Returns the number of non-leap-milliseconds since January 1, 1970 UTC

+

Note that this does reduce the number of years that can be represented +from ~584 Billion to ~584 Million. (If this is a problem, please file +an issue to let me know what domain needs millisecond precision over +billions of years, I'm curious.)

+

Example

+
+use chrono::Utc;
+use chrono::TimeZone;
+
+let dt = Utc.ymd(1970, 1, 1).and_hms_milli(0, 0, 1, 444);
+assert_eq!(dt.timestamp_millis(), 1_444);
+
+let dt = Utc.ymd(2001, 9, 9).and_hms_milli(1, 46, 40, 555);
+assert_eq!(dt.timestamp_millis(), 1_000_000_000_555);
+

Returns the number of non-leap-nanoseconds since January 1, 1970 UTC

+

Note that this does reduce the number of years that can be represented +from ~584 Billion to ~584. (If this is a problem, please file +an issue to let me know what domain needs nanosecond precision over +millenia, I'm curious.)

+

Example

+
+use chrono::Utc;
+use chrono::TimeZone;
+
+let dt = Utc.ymd(1970, 1, 1).and_hms_nano(0, 0, 1, 444);
+assert_eq!(dt.timestamp_nanos(), 1_000_000_444);
+
+let dt = Utc.ymd(2001, 9, 9).and_hms_nano(1, 46, 40, 555);
+assert_eq!(dt.timestamp_nanos(), 1_000_000_000_000_000_555);
+

Returns the number of milliseconds since the last second boundary

+

warning: in event of a leap second, this may exceed 999

+

note: this is not the number of milliseconds since January 1, 1970 0:00:00 UTC

+

Returns the number of microseconds since the last second boundary

+

warning: in event of a leap second, this may exceed 999_999

+

note: this is not the number of microseconds since January 1, 1970 0:00:00 UTC

+

Returns the number of nanoseconds since the last second boundary

+

warning: in event of a leap second, this may exceed 999_999_999

+

note: this is not the number of nanoseconds since January 1, 1970 0:00:00 UTC

+

Retrieves an associated offset from UTC.

+

Retrieves an associated time zone.

+

Changes the associated time zone. +This does not change the actual DateTime (but will change the string representation).

+

Adds given Duration to the current date and time.

+

Returns None when it will result in overflow.

+

Subtracts given Duration from the current date and time.

+

Returns None when it will result in overflow.

+

Subtracts another DateTime from the current date and time. +This does not overflow or underflow at all.

+

Returns a view to the naive UTC datetime.

+

Returns a view to the naive local datetime.

+

impl DateTime<FixedOffset>
[src]

Parses an RFC 2822 date and time string such as Tue, 1 Jul 2003 10:52:37 +0200, +then returns a new DateTime with a parsed FixedOffset.

+

Parses an RFC 3339 and ISO 8601 date and time string such as 1996-12-19T16:39:57-08:00, +then returns a new DateTime with a parsed FixedOffset.

+

Why isn't this named parse_from_iso8601? That's because ISO 8601 allows some freedom +over the syntax and RFC 3339 exercises that freedom to rigidly define a fixed format.

+

Parses a string with the specified format string and +returns a new DateTime with a parsed FixedOffset. +See the format::strftime module +on the supported escape sequences.

+

See also Offset::datetime_from_str which gives a local DateTime on specific time zone.

+

Note that this method requires a timezone in the string. See +NaiveDateTime::parse_from_str +for a version that does not require a timezone in the to-be-parsed str.

+

Example

+
+use chrono::{DateTime, FixedOffset, TimeZone};
+
+let dt = DateTime::parse_from_str(
+    "1983 Apr 13 12:09:14.274 +0000", "%Y %b %d %H:%M:%S%.3f %z");
+assert_eq!(dt, Ok(FixedOffset::east(0).ymd(1983, 4, 13).and_hms_milli(12, 9, 14, 274)));
+

impl<Tz> DateTime<Tz> where
    Tz: TimeZone,
    <Tz as TimeZone>::Offset: Display
[src]

Returns an RFC 2822 date and time string such as Tue, 1 Jul 2003 10:52:37 +0200.

+

Returns an RFC 3339 and ISO 8601 date and time string such as 1996-12-19T16:39:57-08:00.

+

Return an RFC 3339 and ISO 8601 date and time string with subseconds +formatted as per a SecondsFormat. If passed use_z true and the +timezone is UTC (offset 0), use 'Z', as per +Fixed::TimezoneOffsetColonZ. +If passed use_z false, use +Fixed::TimezoneOffsetColon.

+

Examples

+
+let dt = Utc.ymd(2018, 1, 26).and_hms_micro(18, 30, 9, 453_829);
+assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Millis, false),
+           "2018-01-26T18:30:09.453+00:00");
+assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Millis, true),
+           "2018-01-26T18:30:09.453Z");
+assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Secs, true),
+           "2018-01-26T18:30:09Z");
+
+let pst = FixedOffset::east(8 * 60 * 60);
+let dt = pst.ymd(2018, 1, 26).and_hms_micro(10, 30, 9, 453_829);
+assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Secs, true),
+           "2018-01-26T10:30:09+08:00");
+

Formats the combined date and time with the specified formatting items.

+

Formats the combined date and time with the specified format string. +See the format::strftime module +on the supported escape sequences.

+
+

+ Trait Implementations +

+
+

impl<Tz> Copy for DateTime<Tz> where
    Tz: TimeZone,
    <Tz as TimeZone>::Offset: Copy
[src]

impl<Tz> PartialOrd<DateTime<Tz>> for DateTime<Tz> where
    Tz: TimeZone
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl<Tz> Clone for DateTime<Tz> where
    Tz: TimeZone + Clone,
    <Tz as TimeZone>::Offset: Clone
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<Tz> Add<FixedOffset> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<Tz> Add<Duration> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<Tz> From<DateTime<Tz>> for SystemTime where
    Tz: TimeZone
[src]

Performs the conversion.

+

impl From<SystemTime> for DateTime<Local>
[src]

Performs the conversion.

+

impl From<SystemTime> for DateTime<Utc>
[src]

Performs the conversion.

+

impl<Tz> Serialize for DateTime<Tz> where
    Tz: TimeZone
[src]

Serialize into a rfc3339 time string

+

See the serde module for alternate +serializations.

+

impl<Tz> Sub<Duration> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<Tz> Sub<DateTime<Tz>> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<Tz> Sub<FixedOffset> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl FromStr for DateTime<FixedOffset>
[src]

+

The associated error which can be returned from parsing.

+

Parses a string s to return a value of this type. Read more

+

impl FromStr for DateTime<Local>
[src]

+

The associated error which can be returned from parsing.

+

Parses a string s to return a value of this type. Read more

+

impl FromStr for DateTime<Utc>
[src]

+

The associated error which can be returned from parsing.

+

Parses a string s to return a value of this type. Read more

+

impl<Tz> Ord for DateTime<Tz> where
    Tz: TimeZone
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<Tz> Hash for DateTime<Tz> where
    Tz: TimeZone
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl<Tz> Eq for DateTime<Tz> where
    Tz: TimeZone
[src]

impl<Tz, Tz2> PartialEq<DateTime<Tz2>> for DateTime<Tz> where
    Tz: TimeZone,
    Tz2: TimeZone
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl<'de> Deserialize<'de> for DateTime<FixedOffset>
[src]

Deserialize a value that optionally includes a timezone offset in its +string representation

+

The value to be deserialized must be an rfc3339 string.

+

See the serde module for alternate +deserialization formats.

+

Deserialize this value from the given Serde deserializer. Read more

+

impl<'de> Deserialize<'de> for DateTime<Utc>
[src]

Deserialize into a UTC value

+

The value to be deserialized must be an rfc3339 string.

+

See the serde module for alternate +deserialization formats.

+

Deserialize this value from the given Serde deserializer. Read more

+

impl<'de> Deserialize<'de> for DateTime<Local>
[src]

Deserialize a value that includes no timezone in its string +representation

+

The value to be deserialized must be an rfc3339 string.

+

See the serde module for alternate +serialization formats.

+

Deserialize this value from the given Serde deserializer. Read more

+

impl<Tz> Timelike for DateTime<Tz> where
    Tz: TimeZone
[src]

Returns the hour number from 0 to 23.

+

Returns the minute number from 0 to 59.

+

Returns the second number from 0 to 59.

+

Returns the number of nanoseconds since the whole non-leap second. The range from 1,000,000,000 to 1,999,999,999 represents the leap second. Read more

+

Makes a new value with the hour number changed. Read more

+

Makes a new value with the minute number changed. Read more

+

Makes a new value with the second number changed. Read more

+

Makes a new value with nanoseconds since the whole non-leap second changed. Read more

+

Returns the hour number from 1 to 12 with a boolean flag, which is false for AM and true for PM. Read more

+

Returns the number of non-leap seconds past the last midnight.

+

impl<Tz> Display for DateTime<Tz> where
    Tz: TimeZone,
    <Tz as TimeZone>::Offset: Display
[src]

Formats the value using the given formatter. Read more

+

impl<Tz> Send for DateTime<Tz> where
    Tz: TimeZone,
    <Tz as TimeZone>::Offset: Send
[src]

impl<Tz> Datelike for DateTime<Tz> where
    Tz: TimeZone
[src]

Returns the year number in the calendar date.

+

Returns the month number starting from 1. Read more

+

Returns the month number starting from 0. Read more

+

Returns the day of month starting from 1. Read more

+

Returns the day of month starting from 0. Read more

+

Returns the day of year starting from 1. Read more

+

Returns the day of year starting from 0. Read more

+

Returns the day of week.

+

Returns the ISO week.

+

Makes a new value with the year number changed. Read more

+

Makes a new value with the month number (starting from 1) changed. Read more

+

Makes a new value with the month number (starting from 0) changed. Read more

+

Makes a new value with the day of month (starting from 1) changed. Read more

+

Makes a new value with the day of month (starting from 0) changed. Read more

+

Makes a new value with the day of year (starting from 1) changed. Read more

+

Makes a new value with the day of year (starting from 0) changed. Read more

+

Returns the absolute year number starting from 1 with a boolean flag, which is false when the year predates the epoch (BCE/BC) and true otherwise (CE/AD). Read more

+

Returns the number of days since January 1, 1 (Day 1) in the proleptic Gregorian calendar.

+

impl<Tz> Debug for DateTime<Tz> where
    Tz: TimeZone
[src]

Formats the value using the given formatter. Read more

+

impl FromMicros for DateTime<Utc>
[src]

impl ToMicros for DateTime<Utc>
[src]

+

+ Auto Trait Implementations +

+
+

impl<Tz> Sync for DateTime<Tz> where
    <Tz as TimeZone>::Offset: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/struct.OrderedFloat.html b/docs/apis/rust/0.7.0/edn/struct.OrderedFloat.html new file mode 100644 index 00000000..fd4c31d0 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/struct.OrderedFloat.html @@ -0,0 +1,172 @@ + + + + + + + + + + edn::OrderedFloat - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::OrderedFloat + + [] + +

pub struct OrderedFloat<T>(pub T)
where
    T: Float
;

A wrapper around Floats providing an implementation of Ord and Hash.

+

NaN is sorted as greater than all other values and equal +to itself, in contradiction with the IEEE standard.

+
+

+ Methods +

+

impl<T> OrderedFloat<T> where
    T: Float

Get the value out.

+
+

+ Trait Implementations +

+
+

impl<T> Clone for OrderedFloat<T> where
    T: Clone + Float

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<T> Serialize for OrderedFloat<T> where
    T: Float + Serialize

Serialize this value into the given Serde serializer. Read more

+

impl<T> Hash for OrderedFloat<T> where
    T: Float

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl<T> Eq for OrderedFloat<T> where
    T: PartialEq<T> + Float

impl<T> Debug for OrderedFloat<T> where
    T: Debug + Float

Formats the value using the given formatter. Read more

+

impl<T> Copy for OrderedFloat<T> where
    T: Copy + Float

impl<T> PartialOrd<OrderedFloat<T>> for OrderedFloat<T> where
    T: PartialOrd<T> + Float

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl<T> AsRef<T> for OrderedFloat<T> where
    T: Float

Important traits for &'a mut R

Performs the conversion.

+

impl<T> From<T> for OrderedFloat<T> where
    T: Float

Performs the conversion.

+

impl<T> DerefMut for OrderedFloat<T> where
    T: Float

Mutably dereferences the value.

+

impl Into<f32> for OrderedFloat<f32>

Performs the conversion.

+

impl Into<f64> for OrderedFloat<f64>

Performs the conversion.

+

impl<T> Ord for OrderedFloat<T> where
    T: PartialOrd<T> + Float

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<'de, T> Deserialize<'de> for OrderedFloat<T> where
    T: Float + Deserialize<'de>, 

Deserialize this value from the given Serde deserializer. Read more

+

impl<T> PartialEq<OrderedFloat<T>> for OrderedFloat<T> where
    T: PartialEq<T> + Float

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl<T> Display for OrderedFloat<T> where
    T: Display + Float

Formats the value using the given formatter. Read more

+

impl<T> Deref for OrderedFloat<T> where
    T: Float

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl<T> Default for OrderedFloat<T> where
    T: Default + Float

Returns the "default value" for a type. Read more

+

impl<T> AsMut<T> for OrderedFloat<T> where
    T: Float

Important traits for &'a mut R

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl<T> Send for OrderedFloat<T> where
    T: Send

impl<T> Sync for OrderedFloat<T> where
    T: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/struct.Utc.html b/docs/apis/rust/0.7.0/edn/struct.Utc.html new file mode 100644 index 00000000..6ee6bf68 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/struct.Utc.html @@ -0,0 +1,182 @@ + + + + + + + + + + edn::Utc - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::Utc + + [] + + [src]

pub struct Utc;

The UTC time zone. This is the most efficient time zone when you don't need the local time. +It is also used as an offset (which is also a dummy type).

+

Using the TimeZone methods +on the UTC struct is the preferred way to construct DateTime<Utc> +instances.

+

Example

+
+use chrono::{DateTime, TimeZone, NaiveDateTime, Utc};
+
+let dt = DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(61, 0), Utc);
+
+assert_eq!(Utc.timestamp(61, 0), dt);
+assert_eq!(Utc.ymd(1970, 1, 1).and_hms(0, 1, 1), dt);
+
+

+ Methods +

+

impl Utc
[src]

Returns a Date which corresponds to the current date.

+

Returns a DateTime which corresponds to the current date.

+
+

+ Trait Implementations +

+
+

impl Copy for Utc
[src]

impl Clone for Utc
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Offset for Utc
[src]

Returns the fixed offset from UTC to the local time stored.

+

impl Eq for Utc
[src]

impl PartialEq<Utc> for Utc
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for Utc
[src]

Formats the value using the given formatter. Read more

+

impl Debug for Utc
[src]

Formats the value using the given formatter. Read more

+

impl TimeZone for Utc
[src]

+

An associated offset type. This type is used to store the actual offset in date and time types. The original TimeZone value can be recovered via TimeZone::from_offset. Read more

+

Reconstructs the time zone from the offset.

+

Creates the offset(s) for given local NaiveDate if possible.

+

Creates the offset(s) for given local NaiveDateTime if possible.

+

Creates the offset for given UTC NaiveDate. This cannot fail.

+

Creates the offset for given UTC NaiveDateTime. This cannot fail.

+

Makes a new Date from year, month, day and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. Read more

+

Makes a new Date from year, month, day and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. Read more

+

Makes a new Date from year, day of year (DOY or "ordinal") and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. Read more

+

Makes a new Date from year, day of year (DOY or "ordinal") and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. Read more

+

Makes a new Date from ISO week date (year and week number), day of the week (DOW) and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. The resulting Date may have a different year from the input year. Read more

+

Makes a new Date from ISO week date (year and week number), day of the week (DOW) and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. The resulting Date may have a different year from the input year. Read more

+

Makes a new DateTime from the number of non-leap seconds since January 1, 1970 0:00:00 UTC (aka "UNIX timestamp") and the number of nanoseconds since the last whole non-leap second. Read more

+

Makes a new DateTime from the number of non-leap seconds since January 1, 1970 0:00:00 UTC (aka "UNIX timestamp") and the number of nanoseconds since the last whole non-leap second. Read more

+

Parses a string with the specified format string and returns a DateTime with the current offset. See the format::strftime module on the supported escape sequences. Read more

+

Converts the local NaiveDate to the timezone-aware Date if possible.

+

Converts the local NaiveDateTime to the timezone-aware DateTime if possible.

+

Converts the UTC NaiveDate to the local time. The UTC is continuous and thus this cannot fail (but can give the duplicate local time). Read more

+

Converts the UTC NaiveDateTime to the local time. The UTC is continuous and thus this cannot fail (but can give the duplicate local time). Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for Utc

impl Sync for Utc

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/struct.Uuid.html b/docs/apis/rust/0.7.0/edn/struct.Uuid.html new file mode 100644 index 00000000..34fbbd16 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/struct.Uuid.html @@ -0,0 +1,322 @@ + + + + + + + + + + edn::Uuid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::Uuid + + [] + + [src]

pub struct Uuid { /* fields omitted */ }

A Universally Unique Identifier (UUID).

+
+

+ Methods +

+

impl Uuid
[src]

The 'nil UUID'.

+

The nil UUID is special form of UUID that is specified to have all +128 bits set to zero, as defined in IETF RFC 4122 Section 4.1.7.

+

Examples

+

Basic usage:

+ +
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+
+assert_eq!(uuid.hyphenated().to_string(),
+           "00000000-0000-0000-0000-000000000000");
+

Creates a new Uuid.

+

Note that not all versions can be generated currently and None will be +returned if the specified version cannot be generated.

+

To generate a random UUID (UuidVersion::Random), then the v4 +feature must be enabled for this crate.

+

Creates a random Uuid.

+

This uses the rand crate's default task RNG as the source of random numbers. +If you'd like to use a custom generator, don't use this method: use the +rand::Rand trait's rand() method instead.

+

Note that usage of this method requires the v4 feature of this crate +to be enabled.

+

Examples

+

Basic usage:

+ +
+use uuid::Uuid;
+
+let uuid = Uuid::new_v4();
+

Creates a Uuid from four field values.

+

Errors

+

This function will return an error if d4's length is not 8 bytes.

+

Examples

+

Basic usage:

+ +
+use uuid::Uuid;
+
+let d4 = [12, 3, 9, 56, 54, 43, 8, 9];
+
+let uuid = Uuid::from_fields(42, 12, 5, &d4);
+let uuid = uuid.map(|uuid| uuid.hyphenated().to_string());
+
+let expected_uuid = Ok(String::from("0000002a-000c-0005-0c03-0938362b0809"));
+
+assert_eq!(expected_uuid, uuid);
+

An invalid length:

+ +
+use uuid::Uuid;
+use uuid::ParseError;
+
+let d4 = [12];
+
+let uuid = Uuid::from_fields(42, 12, 5, &d4);
+
+let expected_uuid = Err(ParseError::InvalidLength(1));
+
+assert_eq!(expected_uuid, uuid);
+

Creates a Uuid using the supplied bytes.

+

Errors

+

This function will return an error if b has any length other than 16.

+

Examples

+

Basic usage:

+ +
+use uuid::Uuid;
+
+let bytes = [4, 54, 67, 12, 43, 2, 98, 76,
+             32, 50, 87, 5, 1, 33, 43, 87];
+
+let uuid = Uuid::from_bytes(&bytes);
+let uuid = uuid.map(|uuid| uuid.hyphenated().to_string());
+
+let expected_uuid = Ok(String::from("0436430c-2b02-624c-2032-570501212b57"));
+
+assert_eq!(expected_uuid, uuid);
+

An incorrect number of bytes:

+ +
+use uuid::Uuid;
+use uuid::ParseError;
+
+let bytes = [4, 54, 67, 12, 43, 2, 98, 76];
+
+let uuid = Uuid::from_bytes(&bytes);
+
+let expected_uuid = Err(ParseError::InvalidLength(8));
+
+assert_eq!(expected_uuid, uuid);
+

Returns the variant of the Uuid structure.

+

This determines the interpretation of the structure of the UUID. +Currently only the RFC4122 variant is generated by this module.

+ +

Returns the version number of the Uuid.

+

This represents the algorithm used to generate the contents.

+

Currently only the Random (V4) algorithm is supported by this +module. There are security and privacy implications for using +older versions - see Wikipedia: Universally Unique Identifier for +details.

+ +

Returns the version of the Uuid.

+

This represents the algorithm used to generate the contents

+

Return an array of 16 octets containing the UUID data

+

Examples

+
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+assert_eq!(uuid.as_bytes(), &[0; 16]);
+
+let uuid = Uuid::parse_str("936DA01F9ABD4d9d80C702AF85C822A8").unwrap();
+assert_eq!(uuid.as_bytes(),
+           &[147, 109, 160, 31, 154, 189, 77, 157,
+             128, 199, 2, 175, 133, 200, 34, 168]);
+

Returns a wrapper which when formatted via fmt::Display will format a +string of 32 hexadecimal digits.

+

Examples

+
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+assert_eq!(uuid.simple().to_string(),
+           "00000000000000000000000000000000");
+

Returns a wrapper which when formatted via fmt::Display will format a +string of hexadecimal digits separated into groups with a hyphen.

+

Examples

+
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+assert_eq!(uuid.hyphenated().to_string(),
+           "00000000-0000-0000-0000-000000000000");
+

Returns a wrapper which when formatted via fmt::Display will format a +string of the UUID as a full URN string.

+

Examples

+
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+assert_eq!(uuid.urn().to_string(),
+           "urn:uuid:00000000-0000-0000-0000-000000000000");
+

Returns an Optional Tuple of (u64, u16) representing the timestamp and +counter portion of a V1 UUID. If the supplied UUID is not V1, this +will return None

+

Parses a Uuid from a string of hexadecimal digits with optional hyphens.

+

Any of the formats generated by this module (simple, hyphenated, urn) are +supported by this parsing function.

+

Tests if the UUID is nil

+
+

+ Trait Implementations +

+
+

impl Debug for Uuid
[src]

Formats the value using the given formatter. Read more

+

impl Display for Uuid
[src]

Formats the value using the given formatter. Read more

+

impl PartialEq<Uuid> for Uuid
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Hash for Uuid
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for Uuid
[src]

impl FromStr for Uuid
[src]

+

The associated error which can be returned from parsing.

+

Parse a hex string and interpret as a Uuid.

+

Accepted formats are a sequence of 32 hexadecimal characters, +with or without hyphens (grouped as 8, 4, 4, 4, 12).

+

impl Ord for Uuid
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<'de> Deserialize<'de> for Uuid
[src]

Deserialize this value from the given Serde deserializer. Read more

+

impl Rand for Uuid
[src]

Generates a random Uuid (V4 conformant).

+

Generates a random instance of this type using the specified source of randomness. Read more

+

impl Clone for Uuid
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for Uuid
[src]

impl PartialOrd<Uuid> for Uuid
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Serialize for Uuid
[src]

Serialize this value into the given Serde serializer. Read more

+

impl Default for Uuid
[src]

Returns the nil UUID, which is all zeroes

+
+

+ Auto Trait Implementations +

+
+

impl Send for Uuid

impl Sync for Uuid

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/symbols/Keyword.t.html b/docs/apis/rust/0.7.0/edn/symbols/Keyword.t.html new file mode 100644 index 00000000..2ff7981f --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/symbols/Keyword.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/symbols/NamespacedSymbol.t.html b/docs/apis/rust/0.7.0/edn/symbols/NamespacedSymbol.t.html new file mode 100644 index 00000000..3e585b97 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/symbols/NamespacedSymbol.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.NamespacedSymbol.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/symbols/PlainSymbol.t.html b/docs/apis/rust/0.7.0/edn/symbols/PlainSymbol.t.html new file mode 100644 index 00000000..4c20195d --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/symbols/PlainSymbol.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.PlainSymbol.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/symbols/index.html b/docs/apis/rust/0.7.0/edn/symbols/index.html new file mode 100644 index 00000000..e6acc4fb --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/symbols/index.html @@ -0,0 +1,152 @@ + + + + + + + + + + edn::symbols - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module edn::symbols + + [] + + [src]

Structs

+ + + + + + + + + + + + +
Keyword +

A keyword is a symbol, optionally with a namespace, that prints with a leading colon. +This concept is imported from Clojure, as it features in EDN and the query +syntax that we use.

+ +
NamespacedSymbol + +
PlainSymbol +

A simplification of Clojure's Symbol.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/symbols/sidebar-items.js b/docs/apis/rust/0.7.0/edn/symbols/sidebar-items.js new file mode 100644 index 00000000..e081fa1e --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/symbols/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["Keyword","A keyword is a symbol, optionally with a namespace, that prints with a leading colon. This concept is imported from Clojure, as it features in EDN and the query syntax that we use."],["NamespacedSymbol",""],["PlainSymbol","A simplification of Clojure's Symbol."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/symbols/struct.Keyword.html b/docs/apis/rust/0.7.0/edn/symbols/struct.Keyword.html new file mode 100644 index 00000000..462eb3fd --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/symbols/struct.Keyword.html @@ -0,0 +1,237 @@ + + + + + + + + + + edn::symbols::Keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::symbols::Keyword + + [] + + [src]

pub struct Keyword(_);

A keyword is a symbol, optionally with a namespace, that prints with a leading colon. +This concept is imported from Clojure, as it features in EDN and the query +syntax that we use.

+

Clojure's constraints are looser than ours, allowing empty namespaces or +names:

+
user=> (keyword "" "")
+:/
+user=> (keyword "foo" "")
+:foo/
+user=> (keyword "" "bar")
+:/bar
+
+

We think that's nonsense, so we only allow keywords like :bar and :foo/bar, +with both namespace and main parts containing no whitespace and no colon or slash:

+ +
+let bar     = Keyword::plain("bar");                         // :bar
+let foo_bar = Keyword::namespaced("foo", "bar");        // :foo/bar
+assert_eq!("bar", bar.name());
+assert_eq!(None, bar.namespace());
+assert_eq!("bar", foo_bar.name());
+assert_eq!(Some("foo"), foo_bar.namespace());
+

If you're not sure whether your input is well-formed, you should use a +parser or a reader function first to validate. TODO: implement read.

+

Callers are expected to follow these rules: +http://www.clojure.org/reference/reader#_symbols

+

Future: fast equality (interning?) for keywords.

+
+

+ Methods +

+

impl Keyword
[src]

impl Keyword
[src]

Creates a new Keyword.

+

Examples

+
+let keyword = Keyword::namespaced("foo", "bar");
+assert_eq!(keyword.to_string(), ":foo/bar");
+

See also the kw! macro in the main mentat crate.

+

Whether this Keyword should be interpreted in reverse order. For example, +the two following snippets are identical:

+
[?y :person/friend ?x]
+[?x :person/hired ?y]
+
+[?y :person/friend ?x]
+[?y :person/_hired ?x]
+
+

Examples

+
+assert!(!Keyword::namespaced("foo", "bar").is_backward());
+assert!(Keyword::namespaced("foo", "_bar").is_backward());
+

Whether this Keyword should be interpreted in forward order. +See symbols::Keyword::is_backward.

+

Examples

+
+assert!(Keyword::namespaced("foo", "bar").is_forward());
+assert!(!Keyword::namespaced("foo", "_bar").is_forward());
+

Returns a Keyword with the same namespace and a +'backward' name. See symbols::Keyword::is_backward.

+

Returns a forward name if passed a reversed keyword; i.e., this +function is its own inverse.

+

Examples

+
+let nsk = Keyword::namespaced("foo", "bar");
+assert!(!nsk.is_backward());
+assert_eq!(":foo/bar", nsk.to_string());
+
+let reversed = nsk.to_reversed();
+assert!(reversed.is_backward());
+assert_eq!(":foo/_bar", reversed.to_string());
+

If this Keyword is 'backward' (see symbols::Keyword::is_backward), +return Some('forward name'); otherwise, return None.

+

Examples

+
+let nsk = Keyword::namespaced("foo", "bar");
+assert_eq!(None, nsk.unreversed());
+
+let reversed = nsk.to_reversed();
+assert_eq!(Some(nsk), reversed.unreversed());
+
+

+ Trait Implementations +

+
+

impl From<Keyword> for PatternNonValuePlace
[src]

Performs the conversion.

+

impl From<Keyword> for PatternValuePlace
[src]

Performs the conversion.

+

impl Clone for Keyword
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for Keyword
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Keyword
[src]

impl Hash for Keyword
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for Keyword
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for Keyword
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for Keyword
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for Keyword
[src]

Print the keyword in EDN format.

+

Examples

+
+assert_eq!(":baz", Keyword::plain("baz").to_string());
+assert_eq!(":bar/baz", Keyword::namespaced("bar", "baz").to_string());
+assert_eq!(":bar/_baz", Keyword::namespaced("bar", "baz").to_reversed().to_string());
+assert_eq!(":bar/baz", Keyword::namespaced("bar", "baz").to_reversed().to_reversed().to_string());
+
+

+ Auto Trait Implementations +

+
+

impl Send for Keyword

impl Sync for Keyword

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/symbols/struct.NamespacedSymbol.html b/docs/apis/rust/0.7.0/edn/symbols/struct.NamespacedSymbol.html new file mode 100644 index 00000000..b52239ae --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/symbols/struct.NamespacedSymbol.html @@ -0,0 +1,159 @@ + + + + + + + + + + edn::symbols::NamespacedSymbol - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::symbols::NamespacedSymbol + + [] + + [src]

pub struct NamespacedSymbol(_);
+

+ Methods +

+

impl NamespacedSymbol
[src]

+

+ Trait Implementations +

+
+

impl Clone for NamespacedSymbol
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for NamespacedSymbol
[src]

Formats the value using the given formatter. Read more

+

impl Eq for NamespacedSymbol
[src]

impl Hash for NamespacedSymbol
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for NamespacedSymbol
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for NamespacedSymbol
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for NamespacedSymbol
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for NamespacedSymbol
[src]

Print the symbol in EDN format.

+

Examples

+
+assert_eq!("bar/baz", NamespacedSymbol::namespaced("bar", "baz").to_string());
+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/symbols/struct.PlainSymbol.html b/docs/apis/rust/0.7.0/edn/symbols/struct.PlainSymbol.html new file mode 100644 index 00000000..47890910 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/symbols/struct.PlainSymbol.html @@ -0,0 +1,166 @@ + + + + + + + + + + edn::symbols::PlainSymbol - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::symbols::PlainSymbol + + [] + + [src]

pub struct PlainSymbol(pub String);

A simplification of Clojure's Symbol.

+
+

+ Methods +

+

impl PlainSymbol
[src]

Return the name of the symbol without any leading '?' or '$'.

+ +
+assert_eq!("foo", PlainSymbol::plain("?foo").name());
+assert_eq!("foo", PlainSymbol::plain("$foo").name());
+assert_eq!("!foo", PlainSymbol::plain("!foo").name());
+

+

+ Trait Implementations +

+
+

impl Clone for PlainSymbol
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for PlainSymbol
[src]

Formats the value using the given formatter. Read more

+

impl Eq for PlainSymbol
[src]

impl Hash for PlainSymbol
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for PlainSymbol
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for PlainSymbol
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for PlainSymbol
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for PlainSymbol
[src]

Print the symbol in EDN format.

+

Examples

+
+assert_eq!("baz", PlainSymbol::plain("baz").to_string());
+
+

+ Auto Trait Implementations +

+
+

impl Send for PlainSymbol

impl Sync for PlainSymbol

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/types/FromMicros.t.html b/docs/apis/rust/0.7.0/edn/types/FromMicros.t.html new file mode 100644 index 00000000..1238d6c4 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/types/FromMicros.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.FromMicros.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/types/Span.t.html b/docs/apis/rust/0.7.0/edn/types/Span.t.html new file mode 100644 index 00000000..04967764 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/types/Span.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Span.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/types/SpannedValue.t.html b/docs/apis/rust/0.7.0/edn/types/SpannedValue.t.html new file mode 100644 index 00000000..d44987df --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/types/SpannedValue.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.SpannedValue.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/types/ToMicros.t.html b/docs/apis/rust/0.7.0/edn/types/ToMicros.t.html new file mode 100644 index 00000000..d8a8c7fd --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/types/ToMicros.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.ToMicros.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/types/Value.t.html b/docs/apis/rust/0.7.0/edn/types/Value.t.html new file mode 100644 index 00000000..9d922157 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/types/Value.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Value.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/types/ValueAndSpan.t.html b/docs/apis/rust/0.7.0/edn/types/ValueAndSpan.t.html new file mode 100644 index 00000000..0c49c7cb --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/types/ValueAndSpan.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ValueAndSpan.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/types/enum.SpannedValue.html b/docs/apis/rust/0.7.0/edn/types/enum.SpannedValue.html new file mode 100644 index 00000000..a06a2d55 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/types/enum.SpannedValue.html @@ -0,0 +1,179 @@ + + + + + + + + + + edn::types::SpannedValue - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::types::SpannedValue + + [] + + [src]

pub enum SpannedValue {
+    Nil,
+    Boolean(bool),
+    Integer(i64),
+    Instant(DateTime<Utc>),
+    BigInteger(BigInt),
+    Float(OrderedFloat<f64>),
+    Text(String),
+    Uuid(Uuid),
+    PlainSymbol(PlainSymbol),
+    NamespacedSymbol(NamespacedSymbol),
+    Keyword(Keyword),
+    Vector(Vec<ValueAndSpan>),
+    List(LinkedList<ValueAndSpan>),
+    Set(BTreeSet<ValueAndSpan>),
+    Map(BTreeMap<ValueAndSpan, ValueAndSpan>),
+}

SpannedValue is the parallel to Value but used in ValueAndSpan. +Container types have ValueAndSpan children.

+

+ Variants

+ +

+ Methods +

+

impl SpannedValue
[src]

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl PartialEq for SpannedValue
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for SpannedValue
[src]

impl Hash for SpannedValue
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Clone for SpannedValue
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for SpannedValue
[src]

Formats the value using the given formatter. Read more

+

impl From<SpannedValue> for Value
[src]

Performs the conversion.

+

impl PartialOrd for SpannedValue
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Ord for SpannedValue
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Display for SpannedValue
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for SpannedValue

impl Sync for SpannedValue

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/types/enum.Value.html b/docs/apis/rust/0.7.0/edn/types/enum.Value.html new file mode 100644 index 00000000..8c5a9784 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/types/enum.Value.html @@ -0,0 +1,184 @@ + + + + + + + + + + edn::types::Value - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum edn::types::Value + + [] + + [src]

pub enum Value {
+    Nil,
+    Boolean(bool),
+    Integer(i64),
+    Instant(DateTime<Utc>),
+    BigInteger(BigInt),
+    Float(OrderedFloat<f64>),
+    Text(String),
+    Uuid(Uuid),
+    PlainSymbol(PlainSymbol),
+    NamespacedSymbol(NamespacedSymbol),
+    Keyword(Keyword),
+    Vector(Vec<Value>),
+    List(LinkedList<Value>),
+    Set(BTreeSet<Value>),
+    Map(BTreeMap<Value, Value>),
+}

Value represents one of the allowed values in an EDN string.

+

+ Variants

+ +

+ Methods +

+

impl Value
[src]

For debug use only!

+

But right now, it's used in the bootstrapper. We'll fix that soon.

+

impl Value
[src]

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

impl Value
[src]

Return a pretty string representation of this Value.

+

impl Value
[src]

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+
+

+ Trait Implementations +

+
+

impl PartialEq for Value
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for Value
[src]

impl Hash for Value
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Clone for Value
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for Value
[src]

Formats the value using the given formatter. Read more

+

impl From<SpannedValue> for Value
[src]

Performs the conversion.

+

impl From<ValueAndSpan> for Value
[src]

Performs the conversion.

+

impl PartialOrd for Value
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Ord for Value
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Display for Value
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for Value

impl Sync for Value

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/types/index.html b/docs/apis/rust/0.7.0/edn/types/index.html new file mode 100644 index 00000000..561ef396 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/types/index.html @@ -0,0 +1,177 @@ + + + + + + + + + + edn::types - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module edn::types + + [] + + [src]

Structs

+ + + + + + + + +
Span +

Span represents the current offset (start, end) into the input string.

+ +
ValueAndSpan +

A wrapper type around SpannedValue and Span, representing some EDN value +and the parsing offset (start, end) in the original EDN string.

+ +

Enums

+ + + + + + + + +
SpannedValue +

SpannedValue is the parallel to Value but used in ValueAndSpan. +Container types have ValueAndSpan children.

+ +
Value +

Value represents one of the allowed values in an EDN string.

+ +

Traits

+ + + + + + + + +
FromMicros + +
ToMicros + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/types/sidebar-items.js b/docs/apis/rust/0.7.0/edn/types/sidebar-items.js new file mode 100644 index 00000000..e1c341ad --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/types/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["SpannedValue","`SpannedValue` is the parallel to `Value` but used in `ValueAndSpan`. Container types have `ValueAndSpan` children."],["Value","Value represents one of the allowed values in an EDN string."]],"struct":[["Span","Span represents the current offset (start, end) into the input string."],["ValueAndSpan","A wrapper type around `SpannedValue` and `Span`, representing some EDN value and the parsing offset (start, end) in the original EDN string."]],"trait":[["FromMicros",""],["ToMicros",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/types/struct.Span.html b/docs/apis/rust/0.7.0/edn/types/struct.Span.html new file mode 100644 index 00000000..9696fae6 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/types/struct.Span.html @@ -0,0 +1,148 @@ + + + + + + + + + + edn::types::Span - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::types::Span + + [] + + [src]

pub struct Span(pub u32, pub u32);

Span represents the current offset (start, end) into the input string.

+
+

+ Methods +

+

impl Span
[src]

+

+ Trait Implementations +

+
+

impl Clone for Span
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for Span
[src]

impl Debug for Span
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Span
[src]

impl Hash for Span
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl PartialEq for Span
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for Span

impl Sync for Span

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/types/struct.ValueAndSpan.html b/docs/apis/rust/0.7.0/edn/types/struct.ValueAndSpan.html new file mode 100644 index 00000000..a1d87528 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/types/struct.ValueAndSpan.html @@ -0,0 +1,171 @@ + + + + + + + + + + edn::types::ValueAndSpan - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct edn::types::ValueAndSpan + + [] + + [src]

pub struct ValueAndSpan {
+    pub inner: SpannedValue,
+    pub span: Span,
+}

A wrapper type around SpannedValue and Span, representing some EDN value +and the parsing offset (start, end) in the original EDN string.

+

+ Fields

+ + + + +

+ Methods +

+

impl ValueAndSpan
[src]

impl ValueAndSpan
[src]

+

+ Trait Implementations +

+
+

impl PartialEq for ValueAndSpan
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for ValueAndSpan
[src]

impl Hash for ValueAndSpan
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Clone for ValueAndSpan
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for ValueAndSpan
[src]

Formats the value using the given formatter. Read more

+

impl From<ValueAndSpan> for Value
[src]

Performs the conversion.

+

impl PartialOrd for ValueAndSpan
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Ord for ValueAndSpan
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Display for ValueAndSpan
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for ValueAndSpan

impl Sync for ValueAndSpan

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/types/trait.FromMicros.html b/docs/apis/rust/0.7.0/edn/types/trait.FromMicros.html new file mode 100644 index 00000000..844d0922 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/types/trait.FromMicros.html @@ -0,0 +1,141 @@ + + + + + + + + + + edn::types::FromMicros - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait edn::types::FromMicros + + [] + + [src]

pub trait FromMicros {
+    fn from_micros(ts: i64) -> Self;
+}
+

+ Required Methods +

+
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/types/trait.ToMicros.html b/docs/apis/rust/0.7.0/edn/types/trait.ToMicros.html new file mode 100644 index 00000000..87942dff --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/types/trait.ToMicros.html @@ -0,0 +1,141 @@ + + + + + + + + + + edn::types::ToMicros - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait edn::types::ToMicros + + [] + + [src]

pub trait ToMicros {
+    fn to_micros(&self) -> i64;
+}
+

+ Required Methods +

+
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/utils/fn.merge.html b/docs/apis/rust/0.7.0/edn/utils/fn.merge.html new file mode 100644 index 00000000..27a3a14f --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/utils/fn.merge.html @@ -0,0 +1,131 @@ + + + + + + + + + + edn::utils::merge - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function edn::utils::merge + + [] + + [src]

pub fn merge(left: &Value, right: &Value) -> Option<Value>

Merge the EDN Value::Map instance right into left. Returns None if either left or +right is not a Value::Map.

+

Keys present in right overwrite keys present in left. See also +https://clojuredocs.org/clojure.core/merge.

+

TODO: implement merge for [Value], following the concat/SliceConcatExt pattern.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/utils/index.html b/docs/apis/rust/0.7.0/edn/utils/index.html new file mode 100644 index 00000000..d30d93e2 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/utils/index.html @@ -0,0 +1,136 @@ + + + + + + + + + + edn::utils - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module edn::utils + + [] + + [src]

Functions

+ + + + +
merge +

Merge the EDN Value::Map instance right into left. Returns None if either left or +right is not a Value::Map.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/utils/merge.v.html b/docs/apis/rust/0.7.0/edn/utils/merge.v.html new file mode 100644 index 00000000..4ea4ceef --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/utils/merge.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.merge.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/utils/sidebar-items.js b/docs/apis/rust/0.7.0/edn/utils/sidebar-items.js new file mode 100644 index 00000000..f8e8daaf --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/utils/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"fn":[["merge","Merge the EDN `Value::Map` instance `right` into `left`. Returns `None` if either `left` or `right` is not a `Value::Map`."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/value_rc/Cloned.t.html b/docs/apis/rust/0.7.0/edn/value_rc/Cloned.t.html new file mode 100644 index 00000000..25b3eebc --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/value_rc/Cloned.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.Cloned.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/value_rc/FromRc.t.html b/docs/apis/rust/0.7.0/edn/value_rc/FromRc.t.html new file mode 100644 index 00000000..8361d3b4 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/value_rc/FromRc.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.FromRc.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/value_rc/ValueRc.t.html b/docs/apis/rust/0.7.0/edn/value_rc/ValueRc.t.html new file mode 100644 index 00000000..73d9bfdb --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/value_rc/ValueRc.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.ValueRc.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/value_rc/index.html b/docs/apis/rust/0.7.0/edn/value_rc/index.html new file mode 100644 index 00000000..23735963 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/value_rc/index.html @@ -0,0 +1,152 @@ + + + + + + + + + + edn::value_rc - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module edn::value_rc + + [] + + [src]

Traits

+ + + + + + + + +
Cloned + +
FromRc + +

Type Definitions

+ + + + +
ValueRc +

This type alias exists to allow us to use different boxing mechanisms for values. +This type must implement FromRc and Cloned, and a From implementation must exist for +TypedValue.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/value_rc/sidebar-items.js b/docs/apis/rust/0.7.0/edn/value_rc/sidebar-items.js new file mode 100644 index 00000000..eb92c8b8 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/value_rc/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"trait":[["Cloned",""],["FromRc",""]],"type":[["ValueRc","This type alias exists to allow us to use different boxing mechanisms for values. This type must implement `FromRc` and `Cloned`, and a `From` implementation must exist for `TypedValue`."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/value_rc/trait.Cloned.html b/docs/apis/rust/0.7.0/edn/value_rc/trait.Cloned.html new file mode 100644 index 00000000..6e1273be --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/value_rc/trait.Cloned.html @@ -0,0 +1,145 @@ + + + + + + + + + + edn::value_rc::Cloned - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait edn::value_rc::Cloned + + [] + + [src]

pub trait Cloned<T> {
+    fn cloned(&self) -> T;
+
fn to_value_rc(&self) -> ValueRc<T>; +}
+

+ Required Methods +

+
+

+

+ Implementations on Foreign Types +

+

impl<T: Clone> Cloned<T> for Rc<T> where
    T: Sized + Clone
[src]

impl<T: Clone> Cloned<T> for Arc<T> where
    T: Sized + Clone
[src]

impl<T: Clone> Cloned<T> for Box<T> where
    T: Sized + Clone
[src]

+

+ Implementors +

+
    +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/value_rc/trait.FromRc.html b/docs/apis/rust/0.7.0/edn/value_rc/trait.FromRc.html new file mode 100644 index 00000000..3dff6fd2 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/value_rc/trait.FromRc.html @@ -0,0 +1,145 @@ + + + + + + + + + + edn::value_rc::FromRc - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait edn::value_rc::FromRc + + [] + + [src]

pub trait FromRc<T> {
+    fn from_rc(val: Rc<T>) -> Self;
+
fn from_arc(val: Arc<T>) -> Self; +}
+

+ Required Methods +

+
+

+

+ Implementations on Foreign Types +

+

impl<T> FromRc<T> for Rc<T> where
    T: Sized + Clone
[src]

impl<T> FromRc<T> for Arc<T> where
    T: Sized + Clone
[src]

impl<T> FromRc<T> for Box<T> where
    T: Sized + Clone
[src]

+

+ Implementors +

+
    +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/edn/value_rc/type.ValueRc.html b/docs/apis/rust/0.7.0/edn/value_rc/type.ValueRc.html new file mode 100644 index 00000000..435fffa1 --- /dev/null +++ b/docs/apis/rust/0.7.0/edn/value_rc/type.ValueRc.html @@ -0,0 +1,129 @@ + + + + + + + + + + edn::value_rc::ValueRc - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition edn::value_rc::ValueRc + + [] + + [src]

type ValueRc<T> = Arc<T>;

This type alias exists to allow us to use different boxing mechanisms for values. +This type must implement FromRc and Cloned, and a From implementation must exist for +TypedValue.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/implementors/combine/primitives/trait.Parser.js b/docs/apis/rust/0.7.0/implementors/combine/primitives/trait.Parser.js new file mode 100644 index 00000000..8c33113d --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/combine/primitives/trait.Parser.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_parser_utils"] = [{text:"impl<'a, P, N, M, O> Parser for OfExactly<P, N> where
    P: Parser<Input = Stream<'a>, Output = M>,
    N: Parser<Input = Stream<'a>, Output = O>,
    M: 'a + Streaming<'a>, 
",synthetic:false,types:["mentat_parser_utils::value_and_span::OfExactly"]},{text:"impl<'a, Av, Bv> Parser for KeywordMapParser<((&'static str, Av), (&'static str, Bv))> where
    Av: Parser<Input = Stream<'a>>,
    Bv: Parser<Input = Stream<'a>>, 
",synthetic:false,types:["mentat_parser_utils::macros::KeywordMapParser"]},{text:"impl<'a, Av, Bv, Cv> Parser for KeywordMapParser<((&'static str, Av), (&'static str, Bv), (&'static str, Cv))> where
    Av: Parser<Input = Stream<'a>>,
    Bv: Parser<Input = Stream<'a>>,
    Cv: Parser<Input = Stream<'a>>, 
",synthetic:false,types:["mentat_parser_utils::macros::KeywordMapParser"]},{text:"impl<'a, Av, Bv, Cv, Dv> Parser for KeywordMapParser<((&'static str, Av), (&'static str, Bv), (&'static str, Cv), (&'static str, Dv))> where
    Av: Parser<Input = Stream<'a>>,
    Bv: Parser<Input = Stream<'a>>,
    Cv: Parser<Input = Stream<'a>>,
    Dv: Parser<Input = Stream<'a>>, 
",synthetic:false,types:["mentat_parser_utils::macros::KeywordMapParser"]},{text:"impl<'a, Av, Bv, Cv, Dv, Ev> Parser for KeywordMapParser<((&'static str, Av), (&'static str, Bv), (&'static str, Cv), (&'static str, Dv), (&'static str, Ev))> where
    Av: Parser<Input = Stream<'a>>,
    Bv: Parser<Input = Stream<'a>>,
    Cv: Parser<Input = Stream<'a>>,
    Dv: Parser<Input = Stream<'a>>,
    Ev: Parser<Input = Stream<'a>>, 
",synthetic:false,types:["mentat_parser_utils::macros::KeywordMapParser"]},{text:"impl<'a, Av, Bv, Cv, Dv, Ev, Fv> Parser for KeywordMapParser<((&'static str, Av), (&'static str, Bv), (&'static str, Cv), (&'static str, Dv), (&'static str, Ev), (&'static str, Fv))> where
    Av: Parser<Input = Stream<'a>>,
    Bv: Parser<Input = Stream<'a>>,
    Cv: Parser<Input = Stream<'a>>,
    Dv: Parser<Input = Stream<'a>>,
    Ev: Parser<Input = Stream<'a>>,
    Fv: Parser<Input = Stream<'a>>, 
",synthetic:false,types:["mentat_parser_utils::macros::KeywordMapParser"]},{text:"impl<'a, Av, Bv, Cv, Dv, Ev, Fv, Gv> Parser for KeywordMapParser<((&'static str, Av), (&'static str, Bv), (&'static str, Cv), (&'static str, Dv), (&'static str, Ev), (&'static str, Fv), (&'static str, Gv))> where
    Av: Parser<Input = Stream<'a>>,
    Bv: Parser<Input = Stream<'a>>,
    Cv: Parser<Input = Stream<'a>>,
    Dv: Parser<Input = Stream<'a>>,
    Ev: Parser<Input = Stream<'a>>,
    Fv: Parser<Input = Stream<'a>>,
    Gv: Parser<Input = Stream<'a>>, 
",synthetic:false,types:["mentat_parser_utils::macros::KeywordMapParser"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/combine/primitives/trait.StreamOnce.js b/docs/apis/rust/0.7.0/implementors/combine/primitives/trait.StreamOnce.js new file mode 100644 index 00000000..3dd57991 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/combine/primitives/trait.StreamOnce.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_parser_utils"] = [{text:"impl<'a> StreamOnce for Stream<'a>",synthetic:false,types:["mentat_parser_utils::value_and_span::Stream"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/clone/trait.Clone.js b/docs/apis/rust/0.7.0/implementors/core/clone/trait.Clone.js new file mode 100644 index 00000000..9afbfed5 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/clone/trait.Clone.js @@ -0,0 +1,20 @@ +(function() {var implementors = {}; +implementors["edn"] = [{text:"impl Clone for TempId",synthetic:false,types:["edn::entities::TempId"]},{text:"impl Clone for Entid",synthetic:false,types:["edn::entities::Entid"]},{text:"impl<V: Clone> Clone for LookupRef<V>",synthetic:false,types:["edn::entities::LookupRef"]},{text:"impl Clone for TxFunction",synthetic:false,types:["edn::entities::TxFunction"]},{text:"impl<V: Clone> Clone for ValuePlace<V>",synthetic:false,types:["edn::entities::ValuePlace"]},{text:"impl<V: Clone> Clone for EntityPlace<V>",synthetic:false,types:["edn::entities::EntityPlace"]},{text:"impl Clone for AttributePlace",synthetic:false,types:["edn::entities::AttributePlace"]},{text:"impl Clone for OpType",synthetic:false,types:["edn::entities::OpType"]},{text:"impl<V: Clone> Clone for Entity<V>",synthetic:false,types:["edn::entities::Entity"]},{text:"impl Clone for Variable",synthetic:false,types:["edn::query::Variable"]},{text:"impl Clone for QueryFunction",synthetic:false,types:["edn::query::QueryFunction"]},{text:"impl Clone for Direction",synthetic:false,types:["edn::query::Direction"]},{text:"impl Clone for Order",synthetic:false,types:["edn::query::Order"]},{text:"impl Clone for SrcVar",synthetic:false,types:["edn::query::SrcVar"]},{text:"impl Clone for NonIntegerConstant",synthetic:false,types:["edn::query::NonIntegerConstant"]},{text:"impl Clone for FnArg",synthetic:false,types:["edn::query::FnArg"]},{text:"impl Clone for PatternNonValuePlace",synthetic:false,types:["edn::query::PatternNonValuePlace"]},{text:"impl Clone for IdentOrEntid",synthetic:false,types:["edn::query::IdentOrEntid"]},{text:"impl Clone for PatternValuePlace",synthetic:false,types:["edn::query::PatternValuePlace"]},{text:"impl Clone for PullConcreteAttribute",synthetic:false,types:["edn::query::PullConcreteAttribute"]},{text:"impl Clone for NamedPullAttribute",synthetic:false,types:["edn::query::NamedPullAttribute"]},{text:"impl Clone for PullAttributeSpec",synthetic:false,types:["edn::query::PullAttributeSpec"]},{text:"impl Clone for Limit",synthetic:false,types:["edn::query::Limit"]},{text:"impl Clone for VariableOrPlaceholder",synthetic:false,types:["edn::query::VariableOrPlaceholder"]},{text:"impl Clone for Binding",synthetic:false,types:["edn::query::Binding"]},{text:"impl Clone for Pattern",synthetic:false,types:["edn::query::Pattern"]},{text:"impl Clone for Predicate",synthetic:false,types:["edn::query::Predicate"]},{text:"impl Clone for WhereFn",synthetic:false,types:["edn::query::WhereFn"]},{text:"impl Clone for UnifyVars",synthetic:false,types:["edn::query::UnifyVars"]},{text:"impl Clone for OrWhereClause",synthetic:false,types:["edn::query::OrWhereClause"]},{text:"impl Clone for OrJoin",synthetic:false,types:["edn::query::OrJoin"]},{text:"impl Clone for NotJoin",synthetic:false,types:["edn::query::NotJoin"]},{text:"impl Clone for TypeAnnotation",synthetic:false,types:["edn::query::TypeAnnotation"]},{text:"impl Clone for WhereClause",synthetic:false,types:["edn::query::WhereClause"]},{text:"impl Clone for PlainSymbol",synthetic:false,types:["edn::symbols::PlainSymbol"]},{text:"impl Clone for NamespacedSymbol",synthetic:false,types:["edn::symbols::NamespacedSymbol"]},{text:"impl Clone for Keyword",synthetic:false,types:["edn::symbols::Keyword"]},{text:"impl Clone for Value",synthetic:false,types:["edn::types::Value"]},{text:"impl Clone for SpannedValue",synthetic:false,types:["edn::types::SpannedValue"]},{text:"impl Clone for Span",synthetic:false,types:["edn::types::Span"]},{text:"impl Clone for ValueAndSpan",synthetic:false,types:["edn::types::ValueAndSpan"]},{text:"impl Clone for ParseError",synthetic:false,types:["edn::parse::ParseError"]},]; +implementors["mentat"] = [{text:"impl Clone for CacheDirection",synthetic:false,types:["mentat::conn::CacheDirection"]},{text:"impl Clone for CacheAction",synthetic:false,types:["mentat::conn::CacheAction"]},{text:"impl Clone for Definition",synthetic:false,types:["mentat::vocabulary::Definition"]},{text:"impl Clone for Vocabulary",synthetic:false,types:["mentat::vocabulary::Vocabulary"]},{text:"impl Clone for Vocabularies",synthetic:false,types:["mentat::vocabulary::Vocabularies"]},]; +implementors["mentat_cli"] = [{text:"impl Clone for Command",synthetic:false,types:["mentat_cli::command_parser::Command"]},{text:"impl Clone for InputResult",synthetic:false,types:["mentat_cli::input::InputResult"]},]; +implementors["mentat_core"] = [{text:"impl Clone for KnownEntid",synthetic:false,types:["mentat_core::types::KnownEntid"]},{text:"impl Clone for ValueType",synthetic:false,types:["mentat_core::types::ValueType"]},{text:"impl Clone for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl Clone for Binding",synthetic:false,types:["mentat_core::types::Binding"]},{text:"impl Clone for StructuredMap",synthetic:false,types:["mentat_core::types::StructuredMap"]},{text:"impl Clone for ValueTypeSet",synthetic:false,types:["mentat_core::value_type_set::ValueTypeSet"]},{text:"impl Clone for SQLTypeAffinity",synthetic:false,types:["mentat_core::sql_types::SQLTypeAffinity"]},{text:"impl Clone for Unique",synthetic:false,types:["mentat_core::attribute::Unique"]},{text:"impl<T: Clone> Clone for InternSet<T> where
    T: Eq + Hash
",synthetic:false,types:["mentat_core::intern_set::InternSet"]},{text:"impl Clone for RcCounter",synthetic:false,types:["mentat_core::counter::RcCounter"]},{text:"impl<L: Clone, R: Clone> Clone for Either<L, R>",synthetic:false,types:["mentat_core::util::Either"]},{text:"impl Clone for Attribute",synthetic:false,types:["mentat_core::Attribute"]},{text:"impl Clone for Schema",synthetic:false,types:["mentat_core::Schema"]},]; +implementors["mentat_db"] = [{text:"impl Clone for CardinalityConflict",synthetic:false,types:["mentat_db::errors::CardinalityConflict"]},{text:"impl Clone for SchemaConstraintViolation",synthetic:false,types:["mentat_db::errors::SchemaConstraintViolation"]},{text:"impl Clone for InputError",synthetic:false,types:["mentat_db::errors::InputError"]},{text:"impl Clone for DbSqlErrorKind",synthetic:false,types:["mentat_db::errors::DbSqlErrorKind"]},{text:"impl Clone for AttributeCaches",synthetic:false,types:["mentat_db::cache::AttributeCaches"]},{text:"impl Clone for AttributeSpec",synthetic:false,types:["mentat_db::cache::AttributeSpec"]},{text:"impl Clone for SQLiteAttributeCache",synthetic:false,types:["mentat_db::cache::SQLiteAttributeCache"]},{text:"impl Clone for SearchType",synthetic:false,types:["mentat_db::db::SearchType"]},{text:"impl<E: Clone, V: Clone> Clone for Term<E, V>",synthetic:false,types:["mentat_db::internal_types::Term"]},{text:"impl Clone for LookupRefOrTempId",synthetic:false,types:["mentat_db::internal_types::LookupRefOrTempId"]},{text:"impl Clone for AttributeBuilder",synthetic:false,types:["mentat_db::schema::AttributeBuilder"]},{text:"impl Clone for Partition",synthetic:false,types:["mentat_db::types::Partition"]},{text:"impl Clone for DB",synthetic:false,types:["mentat_db::types::DB"]},{text:"impl Clone for TxReport",synthetic:false,types:["mentat_db::types::TxReport"]},]; +implementors["mentat_ffi"] = [{text:"impl Clone for TransactionChange",synthetic:false,types:["mentat_ffi::TransactionChange"]},]; +implementors["mentat_parser_utils"] = [{text:"impl Clone for SpanPosition",synthetic:false,types:["mentat_parser_utils::value_and_span::SpanPosition"]},{text:"impl<'a> Clone for Iter<'a>",synthetic:false,types:["mentat_parser_utils::value_and_span::Iter"]},{text:"impl<'a> Clone for Stream<'a>",synthetic:false,types:["mentat_parser_utils::value_and_span::Stream"]},{text:"impl<P: Clone, N: Clone> Clone for OfExactly<P, N>",synthetic:false,types:["mentat_parser_utils::value_and_span::OfExactly"]},]; +implementors["mentat_query_algebrizer"] = [{text:"impl Clone for BindingError",synthetic:false,types:["mentat_query_algebrizer::errors::BindingError"]},{text:"impl Clone for DatomsTable",synthetic:false,types:["mentat_query_algebrizer::types::DatomsTable"]},{text:"impl Clone for DatomsColumn",synthetic:false,types:["mentat_query_algebrizer::types::DatomsColumn"]},{text:"impl Clone for FulltextColumn",synthetic:false,types:["mentat_query_algebrizer::types::FulltextColumn"]},{text:"impl Clone for VariableColumn",synthetic:false,types:["mentat_query_algebrizer::types::VariableColumn"]},{text:"impl Clone for Column",synthetic:false,types:["mentat_query_algebrizer::types::Column"]},{text:"impl Clone for SourceAlias",synthetic:false,types:["mentat_query_algebrizer::types::SourceAlias"]},{text:"impl Clone for QualifiedAlias",synthetic:false,types:["mentat_query_algebrizer::types::QualifiedAlias"]},{text:"impl Clone for QueryValue",synthetic:false,types:["mentat_query_algebrizer::types::QueryValue"]},{text:"impl Clone for OrderBy",synthetic:false,types:["mentat_query_algebrizer::types::OrderBy"]},{text:"impl Clone for EmptyBecause",synthetic:false,types:["mentat_query_algebrizer::types::EmptyBecause"]},{text:"impl<'s, 'c> Clone for Known<'s, 'c>",synthetic:false,types:["mentat_query_algebrizer::Known"]},]; +implementors["mentat_query_projector"] = [{text:"impl Clone for SimpleAggregationOp",synthetic:false,types:["mentat_query_projector::aggregates::SimpleAggregationOp"]},{text:"impl<T: Clone> Clone for RelResult<T>",synthetic:false,types:["mentat_query_projector::relresult::RelResult"]},{text:"impl Clone for QueryResults",synthetic:false,types:["mentat_query_projector::QueryResults"]},]; +implementors["mentat_query_sql"] = [{text:"impl Clone for Op",synthetic:false,types:["mentat_query_sql::Op"]},]; +implementors["mentat_tolstoy"] = [{text:"impl Clone for TxPart",synthetic:false,types:["mentat_tolstoy::tx_processor::TxPart"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/cmp/trait.Eq.js b/docs/apis/rust/0.7.0/implementors/core/cmp/trait.Eq.js new file mode 100644 index 00000000..629b8a53 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/cmp/trait.Eq.js @@ -0,0 +1,18 @@ +(function() {var implementors = {}; +implementors["edn"] = [{text:"impl Eq for TempId",synthetic:false,types:["edn::entities::TempId"]},{text:"impl Eq for Entid",synthetic:false,types:["edn::entities::Entid"]},{text:"impl<V: Eq> Eq for LookupRef<V>",synthetic:false,types:["edn::entities::LookupRef"]},{text:"impl Eq for TxFunction",synthetic:false,types:["edn::entities::TxFunction"]},{text:"impl<V: Eq> Eq for ValuePlace<V>",synthetic:false,types:["edn::entities::ValuePlace"]},{text:"impl<V: Eq> Eq for EntityPlace<V>",synthetic:false,types:["edn::entities::EntityPlace"]},{text:"impl Eq for AttributePlace",synthetic:false,types:["edn::entities::AttributePlace"]},{text:"impl Eq for OpType",synthetic:false,types:["edn::entities::OpType"]},{text:"impl<V: Eq> Eq for Entity<V>",synthetic:false,types:["edn::entities::Entity"]},{text:"impl Eq for Variable",synthetic:false,types:["edn::query::Variable"]},{text:"impl Eq for QueryFunction",synthetic:false,types:["edn::query::QueryFunction"]},{text:"impl Eq for Direction",synthetic:false,types:["edn::query::Direction"]},{text:"impl Eq for Order",synthetic:false,types:["edn::query::Order"]},{text:"impl Eq for SrcVar",synthetic:false,types:["edn::query::SrcVar"]},{text:"impl Eq for NonIntegerConstant",synthetic:false,types:["edn::query::NonIntegerConstant"]},{text:"impl Eq for FnArg",synthetic:false,types:["edn::query::FnArg"]},{text:"impl Eq for PatternNonValuePlace",synthetic:false,types:["edn::query::PatternNonValuePlace"]},{text:"impl Eq for IdentOrEntid",synthetic:false,types:["edn::query::IdentOrEntid"]},{text:"impl Eq for PatternValuePlace",synthetic:false,types:["edn::query::PatternValuePlace"]},{text:"impl Eq for PullConcreteAttribute",synthetic:false,types:["edn::query::PullConcreteAttribute"]},{text:"impl Eq for NamedPullAttribute",synthetic:false,types:["edn::query::NamedPullAttribute"]},{text:"impl Eq for PullAttributeSpec",synthetic:false,types:["edn::query::PullAttributeSpec"]},{text:"impl Eq for Pull",synthetic:false,types:["edn::query::Pull"]},{text:"impl Eq for Aggregate",synthetic:false,types:["edn::query::Aggregate"]},{text:"impl Eq for Element",synthetic:false,types:["edn::query::Element"]},{text:"impl Eq for Limit",synthetic:false,types:["edn::query::Limit"]},{text:"impl Eq for FindSpec",synthetic:false,types:["edn::query::FindSpec"]},{text:"impl Eq for VariableOrPlaceholder",synthetic:false,types:["edn::query::VariableOrPlaceholder"]},{text:"impl Eq for Binding",synthetic:false,types:["edn::query::Binding"]},{text:"impl Eq for Pattern",synthetic:false,types:["edn::query::Pattern"]},{text:"impl Eq for Predicate",synthetic:false,types:["edn::query::Predicate"]},{text:"impl Eq for WhereFn",synthetic:false,types:["edn::query::WhereFn"]},{text:"impl Eq for UnifyVars",synthetic:false,types:["edn::query::UnifyVars"]},{text:"impl Eq for OrWhereClause",synthetic:false,types:["edn::query::OrWhereClause"]},{text:"impl Eq for OrJoin",synthetic:false,types:["edn::query::OrJoin"]},{text:"impl Eq for NotJoin",synthetic:false,types:["edn::query::NotJoin"]},{text:"impl Eq for TypeAnnotation",synthetic:false,types:["edn::query::TypeAnnotation"]},{text:"impl Eq for WhereClause",synthetic:false,types:["edn::query::WhereClause"]},{text:"impl Eq for ParsedQuery",synthetic:false,types:["edn::query::ParsedQuery"]},{text:"impl Eq for PlainSymbol",synthetic:false,types:["edn::symbols::PlainSymbol"]},{text:"impl Eq for NamespacedSymbol",synthetic:false,types:["edn::symbols::NamespacedSymbol"]},{text:"impl Eq for Keyword",synthetic:false,types:["edn::symbols::Keyword"]},{text:"impl Eq for Value",synthetic:false,types:["edn::types::Value"]},{text:"impl Eq for SpannedValue",synthetic:false,types:["edn::types::SpannedValue"]},{text:"impl Eq for Span",synthetic:false,types:["edn::types::Span"]},{text:"impl Eq for ValueAndSpan",synthetic:false,types:["edn::types::ValueAndSpan"]},{text:"impl Eq for ParseError",synthetic:false,types:["edn::parse::ParseError"]},]; +implementors["mentat"] = [{text:"impl Eq for CacheDirection",synthetic:false,types:["mentat::conn::CacheDirection"]},{text:"impl Eq for CacheAction",synthetic:false,types:["mentat::conn::CacheAction"]},{text:"impl Eq for Vocabulary",synthetic:false,types:["mentat::vocabulary::Vocabulary"]},{text:"impl<'definition> Eq for VocabularyCheck<'definition>",synthetic:false,types:["mentat::vocabulary::VocabularyCheck"]},{text:"impl Eq for VocabularyOutcome",synthetic:false,types:["mentat::vocabulary::VocabularyOutcome"]},]; +implementors["mentat_cli"] = [{text:"impl Eq for Command",synthetic:false,types:["mentat_cli::command_parser::Command"]},]; +implementors["mentat_core"] = [{text:"impl Eq for KnownEntid",synthetic:false,types:["mentat_core::types::KnownEntid"]},{text:"impl Eq for ValueType",synthetic:false,types:["mentat_core::types::ValueType"]},{text:"impl Eq for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl Eq for Binding",synthetic:false,types:["mentat_core::types::Binding"]},{text:"impl Eq for StructuredMap",synthetic:false,types:["mentat_core::types::StructuredMap"]},{text:"impl Eq for ValueTypeSet",synthetic:false,types:["mentat_core::value_type_set::ValueTypeSet"]},{text:"impl Eq for SQLTypeAffinity",synthetic:false,types:["mentat_core::sql_types::SQLTypeAffinity"]},{text:"impl Eq for Unique",synthetic:false,types:["mentat_core::attribute::Unique"]},{text:"impl<T: Eq> Eq for InternSet<T> where
    T: Eq + Hash
",synthetic:false,types:["mentat_core::intern_set::InternSet"]},{text:"impl<L: Eq, R: Eq> Eq for Either<L, R>",synthetic:false,types:["mentat_core::util::Either"]},{text:"impl Eq for Attribute",synthetic:false,types:["mentat_core::Attribute"]},{text:"impl Eq for Schema",synthetic:false,types:["mentat_core::Schema"]},]; +implementors["mentat_db"] = [{text:"impl Eq for CardinalityConflict",synthetic:false,types:["mentat_db::errors::CardinalityConflict"]},{text:"impl Eq for SchemaConstraintViolation",synthetic:false,types:["mentat_db::errors::SchemaConstraintViolation"]},{text:"impl Eq for InputError",synthetic:false,types:["mentat_db::errors::InputError"]},{text:"impl Eq for DbSqlErrorKind",synthetic:false,types:["mentat_db::errors::DbSqlErrorKind"]},{text:"impl Eq for SearchType",synthetic:false,types:["mentat_db::db::SearchType"]},{text:"impl<E: Eq, V: Eq> Eq for Term<E, V>",synthetic:false,types:["mentat_db::internal_types::Term"]},{text:"impl Eq for LookupRefOrTempId",synthetic:false,types:["mentat_db::internal_types::LookupRefOrTempId"]},{text:"impl Eq for AttributeBuilder",synthetic:false,types:["mentat_db::schema::AttributeBuilder"]},{text:"impl Eq for Partition",synthetic:false,types:["mentat_db::types::Partition"]},{text:"impl Eq for DB",synthetic:false,types:["mentat_db::types::DB"]},{text:"impl Eq for TxReport",synthetic:false,types:["mentat_db::types::TxReport"]},]; +implementors["mentat_parser_utils"] = [{text:"impl Eq for SpanPosition",synthetic:false,types:["mentat_parser_utils::value_and_span::SpanPosition"]},]; +implementors["mentat_query_algebrizer"] = [{text:"impl Eq for BindingError",synthetic:false,types:["mentat_query_algebrizer::errors::BindingError"]},{text:"impl Eq for DatomsTable",synthetic:false,types:["mentat_query_algebrizer::types::DatomsTable"]},{text:"impl Eq for ComputedTable",synthetic:false,types:["mentat_query_algebrizer::types::ComputedTable"]},{text:"impl Eq for DatomsColumn",synthetic:false,types:["mentat_query_algebrizer::types::DatomsColumn"]},{text:"impl Eq for FulltextColumn",synthetic:false,types:["mentat_query_algebrizer::types::FulltextColumn"]},{text:"impl Eq for VariableColumn",synthetic:false,types:["mentat_query_algebrizer::types::VariableColumn"]},{text:"impl Eq for Column",synthetic:false,types:["mentat_query_algebrizer::types::Column"]},{text:"impl Eq for SourceAlias",synthetic:false,types:["mentat_query_algebrizer::types::SourceAlias"]},{text:"impl Eq for QualifiedAlias",synthetic:false,types:["mentat_query_algebrizer::types::QualifiedAlias"]},{text:"impl Eq for QueryValue",synthetic:false,types:["mentat_query_algebrizer::types::QueryValue"]},{text:"impl Eq for OrderBy",synthetic:false,types:["mentat_query_algebrizer::types::OrderBy"]},{text:"impl Eq for ColumnConstraint",synthetic:false,types:["mentat_query_algebrizer::types::ColumnConstraint"]},{text:"impl Eq for ColumnConstraintOrAlternation",synthetic:false,types:["mentat_query_algebrizer::types::ColumnConstraintOrAlternation"]},{text:"impl Eq for ColumnIntersection",synthetic:false,types:["mentat_query_algebrizer::types::ColumnIntersection"]},{text:"impl Eq for ColumnAlternation",synthetic:false,types:["mentat_query_algebrizer::types::ColumnAlternation"]},{text:"impl Eq for FindQuery",synthetic:false,types:["mentat_query_algebrizer::types::FindQuery"]},{text:"impl Eq for ConjoiningClauses",synthetic:false,types:["mentat_query_algebrizer::clauses::ConjoiningClauses"]},]; +implementors["mentat_query_projector"] = [{text:"impl Eq for SimpleAggregationOp",synthetic:false,types:["mentat_query_projector::aggregates::SimpleAggregationOp"]},{text:"impl<T: Eq> Eq for RelResult<T>",synthetic:false,types:["mentat_query_projector::relresult::RelResult"]},{text:"impl Eq for QueryOutput",synthetic:false,types:["mentat_query_projector::QueryOutput"]},{text:"impl Eq for QueryResults",synthetic:false,types:["mentat_query_projector::QueryResults"]},]; +implementors["mentat_query_sql"] = [{text:"impl Eq for GroupBy",synthetic:false,types:["mentat_query_sql::GroupBy"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/cmp/trait.Ord.js b/docs/apis/rust/0.7.0/implementors/core/cmp/trait.Ord.js new file mode 100644 index 00000000..b8eaf934 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/cmp/trait.Ord.js @@ -0,0 +1,13 @@ +(function() {var implementors = {}; +implementors["edn"] = [{text:"impl Ord for TempId",synthetic:false,types:["edn::entities::TempId"]},{text:"impl Ord for Entid",synthetic:false,types:["edn::entities::Entid"]},{text:"impl<V: Ord> Ord for LookupRef<V>",synthetic:false,types:["edn::entities::LookupRef"]},{text:"impl Ord for TxFunction",synthetic:false,types:["edn::entities::TxFunction"]},{text:"impl<V: Ord> Ord for ValuePlace<V>",synthetic:false,types:["edn::entities::ValuePlace"]},{text:"impl<V: Ord> Ord for EntityPlace<V>",synthetic:false,types:["edn::entities::EntityPlace"]},{text:"impl Ord for AttributePlace",synthetic:false,types:["edn::entities::AttributePlace"]},{text:"impl Ord for OpType",synthetic:false,types:["edn::entities::OpType"]},{text:"impl<V: Ord> Ord for Entity<V>",synthetic:false,types:["edn::entities::Entity"]},{text:"impl Ord for Variable",synthetic:false,types:["edn::query::Variable"]},{text:"impl Ord for QueryFunction",synthetic:false,types:["edn::query::QueryFunction"]},{text:"impl Ord for SrcVar",synthetic:false,types:["edn::query::SrcVar"]},{text:"impl Ord for PlainSymbol",synthetic:false,types:["edn::symbols::PlainSymbol"]},{text:"impl Ord for NamespacedSymbol",synthetic:false,types:["edn::symbols::NamespacedSymbol"]},{text:"impl Ord for Keyword",synthetic:false,types:["edn::symbols::Keyword"]},{text:"impl Ord for Value",synthetic:false,types:["edn::types::Value"]},{text:"impl Ord for SpannedValue",synthetic:false,types:["edn::types::SpannedValue"]},{text:"impl Ord for ValueAndSpan",synthetic:false,types:["edn::types::ValueAndSpan"]},]; +implementors["mentat_core"] = [{text:"impl Ord for KnownEntid",synthetic:false,types:["mentat_core::types::KnownEntid"]},{text:"impl Ord for ValueType",synthetic:false,types:["mentat_core::types::ValueType"]},{text:"impl Ord for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl Ord for SQLTypeAffinity",synthetic:false,types:["mentat_core::sql_types::SQLTypeAffinity"]},{text:"impl Ord for Unique",synthetic:false,types:["mentat_core::attribute::Unique"]},{text:"impl<L: Ord, R: Ord> Ord for Either<L, R>",synthetic:false,types:["mentat_core::util::Either"]},{text:"impl Ord for Attribute",synthetic:false,types:["mentat_core::Attribute"]},{text:"impl Ord for Schema",synthetic:false,types:["mentat_core::Schema"]},]; +implementors["mentat_db"] = [{text:"impl Ord for SearchType",synthetic:false,types:["mentat_db::db::SearchType"]},{text:"impl<E: Ord, V: Ord> Ord for Term<E, V>",synthetic:false,types:["mentat_db::internal_types::Term"]},{text:"impl Ord for LookupRefOrTempId",synthetic:false,types:["mentat_db::internal_types::LookupRefOrTempId"]},{text:"impl Ord for AttributeBuilder",synthetic:false,types:["mentat_db::schema::AttributeBuilder"]},{text:"impl Ord for Partition",synthetic:false,types:["mentat_db::types::Partition"]},{text:"impl Ord for DB",synthetic:false,types:["mentat_db::types::DB"]},{text:"impl Ord for TxReport",synthetic:false,types:["mentat_db::types::TxReport"]},]; +implementors["mentat_parser_utils"] = [{text:"impl Ord for SpanPosition",synthetic:false,types:["mentat_parser_utils::value_and_span::SpanPosition"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/cmp/trait.PartialEq.js b/docs/apis/rust/0.7.0/implementors/core/cmp/trait.PartialEq.js new file mode 100644 index 00000000..23b619d5 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/cmp/trait.PartialEq.js @@ -0,0 +1,18 @@ +(function() {var implementors = {}; +implementors["edn"] = [{text:"impl PartialEq for TempId",synthetic:false,types:["edn::entities::TempId"]},{text:"impl PartialEq for Entid",synthetic:false,types:["edn::entities::Entid"]},{text:"impl<V: PartialEq> PartialEq for LookupRef<V>",synthetic:false,types:["edn::entities::LookupRef"]},{text:"impl PartialEq for TxFunction",synthetic:false,types:["edn::entities::TxFunction"]},{text:"impl<V: PartialEq> PartialEq for ValuePlace<V>",synthetic:false,types:["edn::entities::ValuePlace"]},{text:"impl<V: PartialEq> PartialEq for EntityPlace<V>",synthetic:false,types:["edn::entities::EntityPlace"]},{text:"impl PartialEq for AttributePlace",synthetic:false,types:["edn::entities::AttributePlace"]},{text:"impl PartialEq for OpType",synthetic:false,types:["edn::entities::OpType"]},{text:"impl<V: PartialEq> PartialEq for Entity<V>",synthetic:false,types:["edn::entities::Entity"]},{text:"impl PartialEq for Variable",synthetic:false,types:["edn::query::Variable"]},{text:"impl PartialEq for QueryFunction",synthetic:false,types:["edn::query::QueryFunction"]},{text:"impl PartialEq for Direction",synthetic:false,types:["edn::query::Direction"]},{text:"impl PartialEq for Order",synthetic:false,types:["edn::query::Order"]},{text:"impl PartialEq for SrcVar",synthetic:false,types:["edn::query::SrcVar"]},{text:"impl PartialEq for NonIntegerConstant",synthetic:false,types:["edn::query::NonIntegerConstant"]},{text:"impl PartialEq for FnArg",synthetic:false,types:["edn::query::FnArg"]},{text:"impl PartialEq for PatternNonValuePlace",synthetic:false,types:["edn::query::PatternNonValuePlace"]},{text:"impl PartialEq for IdentOrEntid",synthetic:false,types:["edn::query::IdentOrEntid"]},{text:"impl PartialEq for PatternValuePlace",synthetic:false,types:["edn::query::PatternValuePlace"]},{text:"impl PartialEq for PullConcreteAttribute",synthetic:false,types:["edn::query::PullConcreteAttribute"]},{text:"impl PartialEq for NamedPullAttribute",synthetic:false,types:["edn::query::NamedPullAttribute"]},{text:"impl PartialEq for PullAttributeSpec",synthetic:false,types:["edn::query::PullAttributeSpec"]},{text:"impl PartialEq for Pull",synthetic:false,types:["edn::query::Pull"]},{text:"impl PartialEq for Aggregate",synthetic:false,types:["edn::query::Aggregate"]},{text:"impl PartialEq for Element",synthetic:false,types:["edn::query::Element"]},{text:"impl PartialEq for Limit",synthetic:false,types:["edn::query::Limit"]},{text:"impl PartialEq for FindSpec",synthetic:false,types:["edn::query::FindSpec"]},{text:"impl PartialEq for VariableOrPlaceholder",synthetic:false,types:["edn::query::VariableOrPlaceholder"]},{text:"impl PartialEq for Binding",synthetic:false,types:["edn::query::Binding"]},{text:"impl PartialEq for Pattern",synthetic:false,types:["edn::query::Pattern"]},{text:"impl PartialEq for Predicate",synthetic:false,types:["edn::query::Predicate"]},{text:"impl PartialEq for WhereFn",synthetic:false,types:["edn::query::WhereFn"]},{text:"impl PartialEq for UnifyVars",synthetic:false,types:["edn::query::UnifyVars"]},{text:"impl PartialEq for OrWhereClause",synthetic:false,types:["edn::query::OrWhereClause"]},{text:"impl PartialEq for OrJoin",synthetic:false,types:["edn::query::OrJoin"]},{text:"impl PartialEq for NotJoin",synthetic:false,types:["edn::query::NotJoin"]},{text:"impl PartialEq for TypeAnnotation",synthetic:false,types:["edn::query::TypeAnnotation"]},{text:"impl PartialEq for WhereClause",synthetic:false,types:["edn::query::WhereClause"]},{text:"impl PartialEq for ParsedQuery",synthetic:false,types:["edn::query::ParsedQuery"]},{text:"impl PartialEq for PlainSymbol",synthetic:false,types:["edn::symbols::PlainSymbol"]},{text:"impl PartialEq for NamespacedSymbol",synthetic:false,types:["edn::symbols::NamespacedSymbol"]},{text:"impl PartialEq for Keyword",synthetic:false,types:["edn::symbols::Keyword"]},{text:"impl PartialEq for Value",synthetic:false,types:["edn::types::Value"]},{text:"impl PartialEq for SpannedValue",synthetic:false,types:["edn::types::SpannedValue"]},{text:"impl PartialEq for Span",synthetic:false,types:["edn::types::Span"]},{text:"impl PartialEq for ValueAndSpan",synthetic:false,types:["edn::types::ValueAndSpan"]},{text:"impl PartialEq for ParseError",synthetic:false,types:["edn::parse::ParseError"]},]; +implementors["mentat"] = [{text:"impl PartialEq for CacheDirection",synthetic:false,types:["mentat::conn::CacheDirection"]},{text:"impl PartialEq for CacheAction",synthetic:false,types:["mentat::conn::CacheAction"]},{text:"impl PartialEq for Vocabulary",synthetic:false,types:["mentat::vocabulary::Vocabulary"]},{text:"impl<'definition> PartialEq for VocabularyCheck<'definition>",synthetic:false,types:["mentat::vocabulary::VocabularyCheck"]},{text:"impl PartialEq for VocabularyOutcome",synthetic:false,types:["mentat::vocabulary::VocabularyOutcome"]},]; +implementors["mentat_cli"] = [{text:"impl PartialEq for Command",synthetic:false,types:["mentat_cli::command_parser::Command"]},]; +implementors["mentat_core"] = [{text:"impl PartialEq for KnownEntid",synthetic:false,types:["mentat_core::types::KnownEntid"]},{text:"impl PartialEq for ValueType",synthetic:false,types:["mentat_core::types::ValueType"]},{text:"impl PartialEq for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl PartialEq for Binding",synthetic:false,types:["mentat_core::types::Binding"]},{text:"impl PartialEq for StructuredMap",synthetic:false,types:["mentat_core::types::StructuredMap"]},{text:"impl PartialEq for ValueTypeSet",synthetic:false,types:["mentat_core::value_type_set::ValueTypeSet"]},{text:"impl PartialEq for SQLTypeAffinity",synthetic:false,types:["mentat_core::sql_types::SQLTypeAffinity"]},{text:"impl PartialEq for Unique",synthetic:false,types:["mentat_core::attribute::Unique"]},{text:"impl<T: PartialEq> PartialEq for InternSet<T> where
    T: Eq + Hash
",synthetic:false,types:["mentat_core::intern_set::InternSet"]},{text:"impl<L: PartialEq, R: PartialEq> PartialEq for Either<L, R>",synthetic:false,types:["mentat_core::util::Either"]},{text:"impl PartialEq for Attribute",synthetic:false,types:["mentat_core::Attribute"]},{text:"impl PartialEq for Schema",synthetic:false,types:["mentat_core::Schema"]},]; +implementors["mentat_db"] = [{text:"impl PartialEq for CardinalityConflict",synthetic:false,types:["mentat_db::errors::CardinalityConflict"]},{text:"impl PartialEq for SchemaConstraintViolation",synthetic:false,types:["mentat_db::errors::SchemaConstraintViolation"]},{text:"impl PartialEq for InputError",synthetic:false,types:["mentat_db::errors::InputError"]},{text:"impl PartialEq for DbSqlErrorKind",synthetic:false,types:["mentat_db::errors::DbSqlErrorKind"]},{text:"impl PartialEq for SearchType",synthetic:false,types:["mentat_db::db::SearchType"]},{text:"impl<E: PartialEq, V: PartialEq> PartialEq for Term<E, V>",synthetic:false,types:["mentat_db::internal_types::Term"]},{text:"impl PartialEq for LookupRefOrTempId",synthetic:false,types:["mentat_db::internal_types::LookupRefOrTempId"]},{text:"impl PartialEq for AttributeBuilder",synthetic:false,types:["mentat_db::schema::AttributeBuilder"]},{text:"impl PartialEq for Partition",synthetic:false,types:["mentat_db::types::Partition"]},{text:"impl PartialEq for DB",synthetic:false,types:["mentat_db::types::DB"]},{text:"impl PartialEq for TxReport",synthetic:false,types:["mentat_db::types::TxReport"]},]; +implementors["mentat_parser_utils"] = [{text:"impl PartialEq for SpanPosition",synthetic:false,types:["mentat_parser_utils::value_and_span::SpanPosition"]},{text:"impl PartialEq for ValueParseError",synthetic:false,types:["mentat_parser_utils::ValueParseError"]},]; +implementors["mentat_query_algebrizer"] = [{text:"impl PartialEq for BindingError",synthetic:false,types:["mentat_query_algebrizer::errors::BindingError"]},{text:"impl PartialEq for DatomsTable",synthetic:false,types:["mentat_query_algebrizer::types::DatomsTable"]},{text:"impl PartialEq for ComputedTable",synthetic:false,types:["mentat_query_algebrizer::types::ComputedTable"]},{text:"impl PartialEq for DatomsColumn",synthetic:false,types:["mentat_query_algebrizer::types::DatomsColumn"]},{text:"impl PartialEq for FulltextColumn",synthetic:false,types:["mentat_query_algebrizer::types::FulltextColumn"]},{text:"impl PartialEq for VariableColumn",synthetic:false,types:["mentat_query_algebrizer::types::VariableColumn"]},{text:"impl PartialEq for Column",synthetic:false,types:["mentat_query_algebrizer::types::Column"]},{text:"impl PartialEq for SourceAlias",synthetic:false,types:["mentat_query_algebrizer::types::SourceAlias"]},{text:"impl PartialEq for QualifiedAlias",synthetic:false,types:["mentat_query_algebrizer::types::QualifiedAlias"]},{text:"impl PartialEq for QueryValue",synthetic:false,types:["mentat_query_algebrizer::types::QueryValue"]},{text:"impl PartialEq for OrderBy",synthetic:false,types:["mentat_query_algebrizer::types::OrderBy"]},{text:"impl PartialEq for ColumnConstraint",synthetic:false,types:["mentat_query_algebrizer::types::ColumnConstraint"]},{text:"impl PartialEq for ColumnConstraintOrAlternation",synthetic:false,types:["mentat_query_algebrizer::types::ColumnConstraintOrAlternation"]},{text:"impl PartialEq for ColumnIntersection",synthetic:false,types:["mentat_query_algebrizer::types::ColumnIntersection"]},{text:"impl PartialEq for ColumnAlternation",synthetic:false,types:["mentat_query_algebrizer::types::ColumnAlternation"]},{text:"impl PartialEq for EmptyBecause",synthetic:false,types:["mentat_query_algebrizer::types::EmptyBecause"]},{text:"impl PartialEq for FindQuery",synthetic:false,types:["mentat_query_algebrizer::types::FindQuery"]},{text:"impl PartialEq for ConjoiningClauses",synthetic:false,types:["mentat_query_algebrizer::clauses::ConjoiningClauses"]},]; +implementors["mentat_query_projector"] = [{text:"impl PartialEq for SimpleAggregationOp",synthetic:false,types:["mentat_query_projector::aggregates::SimpleAggregationOp"]},{text:"impl<T: PartialEq> PartialEq for RelResult<T>",synthetic:false,types:["mentat_query_projector::relresult::RelResult"]},{text:"impl PartialEq for QueryOutput",synthetic:false,types:["mentat_query_projector::QueryOutput"]},{text:"impl PartialEq for QueryResults",synthetic:false,types:["mentat_query_projector::QueryResults"]},]; +implementors["mentat_query_sql"] = [{text:"impl PartialEq for GroupBy",synthetic:false,types:["mentat_query_sql::GroupBy"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/cmp/trait.PartialOrd.js b/docs/apis/rust/0.7.0/implementors/core/cmp/trait.PartialOrd.js new file mode 100644 index 00000000..2d6e37f7 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/cmp/trait.PartialOrd.js @@ -0,0 +1,13 @@ +(function() {var implementors = {}; +implementors["edn"] = [{text:"impl PartialOrd for TempId",synthetic:false,types:["edn::entities::TempId"]},{text:"impl PartialOrd for Entid",synthetic:false,types:["edn::entities::Entid"]},{text:"impl<V: PartialOrd> PartialOrd for LookupRef<V>",synthetic:false,types:["edn::entities::LookupRef"]},{text:"impl PartialOrd for TxFunction",synthetic:false,types:["edn::entities::TxFunction"]},{text:"impl<V: PartialOrd> PartialOrd for ValuePlace<V>",synthetic:false,types:["edn::entities::ValuePlace"]},{text:"impl<V: PartialOrd> PartialOrd for EntityPlace<V>",synthetic:false,types:["edn::entities::EntityPlace"]},{text:"impl PartialOrd for AttributePlace",synthetic:false,types:["edn::entities::AttributePlace"]},{text:"impl PartialOrd for OpType",synthetic:false,types:["edn::entities::OpType"]},{text:"impl<V: PartialOrd> PartialOrd for Entity<V>",synthetic:false,types:["edn::entities::Entity"]},{text:"impl PartialOrd for Variable",synthetic:false,types:["edn::query::Variable"]},{text:"impl PartialOrd for QueryFunction",synthetic:false,types:["edn::query::QueryFunction"]},{text:"impl PartialOrd for SrcVar",synthetic:false,types:["edn::query::SrcVar"]},{text:"impl PartialOrd for PlainSymbol",synthetic:false,types:["edn::symbols::PlainSymbol"]},{text:"impl PartialOrd for NamespacedSymbol",synthetic:false,types:["edn::symbols::NamespacedSymbol"]},{text:"impl PartialOrd for Keyword",synthetic:false,types:["edn::symbols::Keyword"]},{text:"impl PartialOrd for Value",synthetic:false,types:["edn::types::Value"]},{text:"impl PartialOrd for SpannedValue",synthetic:false,types:["edn::types::SpannedValue"]},{text:"impl PartialOrd for ValueAndSpan",synthetic:false,types:["edn::types::ValueAndSpan"]},]; +implementors["mentat_core"] = [{text:"impl PartialOrd for KnownEntid",synthetic:false,types:["mentat_core::types::KnownEntid"]},{text:"impl PartialOrd for ValueType",synthetic:false,types:["mentat_core::types::ValueType"]},{text:"impl PartialOrd for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl PartialOrd for SQLTypeAffinity",synthetic:false,types:["mentat_core::sql_types::SQLTypeAffinity"]},{text:"impl PartialOrd for Unique",synthetic:false,types:["mentat_core::attribute::Unique"]},{text:"impl<L: PartialOrd, R: PartialOrd> PartialOrd for Either<L, R>",synthetic:false,types:["mentat_core::util::Either"]},{text:"impl PartialOrd for Attribute",synthetic:false,types:["mentat_core::Attribute"]},{text:"impl PartialOrd for Schema",synthetic:false,types:["mentat_core::Schema"]},]; +implementors["mentat_db"] = [{text:"impl PartialOrd for SearchType",synthetic:false,types:["mentat_db::db::SearchType"]},{text:"impl<E: PartialOrd, V: PartialOrd> PartialOrd for Term<E, V>",synthetic:false,types:["mentat_db::internal_types::Term"]},{text:"impl PartialOrd for LookupRefOrTempId",synthetic:false,types:["mentat_db::internal_types::LookupRefOrTempId"]},{text:"impl PartialOrd for AttributeBuilder",synthetic:false,types:["mentat_db::schema::AttributeBuilder"]},{text:"impl PartialOrd for Partition",synthetic:false,types:["mentat_db::types::Partition"]},{text:"impl PartialOrd for DB",synthetic:false,types:["mentat_db::types::DB"]},{text:"impl PartialOrd for TxReport",synthetic:false,types:["mentat_db::types::TxReport"]},]; +implementors["mentat_parser_utils"] = [{text:"impl PartialOrd for SpanPosition",synthetic:false,types:["mentat_parser_utils::value_and_span::SpanPosition"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/convert/trait.From.js b/docs/apis/rust/0.7.0/implementors/core/convert/trait.From.js new file mode 100644 index 00000000..ad46465c --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/convert/trait.From.js @@ -0,0 +1,17 @@ +(function() {var implementors = {}; +implementors["edn"] = [{text:"impl<'a> From<&'a str> for NonIntegerConstant",synthetic:false,types:["edn::query::NonIntegerConstant"]},{text:"impl From<String> for NonIntegerConstant",synthetic:false,types:["edn::query::NonIntegerConstant"]},{text:"impl From<Rc<Keyword>> for PatternNonValuePlace",synthetic:false,types:["edn::query::PatternNonValuePlace"]},{text:"impl From<Keyword> for PatternNonValuePlace",synthetic:false,types:["edn::query::PatternNonValuePlace"]},{text:"impl From<Rc<Keyword>> for PatternValuePlace",synthetic:false,types:["edn::query::PatternValuePlace"]},{text:"impl From<Keyword> for PatternValuePlace",synthetic:false,types:["edn::query::PatternValuePlace"]},{text:"impl From<PullConcreteAttribute> for NamedPullAttribute",synthetic:false,types:["edn::query::NamedPullAttribute"]},{text:"impl From<Variable> for Element",synthetic:false,types:["edn::query::Element"]},{text:"impl From<SpannedValue> for Value",synthetic:false,types:["edn::types::Value"]},{text:"impl From<ValueAndSpan> for Value",synthetic:false,types:["edn::types::Value"]},]; +implementors["mentat_core"] = [{text:"impl From<KnownEntid> for Entid",synthetic:false,types:["mentat_core::types::Entid"]},{text:"impl From<KnownEntid> for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl<T> From<T> for Binding where
    T: Into<TypedValue>, 
",synthetic:false,types:["mentat_core::types::Binding"]},{text:"impl From<StructuredMap> for Binding",synthetic:false,types:["mentat_core::types::Binding"]},{text:"impl From<Vec<Binding>> for Binding",synthetic:false,types:["mentat_core::types::Binding"]},{text:"impl From<IndexMap<ValueRc<Keyword>, Binding>> for StructuredMap",synthetic:false,types:["mentat_core::types::StructuredMap"]},{text:"impl<T> From<Vec<(Keyword, T)>> for StructuredMap where
    T: Into<Binding>, 
",synthetic:false,types:["mentat_core::types::StructuredMap"]},{text:"impl From<bool> for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl From<DateTime<Utc>> for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl From<Uuid> for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl<'a> From<&'a str> for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl From<Arc<String>> for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl From<Rc<String>> for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl From<Box<String>> for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl From<String> for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl From<Arc<Keyword>> for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl From<Rc<Keyword>> for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl From<Keyword> for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl From<u32> for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl From<i32> for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl From<f64> for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl From<ValueType> for ValueTypeSet",synthetic:false,types:["mentat_core::value_type_set::ValueTypeSet"]},]; +implementors["mentat_db"] = [{text:"impl From<DbSqlErrorKind> for DbSqlError",synthetic:false,types:["mentat_db::errors::DbSqlError"]},{text:"impl From<Context<DbSqlErrorKind>> for DbSqlError",synthetic:false,types:["mentat_db::errors::DbSqlError"]},]; +implementors["mentat_ffi"] = [{text:"impl<T> From<Option<T>> for ExternOption",synthetic:false,types:["mentat_ffi::ExternOption"]},{text:"impl<T, E> From<Result<T, E>> for ExternResult where
    E: Display
",synthetic:false,types:["mentat_ffi::ExternResult"]},]; +implementors["mentat_parser_utils"] = [{text:"impl<'a> From<ParseError<Stream<'a>>> for ValueParseError",synthetic:false,types:["mentat_parser_utils::ValueParseError"]},]; +implementors["mentat_query_algebrizer"] = [{text:"impl From<DatomsColumn> for Column",synthetic:false,types:["mentat_query_algebrizer::types::Column"]},{text:"impl From<VariableColumn> for Column",synthetic:false,types:["mentat_query_algebrizer::types::Column"]},{text:"impl From<Order> for OrderBy",synthetic:false,types:["mentat_query_algebrizer::types::OrderBy"]},{text:"impl From<ColumnConstraint> for ColumnConstraintOrAlternation",synthetic:false,types:["mentat_query_algebrizer::types::ColumnConstraintOrAlternation"]},{text:"impl From<Vec<ColumnConstraint>> for ColumnIntersection",synthetic:false,types:["mentat_query_algebrizer::types::ColumnIntersection"]},]; +implementors["mentat_query_projector"] = [{text:"impl From<Vec<Vec<TypedValue>>> for RelResult<Binding>",synthetic:false,types:["mentat_query_projector::relresult::RelResult"]},{text:"impl From<QueryOutput> for QueryResults",synthetic:false,types:["mentat_query_projector::QueryResults"]},]; +implementors["mentat_query_sql"] = [{text:"impl From<QueryValue> for ColumnOrExpression",synthetic:false,types:["mentat_query_sql::ColumnOrExpression"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/default/trait.Default.js b/docs/apis/rust/0.7.0/implementors/core/default/trait.Default.js new file mode 100644 index 00000000..04957746 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/default/trait.Default.js @@ -0,0 +1,13 @@ +(function() {var implementors = {}; +implementors["mentat"] = [{text:"impl Default for Vocabularies",synthetic:false,types:["mentat::vocabulary::Vocabularies"]},]; +implementors["mentat_core"] = [{text:"impl Default for StructuredMap",synthetic:false,types:["mentat_core::types::StructuredMap"]},{text:"impl Default for ValueTypeSet",synthetic:false,types:["mentat_core::value_type_set::ValueTypeSet"]},{text:"impl<T: Default> Default for InternSet<T> where
    T: Eq + Hash
",synthetic:false,types:["mentat_core::intern_set::InternSet"]},{text:"impl Default for Attribute",synthetic:false,types:["mentat_core::Attribute"]},{text:"impl Default for Schema",synthetic:false,types:["mentat_core::Schema"]},]; +implementors["mentat_db"] = [{text:"impl Default for AttributeCaches",synthetic:false,types:["mentat_db::cache::AttributeCaches"]},{text:"impl Default for SQLiteAttributeCache",synthetic:false,types:["mentat_db::cache::SQLiteAttributeCache"]},{text:"impl Default for InProgressSQLiteAttributeCache",synthetic:false,types:["mentat_db::cache::InProgressSQLiteAttributeCache"]},{text:"impl Default for AttributeBuilder",synthetic:false,types:["mentat_db::schema::AttributeBuilder"]},{text:"impl Default for DB",synthetic:false,types:["mentat_db::types::DB"]},]; +implementors["mentat_query_algebrizer"] = [{text:"impl Default for ColumnIntersection",synthetic:false,types:["mentat_query_algebrizer::types::ColumnIntersection"]},{text:"impl Default for ColumnAlternation",synthetic:false,types:["mentat_query_algebrizer::types::ColumnAlternation"]},{text:"impl Default for QueryInputs",synthetic:false,types:["mentat_query_algebrizer::clauses::inputs::QueryInputs"]},{text:"impl Default for ConjoiningClauses",synthetic:false,types:["mentat_query_algebrizer::clauses::ConjoiningClauses"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/fmt/trait.Debug.js b/docs/apis/rust/0.7.0/implementors/core/fmt/trait.Debug.js new file mode 100644 index 00000000..2b748dc0 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/fmt/trait.Debug.js @@ -0,0 +1,22 @@ +(function() {var implementors = {}; +implementors["edn"] = [{text:"impl Debug for TempId",synthetic:false,types:["edn::entities::TempId"]},{text:"impl Debug for Entid",synthetic:false,types:["edn::entities::Entid"]},{text:"impl<V: Debug> Debug for LookupRef<V>",synthetic:false,types:["edn::entities::LookupRef"]},{text:"impl Debug for TxFunction",synthetic:false,types:["edn::entities::TxFunction"]},{text:"impl<V: Debug> Debug for ValuePlace<V>",synthetic:false,types:["edn::entities::ValuePlace"]},{text:"impl<V: Debug> Debug for EntityPlace<V>",synthetic:false,types:["edn::entities::EntityPlace"]},{text:"impl Debug for AttributePlace",synthetic:false,types:["edn::entities::AttributePlace"]},{text:"impl Debug for OpType",synthetic:false,types:["edn::entities::OpType"]},{text:"impl<V: Debug> Debug for Entity<V>",synthetic:false,types:["edn::entities::Entity"]},{text:"impl Debug for Variable",synthetic:false,types:["edn::query::Variable"]},{text:"impl Debug for QueryFunction",synthetic:false,types:["edn::query::QueryFunction"]},{text:"impl Debug for Direction",synthetic:false,types:["edn::query::Direction"]},{text:"impl Debug for Order",synthetic:false,types:["edn::query::Order"]},{text:"impl Debug for SrcVar",synthetic:false,types:["edn::query::SrcVar"]},{text:"impl Debug for NonIntegerConstant",synthetic:false,types:["edn::query::NonIntegerConstant"]},{text:"impl Debug for FnArg",synthetic:false,types:["edn::query::FnArg"]},{text:"impl Debug for PatternNonValuePlace",synthetic:false,types:["edn::query::PatternNonValuePlace"]},{text:"impl Debug for IdentOrEntid",synthetic:false,types:["edn::query::IdentOrEntid"]},{text:"impl Debug for PatternValuePlace",synthetic:false,types:["edn::query::PatternValuePlace"]},{text:"impl Debug for PullConcreteAttribute",synthetic:false,types:["edn::query::PullConcreteAttribute"]},{text:"impl Debug for NamedPullAttribute",synthetic:false,types:["edn::query::NamedPullAttribute"]},{text:"impl Debug for PullAttributeSpec",synthetic:false,types:["edn::query::PullAttributeSpec"]},{text:"impl Debug for Pull",synthetic:false,types:["edn::query::Pull"]},{text:"impl Debug for Aggregate",synthetic:false,types:["edn::query::Aggregate"]},{text:"impl Debug for Element",synthetic:false,types:["edn::query::Element"]},{text:"impl Debug for Limit",synthetic:false,types:["edn::query::Limit"]},{text:"impl Debug for FindSpec",synthetic:false,types:["edn::query::FindSpec"]},{text:"impl Debug for VariableOrPlaceholder",synthetic:false,types:["edn::query::VariableOrPlaceholder"]},{text:"impl Debug for Binding",synthetic:false,types:["edn::query::Binding"]},{text:"impl Debug for Pattern",synthetic:false,types:["edn::query::Pattern"]},{text:"impl Debug for Predicate",synthetic:false,types:["edn::query::Predicate"]},{text:"impl Debug for WhereFn",synthetic:false,types:["edn::query::WhereFn"]},{text:"impl Debug for UnifyVars",synthetic:false,types:["edn::query::UnifyVars"]},{text:"impl Debug for OrWhereClause",synthetic:false,types:["edn::query::OrWhereClause"]},{text:"impl Debug for OrJoin",synthetic:false,types:["edn::query::OrJoin"]},{text:"impl Debug for NotJoin",synthetic:false,types:["edn::query::NotJoin"]},{text:"impl Debug for TypeAnnotation",synthetic:false,types:["edn::query::TypeAnnotation"]},{text:"impl Debug for WhereClause",synthetic:false,types:["edn::query::WhereClause"]},{text:"impl Debug for ParsedQuery",synthetic:false,types:["edn::query::ParsedQuery"]},{text:"impl Debug for PlainSymbol",synthetic:false,types:["edn::symbols::PlainSymbol"]},{text:"impl Debug for NamespacedSymbol",synthetic:false,types:["edn::symbols::NamespacedSymbol"]},{text:"impl Debug for Keyword",synthetic:false,types:["edn::symbols::Keyword"]},{text:"impl Debug for Value",synthetic:false,types:["edn::types::Value"]},{text:"impl Debug for SpannedValue",synthetic:false,types:["edn::types::SpannedValue"]},{text:"impl Debug for Span",synthetic:false,types:["edn::types::Span"]},{text:"impl Debug for ValueAndSpan",synthetic:false,types:["edn::types::ValueAndSpan"]},{text:"impl Debug for ParseError",synthetic:false,types:["edn::parse::ParseError"]},]; +implementors["mentat"] = [{text:"impl Debug for MentatError",synthetic:false,types:["mentat::errors::MentatError"]},{text:"impl Debug for CacheDirection",synthetic:false,types:["mentat::conn::CacheDirection"]},{text:"impl Debug for CacheAction",synthetic:false,types:["mentat::conn::CacheAction"]},{text:"impl Debug for Vocabulary",synthetic:false,types:["mentat::vocabulary::Vocabulary"]},{text:"impl Debug for Vocabularies",synthetic:false,types:["mentat::vocabulary::Vocabularies"]},{text:"impl<'definition> Debug for VocabularyCheck<'definition>",synthetic:false,types:["mentat::vocabulary::VocabularyCheck"]},{text:"impl Debug for VocabularyOutcome",synthetic:false,types:["mentat::vocabulary::VocabularyOutcome"]},]; +implementors["mentat_cli"] = [{text:"impl Debug for Command",synthetic:false,types:["mentat_cli::command_parser::Command"]},{text:"impl Debug for InputResult",synthetic:false,types:["mentat_cli::input::InputResult"]},{text:"impl Debug for CliError",synthetic:false,types:["mentat_cli::CliError"]},]; +implementors["mentat_core"] = [{text:"impl Debug for KnownEntid",synthetic:false,types:["mentat_core::types::KnownEntid"]},{text:"impl Debug for ValueType",synthetic:false,types:["mentat_core::types::ValueType"]},{text:"impl Debug for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl Debug for Binding",synthetic:false,types:["mentat_core::types::Binding"]},{text:"impl Debug for StructuredMap",synthetic:false,types:["mentat_core::types::StructuredMap"]},{text:"impl Debug for ValueTypeSet",synthetic:false,types:["mentat_core::value_type_set::ValueTypeSet"]},{text:"impl Debug for SQLTypeAffinity",synthetic:false,types:["mentat_core::sql_types::SQLTypeAffinity"]},{text:"impl Debug for Unique",synthetic:false,types:["mentat_core::attribute::Unique"]},{text:"impl<T: Debug> Debug for InternSet<T> where
    T: Eq + Hash
",synthetic:false,types:["mentat_core::intern_set::InternSet"]},{text:"impl<L: Debug, R: Debug> Debug for Either<L, R>",synthetic:false,types:["mentat_core::util::Either"]},{text:"impl Debug for Attribute",synthetic:false,types:["mentat_core::Attribute"]},{text:"impl Debug for Schema",synthetic:false,types:["mentat_core::Schema"]},]; +implementors["mentat_db"] = [{text:"impl Debug for CardinalityConflict",synthetic:false,types:["mentat_db::errors::CardinalityConflict"]},{text:"impl Debug for SchemaConstraintViolation",synthetic:false,types:["mentat_db::errors::SchemaConstraintViolation"]},{text:"impl Debug for InputError",synthetic:false,types:["mentat_db::errors::InputError"]},{text:"impl Debug for DbError",synthetic:false,types:["mentat_db::errors::DbError"]},{text:"impl Debug for DbSqlError",synthetic:false,types:["mentat_db::errors::DbSqlError"]},{text:"impl Debug for DbSqlErrorKind",synthetic:false,types:["mentat_db::errors::DbSqlErrorKind"]},{text:"impl Debug for AttributeCaches",synthetic:false,types:["mentat_db::cache::AttributeCaches"]},{text:"impl Debug for SQLiteAttributeCache",synthetic:false,types:["mentat_db::cache::SQLiteAttributeCache"]},{text:"impl Debug for InProgressSQLiteAttributeCache",synthetic:false,types:["mentat_db::cache::InProgressSQLiteAttributeCache"]},{text:"impl Debug for SearchType",synthetic:false,types:["mentat_db::db::SearchType"]},{text:"impl<E: Debug, V: Debug> Debug for Term<E, V>",synthetic:false,types:["mentat_db::internal_types::Term"]},{text:"impl Debug for LookupRefOrTempId",synthetic:false,types:["mentat_db::internal_types::LookupRefOrTempId"]},{text:"impl Debug for AttributeBuilder",synthetic:false,types:["mentat_db::schema::AttributeBuilder"]},{text:"impl Debug for Partition",synthetic:false,types:["mentat_db::types::Partition"]},{text:"impl Debug for DB",synthetic:false,types:["mentat_db::types::DB"]},{text:"impl Debug for TxReport",synthetic:false,types:["mentat_db::types::TxReport"]},]; +implementors["mentat_ffi"] = [{text:"impl Debug for TransactionChange",synthetic:false,types:["mentat_ffi::TransactionChange"]},{text:"impl Debug for TxChangeList",synthetic:false,types:["mentat_ffi::TxChangeList"]},{text:"impl Debug for ExternOption",synthetic:false,types:["mentat_ffi::ExternOption"]},{text:"impl Debug for ExternResult",synthetic:false,types:["mentat_ffi::ExternResult"]},{text:"impl<'a, 'c> Debug for InProgressTransactResult<'a, 'c>",synthetic:false,types:["mentat_ffi::InProgressTransactResult"]},]; +implementors["mentat_parser_utils"] = [{text:"impl Debug for SpanPosition",synthetic:false,types:["mentat_parser_utils::value_and_span::SpanPosition"]},{text:"impl Debug for ValueParseError",synthetic:false,types:["mentat_parser_utils::ValueParseError"]},]; +implementors["mentat_query_algebrizer"] = [{text:"impl Debug for InvalidBinding",synthetic:false,types:["mentat_query_algebrizer::errors::InvalidBinding"]},{text:"impl Debug for BindingError",synthetic:false,types:["mentat_query_algebrizer::errors::BindingError"]},{text:"impl Debug for AlgebrizerError",synthetic:false,types:["mentat_query_algebrizer::errors::AlgebrizerError"]},{text:"impl Debug for DatomsTable",synthetic:false,types:["mentat_query_algebrizer::types::DatomsTable"]},{text:"impl Debug for ComputedTable",synthetic:false,types:["mentat_query_algebrizer::types::ComputedTable"]},{text:"impl Debug for VariableColumn",synthetic:false,types:["mentat_query_algebrizer::types::VariableColumn"]},{text:"impl Debug for DatomsColumn",synthetic:false,types:["mentat_query_algebrizer::types::DatomsColumn"]},{text:"impl Debug for Column",synthetic:false,types:["mentat_query_algebrizer::types::Column"]},{text:"impl Debug for FulltextColumn",synthetic:false,types:["mentat_query_algebrizer::types::FulltextColumn"]},{text:"impl Debug for SourceAlias",synthetic:false,types:["mentat_query_algebrizer::types::SourceAlias"]},{text:"impl Debug for QualifiedAlias",synthetic:false,types:["mentat_query_algebrizer::types::QualifiedAlias"]},{text:"impl Debug for QueryValue",synthetic:false,types:["mentat_query_algebrizer::types::QueryValue"]},{text:"impl Debug for OrderBy",synthetic:false,types:["mentat_query_algebrizer::types::OrderBy"]},{text:"impl Debug for ColumnConstraintOrAlternation",synthetic:false,types:["mentat_query_algebrizer::types::ColumnConstraintOrAlternation"]},{text:"impl Debug for ColumnAlternation",synthetic:false,types:["mentat_query_algebrizer::types::ColumnAlternation"]},{text:"impl Debug for ColumnIntersection",synthetic:false,types:["mentat_query_algebrizer::types::ColumnIntersection"]},{text:"impl Debug for ColumnConstraint",synthetic:false,types:["mentat_query_algebrizer::types::ColumnConstraint"]},{text:"impl Debug for EmptyBecause",synthetic:false,types:["mentat_query_algebrizer::types::EmptyBecause"]},{text:"impl Debug for FindQuery",synthetic:false,types:["mentat_query_algebrizer::types::FindQuery"]},{text:"impl Debug for ConjoiningClauses",synthetic:false,types:["mentat_query_algebrizer::clauses::ConjoiningClauses"]},{text:"impl Debug for AlgebraicQuery",synthetic:false,types:["mentat_query_algebrizer::AlgebraicQuery"]},]; +implementors["mentat_query_projector"] = [{text:"impl Debug for ProjectorError",synthetic:false,types:["mentat_query_projector::errors::ProjectorError"]},{text:"impl Debug for SimpleAggregationOp",synthetic:false,types:["mentat_query_projector::aggregates::SimpleAggregationOp"]},{text:"impl<T: Debug> Debug for RelResult<T>",synthetic:false,types:["mentat_query_projector::relresult::RelResult"]},{text:"impl Debug for QueryOutput",synthetic:false,types:["mentat_query_projector::QueryOutput"]},{text:"impl Debug for QueryResults",synthetic:false,types:["mentat_query_projector::QueryResults"]},]; +implementors["mentat_query_pull"] = [{text:"impl Debug for PullError",synthetic:false,types:["mentat_query_pull::errors::PullError"]},]; +implementors["mentat_query_sql"] = [{text:"impl Debug for GroupBy",synthetic:false,types:["mentat_query_sql::GroupBy"]},]; +implementors["mentat_sql"] = [{text:"impl Debug for SQLError",synthetic:false,types:["mentat_sql::SQLError"]},]; +implementors["mentat_tolstoy"] = [{text:"impl Debug for TolstoyError",synthetic:false,types:["mentat_tolstoy::errors::TolstoyError"]},{text:"impl Debug for TxPart",synthetic:false,types:["mentat_tolstoy::tx_processor::TxPart"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/fmt/trait.Display.js b/docs/apis/rust/0.7.0/implementors/core/fmt/trait.Display.js new file mode 100644 index 00000000..70741676 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/fmt/trait.Display.js @@ -0,0 +1,20 @@ +(function() {var implementors = {}; +implementors["edn"] = [{text:"impl Display for TempId",synthetic:false,types:["edn::entities::TempId"]},{text:"impl Display for Variable",synthetic:false,types:["edn::query::Variable"]},{text:"impl Display for QueryFunction",synthetic:false,types:["edn::query::QueryFunction"]},{text:"impl Display for FnArg",synthetic:false,types:["edn::query::FnArg"]},{text:"impl Display for PullConcreteAttribute",synthetic:false,types:["edn::query::PullConcreteAttribute"]},{text:"impl Display for NamedPullAttribute",synthetic:false,types:["edn::query::NamedPullAttribute"]},{text:"impl Display for PullAttributeSpec",synthetic:false,types:["edn::query::PullAttributeSpec"]},{text:"impl Display for Element",synthetic:false,types:["edn::query::Element"]},{text:"impl Display for PlainSymbol",synthetic:false,types:["edn::symbols::PlainSymbol"]},{text:"impl Display for NamespacedSymbol",synthetic:false,types:["edn::symbols::NamespacedSymbol"]},{text:"impl Display for Keyword",synthetic:false,types:["edn::symbols::Keyword"]},{text:"impl Display for Value",synthetic:false,types:["edn::types::Value"]},{text:"impl Display for SpannedValue",synthetic:false,types:["edn::types::SpannedValue"]},{text:"impl Display for ValueAndSpan",synthetic:false,types:["edn::types::ValueAndSpan"]},{text:"impl Display for ParseError",synthetic:false,types:["edn::parse::ParseError"]},]; +implementors["mentat"] = [{text:"impl Display for MentatError",synthetic:false,types:["mentat::errors::MentatError"]},]; +implementors["mentat_cli"] = [{text:"impl Display for CliError",synthetic:false,types:["mentat_cli::CliError"]},]; +implementors["mentat_core"] = [{text:"impl Display for ValueType",synthetic:false,types:["mentat_core::types::ValueType"]},]; +implementors["mentat_db"] = [{text:"impl Display for SchemaConstraintViolation",synthetic:false,types:["mentat_db::errors::SchemaConstraintViolation"]},{text:"impl Display for InputError",synthetic:false,types:["mentat_db::errors::InputError"]},{text:"impl Display for DbError",synthetic:false,types:["mentat_db::errors::DbError"]},{text:"impl Display for DbSqlError",synthetic:false,types:["mentat_db::errors::DbSqlError"]},{text:"impl Display for DbSqlErrorKind",synthetic:false,types:["mentat_db::errors::DbSqlErrorKind"]},]; +implementors["mentat_parser_utils"] = [{text:"impl Display for SpanPosition",synthetic:false,types:["mentat_parser_utils::value_and_span::SpanPosition"]},{text:"impl Display for ValueParseError",synthetic:false,types:["mentat_parser_utils::ValueParseError"]},]; +implementors["mentat_query_algebrizer"] = [{text:"impl Display for InvalidBinding",synthetic:false,types:["mentat_query_algebrizer::errors::InvalidBinding"]},{text:"impl Display for BindingError",synthetic:false,types:["mentat_query_algebrizer::errors::BindingError"]},{text:"impl Display for AlgebrizerError",synthetic:false,types:["mentat_query_algebrizer::errors::AlgebrizerError"]},]; +implementors["mentat_query_projector"] = [{text:"impl Display for ProjectorError",synthetic:false,types:["mentat_query_projector::errors::ProjectorError"]},]; +implementors["mentat_query_pull"] = [{text:"impl Display for PullError",synthetic:false,types:["mentat_query_pull::errors::PullError"]},]; +implementors["mentat_sql"] = [{text:"impl Display for SQLError",synthetic:false,types:["mentat_sql::SQLError"]},]; +implementors["mentat_tolstoy"] = [{text:"impl Display for TolstoyError",synthetic:false,types:["mentat_tolstoy::errors::TolstoyError"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/hash/trait.Hash.js b/docs/apis/rust/0.7.0/implementors/core/hash/trait.Hash.js new file mode 100644 index 00000000..a424b392 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/hash/trait.Hash.js @@ -0,0 +1,12 @@ +(function() {var implementors = {}; +implementors["edn"] = [{text:"impl Hash for TempId",synthetic:false,types:["edn::entities::TempId"]},{text:"impl Hash for Entid",synthetic:false,types:["edn::entities::Entid"]},{text:"impl<V: Hash> Hash for LookupRef<V>",synthetic:false,types:["edn::entities::LookupRef"]},{text:"impl Hash for TxFunction",synthetic:false,types:["edn::entities::TxFunction"]},{text:"impl<V: Hash> Hash for ValuePlace<V>",synthetic:false,types:["edn::entities::ValuePlace"]},{text:"impl<V: Hash> Hash for EntityPlace<V>",synthetic:false,types:["edn::entities::EntityPlace"]},{text:"impl Hash for AttributePlace",synthetic:false,types:["edn::entities::AttributePlace"]},{text:"impl Hash for OpType",synthetic:false,types:["edn::entities::OpType"]},{text:"impl<V: Hash> Hash for Entity<V>",synthetic:false,types:["edn::entities::Entity"]},{text:"impl Hash for Variable",synthetic:false,types:["edn::query::Variable"]},{text:"impl Hash for VariableOrPlaceholder",synthetic:false,types:["edn::query::VariableOrPlaceholder"]},{text:"impl Hash for PlainSymbol",synthetic:false,types:["edn::symbols::PlainSymbol"]},{text:"impl Hash for NamespacedSymbol",synthetic:false,types:["edn::symbols::NamespacedSymbol"]},{text:"impl Hash for Keyword",synthetic:false,types:["edn::symbols::Keyword"]},{text:"impl Hash for Value",synthetic:false,types:["edn::types::Value"]},{text:"impl Hash for SpannedValue",synthetic:false,types:["edn::types::SpannedValue"]},{text:"impl Hash for Span",synthetic:false,types:["edn::types::Span"]},{text:"impl Hash for ValueAndSpan",synthetic:false,types:["edn::types::ValueAndSpan"]},]; +implementors["mentat_core"] = [{text:"impl Hash for KnownEntid",synthetic:false,types:["mentat_core::types::KnownEntid"]},{text:"impl Hash for ValueType",synthetic:false,types:["mentat_core::types::ValueType"]},{text:"impl Hash for TypedValue",synthetic:false,types:["mentat_core::types::TypedValue"]},{text:"impl Hash for SQLTypeAffinity",synthetic:false,types:["mentat_core::sql_types::SQLTypeAffinity"]},{text:"impl Hash for Unique",synthetic:false,types:["mentat_core::attribute::Unique"]},{text:"impl<L: Hash, R: Hash> Hash for Either<L, R>",synthetic:false,types:["mentat_core::util::Either"]},{text:"impl Hash for Attribute",synthetic:false,types:["mentat_core::Attribute"]},{text:"impl Hash for Schema",synthetic:false,types:["mentat_core::Schema"]},]; +implementors["mentat_db"] = [{text:"impl Hash for SearchType",synthetic:false,types:["mentat_db::db::SearchType"]},{text:"impl<E: Hash, V: Hash> Hash for Term<E, V>",synthetic:false,types:["mentat_db::internal_types::Term"]},{text:"impl Hash for LookupRefOrTempId",synthetic:false,types:["mentat_db::internal_types::LookupRefOrTempId"]},{text:"impl Hash for AttributeBuilder",synthetic:false,types:["mentat_db::schema::AttributeBuilder"]},{text:"impl Hash for Partition",synthetic:false,types:["mentat_db::types::Partition"]},{text:"impl Hash for DB",synthetic:false,types:["mentat_db::types::DB"]},{text:"impl Hash for TxReport",synthetic:false,types:["mentat_db::types::TxReport"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/iter/iterator/trait.Iterator.js b/docs/apis/rust/0.7.0/implementors/core/iter/iterator/trait.Iterator.js new file mode 100644 index 00000000..bb12ab55 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/iter/iterator/trait.Iterator.js @@ -0,0 +1,12 @@ +(function() {var implementors = {}; +implementors["mentat_db"] = [{text:"impl<'conn, F> Iterator for AevRows<'conn, F> where
    F: FnMut(&Row) -> Aev
",synthetic:false,types:["mentat_db::cache::AevRows"]},]; +implementors["mentat_parser_utils"] = [{text:"impl<'a> Iterator for Iter<'a>",synthetic:false,types:["mentat_parser_utils::value_and_span::Iter"]},]; +implementors["mentat_tolstoy"] = [{text:"impl<'dbtx, 't, T> Iterator for DatomsIterator<'dbtx, 't, T> where
    T: Sized + Iterator<Item = Result<TxPart>> + 't, 
",synthetic:false,types:["mentat_tolstoy::tx_processor::DatomsIterator"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/iter/traits/trait.Extend.js b/docs/apis/rust/0.7.0/implementors/core/iter/traits/trait.Extend.js new file mode 100644 index 00000000..f6e85919 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/iter/traits/trait.Extend.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_core"] = [{text:"impl Extend<ValueType> for ValueTypeSet",synthetic:false,types:["mentat_core::value_type_set::ValueTypeSet"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/iter/traits/trait.FromIterator.js b/docs/apis/rust/0.7.0/implementors/core/iter/traits/trait.FromIterator.js new file mode 100644 index 00000000..40fd33b6 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/iter/traits/trait.FromIterator.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_core"] = [{text:"impl FromIterator<ValueType> for ValueTypeSet",synthetic:false,types:["mentat_core::value_type_set::ValueTypeSet"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/iter/traits/trait.IntoIterator.js b/docs/apis/rust/0.7.0/implementors/core/iter/traits/trait.IntoIterator.js new file mode 100644 index 00000000..e138b4ad --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/iter/traits/trait.IntoIterator.js @@ -0,0 +1,12 @@ +(function() {var implementors = {}; +implementors["mentat_core"] = [{text:"impl IntoIterator for ValueTypeSet",synthetic:false,types:["mentat_core::value_type_set::ValueTypeSet"]},]; +implementors["mentat_query_algebrizer"] = [{text:"impl IntoIterator for ColumnIntersection",synthetic:false,types:["mentat_query_algebrizer::types::ColumnIntersection"]},{text:"impl IntoIterator for ColumnAlternation",synthetic:false,types:["mentat_query_algebrizer::types::ColumnAlternation"]},]; +implementors["mentat_query_projector"] = [{text:"impl<T> IntoIterator for RelResult<T>",synthetic:false,types:["mentat_query_projector::relresult::RelResult"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/marker/trait.Copy.js b/docs/apis/rust/0.7.0/implementors/core/marker/trait.Copy.js new file mode 100644 index 00000000..e0436ebf --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/marker/trait.Copy.js @@ -0,0 +1,17 @@ +(function() {var implementors = {}; +implementors["edn"] = [{text:"impl Copy for OpType",synthetic:false,types:["edn::entities::OpType"]},{text:"impl Copy for Span",synthetic:false,types:["edn::types::Span"]},]; +implementors["mentat"] = [{text:"impl Copy for CacheDirection",synthetic:false,types:["mentat::conn::CacheDirection"]},{text:"impl Copy for CacheAction",synthetic:false,types:["mentat::conn::CacheAction"]},]; +implementors["mentat_core"] = [{text:"impl Copy for KnownEntid",synthetic:false,types:["mentat_core::types::KnownEntid"]},{text:"impl Copy for ValueType",synthetic:false,types:["mentat_core::types::ValueType"]},{text:"impl Copy for ValueTypeSet",synthetic:false,types:["mentat_core::value_type_set::ValueTypeSet"]},{text:"impl Copy for SQLTypeAffinity",synthetic:false,types:["mentat_core::sql_types::SQLTypeAffinity"]},{text:"impl Copy for Unique",synthetic:false,types:["mentat_core::attribute::Unique"]},]; +implementors["mentat_db"] = [{text:"impl Copy for DbSqlErrorKind",synthetic:false,types:["mentat_db::errors::DbSqlErrorKind"]},]; +implementors["mentat_parser_utils"] = [{text:"impl Copy for SpanPosition",synthetic:false,types:["mentat_parser_utils::value_and_span::SpanPosition"]},]; +implementors["mentat_query_algebrizer"] = [{text:"impl Copy for DatomsTable",synthetic:false,types:["mentat_query_algebrizer::types::DatomsTable"]},{text:"impl<'s, 'c> Copy for Known<'s, 'c>",synthetic:false,types:["mentat_query_algebrizer::Known"]},]; +implementors["mentat_query_projector"] = [{text:"impl Copy for SimpleAggregationOp",synthetic:false,types:["mentat_query_projector::aggregates::SimpleAggregationOp"]},]; +implementors["mentat_query_sql"] = [{text:"impl Copy for Op",synthetic:false,types:["mentat_query_sql::Op"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/marker/trait.Send.js b/docs/apis/rust/0.7.0/implementors/core/marker/trait.Send.js new file mode 100644 index 00000000..fa2c3e61 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/marker/trait.Send.js @@ -0,0 +1,23 @@ +(function() {var implementors = {}; +implementors["edn"] = [{text:"impl<V> Send for LookupRef<V> where
    V: Send
",synthetic:true,types:["edn::entities::LookupRef"]},{text:"impl Send for TxFunction",synthetic:true,types:["edn::entities::TxFunction"]},{text:"impl Send for TempId",synthetic:true,types:["edn::entities::TempId"]},{text:"impl Send for Entid",synthetic:true,types:["edn::entities::Entid"]},{text:"impl<V> Send for ValuePlace<V> where
    V: Send
",synthetic:true,types:["edn::entities::ValuePlace"]},{text:"impl<V> Send for EntityPlace<V> where
    V: Send
",synthetic:true,types:["edn::entities::EntityPlace"]},{text:"impl Send for AttributePlace",synthetic:true,types:["edn::entities::AttributePlace"]},{text:"impl Send for OpType",synthetic:true,types:["edn::entities::OpType"]},{text:"impl<V> Send for Entity<V> where
    V: Send
",synthetic:true,types:["edn::entities::Entity"]},{text:"impl !Send for Variable",synthetic:true,types:["edn::query::Variable"]},{text:"impl Send for QueryFunction",synthetic:true,types:["edn::query::QueryFunction"]},{text:"impl !Send for Order",synthetic:true,types:["edn::query::Order"]},{text:"impl !Send for NamedPullAttribute",synthetic:true,types:["edn::query::NamedPullAttribute"]},{text:"impl !Send for Pull",synthetic:true,types:["edn::query::Pull"]},{text:"impl !Send for Aggregate",synthetic:true,types:["edn::query::Aggregate"]},{text:"impl !Send for Pattern",synthetic:true,types:["edn::query::Pattern"]},{text:"impl !Send for Predicate",synthetic:true,types:["edn::query::Predicate"]},{text:"impl !Send for WhereFn",synthetic:true,types:["edn::query::WhereFn"]},{text:"impl !Send for OrJoin",synthetic:true,types:["edn::query::OrJoin"]},{text:"impl !Send for NotJoin",synthetic:true,types:["edn::query::NotJoin"]},{text:"impl !Send for TypeAnnotation",synthetic:true,types:["edn::query::TypeAnnotation"]},{text:"impl !Send for ParsedQuery",synthetic:true,types:["edn::query::ParsedQuery"]},{text:"impl Send for Direction",synthetic:true,types:["edn::query::Direction"]},{text:"impl Send for SrcVar",synthetic:true,types:["edn::query::SrcVar"]},{text:"impl Send for NonIntegerConstant",synthetic:true,types:["edn::query::NonIntegerConstant"]},{text:"impl !Send for FnArg",synthetic:true,types:["edn::query::FnArg"]},{text:"impl !Send for PatternNonValuePlace",synthetic:true,types:["edn::query::PatternNonValuePlace"]},{text:"impl Send for IdentOrEntid",synthetic:true,types:["edn::query::IdentOrEntid"]},{text:"impl !Send for PatternValuePlace",synthetic:true,types:["edn::query::PatternValuePlace"]},{text:"impl !Send for PullConcreteAttribute",synthetic:true,types:["edn::query::PullConcreteAttribute"]},{text:"impl !Send for PullAttributeSpec",synthetic:true,types:["edn::query::PullAttributeSpec"]},{text:"impl !Send for Element",synthetic:true,types:["edn::query::Element"]},{text:"impl !Send for Limit",synthetic:true,types:["edn::query::Limit"]},{text:"impl !Send for FindSpec",synthetic:true,types:["edn::query::FindSpec"]},{text:"impl !Send for VariableOrPlaceholder",synthetic:true,types:["edn::query::VariableOrPlaceholder"]},{text:"impl !Send for Binding",synthetic:true,types:["edn::query::Binding"]},{text:"impl !Send for UnifyVars",synthetic:true,types:["edn::query::UnifyVars"]},{text:"impl !Send for OrWhereClause",synthetic:true,types:["edn::query::OrWhereClause"]},{text:"impl !Send for WhereClause",synthetic:true,types:["edn::query::WhereClause"]},{text:"impl Send for PlainSymbol",synthetic:true,types:["edn::symbols::PlainSymbol"]},{text:"impl Send for NamespacedSymbol",synthetic:true,types:["edn::symbols::NamespacedSymbol"]},{text:"impl Send for Keyword",synthetic:true,types:["edn::symbols::Keyword"]},{text:"impl Send for Span",synthetic:true,types:["edn::types::Span"]},{text:"impl Send for ValueAndSpan",synthetic:true,types:["edn::types::ValueAndSpan"]},{text:"impl Send for Value",synthetic:true,types:["edn::types::Value"]},{text:"impl Send for SpannedValue",synthetic:true,types:["edn::types::SpannedValue"]},{text:"impl Send for ParseError",synthetic:true,types:["edn::parse::ParseError"]},]; +implementors["mentat"] = [{text:"impl Send for MentatError",synthetic:true,types:["mentat::errors::MentatError"]},{text:"impl Send for Metadata",synthetic:true,types:["mentat::conn::Metadata"]},{text:"impl Send for Conn",synthetic:true,types:["mentat::conn::Conn"]},{text:"impl<'a, 'c> !Send for InProgress<'a, 'c>",synthetic:true,types:["mentat::conn::InProgress"]},{text:"impl<'a, 'c> !Send for InProgressRead<'a, 'c>",synthetic:true,types:["mentat::conn::InProgressRead"]},{text:"impl Send for CacheDirection",synthetic:true,types:["mentat::conn::CacheDirection"]},{text:"impl Send for CacheAction",synthetic:true,types:["mentat::conn::CacheAction"]},{text:"impl !Send for TermBuilder",synthetic:true,types:["mentat::entity_builder::TermBuilder"]},{text:"impl<T> !Send for EntityBuilder<T>",synthetic:true,types:["mentat::entity_builder::EntityBuilder"]},{text:"impl<'a, 'c> !Send for InProgressBuilder<'a, 'c>",synthetic:true,types:["mentat::entity_builder::InProgressBuilder"]},{text:"impl Send for QueryPlanStep",synthetic:true,types:["mentat::query::QueryPlanStep"]},{text:"impl<'sqlite> !Send for PreparedQuery<'sqlite>",synthetic:true,types:["mentat::query::PreparedQuery"]},{text:"impl !Send for QueryExplanation",synthetic:true,types:["mentat::query::QueryExplanation"]},{text:"impl<'a> !Send for QueryBuilder<'a>",synthetic:true,types:["mentat::query_builder::QueryBuilder"]},{text:"impl Send for Store",synthetic:true,types:["mentat::store::Store"]},{text:"impl Send for Definition",synthetic:true,types:["mentat::vocabulary::Definition"]},{text:"impl Send for Vocabulary",synthetic:true,types:["mentat::vocabulary::Vocabulary"]},{text:"impl Send for Vocabularies",synthetic:true,types:["mentat::vocabulary::Vocabularies"]},{text:"impl Send for SimpleVocabularySource",synthetic:true,types:["mentat::vocabulary::SimpleVocabularySource"]},{text:"impl<'definition> Send for VocabularyCheck<'definition>",synthetic:true,types:["mentat::vocabulary::VocabularyCheck"]},{text:"impl Send for VocabularyOutcome",synthetic:true,types:["mentat::vocabulary::VocabularyOutcome"]},]; +implementors["mentat_cli"] = [{text:"impl Send for CliError",synthetic:true,types:["mentat_cli::CliError"]},{text:"impl Send for Command",synthetic:true,types:["mentat_cli::command_parser::Command"]},{text:"impl !Send for InputReader",synthetic:true,types:["mentat_cli::input::InputReader"]},{text:"impl Send for InputResult",synthetic:true,types:["mentat_cli::input::InputResult"]},{text:"impl Send for Repl",synthetic:true,types:["mentat_cli::repl::Repl"]},]; +implementors["mentat_core"] = [{text:"impl Send for KnownEntid",synthetic:true,types:["mentat_core::types::KnownEntid"]},{text:"impl Send for StructuredMap",synthetic:true,types:["mentat_core::types::StructuredMap"]},{text:"impl Send for ValueTypeSet",synthetic:true,types:["mentat_core::value_type_set::ValueTypeSet"]},{text:"impl Send for Attribute",synthetic:true,types:["mentat_core::Attribute"]},{text:"impl Send for Schema",synthetic:true,types:["mentat_core::Schema"]},{text:"impl Send for Binding",synthetic:true,types:["mentat_core::types::Binding"]},{text:"impl Send for TypedValue",synthetic:true,types:["mentat_core::types::TypedValue"]},{text:"impl Send for ValueType",synthetic:true,types:["mentat_core::types::ValueType"]},{text:"impl Send for SQLTypeAffinity",synthetic:true,types:["mentat_core::sql_types::SQLTypeAffinity"]},{text:"impl Send for AttributeBitFlags",synthetic:true,types:["mentat_core::AttributeBitFlags"]},{text:"impl Send for DB_ADD",synthetic:true,types:["mentat_core::values::DB_ADD"]},{text:"impl Send for DB_ALTER_ATTRIBUTE",synthetic:true,types:["mentat_core::values::DB_ALTER_ATTRIBUTE"]},{text:"impl Send for DB_CARDINALITY",synthetic:true,types:["mentat_core::values::DB_CARDINALITY"]},{text:"impl Send for DB_CARDINALITY_MANY",synthetic:true,types:["mentat_core::values::DB_CARDINALITY_MANY"]},{text:"impl Send for DB_CARDINALITY_ONE",synthetic:true,types:["mentat_core::values::DB_CARDINALITY_ONE"]},{text:"impl Send for DB_FULLTEXT",synthetic:true,types:["mentat_core::values::DB_FULLTEXT"]},{text:"impl Send for DB_IDENT",synthetic:true,types:["mentat_core::values::DB_IDENT"]},{text:"impl Send for DB_INDEX",synthetic:true,types:["mentat_core::values::DB_INDEX"]},{text:"impl Send for DB_INSTALL_ATTRIBUTE",synthetic:true,types:["mentat_core::values::DB_INSTALL_ATTRIBUTE"]},{text:"impl Send for DB_IS_COMPONENT",synthetic:true,types:["mentat_core::values::DB_IS_COMPONENT"]},{text:"impl Send for DB_NO_HISTORY",synthetic:true,types:["mentat_core::values::DB_NO_HISTORY"]},{text:"impl Send for DB_PART_DB",synthetic:true,types:["mentat_core::values::DB_PART_DB"]},{text:"impl Send for DB_RETRACT",synthetic:true,types:["mentat_core::values::DB_RETRACT"]},{text:"impl Send for DB_TYPE_BOOLEAN",synthetic:true,types:["mentat_core::values::DB_TYPE_BOOLEAN"]},{text:"impl Send for DB_TYPE_DOUBLE",synthetic:true,types:["mentat_core::values::DB_TYPE_DOUBLE"]},{text:"impl Send for DB_TYPE_INSTANT",synthetic:true,types:["mentat_core::values::DB_TYPE_INSTANT"]},{text:"impl Send for DB_TYPE_KEYWORD",synthetic:true,types:["mentat_core::values::DB_TYPE_KEYWORD"]},{text:"impl Send for DB_TYPE_LONG",synthetic:true,types:["mentat_core::values::DB_TYPE_LONG"]},{text:"impl Send for DB_TYPE_REF",synthetic:true,types:["mentat_core::values::DB_TYPE_REF"]},{text:"impl Send for DB_TYPE_STRING",synthetic:true,types:["mentat_core::values::DB_TYPE_STRING"]},{text:"impl Send for DB_TYPE_URI",synthetic:true,types:["mentat_core::values::DB_TYPE_URI"]},{text:"impl Send for DB_TYPE_UUID",synthetic:true,types:["mentat_core::values::DB_TYPE_UUID"]},{text:"impl Send for DB_UNIQUE",synthetic:true,types:["mentat_core::values::DB_UNIQUE"]},{text:"impl Send for DB_UNIQUE_IDENTITY",synthetic:true,types:["mentat_core::values::DB_UNIQUE_IDENTITY"]},{text:"impl Send for DB_UNIQUE_VALUE",synthetic:true,types:["mentat_core::values::DB_UNIQUE_VALUE"]},{text:"impl Send for DB_VALUE_TYPE",synthetic:true,types:["mentat_core::values::DB_VALUE_TYPE"]},{text:"impl Send for Unique",synthetic:true,types:["mentat_core::attribute::Unique"]},{text:"impl<T> !Send for InternSet<T>",synthetic:true,types:["mentat_core::intern_set::InternSet"]},{text:"impl !Send for RcCounter",synthetic:true,types:["mentat_core::counter::RcCounter"]},{text:"impl<L, R> Send for Either<L, R> where
    L: Send,
    R: Send
",synthetic:true,types:["mentat_core::util::Either"]},]; +implementors["mentat_db"] = [{text:"impl Send for AttributeBuilder",synthetic:true,types:["mentat_db::schema::AttributeBuilder"]},{text:"impl Send for DbSqlError",synthetic:true,types:["mentat_db::errors::DbSqlError"]},{text:"impl Send for CardinalityConflict",synthetic:true,types:["mentat_db::errors::CardinalityConflict"]},{text:"impl Send for SchemaConstraintViolation",synthetic:true,types:["mentat_db::errors::SchemaConstraintViolation"]},{text:"impl Send for InputError",synthetic:true,types:["mentat_db::errors::InputError"]},{text:"impl Send for DbError",synthetic:true,types:["mentat_db::errors::DbError"]},{text:"impl Send for DbSqlErrorKind",synthetic:true,types:["mentat_db::errors::DbSqlErrorKind"]},{text:"impl Send for AevFactory",synthetic:true,types:["mentat_db::cache::AevFactory"]},{text:"impl<'conn, F> !Send for AevRows<'conn, F>",synthetic:true,types:["mentat_db::cache::AevRows"]},{text:"impl Send for AttributeCaches",synthetic:true,types:["mentat_db::cache::AttributeCaches"]},{text:"impl Send for SQLiteAttributeCache",synthetic:true,types:["mentat_db::cache::SQLiteAttributeCache"]},{text:"impl Send for InProgressSQLiteAttributeCache",synthetic:true,types:["mentat_db::cache::InProgressSQLiteAttributeCache"]},{text:"impl<'a> Send for InProgressCacheTransactWatcher<'a>",synthetic:true,types:["mentat_db::cache::InProgressCacheTransactWatcher"]},{text:"impl Send for AttributeSpec",synthetic:true,types:["mentat_db::cache::AttributeSpec"]},{text:"impl Send for SearchType",synthetic:true,types:["mentat_db::db::SearchType"]},{text:"impl Send for IDENTS_SQL_LIST",synthetic:true,types:["mentat_db::entids::IDENTS_SQL_LIST"]},{text:"impl Send for SCHEMA_SQL_LIST",synthetic:true,types:["mentat_db::entids::SCHEMA_SQL_LIST"]},{text:"impl Send for METADATA_SQL_LIST",synthetic:true,types:["mentat_db::entids::METADATA_SQL_LIST"]},{text:"impl<E, V> Send for Term<E, V> where
    E: Send,
    V: Send
",synthetic:true,types:["mentat_db::internal_types::Term"]},{text:"impl !Send for LookupRefOrTempId",synthetic:true,types:["mentat_db::internal_types::LookupRefOrTempId"]},{text:"impl Send for TxObserver",synthetic:true,types:["mentat_db::tx_observer::TxObserver"]},{text:"impl Send for TxCommand",synthetic:true,types:["mentat_db::tx_observer::TxCommand"]},{text:"impl Send for TxObservationService",synthetic:true,types:["mentat_db::tx_observer::TxObservationService"]},{text:"impl Send for InProgressObserverTransactWatcher",synthetic:true,types:["mentat_db::tx_observer::InProgressObserverTransactWatcher"]},{text:"impl Send for Partition",synthetic:true,types:["mentat_db::types::Partition"]},{text:"impl Send for DB",synthetic:true,types:["mentat_db::types::DB"]},{text:"impl Send for TxReport",synthetic:true,types:["mentat_db::types::TxReport"]},]; +implementors["mentat_ffi"] = [{text:"impl Send for TransactionChange",synthetic:true,types:["mentat_ffi::TransactionChange"]},{text:"impl Send for TxChangeList",synthetic:true,types:["mentat_ffi::TxChangeList"]},{text:"impl !Send for ExternOption",synthetic:true,types:["mentat_ffi::ExternOption"]},{text:"impl !Send for ExternResult",synthetic:true,types:["mentat_ffi::ExternResult"]},{text:"impl<'a, 'c> !Send for InProgressTransactResult<'a, 'c>",synthetic:true,types:["mentat_ffi::InProgressTransactResult"]},{text:"impl Send for LogLevel",synthetic:true,types:["mentat_ffi::android::LogLevel"]},]; +implementors["mentat_parser_utils"] = [{text:"impl Send for ValueParseError",synthetic:true,types:["mentat_parser_utils::ValueParseError"]},{text:"impl<T> Send for KeywordMapParser<T> where
    T: Send
",synthetic:true,types:["mentat_parser_utils::macros::KeywordMapParser"]},{text:"impl Send for SpanPosition",synthetic:true,types:["mentat_parser_utils::value_and_span::SpanPosition"]},{text:"impl<'a> Send for Stream<'a>",synthetic:true,types:["mentat_parser_utils::value_and_span::Stream"]},{text:"impl<P, N> Send for OfExactly<P, N> where
    N: Send,
    P: Send
",synthetic:true,types:["mentat_parser_utils::value_and_span::OfExactly"]},{text:"impl<'a> Send for Iter<'a>",synthetic:true,types:["mentat_parser_utils::value_and_span::Iter"]},]; +implementors["mentat_query_algebrizer"] = [{text:"impl Send for InvalidBinding",synthetic:true,types:["mentat_query_algebrizer::errors::InvalidBinding"]},{text:"impl !Send for QueryInputs",synthetic:true,types:["mentat_query_algebrizer::clauses::inputs::QueryInputs"]},{text:"impl !Send for FindQuery",synthetic:true,types:["mentat_query_algebrizer::types::FindQuery"]},{text:"impl<'s, 'c> !Send for Known<'s, 'c>",synthetic:true,types:["mentat_query_algebrizer::Known"]},{text:"impl !Send for AlgebraicQuery",synthetic:true,types:["mentat_query_algebrizer::AlgebraicQuery"]},{text:"impl !Send for ConjoiningClauses",synthetic:true,types:["mentat_query_algebrizer::clauses::ConjoiningClauses"]},{text:"impl !Send for ColumnAlternation",synthetic:true,types:["mentat_query_algebrizer::types::ColumnAlternation"]},{text:"impl !Send for ColumnIntersection",synthetic:true,types:["mentat_query_algebrizer::types::ColumnIntersection"]},{text:"impl !Send for OrderBy",synthetic:true,types:["mentat_query_algebrizer::types::OrderBy"]},{text:"impl !Send for QualifiedAlias",synthetic:true,types:["mentat_query_algebrizer::types::QualifiedAlias"]},{text:"impl Send for SourceAlias",synthetic:true,types:["mentat_query_algebrizer::types::SourceAlias"]},{text:"impl Send for AlgebrizerError",synthetic:true,types:["mentat_query_algebrizer::errors::AlgebrizerError"]},{text:"impl Send for BindingError",synthetic:true,types:["mentat_query_algebrizer::errors::BindingError"]},{text:"impl !Send for EmptyBecause",synthetic:true,types:["mentat_query_algebrizer::types::EmptyBecause"]},{text:"impl !Send for Column",synthetic:true,types:["mentat_query_algebrizer::types::Column"]},{text:"impl !Send for ColumnConstraint",synthetic:true,types:["mentat_query_algebrizer::types::ColumnConstraint"]},{text:"impl !Send for ColumnConstraintOrAlternation",synthetic:true,types:["mentat_query_algebrizer::types::ColumnConstraintOrAlternation"]},{text:"impl !Send for ComputedTable",synthetic:true,types:["mentat_query_algebrizer::types::ComputedTable"]},{text:"impl Send for DatomsColumn",synthetic:true,types:["mentat_query_algebrizer::types::DatomsColumn"]},{text:"impl Send for DatomsTable",synthetic:true,types:["mentat_query_algebrizer::types::DatomsTable"]},{text:"impl Send for FulltextColumn",synthetic:true,types:["mentat_query_algebrizer::types::FulltextColumn"]},{text:"impl !Send for QueryValue",synthetic:true,types:["mentat_query_algebrizer::types::QueryValue"]},{text:"impl !Send for VariableColumn",synthetic:true,types:["mentat_query_algebrizer::types::VariableColumn"]},]; +implementors["mentat_query_projector"] = [{text:"impl !Send for ConstantProjector",synthetic:true,types:["mentat_query_projector::projectors::constant::ConstantProjector"]},{text:"impl<T> Send for RelResult<T> where
    T: Send
",synthetic:true,types:["mentat_query_projector::relresult::RelResult"]},{text:"impl !Send for QueryOutput",synthetic:true,types:["mentat_query_projector::QueryOutput"]},{text:"impl !Send for CombinedProjection",synthetic:true,types:["mentat_query_projector::CombinedProjection"]},{text:"impl Send for SimpleAggregationOp",synthetic:true,types:["mentat_query_projector::aggregates::SimpleAggregationOp"]},{text:"impl Send for QueryResults",synthetic:true,types:["mentat_query_projector::QueryResults"]},{text:"impl Send for ProjectorError",synthetic:true,types:["mentat_query_projector::errors::ProjectorError"]},]; +implementors["mentat_query_pull"] = [{text:"impl Send for Puller",synthetic:true,types:["mentat_query_pull::Puller"]},{text:"impl Send for PullError",synthetic:true,types:["mentat_query_pull::errors::PullError"]},]; +implementors["mentat_query_sql"] = [{text:"impl !Send for ProjectedColumn",synthetic:true,types:["mentat_query_sql::ProjectedColumn"]},{text:"impl Send for Op",synthetic:true,types:["mentat_query_sql::Op"]},{text:"impl !Send for TableList",synthetic:true,types:["mentat_query_sql::TableList"]},{text:"impl !Send for Join",synthetic:true,types:["mentat_query_sql::Join"]},{text:"impl !Send for SelectQuery",synthetic:true,types:["mentat_query_sql::SelectQuery"]},{text:"impl !Send for ColumnOrExpression",synthetic:true,types:["mentat_query_sql::ColumnOrExpression"]},{text:"impl !Send for Expression",synthetic:true,types:["mentat_query_sql::Expression"]},{text:"impl !Send for Projection",synthetic:true,types:["mentat_query_sql::Projection"]},{text:"impl !Send for GroupBy",synthetic:true,types:["mentat_query_sql::GroupBy"]},{text:"impl !Send for Constraint",synthetic:true,types:["mentat_query_sql::Constraint"]},{text:"impl !Send for TableOrSubquery",synthetic:true,types:["mentat_query_sql::TableOrSubquery"]},{text:"impl !Send for Values",synthetic:true,types:["mentat_query_sql::Values"]},{text:"impl !Send for FromClause",synthetic:true,types:["mentat_query_sql::FromClause"]},]; +implementors["mentat_query_translator"] = [{text:"impl !Send for ProjectedSelect",synthetic:true,types:["mentat_query_translator::translate::ProjectedSelect"]},]; +implementors["mentat_sql"] = [{text:"impl !Send for SQLQuery",synthetic:true,types:["mentat_sql::SQLQuery"]},{text:"impl !Send for SQLiteQueryBuilder",synthetic:true,types:["mentat_sql::SQLiteQueryBuilder"]},{text:"impl Send for SQLError",synthetic:true,types:["mentat_sql::SQLError"]},]; +implementors["mentat_tolstoy"] = [{text:"impl Send for TolstoyError",synthetic:true,types:["mentat_tolstoy::errors::TolstoyError"]},{text:"impl Send for SyncMetadataClient",synthetic:true,types:["mentat_tolstoy::metadata::SyncMetadataClient"]},{text:"impl Send for TxPart",synthetic:true,types:["mentat_tolstoy::tx_processor::TxPart"]},{text:"impl Send for Processor",synthetic:true,types:["mentat_tolstoy::tx_processor::Processor"]},{text:"impl<'dbtx, 't, T> Send for DatomsIterator<'dbtx, 't, T> where
    T: Send
",synthetic:true,types:["mentat_tolstoy::tx_processor::DatomsIterator"]},{text:"impl Send for Syncer",synthetic:true,types:["mentat_tolstoy::syncer::Syncer"]},{text:"impl Send for TxMapper",synthetic:true,types:["mentat_tolstoy::tx_mapper::TxMapper"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/marker/trait.Sync.js b/docs/apis/rust/0.7.0/implementors/core/marker/trait.Sync.js new file mode 100644 index 00000000..c0c07420 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/marker/trait.Sync.js @@ -0,0 +1,23 @@ +(function() {var implementors = {}; +implementors["edn"] = [{text:"impl<V> Sync for LookupRef<V> where
    V: Sync
",synthetic:true,types:["edn::entities::LookupRef"]},{text:"impl Sync for TxFunction",synthetic:true,types:["edn::entities::TxFunction"]},{text:"impl Sync for TempId",synthetic:true,types:["edn::entities::TempId"]},{text:"impl Sync for Entid",synthetic:true,types:["edn::entities::Entid"]},{text:"impl<V> Sync for ValuePlace<V> where
    V: Sync
",synthetic:true,types:["edn::entities::ValuePlace"]},{text:"impl<V> Sync for EntityPlace<V> where
    V: Sync
",synthetic:true,types:["edn::entities::EntityPlace"]},{text:"impl Sync for AttributePlace",synthetic:true,types:["edn::entities::AttributePlace"]},{text:"impl Sync for OpType",synthetic:true,types:["edn::entities::OpType"]},{text:"impl<V> Sync for Entity<V> where
    V: Sync
",synthetic:true,types:["edn::entities::Entity"]},{text:"impl !Sync for Variable",synthetic:true,types:["edn::query::Variable"]},{text:"impl Sync for QueryFunction",synthetic:true,types:["edn::query::QueryFunction"]},{text:"impl !Sync for Order",synthetic:true,types:["edn::query::Order"]},{text:"impl !Sync for NamedPullAttribute",synthetic:true,types:["edn::query::NamedPullAttribute"]},{text:"impl !Sync for Pull",synthetic:true,types:["edn::query::Pull"]},{text:"impl !Sync for Aggregate",synthetic:true,types:["edn::query::Aggregate"]},{text:"impl !Sync for Pattern",synthetic:true,types:["edn::query::Pattern"]},{text:"impl !Sync for Predicate",synthetic:true,types:["edn::query::Predicate"]},{text:"impl !Sync for WhereFn",synthetic:true,types:["edn::query::WhereFn"]},{text:"impl !Sync for OrJoin",synthetic:true,types:["edn::query::OrJoin"]},{text:"impl !Sync for NotJoin",synthetic:true,types:["edn::query::NotJoin"]},{text:"impl !Sync for TypeAnnotation",synthetic:true,types:["edn::query::TypeAnnotation"]},{text:"impl !Sync for ParsedQuery",synthetic:true,types:["edn::query::ParsedQuery"]},{text:"impl Sync for Direction",synthetic:true,types:["edn::query::Direction"]},{text:"impl Sync for SrcVar",synthetic:true,types:["edn::query::SrcVar"]},{text:"impl Sync for NonIntegerConstant",synthetic:true,types:["edn::query::NonIntegerConstant"]},{text:"impl !Sync for FnArg",synthetic:true,types:["edn::query::FnArg"]},{text:"impl !Sync for PatternNonValuePlace",synthetic:true,types:["edn::query::PatternNonValuePlace"]},{text:"impl Sync for IdentOrEntid",synthetic:true,types:["edn::query::IdentOrEntid"]},{text:"impl !Sync for PatternValuePlace",synthetic:true,types:["edn::query::PatternValuePlace"]},{text:"impl !Sync for PullConcreteAttribute",synthetic:true,types:["edn::query::PullConcreteAttribute"]},{text:"impl !Sync for PullAttributeSpec",synthetic:true,types:["edn::query::PullAttributeSpec"]},{text:"impl !Sync for Element",synthetic:true,types:["edn::query::Element"]},{text:"impl !Sync for Limit",synthetic:true,types:["edn::query::Limit"]},{text:"impl !Sync for FindSpec",synthetic:true,types:["edn::query::FindSpec"]},{text:"impl !Sync for VariableOrPlaceholder",synthetic:true,types:["edn::query::VariableOrPlaceholder"]},{text:"impl !Sync for Binding",synthetic:true,types:["edn::query::Binding"]},{text:"impl !Sync for UnifyVars",synthetic:true,types:["edn::query::UnifyVars"]},{text:"impl !Sync for OrWhereClause",synthetic:true,types:["edn::query::OrWhereClause"]},{text:"impl !Sync for WhereClause",synthetic:true,types:["edn::query::WhereClause"]},{text:"impl Sync for PlainSymbol",synthetic:true,types:["edn::symbols::PlainSymbol"]},{text:"impl Sync for NamespacedSymbol",synthetic:true,types:["edn::symbols::NamespacedSymbol"]},{text:"impl Sync for Keyword",synthetic:true,types:["edn::symbols::Keyword"]},{text:"impl Sync for Span",synthetic:true,types:["edn::types::Span"]},{text:"impl Sync for ValueAndSpan",synthetic:true,types:["edn::types::ValueAndSpan"]},{text:"impl Sync for Value",synthetic:true,types:["edn::types::Value"]},{text:"impl Sync for SpannedValue",synthetic:true,types:["edn::types::SpannedValue"]},{text:"impl Sync for ParseError",synthetic:true,types:["edn::parse::ParseError"]},]; +implementors["mentat"] = [{text:"impl Sync for MentatError",synthetic:true,types:["mentat::errors::MentatError"]},{text:"impl Sync for Metadata",synthetic:true,types:["mentat::conn::Metadata"]},{text:"impl Sync for Conn",synthetic:true,types:["mentat::conn::Conn"]},{text:"impl<'a, 'c> !Sync for InProgress<'a, 'c>",synthetic:true,types:["mentat::conn::InProgress"]},{text:"impl<'a, 'c> !Sync for InProgressRead<'a, 'c>",synthetic:true,types:["mentat::conn::InProgressRead"]},{text:"impl Sync for CacheDirection",synthetic:true,types:["mentat::conn::CacheDirection"]},{text:"impl Sync for CacheAction",synthetic:true,types:["mentat::conn::CacheAction"]},{text:"impl !Sync for TermBuilder",synthetic:true,types:["mentat::entity_builder::TermBuilder"]},{text:"impl<T> !Sync for EntityBuilder<T>",synthetic:true,types:["mentat::entity_builder::EntityBuilder"]},{text:"impl<'a, 'c> !Sync for InProgressBuilder<'a, 'c>",synthetic:true,types:["mentat::entity_builder::InProgressBuilder"]},{text:"impl Sync for QueryPlanStep",synthetic:true,types:["mentat::query::QueryPlanStep"]},{text:"impl<'sqlite> !Sync for PreparedQuery<'sqlite>",synthetic:true,types:["mentat::query::PreparedQuery"]},{text:"impl !Sync for QueryExplanation",synthetic:true,types:["mentat::query::QueryExplanation"]},{text:"impl<'a> !Sync for QueryBuilder<'a>",synthetic:true,types:["mentat::query_builder::QueryBuilder"]},{text:"impl !Sync for Store",synthetic:true,types:["mentat::store::Store"]},{text:"impl Sync for Definition",synthetic:true,types:["mentat::vocabulary::Definition"]},{text:"impl Sync for Vocabulary",synthetic:true,types:["mentat::vocabulary::Vocabulary"]},{text:"impl Sync for Vocabularies",synthetic:true,types:["mentat::vocabulary::Vocabularies"]},{text:"impl Sync for SimpleVocabularySource",synthetic:true,types:["mentat::vocabulary::SimpleVocabularySource"]},{text:"impl<'definition> Sync for VocabularyCheck<'definition>",synthetic:true,types:["mentat::vocabulary::VocabularyCheck"]},{text:"impl Sync for VocabularyOutcome",synthetic:true,types:["mentat::vocabulary::VocabularyOutcome"]},]; +implementors["mentat_cli"] = [{text:"impl Sync for CliError",synthetic:true,types:["mentat_cli::CliError"]},{text:"impl Sync for Command",synthetic:true,types:["mentat_cli::command_parser::Command"]},{text:"impl !Sync for InputReader",synthetic:true,types:["mentat_cli::input::InputReader"]},{text:"impl Sync for InputResult",synthetic:true,types:["mentat_cli::input::InputResult"]},{text:"impl !Sync for Repl",synthetic:true,types:["mentat_cli::repl::Repl"]},]; +implementors["mentat_core"] = [{text:"impl Sync for KnownEntid",synthetic:true,types:["mentat_core::types::KnownEntid"]},{text:"impl Sync for StructuredMap",synthetic:true,types:["mentat_core::types::StructuredMap"]},{text:"impl Sync for ValueTypeSet",synthetic:true,types:["mentat_core::value_type_set::ValueTypeSet"]},{text:"impl Sync for Attribute",synthetic:true,types:["mentat_core::Attribute"]},{text:"impl Sync for Schema",synthetic:true,types:["mentat_core::Schema"]},{text:"impl Sync for Binding",synthetic:true,types:["mentat_core::types::Binding"]},{text:"impl Sync for TypedValue",synthetic:true,types:["mentat_core::types::TypedValue"]},{text:"impl Sync for ValueType",synthetic:true,types:["mentat_core::types::ValueType"]},{text:"impl Sync for SQLTypeAffinity",synthetic:true,types:["mentat_core::sql_types::SQLTypeAffinity"]},{text:"impl Sync for AttributeBitFlags",synthetic:true,types:["mentat_core::AttributeBitFlags"]},{text:"impl Sync for DB_ADD",synthetic:true,types:["mentat_core::values::DB_ADD"]},{text:"impl Sync for DB_ALTER_ATTRIBUTE",synthetic:true,types:["mentat_core::values::DB_ALTER_ATTRIBUTE"]},{text:"impl Sync for DB_CARDINALITY",synthetic:true,types:["mentat_core::values::DB_CARDINALITY"]},{text:"impl Sync for DB_CARDINALITY_MANY",synthetic:true,types:["mentat_core::values::DB_CARDINALITY_MANY"]},{text:"impl Sync for DB_CARDINALITY_ONE",synthetic:true,types:["mentat_core::values::DB_CARDINALITY_ONE"]},{text:"impl Sync for DB_FULLTEXT",synthetic:true,types:["mentat_core::values::DB_FULLTEXT"]},{text:"impl Sync for DB_IDENT",synthetic:true,types:["mentat_core::values::DB_IDENT"]},{text:"impl Sync for DB_INDEX",synthetic:true,types:["mentat_core::values::DB_INDEX"]},{text:"impl Sync for DB_INSTALL_ATTRIBUTE",synthetic:true,types:["mentat_core::values::DB_INSTALL_ATTRIBUTE"]},{text:"impl Sync for DB_IS_COMPONENT",synthetic:true,types:["mentat_core::values::DB_IS_COMPONENT"]},{text:"impl Sync for DB_NO_HISTORY",synthetic:true,types:["mentat_core::values::DB_NO_HISTORY"]},{text:"impl Sync for DB_PART_DB",synthetic:true,types:["mentat_core::values::DB_PART_DB"]},{text:"impl Sync for DB_RETRACT",synthetic:true,types:["mentat_core::values::DB_RETRACT"]},{text:"impl Sync for DB_TYPE_BOOLEAN",synthetic:true,types:["mentat_core::values::DB_TYPE_BOOLEAN"]},{text:"impl Sync for DB_TYPE_DOUBLE",synthetic:true,types:["mentat_core::values::DB_TYPE_DOUBLE"]},{text:"impl Sync for DB_TYPE_INSTANT",synthetic:true,types:["mentat_core::values::DB_TYPE_INSTANT"]},{text:"impl Sync for DB_TYPE_KEYWORD",synthetic:true,types:["mentat_core::values::DB_TYPE_KEYWORD"]},{text:"impl Sync for DB_TYPE_LONG",synthetic:true,types:["mentat_core::values::DB_TYPE_LONG"]},{text:"impl Sync for DB_TYPE_REF",synthetic:true,types:["mentat_core::values::DB_TYPE_REF"]},{text:"impl Sync for DB_TYPE_STRING",synthetic:true,types:["mentat_core::values::DB_TYPE_STRING"]},{text:"impl Sync for DB_TYPE_URI",synthetic:true,types:["mentat_core::values::DB_TYPE_URI"]},{text:"impl Sync for DB_TYPE_UUID",synthetic:true,types:["mentat_core::values::DB_TYPE_UUID"]},{text:"impl Sync for DB_UNIQUE",synthetic:true,types:["mentat_core::values::DB_UNIQUE"]},{text:"impl Sync for DB_UNIQUE_IDENTITY",synthetic:true,types:["mentat_core::values::DB_UNIQUE_IDENTITY"]},{text:"impl Sync for DB_UNIQUE_VALUE",synthetic:true,types:["mentat_core::values::DB_UNIQUE_VALUE"]},{text:"impl Sync for DB_VALUE_TYPE",synthetic:true,types:["mentat_core::values::DB_VALUE_TYPE"]},{text:"impl Sync for Unique",synthetic:true,types:["mentat_core::attribute::Unique"]},{text:"impl<T> !Sync for InternSet<T>",synthetic:true,types:["mentat_core::intern_set::InternSet"]},{text:"impl !Sync for RcCounter",synthetic:true,types:["mentat_core::counter::RcCounter"]},{text:"impl<L, R> Sync for Either<L, R> where
    L: Sync,
    R: Sync
",synthetic:true,types:["mentat_core::util::Either"]},]; +implementors["mentat_db"] = [{text:"impl Sync for AttributeBuilder",synthetic:true,types:["mentat_db::schema::AttributeBuilder"]},{text:"impl Sync for DbSqlError",synthetic:true,types:["mentat_db::errors::DbSqlError"]},{text:"impl Sync for CardinalityConflict",synthetic:true,types:["mentat_db::errors::CardinalityConflict"]},{text:"impl Sync for SchemaConstraintViolation",synthetic:true,types:["mentat_db::errors::SchemaConstraintViolation"]},{text:"impl Sync for InputError",synthetic:true,types:["mentat_db::errors::InputError"]},{text:"impl Sync for DbError",synthetic:true,types:["mentat_db::errors::DbError"]},{text:"impl Sync for DbSqlErrorKind",synthetic:true,types:["mentat_db::errors::DbSqlErrorKind"]},{text:"impl Sync for AevFactory",synthetic:true,types:["mentat_db::cache::AevFactory"]},{text:"impl<'conn, F> !Sync for AevRows<'conn, F>",synthetic:true,types:["mentat_db::cache::AevRows"]},{text:"impl Sync for AttributeCaches",synthetic:true,types:["mentat_db::cache::AttributeCaches"]},{text:"impl Sync for SQLiteAttributeCache",synthetic:true,types:["mentat_db::cache::SQLiteAttributeCache"]},{text:"impl Sync for InProgressSQLiteAttributeCache",synthetic:true,types:["mentat_db::cache::InProgressSQLiteAttributeCache"]},{text:"impl<'a> Sync for InProgressCacheTransactWatcher<'a>",synthetic:true,types:["mentat_db::cache::InProgressCacheTransactWatcher"]},{text:"impl Sync for AttributeSpec",synthetic:true,types:["mentat_db::cache::AttributeSpec"]},{text:"impl Sync for SearchType",synthetic:true,types:["mentat_db::db::SearchType"]},{text:"impl Sync for IDENTS_SQL_LIST",synthetic:true,types:["mentat_db::entids::IDENTS_SQL_LIST"]},{text:"impl Sync for SCHEMA_SQL_LIST",synthetic:true,types:["mentat_db::entids::SCHEMA_SQL_LIST"]},{text:"impl Sync for METADATA_SQL_LIST",synthetic:true,types:["mentat_db::entids::METADATA_SQL_LIST"]},{text:"impl<E, V> Sync for Term<E, V> where
    E: Sync,
    V: Sync
",synthetic:true,types:["mentat_db::internal_types::Term"]},{text:"impl !Sync for LookupRefOrTempId",synthetic:true,types:["mentat_db::internal_types::LookupRefOrTempId"]},{text:"impl Sync for TxObserver",synthetic:true,types:["mentat_db::tx_observer::TxObserver"]},{text:"impl Sync for TxCommand",synthetic:true,types:["mentat_db::tx_observer::TxCommand"]},{text:"impl !Sync for TxObservationService",synthetic:true,types:["mentat_db::tx_observer::TxObservationService"]},{text:"impl Sync for InProgressObserverTransactWatcher",synthetic:true,types:["mentat_db::tx_observer::InProgressObserverTransactWatcher"]},{text:"impl Sync for Partition",synthetic:true,types:["mentat_db::types::Partition"]},{text:"impl Sync for DB",synthetic:true,types:["mentat_db::types::DB"]},{text:"impl Sync for TxReport",synthetic:true,types:["mentat_db::types::TxReport"]},]; +implementors["mentat_ffi"] = [{text:"impl Sync for TransactionChange",synthetic:true,types:["mentat_ffi::TransactionChange"]},{text:"impl Sync for TxChangeList",synthetic:true,types:["mentat_ffi::TxChangeList"]},{text:"impl !Sync for ExternOption",synthetic:true,types:["mentat_ffi::ExternOption"]},{text:"impl !Sync for ExternResult",synthetic:true,types:["mentat_ffi::ExternResult"]},{text:"impl<'a, 'c> !Sync for InProgressTransactResult<'a, 'c>",synthetic:true,types:["mentat_ffi::InProgressTransactResult"]},{text:"impl Sync for LogLevel",synthetic:true,types:["mentat_ffi::android::LogLevel"]},]; +implementors["mentat_parser_utils"] = [{text:"impl Sync for ValueParseError",synthetic:true,types:["mentat_parser_utils::ValueParseError"]},{text:"impl<T> Sync for KeywordMapParser<T> where
    T: Sync
",synthetic:true,types:["mentat_parser_utils::macros::KeywordMapParser"]},{text:"impl Sync for SpanPosition",synthetic:true,types:["mentat_parser_utils::value_and_span::SpanPosition"]},{text:"impl<'a> Sync for Stream<'a>",synthetic:true,types:["mentat_parser_utils::value_and_span::Stream"]},{text:"impl<P, N> Sync for OfExactly<P, N> where
    N: Sync,
    P: Sync
",synthetic:true,types:["mentat_parser_utils::value_and_span::OfExactly"]},{text:"impl<'a> Sync for Iter<'a>",synthetic:true,types:["mentat_parser_utils::value_and_span::Iter"]},]; +implementors["mentat_query_algebrizer"] = [{text:"impl Sync for InvalidBinding",synthetic:true,types:["mentat_query_algebrizer::errors::InvalidBinding"]},{text:"impl !Sync for QueryInputs",synthetic:true,types:["mentat_query_algebrizer::clauses::inputs::QueryInputs"]},{text:"impl !Sync for FindQuery",synthetic:true,types:["mentat_query_algebrizer::types::FindQuery"]},{text:"impl<'s, 'c> !Sync for Known<'s, 'c>",synthetic:true,types:["mentat_query_algebrizer::Known"]},{text:"impl !Sync for AlgebraicQuery",synthetic:true,types:["mentat_query_algebrizer::AlgebraicQuery"]},{text:"impl !Sync for ConjoiningClauses",synthetic:true,types:["mentat_query_algebrizer::clauses::ConjoiningClauses"]},{text:"impl !Sync for ColumnAlternation",synthetic:true,types:["mentat_query_algebrizer::types::ColumnAlternation"]},{text:"impl !Sync for ColumnIntersection",synthetic:true,types:["mentat_query_algebrizer::types::ColumnIntersection"]},{text:"impl !Sync for OrderBy",synthetic:true,types:["mentat_query_algebrizer::types::OrderBy"]},{text:"impl !Sync for QualifiedAlias",synthetic:true,types:["mentat_query_algebrizer::types::QualifiedAlias"]},{text:"impl Sync for SourceAlias",synthetic:true,types:["mentat_query_algebrizer::types::SourceAlias"]},{text:"impl Sync for AlgebrizerError",synthetic:true,types:["mentat_query_algebrizer::errors::AlgebrizerError"]},{text:"impl Sync for BindingError",synthetic:true,types:["mentat_query_algebrizer::errors::BindingError"]},{text:"impl !Sync for EmptyBecause",synthetic:true,types:["mentat_query_algebrizer::types::EmptyBecause"]},{text:"impl !Sync for Column",synthetic:true,types:["mentat_query_algebrizer::types::Column"]},{text:"impl !Sync for ColumnConstraint",synthetic:true,types:["mentat_query_algebrizer::types::ColumnConstraint"]},{text:"impl !Sync for ColumnConstraintOrAlternation",synthetic:true,types:["mentat_query_algebrizer::types::ColumnConstraintOrAlternation"]},{text:"impl !Sync for ComputedTable",synthetic:true,types:["mentat_query_algebrizer::types::ComputedTable"]},{text:"impl Sync for DatomsColumn",synthetic:true,types:["mentat_query_algebrizer::types::DatomsColumn"]},{text:"impl Sync for DatomsTable",synthetic:true,types:["mentat_query_algebrizer::types::DatomsTable"]},{text:"impl Sync for FulltextColumn",synthetic:true,types:["mentat_query_algebrizer::types::FulltextColumn"]},{text:"impl !Sync for QueryValue",synthetic:true,types:["mentat_query_algebrizer::types::QueryValue"]},{text:"impl !Sync for VariableColumn",synthetic:true,types:["mentat_query_algebrizer::types::VariableColumn"]},]; +implementors["mentat_query_projector"] = [{text:"impl !Sync for ConstantProjector",synthetic:true,types:["mentat_query_projector::projectors::constant::ConstantProjector"]},{text:"impl<T> Sync for RelResult<T> where
    T: Sync
",synthetic:true,types:["mentat_query_projector::relresult::RelResult"]},{text:"impl !Sync for QueryOutput",synthetic:true,types:["mentat_query_projector::QueryOutput"]},{text:"impl !Sync for CombinedProjection",synthetic:true,types:["mentat_query_projector::CombinedProjection"]},{text:"impl Sync for SimpleAggregationOp",synthetic:true,types:["mentat_query_projector::aggregates::SimpleAggregationOp"]},{text:"impl Sync for QueryResults",synthetic:true,types:["mentat_query_projector::QueryResults"]},{text:"impl Sync for ProjectorError",synthetic:true,types:["mentat_query_projector::errors::ProjectorError"]},]; +implementors["mentat_query_pull"] = [{text:"impl Sync for Puller",synthetic:true,types:["mentat_query_pull::Puller"]},{text:"impl Sync for PullError",synthetic:true,types:["mentat_query_pull::errors::PullError"]},]; +implementors["mentat_query_sql"] = [{text:"impl !Sync for ProjectedColumn",synthetic:true,types:["mentat_query_sql::ProjectedColumn"]},{text:"impl Sync for Op",synthetic:true,types:["mentat_query_sql::Op"]},{text:"impl !Sync for TableList",synthetic:true,types:["mentat_query_sql::TableList"]},{text:"impl !Sync for Join",synthetic:true,types:["mentat_query_sql::Join"]},{text:"impl !Sync for SelectQuery",synthetic:true,types:["mentat_query_sql::SelectQuery"]},{text:"impl !Sync for ColumnOrExpression",synthetic:true,types:["mentat_query_sql::ColumnOrExpression"]},{text:"impl !Sync for Expression",synthetic:true,types:["mentat_query_sql::Expression"]},{text:"impl !Sync for Projection",synthetic:true,types:["mentat_query_sql::Projection"]},{text:"impl !Sync for GroupBy",synthetic:true,types:["mentat_query_sql::GroupBy"]},{text:"impl !Sync for Constraint",synthetic:true,types:["mentat_query_sql::Constraint"]},{text:"impl !Sync for TableOrSubquery",synthetic:true,types:["mentat_query_sql::TableOrSubquery"]},{text:"impl !Sync for Values",synthetic:true,types:["mentat_query_sql::Values"]},{text:"impl !Sync for FromClause",synthetic:true,types:["mentat_query_sql::FromClause"]},]; +implementors["mentat_query_translator"] = [{text:"impl !Sync for ProjectedSelect",synthetic:true,types:["mentat_query_translator::translate::ProjectedSelect"]},]; +implementors["mentat_sql"] = [{text:"impl !Sync for SQLQuery",synthetic:true,types:["mentat_sql::SQLQuery"]},{text:"impl !Sync for SQLiteQueryBuilder",synthetic:true,types:["mentat_sql::SQLiteQueryBuilder"]},{text:"impl Sync for SQLError",synthetic:true,types:["mentat_sql::SQLError"]},]; +implementors["mentat_tolstoy"] = [{text:"impl Sync for TolstoyError",synthetic:true,types:["mentat_tolstoy::errors::TolstoyError"]},{text:"impl Sync for SyncMetadataClient",synthetic:true,types:["mentat_tolstoy::metadata::SyncMetadataClient"]},{text:"impl Sync for TxPart",synthetic:true,types:["mentat_tolstoy::tx_processor::TxPart"]},{text:"impl Sync for Processor",synthetic:true,types:["mentat_tolstoy::tx_processor::Processor"]},{text:"impl<'dbtx, 't, T> Sync for DatomsIterator<'dbtx, 't, T> where
    T: Sync
",synthetic:true,types:["mentat_tolstoy::tx_processor::DatomsIterator"]},{text:"impl Sync for Syncer",synthetic:true,types:["mentat_tolstoy::syncer::Syncer"]},{text:"impl Sync for TxMapper",synthetic:true,types:["mentat_tolstoy::tx_mapper::TxMapper"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/ops/deref/trait.Deref.js b/docs/apis/rust/0.7.0/implementors/core/ops/deref/trait.Deref.js new file mode 100644 index 00000000..24fa4e94 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/ops/deref/trait.Deref.js @@ -0,0 +1,11 @@ +(function() {var implementors = {}; +implementors["mentat_core"] = [{text:"impl __Deref for DB_ADD",synthetic:false,types:["mentat_core::values::DB_ADD"]},{text:"impl __Deref for DB_ALTER_ATTRIBUTE",synthetic:false,types:["mentat_core::values::DB_ALTER_ATTRIBUTE"]},{text:"impl __Deref for DB_CARDINALITY",synthetic:false,types:["mentat_core::values::DB_CARDINALITY"]},{text:"impl __Deref for DB_CARDINALITY_MANY",synthetic:false,types:["mentat_core::values::DB_CARDINALITY_MANY"]},{text:"impl __Deref for DB_CARDINALITY_ONE",synthetic:false,types:["mentat_core::values::DB_CARDINALITY_ONE"]},{text:"impl __Deref for DB_FULLTEXT",synthetic:false,types:["mentat_core::values::DB_FULLTEXT"]},{text:"impl __Deref for DB_IDENT",synthetic:false,types:["mentat_core::values::DB_IDENT"]},{text:"impl __Deref for DB_INDEX",synthetic:false,types:["mentat_core::values::DB_INDEX"]},{text:"impl __Deref for DB_INSTALL_ATTRIBUTE",synthetic:false,types:["mentat_core::values::DB_INSTALL_ATTRIBUTE"]},{text:"impl __Deref for DB_IS_COMPONENT",synthetic:false,types:["mentat_core::values::DB_IS_COMPONENT"]},{text:"impl __Deref for DB_NO_HISTORY",synthetic:false,types:["mentat_core::values::DB_NO_HISTORY"]},{text:"impl __Deref for DB_PART_DB",synthetic:false,types:["mentat_core::values::DB_PART_DB"]},{text:"impl __Deref for DB_RETRACT",synthetic:false,types:["mentat_core::values::DB_RETRACT"]},{text:"impl __Deref for DB_TYPE_BOOLEAN",synthetic:false,types:["mentat_core::values::DB_TYPE_BOOLEAN"]},{text:"impl __Deref for DB_TYPE_DOUBLE",synthetic:false,types:["mentat_core::values::DB_TYPE_DOUBLE"]},{text:"impl __Deref for DB_TYPE_INSTANT",synthetic:false,types:["mentat_core::values::DB_TYPE_INSTANT"]},{text:"impl __Deref for DB_TYPE_KEYWORD",synthetic:false,types:["mentat_core::values::DB_TYPE_KEYWORD"]},{text:"impl __Deref for DB_TYPE_LONG",synthetic:false,types:["mentat_core::values::DB_TYPE_LONG"]},{text:"impl __Deref for DB_TYPE_REF",synthetic:false,types:["mentat_core::values::DB_TYPE_REF"]},{text:"impl __Deref for DB_TYPE_STRING",synthetic:false,types:["mentat_core::values::DB_TYPE_STRING"]},{text:"impl __Deref for DB_TYPE_URI",synthetic:false,types:["mentat_core::values::DB_TYPE_URI"]},{text:"impl __Deref for DB_TYPE_UUID",synthetic:false,types:["mentat_core::values::DB_TYPE_UUID"]},{text:"impl __Deref for DB_UNIQUE",synthetic:false,types:["mentat_core::values::DB_UNIQUE"]},{text:"impl __Deref for DB_UNIQUE_IDENTITY",synthetic:false,types:["mentat_core::values::DB_UNIQUE_IDENTITY"]},{text:"impl __Deref for DB_UNIQUE_VALUE",synthetic:false,types:["mentat_core::values::DB_UNIQUE_VALUE"]},{text:"impl __Deref for DB_VALUE_TYPE",synthetic:false,types:["mentat_core::values::DB_VALUE_TYPE"]},]; +implementors["mentat_db"] = [{text:"impl __Deref for IDENTS_SQL_LIST",synthetic:false,types:["mentat_db::entids::IDENTS_SQL_LIST"]},{text:"impl __Deref for SCHEMA_SQL_LIST",synthetic:false,types:["mentat_db::entids::SCHEMA_SQL_LIST"]},{text:"impl __Deref for METADATA_SQL_LIST",synthetic:false,types:["mentat_db::entids::METADATA_SQL_LIST"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/core/ops/drop/trait.Drop.js b/docs/apis/rust/0.7.0/implementors/core/ops/drop/trait.Drop.js new file mode 100644 index 00000000..27369d45 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/core/ops/drop/trait.Drop.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_db"] = [{text:"impl Drop for TxObservationService",synthetic:false,types:["mentat_db::tx_observer::TxObservationService"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/edn/query/trait.ContainsVariables.js b/docs/apis/rust/0.7.0/implementors/edn/query/trait.ContainsVariables.js new file mode 100644 index 00000000..9407c96f --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/edn/query/trait.ContainsVariables.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["edn"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/edn/query/trait.FromValue.js b/docs/apis/rust/0.7.0/implementors/edn/query/trait.FromValue.js new file mode 100644 index 00000000..9407c96f --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/edn/query/trait.FromValue.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["edn"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/edn/types/trait.FromMicros.js b/docs/apis/rust/0.7.0/implementors/edn/types/trait.FromMicros.js new file mode 100644 index 00000000..9407c96f --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/edn/types/trait.FromMicros.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["edn"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/edn/types/trait.ToMicros.js b/docs/apis/rust/0.7.0/implementors/edn/types/trait.ToMicros.js new file mode 100644 index 00000000..9407c96f --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/edn/types/trait.ToMicros.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["edn"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/edn/value_rc/trait.Cloned.js b/docs/apis/rust/0.7.0/implementors/edn/value_rc/trait.Cloned.js new file mode 100644 index 00000000..9407c96f --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/edn/value_rc/trait.Cloned.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["edn"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/edn/value_rc/trait.FromRc.js b/docs/apis/rust/0.7.0/implementors/edn/value_rc/trait.FromRc.js new file mode 100644 index 00000000..9407c96f --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/edn/value_rc/trait.FromRc.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["edn"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/enum_set/trait.CLike.js b/docs/apis/rust/0.7.0/implementors/enum_set/trait.CLike.js new file mode 100644 index 00000000..6ccdefa2 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/enum_set/trait.CLike.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_core"] = [{text:"impl CLike for ValueType",synthetic:false,types:["mentat_core::types::ValueType"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/failure/trait.Fail.js b/docs/apis/rust/0.7.0/implementors/failure/trait.Fail.js new file mode 100644 index 00000000..6397de00 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/failure/trait.Fail.js @@ -0,0 +1,17 @@ +(function() {var implementors = {}; +implementors["mentat"] = [{text:"impl Fail for MentatError",synthetic:false,types:["mentat::errors::MentatError"]},]; +implementors["mentat_cli"] = [{text:"impl Fail for CliError",synthetic:false,types:["mentat_cli::CliError"]},]; +implementors["mentat_db"] = [{text:"impl Fail for SchemaConstraintViolation",synthetic:false,types:["mentat_db::errors::SchemaConstraintViolation"]},{text:"impl Fail for DbError",synthetic:false,types:["mentat_db::errors::DbError"]},{text:"impl Fail for DbSqlError",synthetic:false,types:["mentat_db::errors::DbSqlError"]},{text:"impl Fail for DbSqlErrorKind",synthetic:false,types:["mentat_db::errors::DbSqlErrorKind"]},]; +implementors["mentat_query_algebrizer"] = [{text:"impl Fail for InvalidBinding",synthetic:false,types:["mentat_query_algebrizer::errors::InvalidBinding"]},{text:"impl Fail for BindingError",synthetic:false,types:["mentat_query_algebrizer::errors::BindingError"]},{text:"impl Fail for AlgebrizerError",synthetic:false,types:["mentat_query_algebrizer::errors::AlgebrizerError"]},]; +implementors["mentat_query_projector"] = [{text:"impl Fail for ProjectorError",synthetic:false,types:["mentat_query_projector::errors::ProjectorError"]},]; +implementors["mentat_query_pull"] = [{text:"impl Fail for PullError",synthetic:false,types:["mentat_query_pull::errors::PullError"]},]; +implementors["mentat_sql"] = [{text:"impl Fail for SQLError",synthetic:false,types:["mentat_sql::SQLError"]},]; +implementors["mentat_tolstoy"] = [{text:"impl Fail for TolstoyError",synthetic:false,types:["mentat_tolstoy::errors::TolstoyError"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/lazy_static/trait.LazyStatic.js b/docs/apis/rust/0.7.0/implementors/lazy_static/trait.LazyStatic.js new file mode 100644 index 00000000..91de69d0 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/lazy_static/trait.LazyStatic.js @@ -0,0 +1,11 @@ +(function() {var implementors = {}; +implementors["mentat_core"] = [{text:"impl LazyStatic for DB_ADD",synthetic:false,types:["mentat_core::values::DB_ADD"]},{text:"impl LazyStatic for DB_ALTER_ATTRIBUTE",synthetic:false,types:["mentat_core::values::DB_ALTER_ATTRIBUTE"]},{text:"impl LazyStatic for DB_CARDINALITY",synthetic:false,types:["mentat_core::values::DB_CARDINALITY"]},{text:"impl LazyStatic for DB_CARDINALITY_MANY",synthetic:false,types:["mentat_core::values::DB_CARDINALITY_MANY"]},{text:"impl LazyStatic for DB_CARDINALITY_ONE",synthetic:false,types:["mentat_core::values::DB_CARDINALITY_ONE"]},{text:"impl LazyStatic for DB_FULLTEXT",synthetic:false,types:["mentat_core::values::DB_FULLTEXT"]},{text:"impl LazyStatic for DB_IDENT",synthetic:false,types:["mentat_core::values::DB_IDENT"]},{text:"impl LazyStatic for DB_INDEX",synthetic:false,types:["mentat_core::values::DB_INDEX"]},{text:"impl LazyStatic for DB_INSTALL_ATTRIBUTE",synthetic:false,types:["mentat_core::values::DB_INSTALL_ATTRIBUTE"]},{text:"impl LazyStatic for DB_IS_COMPONENT",synthetic:false,types:["mentat_core::values::DB_IS_COMPONENT"]},{text:"impl LazyStatic for DB_NO_HISTORY",synthetic:false,types:["mentat_core::values::DB_NO_HISTORY"]},{text:"impl LazyStatic for DB_PART_DB",synthetic:false,types:["mentat_core::values::DB_PART_DB"]},{text:"impl LazyStatic for DB_RETRACT",synthetic:false,types:["mentat_core::values::DB_RETRACT"]},{text:"impl LazyStatic for DB_TYPE_BOOLEAN",synthetic:false,types:["mentat_core::values::DB_TYPE_BOOLEAN"]},{text:"impl LazyStatic for DB_TYPE_DOUBLE",synthetic:false,types:["mentat_core::values::DB_TYPE_DOUBLE"]},{text:"impl LazyStatic for DB_TYPE_INSTANT",synthetic:false,types:["mentat_core::values::DB_TYPE_INSTANT"]},{text:"impl LazyStatic for DB_TYPE_KEYWORD",synthetic:false,types:["mentat_core::values::DB_TYPE_KEYWORD"]},{text:"impl LazyStatic for DB_TYPE_LONG",synthetic:false,types:["mentat_core::values::DB_TYPE_LONG"]},{text:"impl LazyStatic for DB_TYPE_REF",synthetic:false,types:["mentat_core::values::DB_TYPE_REF"]},{text:"impl LazyStatic for DB_TYPE_STRING",synthetic:false,types:["mentat_core::values::DB_TYPE_STRING"]},{text:"impl LazyStatic for DB_TYPE_URI",synthetic:false,types:["mentat_core::values::DB_TYPE_URI"]},{text:"impl LazyStatic for DB_TYPE_UUID",synthetic:false,types:["mentat_core::values::DB_TYPE_UUID"]},{text:"impl LazyStatic for DB_UNIQUE",synthetic:false,types:["mentat_core::values::DB_UNIQUE"]},{text:"impl LazyStatic for DB_UNIQUE_IDENTITY",synthetic:false,types:["mentat_core::values::DB_UNIQUE_IDENTITY"]},{text:"impl LazyStatic for DB_UNIQUE_VALUE",synthetic:false,types:["mentat_core::values::DB_UNIQUE_VALUE"]},{text:"impl LazyStatic for DB_VALUE_TYPE",synthetic:false,types:["mentat_core::values::DB_VALUE_TYPE"]},]; +implementors["mentat_db"] = [{text:"impl LazyStatic for IDENTS_SQL_LIST",synthetic:false,types:["mentat_db::entids::IDENTS_SQL_LIST"]},{text:"impl LazyStatic for SCHEMA_SQL_LIST",synthetic:false,types:["mentat_db::entids::SCHEMA_SQL_LIST"]},{text:"impl LazyStatic for METADATA_SQL_LIST",synthetic:false,types:["mentat_db::entids::METADATA_SQL_LIST"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat/conn/trait.Pullable.js b/docs/apis/rust/0.7.0/implementors/mentat/conn/trait.Pullable.js new file mode 100644 index 00000000..86418d8a --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat/conn/trait.Pullable.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat/conn/trait.Queryable.js b/docs/apis/rust/0.7.0/implementors/mentat/conn/trait.Queryable.js new file mode 100644 index 00000000..86418d8a --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat/conn/trait.Queryable.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat/conn/trait.Syncable.js b/docs/apis/rust/0.7.0/implementors/mentat/conn/trait.Syncable.js new file mode 100644 index 00000000..86418d8a --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat/conn/trait.Syncable.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat/entity_builder/trait.BuildTerms.js b/docs/apis/rust/0.7.0/implementors/mentat/entity_builder/trait.BuildTerms.js new file mode 100644 index 00000000..86418d8a --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat/entity_builder/trait.BuildTerms.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat/entity_builder/trait.FromThing.js b/docs/apis/rust/0.7.0/implementors/mentat/entity_builder/trait.FromThing.js new file mode 100644 index 00000000..86418d8a --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat/entity_builder/trait.FromThing.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat/entity_builder/trait.IntoThing.js b/docs/apis/rust/0.7.0/implementors/mentat/entity_builder/trait.IntoThing.js new file mode 100644 index 00000000..86418d8a --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat/entity_builder/trait.IntoThing.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat/query/trait.IntoResult.js b/docs/apis/rust/0.7.0/implementors/mentat/query/trait.IntoResult.js new file mode 100644 index 00000000..86418d8a --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat/query/trait.IntoResult.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat/trait.HasSchema.js b/docs/apis/rust/0.7.0/implementors/mentat/trait.HasSchema.js new file mode 100644 index 00000000..441379d6 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat/trait.HasSchema.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat"] = [{text:"impl<'a, 'c> HasSchema for InProgressRead<'a, 'c>",synthetic:false,types:["mentat::conn::InProgressRead"]},{text:"impl<'a, 'c> HasSchema for InProgress<'a, 'c>",synthetic:false,types:["mentat::conn::InProgress"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat/vocabulary/trait.HasVocabularies.js b/docs/apis/rust/0.7.0/implementors/mentat/vocabulary/trait.HasVocabularies.js new file mode 100644 index 00000000..86418d8a --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat/vocabulary/trait.HasVocabularies.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat/vocabulary/trait.VersionedStore.js b/docs/apis/rust/0.7.0/implementors/mentat/vocabulary/trait.VersionedStore.js new file mode 100644 index 00000000..86418d8a --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat/vocabulary/trait.VersionedStore.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat/vocabulary/trait.VocabularySource.js b/docs/apis/rust/0.7.0/implementors/mentat/vocabulary/trait.VocabularySource.js new file mode 100644 index 00000000..86418d8a --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat/vocabulary/trait.VocabularySource.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_core/cache/trait.CachedAttributes.js b/docs/apis/rust/0.7.0/implementors/mentat_core/cache/trait.CachedAttributes.js new file mode 100644 index 00000000..435769e5 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_core/cache/trait.CachedAttributes.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_db"] = [{text:"impl CachedAttributes for AttributeCaches",synthetic:false,types:["mentat_db::cache::AttributeCaches"]},{text:"impl CachedAttributes for SQLiteAttributeCache",synthetic:false,types:["mentat_db::cache::SQLiteAttributeCache"]},{text:"impl CachedAttributes for InProgressSQLiteAttributeCache",synthetic:false,types:["mentat_db::cache::InProgressSQLiteAttributeCache"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_core/cache/trait.UpdateableCache.js b/docs/apis/rust/0.7.0/implementors/mentat_core/cache/trait.UpdateableCache.js new file mode 100644 index 00000000..3a8b66f1 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_core/cache/trait.UpdateableCache.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_db"] = [{text:"impl UpdateableCache for AttributeCaches",synthetic:false,types:["mentat_db::cache::AttributeCaches"]},{text:"impl UpdateableCache for SQLiteAttributeCache",synthetic:false,types:["mentat_db::cache::SQLiteAttributeCache"]},{text:"impl UpdateableCache for InProgressSQLiteAttributeCache",synthetic:false,types:["mentat_db::cache::InProgressSQLiteAttributeCache"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_core/trait.Cloned.js b/docs/apis/rust/0.7.0/implementors/mentat_core/trait.Cloned.js new file mode 100644 index 00000000..b11516d1 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_core/trait.Cloned.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_core"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_core/trait.FromMicros.js b/docs/apis/rust/0.7.0/implementors/mentat_core/trait.FromMicros.js new file mode 100644 index 00000000..b11516d1 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_core/trait.FromMicros.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_core"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_core/trait.FromRc.js b/docs/apis/rust/0.7.0/implementors/mentat_core/trait.FromRc.js new file mode 100644 index 00000000..b11516d1 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_core/trait.FromRc.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_core"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_core/trait.HasSchema.js b/docs/apis/rust/0.7.0/implementors/mentat_core/trait.HasSchema.js new file mode 100644 index 00000000..b11516d1 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_core/trait.HasSchema.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_core"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_core/trait.SQLValueType.js b/docs/apis/rust/0.7.0/implementors/mentat_core/trait.SQLValueType.js new file mode 100644 index 00000000..b11516d1 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_core/trait.SQLValueType.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_core"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_core/trait.SQLValueTypeSet.js b/docs/apis/rust/0.7.0/implementors/mentat_core/trait.SQLValueTypeSet.js new file mode 100644 index 00000000..b11516d1 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_core/trait.SQLValueTypeSet.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_core"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_core/trait.Timelike.js b/docs/apis/rust/0.7.0/implementors/mentat_core/trait.Timelike.js new file mode 100644 index 00000000..b11516d1 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_core/trait.Timelike.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_core"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_core/trait.ToMicros.js b/docs/apis/rust/0.7.0/implementors/mentat_core/trait.ToMicros.js new file mode 100644 index 00000000..b11516d1 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_core/trait.ToMicros.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_core"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_core/util/trait.OptionEffect.js b/docs/apis/rust/0.7.0/implementors/mentat_core/util/trait.OptionEffect.js new file mode 100644 index 00000000..b11516d1 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_core/util/trait.OptionEffect.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_core"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_core/util/trait.ResultEffect.js b/docs/apis/rust/0.7.0/implementors/mentat_core/util/trait.ResultEffect.js new file mode 100644 index 00000000..b11516d1 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_core/util/trait.ResultEffect.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_core"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_db/db/trait.MentatStoring.js b/docs/apis/rust/0.7.0/implementors/mentat_db/db/trait.MentatStoring.js new file mode 100644 index 00000000..ab6912ca --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_db/db/trait.MentatStoring.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_db"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_db/db/trait.PartitionMapping.js b/docs/apis/rust/0.7.0/implementors/mentat_db/db/trait.PartitionMapping.js new file mode 100644 index 00000000..ab6912ca --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_db/db/trait.PartitionMapping.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_db"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_db/db/trait.TypedSQLValue.js b/docs/apis/rust/0.7.0/implementors/mentat_db/db/trait.TypedSQLValue.js new file mode 100644 index 00000000..ab6912ca --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_db/db/trait.TypedSQLValue.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_db"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_db/trait.AttributeValidation.js b/docs/apis/rust/0.7.0/implementors/mentat_db/trait.AttributeValidation.js new file mode 100644 index 00000000..ab6912ca --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_db/trait.AttributeValidation.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_db"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_db/trait.TransactWatcher.js b/docs/apis/rust/0.7.0/implementors/mentat_db/trait.TransactWatcher.js new file mode 100644 index 00000000..ab6912ca --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_db/trait.TransactWatcher.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_db"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_db/tx_observer/trait.Command.js b/docs/apis/rust/0.7.0/implementors/mentat_db/tx_observer/trait.Command.js new file mode 100644 index 00000000..ab6912ca --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_db/tx_observer/trait.Command.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_db"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_db/types/trait.TransactableValue.js b/docs/apis/rust/0.7.0/implementors/mentat_db/types/trait.TransactableValue.js new file mode 100644 index 00000000..ab6912ca --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_db/types/trait.TransactableValue.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_db"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_ffi/trait.BuildTerms.js b/docs/apis/rust/0.7.0/implementors/mentat_ffi/trait.BuildTerms.js new file mode 100644 index 00000000..dcd47e3e --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_ffi/trait.BuildTerms.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_ffi"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_ffi/trait.HasSchema.js b/docs/apis/rust/0.7.0/implementors/mentat_ffi/trait.HasSchema.js new file mode 100644 index 00000000..dcd47e3e --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_ffi/trait.HasSchema.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_ffi"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_ffi/trait.IntoThing.js b/docs/apis/rust/0.7.0/implementors/mentat_ffi/trait.IntoThing.js new file mode 100644 index 00000000..dcd47e3e --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_ffi/trait.IntoThing.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_ffi"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_ffi/trait.Queryable.js b/docs/apis/rust/0.7.0/implementors/mentat_ffi/trait.Queryable.js new file mode 100644 index 00000000..dcd47e3e --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_ffi/trait.Queryable.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_ffi"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_ffi/trait.Syncable.js b/docs/apis/rust/0.7.0/implementors/mentat_ffi/trait.Syncable.js new file mode 100644 index 00000000..dcd47e3e --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_ffi/trait.Syncable.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_ffi"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_parser_utils/value_and_span/trait.Item.js b/docs/apis/rust/0.7.0/implementors/mentat_parser_utils/value_and_span/trait.Item.js new file mode 100644 index 00000000..6e7e2047 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_parser_utils/value_and_span/trait.Item.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_parser_utils"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_parser_utils/value_and_span/trait.OfExactlyParsing.js b/docs/apis/rust/0.7.0/implementors/mentat_parser_utils/value_and_span/trait.OfExactlyParsing.js new file mode 100644 index 00000000..6e7e2047 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_parser_utils/value_and_span/trait.OfExactlyParsing.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_parser_utils"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_parser_utils/value_and_span/trait.Streaming.js b/docs/apis/rust/0.7.0/implementors/mentat_parser_utils/value_and_span/trait.Streaming.js new file mode 100644 index 00000000..6e7e2047 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_parser_utils/value_and_span/trait.Streaming.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_parser_utils"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_query_algebrizer/trait.ColumnName.js b/docs/apis/rust/0.7.0/implementors/mentat_query_algebrizer/trait.ColumnName.js new file mode 100644 index 00000000..6b2a2f91 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_query_algebrizer/trait.ColumnName.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_query_algebrizer"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_query_projector/trait.Projector.js b/docs/apis/rust/0.7.0/implementors/mentat_query_projector/trait.Projector.js new file mode 100644 index 00000000..377bb06b --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_query_projector/trait.Projector.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_query_projector"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_sql/trait.QueryBuilder.js b/docs/apis/rust/0.7.0/implementors/mentat_sql/trait.QueryBuilder.js new file mode 100644 index 00000000..96ec4602 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_sql/trait.QueryBuilder.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_sql"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_sql/trait.QueryFragment.js b/docs/apis/rust/0.7.0/implementors/mentat_sql/trait.QueryFragment.js new file mode 100644 index 00000000..218d3491 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_sql/trait.QueryFragment.js @@ -0,0 +1,11 @@ +(function() {var implementors = {}; +implementors["mentat_query_sql"] = [{text:"impl QueryFragment for GroupBy",synthetic:false,types:["mentat_query_sql::GroupBy"]},{text:"impl QueryFragment for ColumnOrExpression",synthetic:false,types:["mentat_query_sql::ColumnOrExpression"]},{text:"impl QueryFragment for Expression",synthetic:false,types:["mentat_query_sql::Expression"]},{text:"impl QueryFragment for Projection",synthetic:false,types:["mentat_query_sql::Projection"]},{text:"impl QueryFragment for Op",synthetic:false,types:["mentat_query_sql::Op"]},{text:"impl QueryFragment for Constraint",synthetic:false,types:["mentat_query_sql::Constraint"]},{text:"impl QueryFragment for TableList",synthetic:false,types:["mentat_query_sql::TableList"]},{text:"impl QueryFragment for Join",synthetic:false,types:["mentat_query_sql::Join"]},{text:"impl QueryFragment for TableOrSubquery",synthetic:false,types:["mentat_query_sql::TableOrSubquery"]},{text:"impl QueryFragment for Values",synthetic:false,types:["mentat_query_sql::Values"]},{text:"impl QueryFragment for FromClause",synthetic:false,types:["mentat_query_sql::FromClause"]},{text:"impl QueryFragment for SelectQuery",synthetic:false,types:["mentat_query_sql::SelectQuery"]},]; +implementors["mentat_sql"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/mentat_tolstoy/metadata/trait.HeadTrackable.js b/docs/apis/rust/0.7.0/implementors/mentat_tolstoy/metadata/trait.HeadTrackable.js new file mode 100644 index 00000000..6e289741 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/mentat_tolstoy/metadata/trait.HeadTrackable.js @@ -0,0 +1,10 @@ +(function() {var implementors = {}; +implementors["mentat_tolstoy"] = []; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/implementors/std/error/trait.Error.js b/docs/apis/rust/0.7.0/implementors/std/error/trait.Error.js new file mode 100644 index 00000000..86ac4da1 --- /dev/null +++ b/docs/apis/rust/0.7.0/implementors/std/error/trait.Error.js @@ -0,0 +1,11 @@ +(function() {var implementors = {}; +implementors["edn"] = [{text:"impl Error for ParseError",synthetic:false,types:["edn::parse::ParseError"]},]; +implementors["mentat_parser_utils"] = [{text:"impl Error for ValueParseError",synthetic:false,types:["mentat_parser_utils::ValueParseError"]},]; + + if (window.register_implementors) { + window.register_implementors(implementors); + } else { + window.pending_implementors = implementors; + } + +})() diff --git a/docs/apis/rust/0.7.0/light.css b/docs/apis/rust/0.7.0/light.css new file mode 100644 index 00000000..2334a272 --- /dev/null +++ b/docs/apis/rust/0.7.0/light.css @@ -0,0 +1,385 @@ +/** + * Copyright 2015 The Rust Project Developers. See the COPYRIGHT + * file at the top-level directory of this distribution and at + * http://rust-lang.org/COPYRIGHT. + * + * Licensed under the Apache License, Version 2.0 or the MIT license + * , at your + * option. This file may not be copied, modified, or distributed + * except according to those terms. + */ + +/* General structure and fonts */ + +body { + background-color: white; + color: black; +} + +h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { + color: black; +} +h1.fqn { + border-bottom-color: #D5D5D5; +} +h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { + border-bottom-color: #DDDDDD; +} + +.in-band { + background-color: white; +} + +.invisible { + background: rgba(0, 0, 0, 0); +} + +.docblock code, .docblock-short code { + background-color: #F5F5F5; +} +pre { + background-color: #F5F5F5; +} + +.sidebar { + background-color: #F1F1F1; +} + +.sidebar .current { + background-color: #fff; +} + +.source .sidebar { + background-color: #fff; +} + +.sidebar .location { + border-color: #000; + background-color: #fff; + color: #333; +} + +.sidebar .version { + border-bottom-color: #DDD; +} + +.sidebar-title { + border-top-color: #777; + border-bottom-color: #777; +} + +.block a:hover { + background: #F5F5F5; +} + +.line-numbers span { color: #c67e2d; } +.line-numbers .line-highlighted { + background-color: #f6fdb0 !important; +} + +.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 { + border-bottom-color: #DDD; +} + +.docblock table { + border-color: #ddd; +} + +.docblock table td { + border-top-color: #ddd; + border-bottom-color: #ddd; +} + +.docblock table th { + border-top-color: #ddd; + border-bottom-color: #ddd; +} + +:target { background: #FDFFD3; } + +:target > .in-band { + background: #FDFFD3; +} + +.content .method .where, +.content .fn .where, +.content .where.fmt-newline { + color: #4E4C4C; +} + +.content .highlighted { + color: #000 !important; + background-color: #ccc; +} +.content .highlighted a, .content .highlighted span { color: #000 !important; } +.content .highlighted.trait { background-color: #c7b6ff; } +.content .highlighted.mod, +.content .highlighted.externcrate { background-color: #afc6e4; } +.content .highlighted.enum { background-color: #b4d1b9; } +.content .highlighted.struct { background-color: #e7b1a0; } +.content .highlighted.union { background-color: #b7bd49; } +.content .highlighted.fn, +.content .highlighted.method, +.content .highlighted.tymethod { background-color: #c6afb3; } +.content .highlighted.type { background-color: #ffc891; } +.content .highlighted.foreigntype { background-color: #f5c4ff; } +.content .highlighted.macro { background-color: #8ce488; } +.content .highlighted.constant, +.content .highlighted.static { background-color: #c3e0ff; } +.content .highlighted.primitive { background-color: #9aecff; } + +.content span.enum, .content a.enum, .block a.current.enum { color: #508157; } +.content span.struct, .content a.struct, .block a.current.struct { color: #ad448e; } +.content span.type, .content a.type, .block a.current.type { color: #ba5d00; } +.content span.foreigntype, .content a.foreigntype, .block a.current.foreigntype { color: #cd00e2; } +.content span.macro, .content a.macro, .block a.current.macro { color: #068000; } +.content span.union, .content a.union, .block a.current.union { color: #767b27; } +.content span.constant, .content a.constant, .block a.current.constant, +.content span.static, .content a.static, .block a.current.static { color: #546e8a; } +.content span.primitive, .content a.primitive, .block a.current.primitive { color: #2c8093; } +.content span.externcrate, +.content span.mod, .content a.mod, .block a.current.mod { color: #4d76ae; } +.content span.trait, .content a.trait, .block a.current.trait { color: #7c5af3; } +.content span.fn, .content a.fn, .block a.current.fn, +.content span.method, .content a.method, .block a.current.method, +.content span.tymethod, .content a.tymethod, .block a.current.tymethod, +.content .fnname { color: #9a6e31; } + +pre.rust .comment { color: #8E908C; } +pre.rust .doccomment { color: #4D4D4C; } + +nav { + border-bottom-color: #e0e0e0; +} +nav.main .current { + border-top-color: #000; + border-bottom-color: #000; +} +nav.main .separator { + border: 1px solid #000; +} +a { + color: #000; +} + +.docblock a, .docblock-short a, .stability a { + color: #3873AD; +} + +a.test-arrow { + color: #f5f5f5; +} + +.collapse-toggle { + color: #999; +} + +.search-input { + color: #555; + box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent; + background-color: white; +} + +.search-input:focus { + border-color: #66afe9; +} + +.stab.unstable { background: #FFF5D6; border-color: #FFC600; } +.stab.deprecated { background: #F3DFFF; border-color: #7F0087; } +.stab.portability { background: #C4ECFF; border-color: #7BA5DB; } + +.module-item .stab { + color: #000; +} + +#help > div { + background: #e9e9e9; + border-color: #bfbfbf; +} + +.since { + color: grey; +} + +tr.result span.primitive::after { + color: black; +} + +.line-numbers :target { background-color: transparent; } + +/* Code highlighting */ +pre.rust .kw { color: #8959A8; } +pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; } +pre.rust .number, pre.rust .string { color: #718C00; } +pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val, +pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; } +pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; } +pre.rust .lifetime { color: #B76514; } +pre.rust .question-mark { + color: #ff9011; +} + +a.test-arrow { + background-color: rgba(78, 139, 202, 0.2); +} + +a.test-arrow:hover{ + background-color: #4e8bca; +} + +.toggle-label { + color: #999; +} + +:target > code { + background: #FDFFD3; +} + +pre.compile_fail { + border-left: 2px solid rgba(255,0,0,.4); +} + +pre.compile_fail:hover, .information:hover + pre.compile_fail { + border-left: 2px solid #f00; +} + +pre.ignore { + border-left: 2px solid rgba(255,142,0,.4); +} + +pre.ignore:hover, .information:hover + pre.ignore { + border-left: 2px solid #ff9200; +} + +.tooltip.compile_fail { + color: rgba(255,0,0,.3); +} + +.information > .compile_fail:hover { + color: #f00; +} + +.tooltip.ignore { + color: rgba(255,142,0,.3); +} + +.information > .ignore:hover { + color: rgba(255,142,0,1); +} + +.search-failed > a { + color: #0089ff; +} + +.tooltip .tooltiptext { + background-color: black; + color: #fff; +} + +.tooltip .tooltiptext::after { + border-color: transparent black transparent transparent; +} + +.important-traits .tooltip .tooltiptext { + background-color: white; + color: black; + border-color: black; +} + +#titles > div { + border-bottom-color: #ccc; +} + +#titles > div.selected { + border-bottom-color: #0078ee; +} + +#titles > div:hover { + border-bottom-color: #0089ff; +} + +#titles > div > div.count { + color: #888; +} + +.modal { + background-color: rgba(0,0,0,0.3); +} + +.modal-content { + background-color: #eee; + border-color: #999; +} + +.modal-content > .close { + background-color: #eee; + border-color: #999; +} + +.modal-content > .close:hover { + background-color: #ff1f1f; + color: white; +} + +.modal-content > .whiter { + background-color: #eee; +} + +.modal-content > .close:hover + .whiter { + background-color: #ff1f1f; +} + +@media (max-width: 700px) { + .sidebar-menu { + background-color: #F1F1F1; + border-bottom-color: #e0e0e0; + border-right-color: #e0e0e0; + } + + .sidebar-elems { + background-color: #F1F1F1; + border-right-color: #000; + } + + #sidebar-filler { + background-color: #F1F1F1; + border-bottom-color: #e0e0e0; + } +} + +kbd { + color: #000; + background-color: #fafbfc; + border-color: #d1d5da; + border-bottom-color: #c6cbd1; + box-shadow-color: #c6cbd1; +} + +#theme-picker { + border-color: #e0e0e0; + background-color: #fff; +} + +#theme-picker:hover, #theme-picker:focus { + border-color: #717171; +} + +#theme-choices { + border-color: #ccc; + background-color: #fff; +} + +#theme-choices > button:not(:first-child) { + border-top-color: #e0e0e0; +} + +#theme-choices > button:hover, #theme-choices > button:focus { + background-color: #eee; +} + +@media (max-width: 700px) { + #theme-picker { + background: #fff; + } +} diff --git a/docs/apis/rust/0.7.0/main.js b/docs/apis/rust/0.7.0/main.js new file mode 100644 index 00000000..3c115e2b --- /dev/null +++ b/docs/apis/rust/0.7.0/main.js @@ -0,0 +1,2045 @@ +/*! + * Copyright 2014 The Rust Project Developers. See the COPYRIGHT + * file at the top-level directory of this distribution and at + * http://rust-lang.org/COPYRIGHT. + * + * Licensed under the Apache License, Version 2.0 or the MIT license + * , at your + * option. This file may not be copied, modified, or distributed + * except according to those terms. + */ + +/*jslint browser: true, es5: true */ +/*globals $: true, rootPath: true */ + +(function() { + "use strict"; + + // This mapping table should match the discriminants of + // `rustdoc::html::item_type::ItemType` type in Rust. + var itemTypes = ["mod", + "externcrate", + "import", + "struct", + "enum", + "fn", + "type", + "static", + "trait", + "impl", + "tymethod", + "method", + "structfield", + "variant", + "macro", + "primitive", + "associatedtype", + "constant", + "associatedconstant", + "union", + "foreigntype"]; + + // On the search screen, so you remain on the last tab you opened. + // + // 0 for "In Names" + // 1 for "In Parameters" + // 2 for "In Return Types" + var currentTab = 0; + + var themesWidth = null; + + if (!String.prototype.startsWith) { + String.prototype.startsWith = function(searchString, position) { + position = position || 0; + return this.indexOf(searchString, position) === position; + }; + } + + function hasClass(elem, className) { + if (elem && className && elem.className) { + var elemClass = elem.className; + var start = elemClass.indexOf(className); + if (start === -1) { + return false; + } else if (elemClass.length === className.length) { + return true; + } else { + if (start > 0 && elemClass[start - 1] !== ' ') { + return false; + } + var end = start + className.length; + if (end < elemClass.length && elemClass[end] !== ' ') { + return false; + } + return true; + } + if (start > 0 && elemClass[start - 1] !== ' ') { + return false; + } + var end = start + className.length; + if (end < elemClass.length && elemClass[end] !== ' ') { + return false; + } + return true; + } + return false; + } + + function addClass(elem, className) { + if (elem && className && !hasClass(elem, className)) { + if (elem.className && elem.className.length > 0) { + elem.className += ' ' + className; + } else { + elem.className = className; + } + } + } + + function removeClass(elem, className) { + if (elem && className && elem.className) { + elem.className = (" " + elem.className + " ").replace(" " + className + " ", " ") + .trim(); + } + } + + function isHidden(elem) { + return (elem.offsetParent === null) + } + + function showSidebar() { + var elems = document.getElementsByClassName("sidebar-elems")[0]; + if (elems) { + addClass(elems, "show-it"); + } + var sidebar = document.getElementsByClassName('sidebar')[0]; + if (sidebar) { + addClass(sidebar, 'mobile'); + var filler = document.getElementById("sidebar-filler"); + if (!filler) { + var div = document.createElement("div"); + div.id = "sidebar-filler"; + sidebar.appendChild(div); + } + } + var themePicker = document.getElementsByClassName("theme-picker"); + if (themePicker && themePicker.length > 0) { + themePicker[0].style.display = "none"; + } + } + + function hideSidebar() { + var elems = document.getElementsByClassName("sidebar-elems")[0]; + if (elems) { + removeClass(elems, "show-it"); + } + var sidebar = document.getElementsByClassName('sidebar')[0]; + removeClass(sidebar, 'mobile'); + var filler = document.getElementById("sidebar-filler"); + if (filler) { + filler.remove(); + } + document.getElementsByTagName("body")[0].style.marginTop = ''; + var themePicker = document.getElementsByClassName("theme-picker"); + if (themePicker && themePicker.length > 0) { + themePicker[0].style.display = null; + } + } + + // used for special search precedence + var TY_PRIMITIVE = itemTypes.indexOf("primitive"); + + onEach(document.getElementsByClassName('js-only'), function(e) { + removeClass(e, 'js-only'); + }); + + function getQueryStringParams() { + var params = {}; + window.location.search.substring(1).split("&"). + map(function(s) { + var pair = s.split("="); + params[decodeURIComponent(pair[0])] = + typeof pair[1] === "undefined" ? null : decodeURIComponent(pair[1]); + }); + return params; + } + + function browserSupportsHistoryApi() { + return document.location.protocol != "file:" && + window.history && typeof window.history.pushState === "function"; + } + + function highlightSourceLines(ev) { + // If we're in mobile mode, we should add the sidebar in any case. + hideSidebar(); + var search = document.getElementById("search"); + var i, from, to, match = window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/); + if (match) { + from = parseInt(match[1], 10); + to = Math.min(50000, parseInt(match[2] || match[1], 10)); + from = Math.min(from, to); + var elem = document.getElementById(from); + if (!elem) { + return; + } + if (ev === null) { + var x = document.getElementById(from); + if (x) { + x.scrollIntoView(); + } + } + onEach(document.getElementsByClassName('line-numbers'), function(e) { + onEach(e.getElementsByTagName('span'), function(i_e) { + removeClass(i_e, 'line-highlighted'); + }); + }) + for (i = from; i <= to; ++i) { + addClass(document.getElementById(i), 'line-highlighted'); + } + } else if (ev !== null && search && !hasClass(search, "hidden") && ev.newURL) { + addClass(search, "hidden"); + removeClass(document.getElementById("main"), "hidden"); + var hash = ev.newURL.slice(ev.newURL.indexOf('#') + 1); + if (browserSupportsHistoryApi()) { + history.replaceState(hash, "", "?search=#" + hash); + } + var elem = document.getElementById(hash); + if (elem) { + elem.scrollIntoView(); + } + } + } + highlightSourceLines(null); + window.onhashchange = highlightSourceLines; + + // Gets the human-readable string for the virtual-key code of the + // given KeyboardEvent, ev. + // + // This function is meant as a polyfill for KeyboardEvent#key, + // since it is not supported in Trident. We also test for + // KeyboardEvent#keyCode because the handleShortcut handler is + // also registered for the keydown event, because Blink doesn't fire + // keypress on hitting the Escape key. + // + // So I guess you could say things are getting pretty interoperable. + function getVirtualKey(ev) { + if ("key" in ev && typeof ev.key != "undefined") + return ev.key; + + var c = ev.charCode || ev.keyCode; + if (c == 27) + return "Escape"; + return String.fromCharCode(c); + } + + function displayHelp(display, ev) { + if (display === true) { + if (hasClass(help, "hidden")) { + ev.preventDefault(); + removeClass(help, "hidden"); + addClass(document.body, "blur"); + } + } else if (!hasClass(help, "hidden")) { + ev.preventDefault(); + addClass(help, "hidden"); + removeClass(document.body, "blur"); + } + } + + function handleEscape(ev, help) { + hideModal(); + var search = document.getElementById("search"); + if (!hasClass(help, "hidden")) { + displayHelp(false, ev); + } else if (!hasClass(search, "hidden")) { + ev.preventDefault(); + addClass(search, "hidden"); + removeClass(document.getElementById("main"), "hidden"); + } + defocusSearchBar(); + } + + function handleShortcut(ev) { + // Don't interfere with browser shortcuts + if (ev.ctrlKey || ev.altKey || ev.metaKey) { + return; + } + + var help = document.getElementById("help"); + if (document.activeElement.tagName === "INPUT") { + switch (getVirtualKey(ev)) { + case "Escape": + handleEscape(ev, help); + break; + } + } else { + switch (getVirtualKey(ev)) { + case "Escape": + handleEscape(ev, help); + break; + + case "s": + case "S": + displayHelp(false, ev); + hideModal(); + ev.preventDefault(); + focusSearchBar(); + break; + + case "+": + case "-": + ev.preventDefault(); + toggleAllDocs(); + break; + + case "?": + if (ev.shiftKey) { + hideModal(); + displayHelp(true, ev); + } + break; + } + } + } + + document.onkeypress = handleShortcut; + document.onkeydown = handleShortcut; + document.onclick = function(ev) { + if (hasClass(ev.target, 'collapse-toggle')) { + collapseDocs(ev.target, "toggle"); + } else if (hasClass(ev.target.parentNode, 'collapse-toggle')) { + collapseDocs(ev.target.parentNode, "toggle"); + } else if (ev.target.tagName === 'SPAN' && hasClass(ev.target.parentNode, 'line-numbers')) { + var prev_id = 0; + + var set_fragment = function (name) { + if (browserSupportsHistoryApi()) { + history.replaceState(null, null, '#' + name); + window.hashchange(); + } else { + location.replace('#' + name); + } + }; + + var cur_id = parseInt(ev.target.id, 10); + + if (ev.shiftKey && prev_id) { + if (prev_id > cur_id) { + var tmp = prev_id; + prev_id = cur_id; + cur_id = tmp; + } + + set_fragment(prev_id + '-' + cur_id); + } else { + prev_id = cur_id; + + set_fragment(cur_id); + } + } else if (!hasClass(document.getElementById("help"), "hidden")) { + addClass(document.getElementById("help"), "hidden"); + removeClass(document.body, "blur"); + } + }; + + var x = document.getElementsByClassName('version-selector'); + if (x.length > 0) { + x[0].onchange = function() { + var i, match, + url = document.location.href, + stripped = '', + len = rootPath.match(/\.\.\//g).length + 1; + + for (i = 0; i < len; ++i) { + match = url.match(/\/[^\/]*$/); + if (i < len - 1) { + stripped = match[0] + stripped; + } + url = url.substring(0, url.length - match[0].length); + } + + url += '/' + document.getElementsByClassName('version-selector')[0].value + stripped; + + document.location.href = url; + }; + } + + /** + * A function to compute the Levenshtein distance between two strings + * Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported + * Full License can be found at http://creativecommons.org/licenses/by-sa/3.0/legalcode + * This code is an unmodified version of the code written by Marco de Wit + * and was found at http://stackoverflow.com/a/18514751/745719 + */ + var levenshtein_row2 = []; + function levenshtein(s1, s2) { + if (s1 === s2) { + return 0; + } + var s1_len = s1.length, s2_len = s2.length; + if (s1_len && s2_len) { + var i1 = 0, i2 = 0, a, b, c, c2, row = levenshtein_row2; + while (i1 < s1_len) { + row[i1] = ++i1; + } + while (i2 < s2_len) { + c2 = s2.charCodeAt(i2); + a = i2; + ++i2; + b = i2; + for (i1 = 0; i1 < s1_len; ++i1) { + c = a + (s1.charCodeAt(i1) !== c2 ? 1 : 0); + a = row[i1]; + b = b < a ? (b < c ? b + 1 : c) : (a < c ? a + 1 : c); + row[i1] = b; + } + } + return b; + } + return s1_len + s2_len; + } + + function initSearch(rawSearchIndex) { + var currentResults, index, searchIndex; + var MAX_LEV_DISTANCE = 3; + var MAX_RESULTS = 200; + var params = getQueryStringParams(); + + // Populate search bar with query string search term when provided, + // but only if the input bar is empty. This avoid the obnoxious issue + // where you start trying to do a search, and the index loads, and + // suddenly your search is gone! + if (document.getElementsByClassName("search-input")[0].value === "") { + document.getElementsByClassName("search-input")[0].value = params.search || ''; + } + + /** + * Executes the query and builds an index of results + * @param {[Object]} query [The user query] + * @param {[type]} searchWords [The list of search words to query + * against] + * @return {[type]} [A search index of results] + */ + function execQuery(query, searchWords) { + function itemTypeFromName(typename) { + for (var i = 0; i < itemTypes.length; ++i) { + if (itemTypes[i] === typename) { + return i; + } + } + return -1; + } + + var valLower = query.query.toLowerCase(), + val = valLower, + typeFilter = itemTypeFromName(query.type), + results = {}, results_in_args = {}, results_returned = {}, + split = valLower.split("::"); + + for (var z = 0; z < split.length; ++z) { + if (split[z] === "") { + split.splice(z, 1); + z -= 1; + } + } + + function transformResults(results, isType) { + var out = []; + for (i = 0; i < results.length; ++i) { + if (results[i].id > -1) { + var obj = searchIndex[results[i].id]; + obj.lev = results[i].lev; + if (isType !== true || obj.type) { + out.push(obj); + } + } + if (out.length >= MAX_RESULTS) { + break; + } + } + return out; + } + + function sortResults(results, isType) { + var ar = []; + for (var entry in results) { + if (results.hasOwnProperty(entry)) { + ar.push(results[entry]); + } + } + results = ar; + var nresults = results.length; + for (var i = 0; i < nresults; ++i) { + results[i].word = searchWords[results[i].id]; + results[i].item = searchIndex[results[i].id] || {}; + } + // if there are no results then return to default and fail + if (results.length === 0) { + return []; + } + + results.sort(function(aaa, bbb) { + var a, b; + + // Sort by non levenshtein results and then levenshtein results by the distance + // (less changes required to match means higher rankings) + a = (aaa.lev); + b = (bbb.lev); + if (a !== b) { return a - b; } + + // sort by crate (non-current crate goes later) + a = (aaa.item.crate !== window.currentCrate); + b = (bbb.item.crate !== window.currentCrate); + if (a !== b) { return a - b; } + + // sort by exact match (mismatch goes later) + a = (aaa.word !== valLower); + b = (bbb.word !== valLower); + if (a !== b) { return a - b; } + + // sort by item name length (longer goes later) + a = aaa.word.length; + b = bbb.word.length; + if (a !== b) { return a - b; } + + // sort by item name (lexicographically larger goes later) + a = aaa.word; + b = bbb.word; + if (a !== b) { return (a > b ? +1 : -1); } + + // sort by index of keyword in item name (no literal occurrence goes later) + a = (aaa.index < 0); + b = (bbb.index < 0); + if (a !== b) { return a - b; } + // (later literal occurrence, if any, goes later) + a = aaa.index; + b = bbb.index; + if (a !== b) { return a - b; } + + // special precedence for primitive pages + if ((aaa.item.ty === TY_PRIMITIVE) && (bbb.item.ty !== TY_PRIMITIVE)) { + return -1; + } + if ((bbb.item.ty === TY_PRIMITIVE) && (aaa.item.ty !== TY_PRIMITIVE)) { + return 1; + } + + // sort by description (no description goes later) + a = (aaa.item.desc === ''); + b = (bbb.item.desc === ''); + if (a !== b) { return a - b; } + + // sort by type (later occurrence in `itemTypes` goes later) + a = aaa.item.ty; + b = bbb.item.ty; + if (a !== b) { return a - b; } + + // sort by path (lexicographically larger goes later) + a = aaa.item.path; + b = bbb.item.path; + if (a !== b) { return (a > b ? +1 : -1); } + + // que sera, sera + return 0; + }); + + for (var i = 0; i < results.length; ++i) { + var result = results[i]; + + // this validation does not make sense when searching by types + if (result.dontValidate) { + continue; + } + var name = result.item.name.toLowerCase(), + path = result.item.path.toLowerCase(), + parent = result.item.parent; + + if (isType !== true && + validateResult(name, path, split, parent) === false) + { + result.id = -1; + } + } + return transformResults(results); + } + + function extractGenerics(val) { + val = val.toLowerCase(); + if (val.indexOf('<') !== -1) { + var values = val.substring(val.indexOf('<') + 1, val.lastIndexOf('>')); + return { + name: val.substring(0, val.indexOf('<')), + generics: values.split(/\s*,\s*/), + }; + } + return { + name: val, + generics: [], + }; + } + + function checkGenerics(obj, val) { + // The names match, but we need to be sure that all generics kinda + // match as well. + var lev_distance = MAX_LEV_DISTANCE + 1; + if (val.generics.length > 0) { + if (obj.generics && obj.generics.length >= val.generics.length) { + var elems = obj.generics.slice(0); + var total = 0; + var done = 0; + // We need to find the type that matches the most to remove it in order + // to move forward. + for (var y = 0; y < val.generics.length; ++y) { + var lev = { pos: -1, lev: MAX_LEV_DISTANCE + 1}; + for (var x = 0; x < elems.length; ++x) { + var tmp_lev = levenshtein(elems[x], val.generics[y]); + if (tmp_lev < lev.lev) { + lev.lev = tmp_lev; + lev.pos = x; + } + } + if (lev.pos !== -1) { + elems.splice(lev.pos, 1); + lev_distance = Math.min(lev.lev, lev_distance); + total += lev.lev; + done += 1; + } else { + return MAX_LEV_DISTANCE + 1; + } + } + return lev_distance;//Math.ceil(total / done); + } + } + return MAX_LEV_DISTANCE + 1; + } + + // Check for type name and type generics (if any). + function checkType(obj, val, literalSearch) { + var lev_distance = MAX_LEV_DISTANCE + 1; + if (obj.name === val.name) { + if (literalSearch === true) { + if (val.generics && val.generics.length !== 0) { + if (obj.generics && obj.length >= val.generics.length) { + var elems = obj.generics.slice(0); + var allFound = true; + var x; + + for (var y = 0; allFound === true && y < val.generics.length; ++y) { + allFound = false; + for (x = 0; allFound === false && x < elems.length; ++x) { + allFound = elems[x] === val.generics[y]; + } + if (allFound === true) { + elems.splice(x - 1, 1); + } + } + if (allFound === true) { + return true; + } + } else { + return false; + } + } + return true; + } + // If the type has generics but don't match, then it won't return at this point. + // Otherwise, `checkGenerics` will return 0 and it'll return. + if (obj.generics && obj.generics.length !== 0) { + var tmp_lev = checkGenerics(obj, val); + if (tmp_lev <= MAX_LEV_DISTANCE) { + return tmp_lev; + } + } else { + return 0; + } + } + // Names didn't match so let's check if one of the generic types could. + if (literalSearch === true) { + if (obj.generics && obj.generics.length > 0) { + for (var x = 0; x < obj.generics.length; ++x) { + if (obj.generics[x] === val.name) { + return true; + } + } + } + return false; + } + var lev_distance = Math.min(levenshtein(obj.name, val.name), lev_distance); + if (lev_distance <= MAX_LEV_DISTANCE) { + lev_distance = Math.min(checkGenerics(obj, val), lev_distance); + } else if (obj.generics && obj.generics.length > 0) { + // We can check if the type we're looking for is inside the generics! + for (var x = 0; x < obj.generics.length; ++x) { + lev_distance = Math.min(levenshtein(obj.generics[x], val.name), + lev_distance); + } + } + // Now whatever happens, the returned distance is "less good" so we should mark it + // as such, and so we add 1 to the distance to make it "less good". + return lev_distance + 1; + } + + function findArg(obj, val, literalSearch) { + var lev_distance = MAX_LEV_DISTANCE + 1; + + if (obj && obj.type && obj.type.inputs.length > 0) { + for (var i = 0; i < obj.type.inputs.length; i++) { + var tmp = checkType(obj.type.inputs[i], val, literalSearch); + if (literalSearch === true && tmp === true) { + return true; + } + lev_distance = Math.min(tmp, lev_distance); + if (lev_distance === 0) { + return 0; + } + } + } + return literalSearch === true ? false : lev_distance; + } + + function checkReturned(obj, val, literalSearch) { + var lev_distance = MAX_LEV_DISTANCE + 1; + + if (obj && obj.type && obj.type.output) { + var tmp = checkType(obj.type.output, val, literalSearch); + if (literalSearch === true && tmp === true) { + return true; + } + lev_distance = Math.min(tmp, lev_distance); + if (lev_distance === 0) { + return 0; + } + } + return literalSearch === true ? false : lev_distance; + } + + function checkPath(startsWith, lastElem, ty) { + if (startsWith.length === 0) { + return 0; + } + var ret_lev = MAX_LEV_DISTANCE + 1; + var path = ty.path.split("::"); + + if (ty.parent && ty.parent.name) { + path.push(ty.parent.name.toLowerCase()); + } + + if (startsWith.length > path.length) { + return MAX_LEV_DISTANCE + 1; + } + for (var i = 0; i < path.length; ++i) { + if (i + startsWith.length > path.length) { + break; + } + var lev_total = 0; + var aborted = false; + for (var x = 0; x < startsWith.length; ++x) { + var lev = levenshtein(path[i + x], startsWith[x]); + if (lev > MAX_LEV_DISTANCE) { + aborted = true; + break; + } + lev_total += lev; + } + if (aborted === false) { + ret_lev = Math.min(ret_lev, Math.round(lev_total / startsWith.length)); + } + } + return ret_lev; + } + + function typePassesFilter(filter, type) { + // No filter + if (filter < 0) return true; + + // Exact match + if (filter === type) return true; + + // Match related items + var name = itemTypes[type]; + switch (itemTypes[filter]) { + case "constant": + return (name == "associatedconstant"); + case "fn": + return (name == "method" || name == "tymethod"); + case "type": + return (name == "primitive"); + } + + // No match + return false; + } + + function generateId(ty) { + if (ty.parent && ty.parent.name) { + return itemTypes[ty.ty] + ty.path + ty.parent.name + ty.name; + } + return itemTypes[ty.ty] + ty.path + ty.name; + } + + // quoted values mean literal search + var nSearchWords = searchWords.length; + if ((val.charAt(0) === "\"" || val.charAt(0) === "'") && + val.charAt(val.length - 1) === val.charAt(0)) + { + val = extractGenerics(val.substr(1, val.length - 2)); + for (var i = 0; i < nSearchWords; ++i) { + var in_args = findArg(searchIndex[i], val, true); + var returned = checkReturned(searchIndex[i], val, true); + var ty = searchIndex[i]; + var fullId = generateId(ty); + + if (searchWords[i] === val.name) { + // filter type: ... queries + if (typePassesFilter(typeFilter, searchIndex[i].ty) && + results[fullId] === undefined) + { + results[fullId] = {id: i, index: -1}; + } + } else if ((in_args === true || returned === true) && + typePassesFilter(typeFilter, searchIndex[i].ty)) { + if (in_args === true || returned === true) { + if (in_args === true) { + results_in_args[fullId] = { + id: i, + index: -1, + dontValidate: true, + }; + } + if (returned === true) { + results_returned[fullId] = { + id: i, + index: -1, + dontValidate: true, + }; + } + } else { + results[fullId] = { + id: i, + index: -1, + dontValidate: true, + }; + } + } + } + query.inputs = [val]; + query.output = val; + query.search = val; + // searching by type + } else if (val.search("->") > -1) { + var trimmer = function (s) { return s.trim(); }; + var parts = val.split("->").map(trimmer); + var input = parts[0]; + // sort inputs so that order does not matter + var inputs = input.split(",").map(trimmer).sort(); + for (var i = 0; i < inputs.length; ++i) { + inputs[i] = extractGenerics(inputs[i]); + } + var output = extractGenerics(parts[1]); + + for (var i = 0; i < nSearchWords; ++i) { + var type = searchIndex[i].type; + var ty = searchIndex[i]; + if (!type) { + continue; + } + var fullId = generateId(ty); + + // allow searching for void (no output) functions as well + var typeOutput = type.output ? type.output.name : ""; + var returned = checkReturned(ty, output, true); + if (output.name === "*" || returned === true) { + var in_args = false; + var module = false; + + if (input === "*") { + module = true; + } else { + var allFound = true; + for (var it = 0; allFound === true && it < inputs.length; it++) { + allFound = checkType(type, inputs[it], true); + } + in_args = allFound; + } + if (in_args === true) { + results_in_args[fullId] = { + id: i, + index: -1, + dontValidate: true, + }; + } + if (returned === true) { + results_returned[fullId] = { + id: i, + index: -1, + dontValidate: true, + }; + } + if (module === true) { + results[fullId] = { + id: i, + index: -1, + dontValidate: true, + }; + } + } + } + query.inputs = inputs.map(function(input) { + return input.name; + }); + query.output = output.name; + } else { + query.inputs = [val]; + query.output = val; + query.search = val; + // gather matching search results up to a certain maximum + val = val.replace(/\_/g, ""); + + var valGenerics = extractGenerics(val); + + var paths = valLower.split("::"); + var j; + for (j = 0; j < paths.length; ++j) { + if (paths[j] === "") { + paths.splice(j, 1); + j -= 1; + } + } + val = paths[paths.length - 1]; + var startsWith = paths.slice(0, paths.length > 1 ? paths.length - 1 : 1); + + for (j = 0; j < nSearchWords; ++j) { + var lev_distance; + var ty = searchIndex[j]; + if (!ty) { + continue; + } + var lev_add = 0; + if (paths.length > 1) { + var lev = checkPath(startsWith, paths[paths.length - 1], ty); + if (lev > MAX_LEV_DISTANCE) { + continue; + } else if (lev > 0) { + lev_add = 1; + } + } + + var returned = MAX_LEV_DISTANCE + 1; + var in_args = MAX_LEV_DISTANCE + 1; + var index = -1; + // we want lev results to go lower than others + var lev = MAX_LEV_DISTANCE + 1; + var fullId = generateId(ty); + + if (searchWords[j].indexOf(split[i]) > -1 || + searchWords[j].indexOf(val) > -1 || + searchWords[j].replace(/_/g, "").indexOf(val) > -1) + { + // filter type: ... queries + if (typePassesFilter(typeFilter, ty.ty) && results[fullId] === undefined) { + index = searchWords[j].replace(/_/g, "").indexOf(val); + } + } + if ((lev = levenshtein(searchWords[j], val)) <= MAX_LEV_DISTANCE) { + if (typePassesFilter(typeFilter, ty.ty) === false) { + lev = MAX_LEV_DISTANCE + 1; + } else { + lev += 1; + } + } + if ((in_args = findArg(ty, valGenerics)) <= MAX_LEV_DISTANCE) { + if (typePassesFilter(typeFilter, ty.ty) === false) { + in_args = MAX_LEV_DISTANCE + 1; + } + } + if ((returned = checkReturned(ty, valGenerics)) <= MAX_LEV_DISTANCE) { + if (typePassesFilter(typeFilter, ty.ty) === false) { + returned = MAX_LEV_DISTANCE + 1; + } + } + + lev += lev_add; + if (lev > 0 && val.length > 3 && searchWords[j].startsWith(val)) { + if (val.length < 6) { + lev -= 1; + } else { + lev = 0; + } + } + if (in_args <= MAX_LEV_DISTANCE) { + if (results_in_args[fullId] === undefined) { + results_in_args[fullId] = { + id: j, + index: index, + lev: in_args, + }; + } + results_in_args[fullId].lev = + Math.min(results_in_args[fullId].lev, in_args); + } + if (returned <= MAX_LEV_DISTANCE) { + if (results_returned[fullId] === undefined) { + results_returned[fullId] = { + id: j, + index: index, + lev: returned, + }; + } + results_returned[fullId].lev = + Math.min(results_returned[fullId].lev, returned); + } + if (index !== -1 || lev <= MAX_LEV_DISTANCE) { + if (index !== -1) { + lev = 0; + } + if (results[fullId] === undefined) { + results[fullId] = { + id: j, + index: index, + lev: lev, + }; + } + results[fullId].lev = Math.min(results[fullId].lev, lev); + } + } + } + + return { + 'in_args': sortResults(results_in_args, true), + 'returned': sortResults(results_returned, true), + 'others': sortResults(results), + }; + } + + /** + * Validate performs the following boolean logic. For example: + * "File::open" will give IF A PARENT EXISTS => ("file" && "open") + * exists in (name || path || parent) OR => ("file" && "open") exists in + * (name || path ) + * + * This could be written functionally, but I wanted to minimise + * functions on stack. + * + * @param {[string]} name [The name of the result] + * @param {[string]} path [The path of the result] + * @param {[string]} keys [The keys to be used (["file", "open"])] + * @param {[object]} parent [The parent of the result] + * @return {[boolean]} [Whether the result is valid or not] + */ + function validateResult(name, path, keys, parent) { + for (var i = 0; i < keys.length; ++i) { + // each check is for validation so we negate the conditions and invalidate + if (!( + // check for an exact name match + name.indexOf(keys[i]) > -1 || + // then an exact path match + path.indexOf(keys[i]) > -1 || + // next if there is a parent, check for exact parent match + (parent !== undefined && + parent.name.toLowerCase().indexOf(keys[i]) > -1) || + // lastly check to see if the name was a levenshtein match + levenshtein(name, keys[i]) <= MAX_LEV_DISTANCE)) { + return false; + } + } + return true; + } + + function getQuery(raw) { + var matches, type, query; + query = raw; + + matches = query.match(/^(fn|mod|struct|enum|trait|type|const|macro)\s*:\s*/i); + if (matches) { + type = matches[1].replace(/^const$/, 'constant'); + query = query.substring(matches[0].length); + } + + return { + raw: raw, + query: query, + type: type, + id: query + type + }; + } + + function initSearchNav() { + var hoverTimeout; + + var click_func = function(e) { + var el = e.target; + // to retrieve the real "owner" of the event. + while (el.tagName !== 'TR') { + el = el.parentNode; + } + var dst = e.target.getElementsByTagName('a'); + if (dst.length < 1) { + return; + } + dst = dst[0]; + if (window.location.pathname === dst.pathname) { + addClass(document.getElementById('search'), 'hidden'); + removeClass(document.getElementById('main'), 'hidden'); + document.location.href = dst.href; + } + }; + var mouseover_func = function(e) { + var el = e.target; + // to retrieve the real "owner" of the event. + while (el.tagName !== 'TR') { + el = el.parentNode; + } + clearTimeout(hoverTimeout); + hoverTimeout = setTimeout(function() { + onEach(document.getElementsByClassName('search-results'), function(e) { + onEach(e.getElementsByClassName('result'), function(i_e) { + removeClass(i_e, 'highlighted'); + }); + }); + addClass(el, 'highlighted'); + }, 20); + }; + onEach(document.getElementsByClassName('search-results'), function(e) { + onEach(e.getElementsByClassName('result'), function(i_e) { + i_e.onclick = click_func; + i_e.onmouseover = mouseover_func; + }); + }); + + var search_input = document.getElementsByClassName('search-input')[0]; + search_input.onkeydown = function(e) { + // "actives" references the currently highlighted item in each search tab. + // Each array in "actives" represents a tab. + var actives = [[], [], []]; + // "current" is used to know which tab we're looking into. + var current = 0; + onEach(document.getElementsByClassName('search-results'), function(e) { + onEach(e.getElementsByClassName('highlighted'), function(e) { + actives[current].push(e); + }); + current += 1; + }); + + if (e.which === 38) { // up + if (!actives[currentTab].length || + !actives[currentTab][0].previousElementSibling) { + return; + } + + addClass(actives[currentTab][0].previousElementSibling, 'highlighted'); + removeClass(actives[currentTab][0], 'highlighted'); + } else if (e.which === 40) { // down + if (!actives[currentTab].length) { + var results = document.getElementsByClassName('search-results'); + if (results.length > 0) { + var res = results[currentTab].getElementsByClassName('result'); + if (res.length > 0) { + addClass(res[0], 'highlighted'); + } + } + } else if (actives[currentTab][0].nextElementSibling) { + addClass(actives[currentTab][0].nextElementSibling, 'highlighted'); + removeClass(actives[currentTab][0], 'highlighted'); + } + } else if (e.which === 13) { // return + if (actives[currentTab].length) { + document.location.href = + actives[currentTab][0].getElementsByTagName('a')[0].href; + } + } else if (e.which === 9) { // tab + if (e.shiftKey) { + printTab(currentTab > 0 ? currentTab - 1 : 2); + } else { + printTab(currentTab > 1 ? 0 : currentTab + 1); + } + e.preventDefault(); + } else if (e.which === 16) { // shift + // Does nothing, it's just to avoid losing "focus" on the highlighted element. + } else if (e.which === 27) { // escape + removeClass(actives[currentTab][0], 'highlighted'); + document.getElementsByClassName('search-input')[0].value = ''; + defocusSearchBar(); + } else if (actives[currentTab].length > 0) { + removeClass(actives[currentTab][0], 'highlighted'); + } + }; + } + + function escape(content) { + var h1 = document.createElement('h1'); + h1.textContent = content; + return h1.innerHTML; + } + + function pathSplitter(path) { + return '' + path.replace(/::/g, '::'); + } + + function addTab(array, query, display) { + var extraStyle = ''; + if (display === false) { + extraStyle = ' style="display: none;"'; + } + + var output = ''; + if (array.length > 0) { + output = ''; + var shown = []; + + array.forEach(function(item) { + var name, type, href, displayPath; + + if (shown.indexOf(item) !== -1) { + return; + } + + shown.push(item); + name = item.name; + type = itemTypes[item.ty]; + + if (type === 'mod') { + displayPath = item.path + '::'; + href = rootPath + item.path.replace(/::/g, '/') + '/' + + name + '/index.html'; + } else if (type === "primitive") { + displayPath = ""; + href = rootPath + item.path.replace(/::/g, '/') + + '/' + type + '.' + name + '.html'; + } else if (type === "externcrate") { + displayPath = ""; + href = rootPath + name + '/index.html'; + } else if (item.parent !== undefined) { + var myparent = item.parent; + var anchor = '#' + type + '.' + name; + var parentType = itemTypes[myparent.ty]; + if (parentType === "primitive") { + displayPath = myparent.name + '::'; + } else { + displayPath = item.path + '::' + myparent.name + '::'; + } + href = rootPath + item.path.replace(/::/g, '/') + + '/' + parentType + + '.' + myparent.name + + '.html' + anchor; + } else { + displayPath = item.path + '::'; + href = rootPath + item.path.replace(/::/g, '/') + + '/' + type + '.' + name + '.html'; + } + + output += ''; + }); + output += '
' + + '' + + pathSplitter(displayPath) + '' + + name + '' + + '' + + '' + escape(item.desc) + + ' 
'; + } else { + output = '
No results :(
' + + 'Try on DuckDuckGo?
'; + } + return output; + } + + function makeTabHeader(tabNb, text, nbElems) { + if (currentTab === tabNb) { + return '
' + text + + '
(' + nbElems + ')
'; + } + return '
' + text + '
(' + nbElems + ')
'; + } + + function showResults(results) { + var output, query = getQuery(document.getElementsByClassName('search-input')[0].value); + + currentResults = query.id; + output = '

Results for ' + escape(query.query) + + (query.type ? ' (type: ' + escape(query.type) + ')' : '') + '

' + + '
' + + makeTabHeader(0, "In Names", results['others'].length) + + makeTabHeader(1, "In Parameters", results['in_args'].length) + + makeTabHeader(2, "In Return Types", results['returned'].length) + + '
'; + + output += addTab(results['others'], query); + output += addTab(results['in_args'], query, false); + output += addTab(results['returned'], query, false); + output += '
'; + + addClass(document.getElementById('main'), 'hidden'); + var search = document.getElementById('search'); + removeClass(search, 'hidden'); + search.innerHTML = output; + var tds = search.getElementsByTagName('td'); + var td_width = 0; + if (tds.length > 0) { + td_width = tds[0].offsetWidth; + } + var width = search.offsetWidth - 40 - td_width; + onEach(search.getElementsByClassName('desc'), function(e) { + e.style.width = width + 'px'; + }); + initSearchNav(); + var elems = document.getElementById('titles').childNodes; + elems[0].onclick = function() { printTab(0); }; + elems[1].onclick = function() { printTab(1); }; + elems[2].onclick = function() { printTab(2); }; + printTab(currentTab); + } + + function search(e) { + var query, + obj, i, len, + results = {"in_args": [], "returned": [], "others": []}, + resultIndex; + var params = getQueryStringParams(); + + query = getQuery(document.getElementsByClassName('search-input')[0].value); + if (e) { + e.preventDefault(); + } + + if (!query.query || query.id === currentResults) { + return; + } + + // Update document title to maintain a meaningful browser history + document.title = "Results for " + query.query + " - Rust"; + + // Because searching is incremental by character, only the most + // recent search query is added to the browser history. + if (browserSupportsHistoryApi()) { + if (!history.state && !params.search) { + history.pushState(query, "", "?search=" + encodeURIComponent(query.raw)); + } else { + history.replaceState(query, "", "?search=" + encodeURIComponent(query.raw)); + } + } + + results = execQuery(query, index); + showResults(results); + } + + function buildIndex(rawSearchIndex) { + searchIndex = []; + var searchWords = []; + for (var crate in rawSearchIndex) { + if (!rawSearchIndex.hasOwnProperty(crate)) { continue; } + + searchWords.push(crate); + searchIndex.push({ + crate: crate, + ty: 1, // == ExternCrate + name: crate, + path: "", + desc: rawSearchIndex[crate].doc, + type: null, + }); + + // an array of [(Number) item type, + // (String) name, + // (String) full path or empty string for previous path, + // (String) description, + // (Number | null) the parent path index to `paths`] + // (Object | null) the type of the function (if any) + var items = rawSearchIndex[crate].items; + // an array of [(Number) item type, + // (String) name] + var paths = rawSearchIndex[crate].paths; + + // convert `paths` into an object form + var len = paths.length; + for (var i = 0; i < len; ++i) { + paths[i] = {ty: paths[i][0], name: paths[i][1]}; + } + + // convert `items` into an object form, and construct word indices. + // + // before any analysis is performed lets gather the search terms to + // search against apart from the rest of the data. This is a quick + // operation that is cached for the life of the page state so that + // all other search operations have access to this cached data for + // faster analysis operations + var len = items.length; + var lastPath = ""; + for (var i = 0; i < len; ++i) { + var rawRow = items[i]; + var row = {crate: crate, ty: rawRow[0], name: rawRow[1], + path: rawRow[2] || lastPath, desc: rawRow[3], + parent: paths[rawRow[4]], type: rawRow[5]}; + searchIndex.push(row); + if (typeof row.name === "string") { + var word = row.name.toLowerCase(); + searchWords.push(word); + } else { + searchWords.push(""); + } + lastPath = row.path; + } + } + return searchWords; + } + + function startSearch() { + var searchTimeout; + var callback = function() { + var search_input = document.getElementsByClassName('search-input'); + if (search_input.length < 1) { return; } + search_input = search_input[0]; + clearTimeout(searchTimeout); + if (search_input.value.length === 0) { + if (browserSupportsHistoryApi()) { + history.replaceState("", "std - Rust", "?search="); + } + var main = document.getElementById('main'); + if (hasClass(main, 'content')) { + removeClass(main, 'hidden'); + } + var search_c = document.getElementById('search'); + if (hasClass(search_c, 'content')) { + addClass(search_c, 'hidden'); + } + } else { + searchTimeout = setTimeout(search, 500); + } + }; + var search_input = document.getElementsByClassName("search-input")[0]; + search_input.onkeyup = callback; + search_input.oninput = callback; + document.getElementsByClassName("search-form")[0].onsubmit = function(e) { + e.preventDefault(); + clearTimeout(searchTimeout); + search(); + }; + search_input.onchange = function(e) { + // Do NOT e.preventDefault() here. It will prevent pasting. + clearTimeout(searchTimeout); + // zero-timeout necessary here because at the time of event handler execution the + // pasted content is not in the input field yet. Shouldn’t make any difference for + // change, though. + setTimeout(search, 0); + }; + search_input.onpaste = search_input.onchange; + + // Push and pop states are used to add search results to the browser + // history. + if (browserSupportsHistoryApi()) { + // Store the previous so we can revert back to it later. + var previousTitle = document.title; + + window.onpopstate = function(e) { + var params = getQueryStringParams(); + // When browsing back from search results the main page + // visibility must be reset. + if (!params.search) { + var main = document.getElementById('main'); + if (hasClass(main, 'content')) { + removeClass(main, 'hidden'); + } + var search_c = document.getElementById('search'); + if (hasClass(search_c, 'content')) { + addClass(search_c, 'hidden'); + } + } + // Revert to the previous title manually since the History + // API ignores the title parameter. + document.title = previousTitle; + // When browsing forward to search results the previous + // search will be repeated, so the currentResults are + // cleared to ensure the search is successful. + currentResults = null; + // Synchronize search bar with query string state and + // perform the search. This will empty the bar if there's + // nothing there, which lets you really go back to a + // previous state with nothing in the bar. + if (params.search) { + document.getElementsByClassName('search-input')[0].value = params.search; + } else { + document.getElementsByClassName('search-input')[0].value = ''; + } + // Some browsers fire 'onpopstate' for every page load + // (Chrome), while others fire the event only when actually + // popping a state (Firefox), which is why search() is + // called both here and at the end of the startSearch() + // function. + search(); + }; + } + search(); + } + + index = buildIndex(rawSearchIndex); + startSearch(); + + // Draw a convenient sidebar of known crates if we have a listing + if (rootPath === '../') { + var sidebar = document.getElementsByClassName('sidebar-elems')[0]; + if (sidebar) { + var div = document.createElement('div'); + div.className = 'block crate'; + div.innerHTML = '<h3>Crates</h3>'; + var ul = document.createElement('ul'); + div.appendChild(ul); + + var crates = []; + for (var crate in rawSearchIndex) { + if (!rawSearchIndex.hasOwnProperty(crate)) { + continue; + } + crates.push(crate); + } + crates.sort(); + for (var i = 0; i < crates.length; ++i) { + var klass = 'crate'; + if (crates[i] === window.currentCrate) { + klass += ' current'; + } + var link = document.createElement('a'); + link.href = '../' + crates[i] + '/index.html'; + link.title = rawSearchIndex[crates[i]].doc; + link.className = klass; + link.textContent = crates[i]; + + var li = document.createElement('li'); + li.appendChild(link); + ul.appendChild(li); + } + sidebar.appendChild(div); + } + } + } + + window.initSearch = initSearch; + + // delayed sidebar rendering. + function initSidebarItems(items) { + var sidebar = document.getElementsByClassName('sidebar-elems')[0]; + var current = window.sidebarCurrent; + + function block(shortty, longty) { + var filtered = items[shortty]; + if (!filtered) { return; } + + var div = document.createElement('div'); + div.className = 'block ' + shortty; + var h3 = document.createElement('h3'); + h3.textContent = longty; + div.appendChild(h3); + var ul = document.createElement('ul'); + + for (var i = 0; i < filtered.length; ++i) { + var item = filtered[i]; + var name = item[0]; + var desc = item[1]; // can be null + + var klass = shortty; + if (name === current.name && shortty === current.ty) { + klass += ' current'; + } + var path; + if (shortty === 'mod') { + path = name + '/index.html'; + } else { + path = shortty + '.' + name + '.html'; + } + var link = document.createElement('a'); + link.href = current.relpath + path; + link.title = desc; + link.className = klass; + link.textContent = name; + var li = document.createElement('li'); + li.appendChild(link); + ul.appendChild(li); + } + div.appendChild(ul); + if (sidebar) { + sidebar.appendChild(div); + } + } + + block("primitive", "Primitive Types"); + block("mod", "Modules"); + block("macro", "Macros"); + block("struct", "Structs"); + block("enum", "Enums"); + block("union", "Unions"); + block("constant", "Constants"); + block("static", "Statics"); + block("trait", "Traits"); + block("fn", "Functions"); + block("type", "Type Definitions"); + block("foreigntype", "Foreign Types"); + } + + window.initSidebarItems = initSidebarItems; + + window.register_implementors = function(imp) { + var implementors = document.getElementById('implementors-list'); + var synthetic_implementors = document.getElementById('synthetic-implementors-list'); + + var libs = Object.getOwnPropertyNames(imp); + for (var i = 0; i < libs.length; ++i) { + if (libs[i] === currentCrate) { continue; } + var structs = imp[libs[i]]; + + struct_loop: + for (var j = 0; j < structs.length; ++j) { + var struct = structs[j]; + + var list = struct.synthetic ? synthetic_implementors : implementors; + + if (struct.synthetic) { + for (var k = 0; k < struct.types.length; k++) { + if (window.inlined_types.has(struct.types[k])) { + continue struct_loop; + } + window.inlined_types.add(struct.types[k]); + } + } + + var code = document.createElement('code'); + code.innerHTML = struct.text; + + var x = code.getElementsByTagName('a'); + for (var k = 0; k < x.length; k++) { + var href = x[k].getAttribute('href'); + if (href && href.indexOf('http') !== 0) { + x[k].setAttribute('href', rootPath + href); + } + } + var li = document.createElement('li'); + li.appendChild(code); + list.appendChild(li); + } + } + }; + if (window.pending_implementors) { + window.register_implementors(window.pending_implementors); + } + + function labelForToggleButton(sectionIsCollapsed) { + if (sectionIsCollapsed) { + // button will expand the section + return "+"; + } + // button will collapse the section + // note that this text is also set in the HTML template in render.rs + return "\u2212"; // "\u2212" is '−' minus sign + } + + function onEveryMatchingChild(elem, className, func) { + if (elem && className && func) { + for (var i = 0; i < elem.childNodes.length; i++) { + if (hasClass(elem.childNodes[i], className)) { + func(elem.childNodes[i]); + } else { + onEveryMatchingChild(elem.childNodes[i], className, func); + } + } + } + } + + function toggleAllDocs() { + var toggle = document.getElementById("toggle-all-docs"); + if (hasClass(toggle, "will-expand")) { + updateLocalStorage("rustdoc-collapse", "false"); + removeClass(toggle, "will-expand"); + onEveryMatchingChild(toggle, "inner", function(e) { + e.innerHTML = labelForToggleButton(false); + }); + toggle.title = "collapse all docs"; + onEach(document.getElementsByClassName("collapse-toggle"), function(e) { + collapseDocs(e, "show"); + }); + } else { + updateLocalStorage("rustdoc-collapse", "true"); + addClass(toggle, "will-expand"); + onEveryMatchingChild(toggle, "inner", function(e) { + e.innerHTML = labelForToggleButton(true); + }); + toggle.title = "expand all docs"; + + onEach(document.getElementsByClassName("collapse-toggle"), function(e) { + collapseDocs(e, "hide"); + }); + } + } + + function collapseDocs(toggle, mode) { + if (!toggle || !toggle.parentNode) { + return; + } + + function adjustToggle(arg) { + return function(e) { + if (hasClass(e, 'toggle-label')) { + if (arg) { + e.style.display = 'inline-block'; + } else { + e.style.display = 'none'; + } + } + if (hasClass(e, 'inner')) { + e.innerHTML = labelForToggleButton(arg); + } + }; + }; + + if (!hasClass(toggle.parentNode, "impl")) { + var relatedDoc = toggle.parentNode.nextElementSibling; + if (hasClass(relatedDoc, "stability")) { + relatedDoc = relatedDoc.nextElementSibling; + } + if (hasClass(relatedDoc, "docblock")) { + var action = mode; + if (action === "toggle") { + if (hasClass(relatedDoc, "hidden-by-usual-hider")) { + action = "show"; + } else { + action = "hide"; + } + } + if (action === "hide") { + addClass(relatedDoc, "hidden-by-usual-hider"); + onEach(toggle.childNodes, adjustToggle(true)); + addClass(toggle.parentNode, 'collapsed'); + } else if (action === "show") { + removeClass(relatedDoc, "hidden-by-usual-hider"); + removeClass(toggle.parentNode, 'collapsed'); + onEach(toggle.childNodes, adjustToggle(false)); + } + } + } else { + // we are collapsing the impl block + function implHider(addOrRemove) { + return function(n) { + var is_method = hasClass(n, "method"); + if (is_method || hasClass(n, "type")) { + if (is_method === true) { + if (addOrRemove) { + addClass(n, "hidden-by-impl-hider"); + } else { + removeClass(n, "hidden-by-impl-hider"); + } + } + var ns = n.nextElementSibling; + while (true) { + if (ns && ( + hasClass(ns, "docblock") || + hasClass(ns, "stability"))) { + if (addOrRemove) { + addClass(ns, "hidden-by-impl-hider"); + } else { + removeClass(ns, "hidden-by-impl-hider"); + } + ns = ns.nextElementSibling; + continue; + } + break; + } + } + } + } + + var relatedDoc = toggle.parentNode; + var docblock = relatedDoc.nextElementSibling; + + while (!hasClass(relatedDoc, "impl-items")) { + relatedDoc = relatedDoc.nextElementSibling; + } + + if (!relatedDoc && !hasClass(docblock, "docblock")) { + return; + } + + // Hide all functions, but not associated types/consts + + var action = mode; + if (action === "toggle") { + if (hasClass(relatedDoc, "fns-now-collapsed") || + hasClass(docblock, "hidden-by-impl-hider")) { + action = "show"; + } else { + action = "hide"; + } + } + + if (action === "show") { + removeClass(relatedDoc, "fns-now-collapsed"); + removeClass(docblock, "hidden-by-usual-hider"); + onEach(toggle.childNodes, adjustToggle(false)); + onEach(relatedDoc.childNodes, implHider(false)); + } else if (action === "hide") { + addClass(relatedDoc, "fns-now-collapsed"); + addClass(docblock, "hidden-by-usual-hider"); + onEach(toggle.childNodes, adjustToggle(true)); + onEach(relatedDoc.childNodes, implHider(true)); + } + } + } + + function autoCollapseAllImpls() { + // Automatically minimize all non-inherent impls + onEach(document.getElementsByClassName('impl'), function(n) { + // inherent impl ids are like 'impl' or impl-<number>' + var inherent = (n.id.match(/^impl(?:-\d+)?$/) !== null); + if (!inherent) { + onEach(n.childNodes, function(m) { + if (hasClass(m, "collapse-toggle")) { + collapseDocs(m, "hide"); + } + }); + } + }); + } + + var x = document.getElementById('toggle-all-docs'); + if (x) { + x.onclick = toggleAllDocs; + } + + function insertAfter(newNode, referenceNode) { + referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); + } + + function checkIfThereAreMethods(elems) { + var areThereMethods = false; + + onEach(elems, function(e) { + if (hasClass(e, "method")) { + areThereMethods = true; + return true; + } + }); + return areThereMethods; + } + + var toggle = document.createElement('a'); + toggle.href = 'javascript:void(0)'; + toggle.className = 'collapse-toggle'; + toggle.innerHTML = "[<span class='inner'>" + labelForToggleButton(false) + "</span>]"; + + var func = function(e) { + var next = e.nextElementSibling; + if (hasClass(e, 'impl') && next && hasClass(next, 'docblock')) { + next = next.nextElementSibling; + } + if (!next) { + return; + } + if ((checkIfThereAreMethods(next.childNodes) || hasClass(e, 'method')) && + (hasClass(next, 'docblock') || + hasClass(e, 'impl') || + (hasClass(next, 'stability') && + hasClass(next.nextElementSibling, 'docblock')))) { + insertAfter(toggle.cloneNode(true), e.childNodes[e.childNodes.length - 1]); + } + } + onEach(document.getElementsByClassName('method'), func); + onEach(document.getElementsByClassName('impl'), func); + onEach(document.getElementsByClassName('impl-items'), function(e) { + onEach(e.getElementsByClassName('associatedconstant'), func); + }); + + function createToggle(otherMessage) { + var span = document.createElement('span'); + span.className = 'toggle-label'; + span.style.display = 'none'; + if (!otherMessage) { + span.innerHTML = ' Expand description'; + } else { + span.innerHTML = otherMessage; + span.style.fontSize = '20px'; + } + + var mainToggle = toggle.cloneNode(true); + mainToggle.appendChild(span); + + var wrapper = document.createElement('div'); + wrapper.className = 'toggle-wrapper'; + wrapper.appendChild(mainToggle); + return wrapper; + } + + onEach(document.getElementById('main').getElementsByClassName('docblock'), function(e) { + if (e.parentNode.id === "main") { + var otherMessage; + if (hasClass(e, "type-decl")) { + otherMessage = ' Show type declaration'; + } + e.parentNode.insertBefore(createToggle(otherMessage), e); + if (otherMessage) { + collapseDocs(e.previousSibling.childNodes[0], "toggle"); + } + } + }); + + onEach(document.getElementsByClassName('docblock'), function(e) { + if (hasClass(e, 'autohide')) { + var wrap = e.previousElementSibling; + if (wrap && hasClass(wrap, 'toggle-wrapper')) { + var toggle = wrap.childNodes[0]; + if (e.childNodes[0].tagName === 'H3') { + onEach(toggle.getElementsByClassName('toggle-label'), function(i_e) { + i_e.innerHTML = " Show " + e.childNodes[0].innerHTML; + }); + } + e.style.display = 'none'; + addClass(wrap, 'collapsed'); + onEach(toggle.getElementsByClassName('inner'), function(e) { + e.innerHTML = labelForToggleButton(true); + }); + onEach(toggle.getElementsByClassName('toggle-label'), function(e) { + e.style.display = 'inline-block'; + }); + } + } + }) + + autoCollapseAllImpls(); + + function createToggleWrapper() { + var span = document.createElement('span'); + span.className = 'toggle-label'; + span.style.display = 'none'; + span.innerHTML = ' Expand attributes'; + toggle.appendChild(span); + + var wrapper = document.createElement('div'); + wrapper.className = 'toggle-wrapper toggle-attributes'; + wrapper.appendChild(toggle); + return wrapper; + } + + // In the search display, allows to switch between tabs. + function printTab(nb) { + if (nb === 0 || nb === 1 || nb === 2) { + currentTab = nb; + } + var nb_copy = nb; + onEach(document.getElementById('titles').childNodes, function(elem) { + if (nb_copy === 0) { + addClass(elem, 'selected'); + } else { + removeClass(elem, 'selected'); + } + nb_copy -= 1; + }); + onEach(document.getElementById('results').childNodes, function(elem) { + if (nb === 0) { + elem.style.display = ''; + } else { + elem.style.display = 'none'; + } + nb -= 1; + }); + } + + onEach(document.getElementById('main').getElementsByTagName('pre'), function(e) { + onEach(e.getElementsByClassName('attributes'), function(i_e) { + i_e.parentNode.insertBefore(createToggleWrapper(), i_e); + collapseDocs(i_e.previousSibling.childNodes[0], "toggle"); + }); + }); + + onEach(document.getElementsByClassName('rust-example-rendered'), function(e) { + if (hasClass(e, 'compile_fail')) { + e.addEventListener("mouseover", function(event) { + e.previousElementSibling.childNodes[0].style.color = '#f00'; + }); + e.addEventListener("mouseout", function(event) { + e.previousElementSibling.childNodes[0].style.color = ''; + }); + } else if (hasClass(e, 'ignore')) { + e.addEventListener("mouseover", function(event) { + e.previousElementSibling.childNodes[0].style.color = '#ff9200'; + }); + e.addEventListener("mouseout", function(event) { + e.previousElementSibling.childNodes[0].style.color = ''; + }); + } + }); + + function showModal(content) { + var modal = document.createElement('div'); + modal.id = "important"; + addClass(modal, 'modal'); + modal.innerHTML = '<div class="modal-content"><div class="close" id="modal-close">✕</div>' + + '<div class="whiter"></div><span class="docblock">' + content + + '</span></div>'; + document.getElementsByTagName('body')[0].appendChild(modal); + document.getElementById('modal-close').onclick = hideModal; + modal.onclick = hideModal; + } + + function hideModal() { + var modal = document.getElementById("important"); + if (modal) { + modal.parentNode.removeChild(modal); + } + } + + onEach(document.getElementsByClassName('important-traits'), function(e) { + e.onclick = function() { + showModal(e.lastElementChild.innerHTML); + }; + }); + + var search_input = document.getElementsByClassName("search-input")[0]; + + if (search_input) { + search_input.onfocus = function() { + if (search_input.value !== "") { + addClass(document.getElementById("main"), "hidden"); + removeClass(document.getElementById("search"), "hidden"); + if (browserSupportsHistoryApi()) { + history.replaceState(search_input.value, + "", + "?search=" + encodeURIComponent(search_input.value)); + } + } + }; + } + + var params = getQueryStringParams(); + if (params && params.search) { + addClass(document.getElementById("main"), "hidden"); + var search = document.getElementById("search"); + removeClass(search, "hidden"); + search.innerHTML = '<h3 style="text-align: center;">Loading search results...</h3>'; + } + + var sidebar_menu = document.getElementsByClassName("sidebar-menu")[0]; + if (sidebar_menu) { + sidebar_menu.onclick = function() { + var sidebar = document.getElementsByClassName('sidebar')[0]; + if (hasClass(sidebar, "mobile") === true) { + hideSidebar(); + } else { + showSidebar(); + } + }; + } + + window.onresize = function() { + hideSidebar(); + }; + + if (getCurrentValue("rustdoc-collapse") === "true") { + toggleAllDocs(); + } +}()); + +// Sets the focus on the search bar at the top of the page +function focusSearchBar() { + document.getElementsByClassName('search-input')[0].focus(); +} + +// Removes the focus from the search bar +function defocusSearchBar() { + document.getElementsByClassName('search-input')[0].blur(); +} diff --git a/docs/apis/rust/0.7.0/mentat/Attribute.t.html b/docs/apis/rust/0.7.0/mentat/Attribute.t.html new file mode 100644 index 00000000..d929c865 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/Attribute.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.Attribute.html"> +</head> +<body> + <p>Redirecting to <a href="struct.Attribute.html">struct.Attribute.html</a>...</p> + <script>location.replace("struct.Attribute.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/AttributeSet.t.html b/docs/apis/rust/0.7.0/mentat/AttributeSet.t.html new file mode 100644 index 00000000..f738004f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/AttributeSet.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=type.AttributeSet.html"> +</head> +<body> + <p>Redirecting to <a href="type.AttributeSet.html">type.AttributeSet.html</a>...</p> + <script>location.replace("type.AttributeSet.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/Binding.t.html b/docs/apis/rust/0.7.0/mentat/Binding.t.html new file mode 100644 index 00000000..04563187 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/Binding.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=enum.Binding.html"> +</head> +<body> + <p>Redirecting to <a href="enum.Binding.html">enum.Binding.html</a>...</p> + <script>location.replace("enum.Binding.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/CORE_SCHEMA_VERSION.v.html b/docs/apis/rust/0.7.0/mentat/CORE_SCHEMA_VERSION.v.html new file mode 100644 index 00000000..0bacaf6c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/CORE_SCHEMA_VERSION.v.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=constant.CORE_SCHEMA_VERSION.html"> +</head> +<body> + <p>Redirecting to <a href="constant.CORE_SCHEMA_VERSION.html">constant.CORE_SCHEMA_VERSION.html</a>...</p> + <script>location.replace("constant.CORE_SCHEMA_VERSION.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/DB_SCHEMA_CORE.v.html b/docs/apis/rust/0.7.0/mentat/DB_SCHEMA_CORE.v.html new file mode 100644 index 00000000..2845e186 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/DB_SCHEMA_CORE.v.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=constant.DB_SCHEMA_CORE.html"> +</head> +<body> + <p>Redirecting to <a href="constant.DB_SCHEMA_CORE.html">constant.DB_SCHEMA_CORE.html</a>...</p> + <script>location.replace("constant.DB_SCHEMA_CORE.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/DateTime.t.html b/docs/apis/rust/0.7.0/mentat/DateTime.t.html new file mode 100644 index 00000000..4f28f679 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/DateTime.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.DateTime.html"> +</head> +<body> + <p>Redirecting to <a href="struct.DateTime.html">struct.DateTime.html</a>...</p> + <script>location.replace("struct.DateTime.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/Entid.t.html b/docs/apis/rust/0.7.0/mentat/Entid.t.html new file mode 100644 index 00000000..a33a5c5a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/Entid.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=type.Entid.html"> +</head> +<body> + <p>Redirecting to <a href="type.Entid.html">type.Entid.html</a>...</p> + <script>location.replace("type.Entid.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/FindSpec.t.html b/docs/apis/rust/0.7.0/mentat/FindSpec.t.html new file mode 100644 index 00000000..85d8eec4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/FindSpec.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=enum.FindSpec.html"> +</head> +<body> + <p>Redirecting to <a href="enum.FindSpec.html">enum.FindSpec.html</a>...</p> + <script>location.replace("enum.FindSpec.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/HasSchema.t.html b/docs/apis/rust/0.7.0/mentat/HasSchema.t.html new file mode 100644 index 00000000..5c26521f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/HasSchema.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=trait.HasSchema.html"> +</head> +<body> + <p>Redirecting to <a href="trait.HasSchema.html">trait.HasSchema.html</a>...</p> + <script>location.replace("trait.HasSchema.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/Keyword.t.html b/docs/apis/rust/0.7.0/mentat/Keyword.t.html new file mode 100644 index 00000000..2ff7981f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/Keyword.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.Keyword.html"> +</head> +<body> + <p>Redirecting to <a href="struct.Keyword.html">struct.Keyword.html</a>...</p> + <script>location.replace("struct.Keyword.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/KnownEntid.t.html b/docs/apis/rust/0.7.0/mentat/KnownEntid.t.html new file mode 100644 index 00000000..f715cf77 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/KnownEntid.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.KnownEntid.html"> +</head> +<body> + <p>Redirecting to <a href="struct.KnownEntid.html">struct.KnownEntid.html</a>...</p> + <script>location.replace("struct.KnownEntid.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/PlainSymbol.t.html b/docs/apis/rust/0.7.0/mentat/PlainSymbol.t.html new file mode 100644 index 00000000..4c20195d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/PlainSymbol.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.PlainSymbol.html"> +</head> +<body> + <p>Redirecting to <a href="struct.PlainSymbol.html">struct.PlainSymbol.html</a>...</p> + <script>location.replace("struct.PlainSymbol.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/QueryInputs.t.html b/docs/apis/rust/0.7.0/mentat/QueryInputs.t.html new file mode 100644 index 00000000..e805aadc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/QueryInputs.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.QueryInputs.html"> +</head> +<body> + <p>Redirecting to <a href="struct.QueryInputs.html">struct.QueryInputs.html</a>...</p> + <script>location.replace("struct.QueryInputs.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/QueryOutput.t.html b/docs/apis/rust/0.7.0/mentat/QueryOutput.t.html new file mode 100644 index 00000000..56ae12d8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/QueryOutput.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.QueryOutput.html"> +</head> +<body> + <p>Redirecting to <a href="struct.QueryOutput.html">struct.QueryOutput.html</a>...</p> + <script>location.replace("struct.QueryOutput.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/QueryResults.t.html b/docs/apis/rust/0.7.0/mentat/QueryResults.t.html new file mode 100644 index 00000000..b52d422e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/QueryResults.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=enum.QueryResults.html"> +</head> +<body> + <p>Redirecting to <a href="enum.QueryResults.html">enum.QueryResults.html</a>...</p> + <script>location.replace("enum.QueryResults.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/RelResult.t.html b/docs/apis/rust/0.7.0/mentat/RelResult.t.html new file mode 100644 index 00000000..28847dea --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/RelResult.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.RelResult.html"> +</head> +<body> + <p>Redirecting to <a href="struct.RelResult.html">struct.RelResult.html</a>...</p> + <script>location.replace("struct.RelResult.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/Schema.t.html b/docs/apis/rust/0.7.0/mentat/Schema.t.html new file mode 100644 index 00000000..176b0419 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/Schema.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.Schema.html"> +</head> +<body> + <p>Redirecting to <a href="struct.Schema.html">struct.Schema.html</a>...</p> + <script>location.replace("struct.Schema.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/TxObserver.t.html b/docs/apis/rust/0.7.0/mentat/TxObserver.t.html new file mode 100644 index 00000000..fa2f3723 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/TxObserver.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.TxObserver.html"> +</head> +<body> + <p>Redirecting to <a href="struct.TxObserver.html">struct.TxObserver.html</a>...</p> + <script>location.replace("struct.TxObserver.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/TxReport.t.html b/docs/apis/rust/0.7.0/mentat/TxReport.t.html new file mode 100644 index 00000000..94bca9f7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/TxReport.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.TxReport.html"> +</head> +<body> + <p>Redirecting to <a href="struct.TxReport.html">struct.TxReport.html</a>...</p> + <script>location.replace("struct.TxReport.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/TypedValue.t.html b/docs/apis/rust/0.7.0/mentat/TypedValue.t.html new file mode 100644 index 00000000..8b0ac4a6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/TypedValue.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=enum.TypedValue.html"> +</head> +<body> + <p>Redirecting to <a href="enum.TypedValue.html">enum.TypedValue.html</a>...</p> + <script>location.replace("enum.TypedValue.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/Utc.t.html b/docs/apis/rust/0.7.0/mentat/Utc.t.html new file mode 100644 index 00000000..dda32b3b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/Utc.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.Utc.html"> +</head> +<body> + <p>Redirecting to <a href="struct.Utc.html">struct.Utc.html</a>...</p> + <script>location.replace("struct.Utc.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/Uuid.t.html b/docs/apis/rust/0.7.0/mentat/Uuid.t.html new file mode 100644 index 00000000..60b8c2f7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/Uuid.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.Uuid.html"> +</head> +<body> + <p>Redirecting to <a href="struct.Uuid.html">struct.Uuid.html</a>...</p> + <script>location.replace("struct.Uuid.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/ValueType.t.html b/docs/apis/rust/0.7.0/mentat/ValueType.t.html new file mode 100644 index 00000000..2809fdde --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/ValueType.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=enum.ValueType.html"> +</head> +<body> + <p>Redirecting to <a href="enum.ValueType.html">enum.ValueType.html</a>...</p> + <script>location.replace("enum.ValueType.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/Variable.t.html b/docs/apis/rust/0.7.0/mentat/Variable.t.html new file mode 100644 index 00000000..37fb069f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/Variable.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.Variable.html"> +</head> +<body> + <p>Redirecting to <a href="struct.Variable.html">struct.Variable.html</a>...</p> + <script>location.replace("struct.Variable.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/bail.m.html b/docs/apis/rust/0.7.0/mentat/bail.m.html new file mode 100644 index 00000000..6a9910ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/bail.m.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=macro.bail.html"> +</head> +<body> + <p>Redirecting to <a href="macro.bail.html">macro.bail.html</a>...</p> + <script>location.replace("macro.bail.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/CacheAction.t.html b/docs/apis/rust/0.7.0/mentat/conn/CacheAction.t.html new file mode 100644 index 00000000..9697c408 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/CacheAction.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=enum.CacheAction.html"> +</head> +<body> + <p>Redirecting to <a href="enum.CacheAction.html">enum.CacheAction.html</a>...</p> + <script>location.replace("enum.CacheAction.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/CacheDirection.t.html b/docs/apis/rust/0.7.0/mentat/conn/CacheDirection.t.html new file mode 100644 index 00000000..267c7f41 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/CacheDirection.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=enum.CacheDirection.html"> +</head> +<body> + <p>Redirecting to <a href="enum.CacheDirection.html">enum.CacheDirection.html</a>...</p> + <script>location.replace("enum.CacheDirection.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/Conn.t.html b/docs/apis/rust/0.7.0/mentat/conn/Conn.t.html new file mode 100644 index 00000000..d9ebf261 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/Conn.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.Conn.html"> +</head> +<body> + <p>Redirecting to <a href="struct.Conn.html">struct.Conn.html</a>...</p> + <script>location.replace("struct.Conn.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/InProgress.t.html b/docs/apis/rust/0.7.0/mentat/conn/InProgress.t.html new file mode 100644 index 00000000..4892260c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/InProgress.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.InProgress.html"> +</head> +<body> + <p>Redirecting to <a href="struct.InProgress.html">struct.InProgress.html</a>...</p> + <script>location.replace("struct.InProgress.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/InProgressRead.t.html b/docs/apis/rust/0.7.0/mentat/conn/InProgressRead.t.html new file mode 100644 index 00000000..7d9303da --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/InProgressRead.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.InProgressRead.html"> +</head> +<body> + <p>Redirecting to <a href="struct.InProgressRead.html">struct.InProgressRead.html</a>...</p> + <script>location.replace("struct.InProgressRead.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/Metadata.t.html b/docs/apis/rust/0.7.0/mentat/conn/Metadata.t.html new file mode 100644 index 00000000..d60d1c77 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/Metadata.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=struct.Metadata.html"> +</head> +<body> + <p>Redirecting to <a href="struct.Metadata.html">struct.Metadata.html</a>...</p> + <script>location.replace("struct.Metadata.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/Pullable.t.html b/docs/apis/rust/0.7.0/mentat/conn/Pullable.t.html new file mode 100644 index 00000000..daf1a9a7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/Pullable.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=trait.Pullable.html"> +</head> +<body> + <p>Redirecting to <a href="trait.Pullable.html">trait.Pullable.html</a>...</p> + <script>location.replace("trait.Pullable.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/Queryable.t.html b/docs/apis/rust/0.7.0/mentat/conn/Queryable.t.html new file mode 100644 index 00000000..6a690d5c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/Queryable.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=trait.Queryable.html"> +</head> +<body> + <p>Redirecting to <a href="trait.Queryable.html">trait.Queryable.html</a>...</p> + <script>location.replace("trait.Queryable.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/Syncable.t.html b/docs/apis/rust/0.7.0/mentat/conn/Syncable.t.html new file mode 100644 index 00000000..d189cf43 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/Syncable.t.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="refresh" content="0;URL=trait.Syncable.html"> +</head> +<body> + <p>Redirecting to <a href="trait.Syncable.html">trait.Syncable.html</a>...</p> + <script>location.replace("trait.Syncable.html" + location.search + location.hash);</script> +</body> +</html> \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/enum.CacheAction.html b/docs/apis/rust/0.7.0/mentat/conn/enum.CacheAction.html new file mode 100644 index 00000000..e60edea7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/enum.CacheAction.html @@ -0,0 +1,146 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="generator" content="rustdoc"> + <meta name="description" content="API documentation for the Rust `CacheAction` enum in crate `mentat`."> + <meta name="keywords" content="rust, rustlang, rust-lang, CacheAction"> + + <title>mentat::conn::CacheAction - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat::conn::CacheAction + + [] + + [src]

pub enum CacheAction {
+    Register,
+    Deregister,
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Clone for CacheAction
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for CacheAction
[src]

impl Debug for CacheAction
[src]

Formats the value using the given formatter. Read more

+

impl Eq for CacheAction
[src]

impl PartialEq for CacheAction
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for CacheAction

impl Sync for CacheAction

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/enum.CacheDirection.html b/docs/apis/rust/0.7.0/mentat/conn/enum.CacheDirection.html new file mode 100644 index 00000000..1a34e584 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/enum.CacheDirection.html @@ -0,0 +1,147 @@ + + + + + + + + + + mentat::conn::CacheDirection - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat::conn::CacheDirection + + [] + + [src]

pub enum CacheDirection {
+    Forward,
+    Reverse,
+    Both,
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Clone for CacheDirection
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for CacheDirection
[src]

impl Debug for CacheDirection
[src]

Formats the value using the given formatter. Read more

+

impl Eq for CacheDirection
[src]

impl PartialEq for CacheDirection
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/index.html b/docs/apis/rust/0.7.0/mentat/conn/index.html new file mode 100644 index 00000000..39175e30 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/index.html @@ -0,0 +1,200 @@ + + + + + + + + + + mentat::conn - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat::conn + + [] + + [src]

Structs

+ + + + + + + + + + + + + + + + +
Conn +

A mutable, safe reference to the current Mentat store.

+ +
InProgress +

Represents an in-progress, not yet committed, set of changes to the store. +Call commit to commit your changes, or rollback to discard them. +A transaction is held open until you do so. +Your changes will be implicitly dropped along with this struct.

+ +
InProgressRead +

Represents an in-progress set of reads to the store. Just like InProgress, +which is read-write, but only allows for reads.

+ +
Metadata +

Connection metadata required to query from, or apply transactions to, a Mentat store.

+ +

Enums

+ + + + + + + + +
CacheAction + +
CacheDirection + +

Traits

+ + + + + + + + + + + + +
Pullable + +
Queryable + +
Syncable + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/sidebar-items.js b/docs/apis/rust/0.7.0/mentat/conn/sidebar-items.js new file mode 100644 index 00000000..ff9883be --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["CacheAction",""],["CacheDirection",""]],"struct":[["Conn","A mutable, safe reference to the current Mentat store."],["InProgress","Represents an in-progress, not yet committed, set of changes to the store. Call `commit` to commit your changes, or `rollback` to discard them. A transaction is held open until you do so. Your changes will be implicitly dropped along with this struct."],["InProgressRead","Represents an in-progress set of reads to the store. Just like `InProgress`, which is read-write, but only allows for reads."],["Metadata","Connection metadata required to query from, or apply transactions to, a Mentat store."]],"trait":[["Pullable",""],["Queryable",""],["Syncable",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/struct.Conn.html b/docs/apis/rust/0.7.0/mentat/conn/struct.Conn.html new file mode 100644 index 00000000..f5257d9d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/struct.Conn.html @@ -0,0 +1,156 @@ + + + + + + + + + + mentat::conn::Conn - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::conn::Conn + + [] + + [src]

pub struct Conn { /* fields omitted */ }

A mutable, safe reference to the current Mentat store.

+
+

+ Methods +

+

impl Conn
[src]

Yield a clone of the current Schema instance.

+

Query the Mentat store, using the given connection and the current metadata.

+

Query the Mentat store, using the given connection and the current metadata, +but without using the cache.

+

IMMEDIATE means 'start the transaction now, but don't exclude readers'. It prevents other +connections from taking immediate or exclusive transactions. This is appropriate for our +writes and InProgress: it means we are ready to write whenever we want to, and nobody else +can start a transaction that's not DEFERRED, but we don't need exclusivity yet.

+

Transact entities against the Mentat store, using the given connection and the current +metadata.

+

Adds or removes the values of a given attribute to an in-memory cache. +The attribute should be a namespaced string: e.g., :foo/bar. +cache_action determines if the attribute should be added or removed from the cache. +CacheAction::Add is idempotent - each attribute is only added once. +CacheAction::Remove throws an error if the attribute does not currently exist in the cache.

+

+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl Send for Conn

impl Sync for Conn

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/struct.InProgress.html b/docs/apis/rust/0.7.0/mentat/conn/struct.InProgress.html new file mode 100644 index 00000000..23c67aa1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/struct.InProgress.html @@ -0,0 +1,153 @@ + + + + + + + + + + mentat::conn::InProgress - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::conn::InProgress + + [] + + [src]

pub struct InProgress<'a, 'c> { /* fields omitted */ }

Represents an in-progress, not yet committed, set of changes to the store. +Call commit to commit your changes, or rollback to discard them. +A transaction is held open until you do so. +Your changes will be implicitly dropped along with this struct.

+
+

+ Methods +

+

impl<'a, 'c> InProgress<'a, 'c>
[src]

Choose whether to use in-memory caches for running queries.

+

If you only have a reference to an InProgress, you can't use the easy builder. +This exists so you can make your own.

+

+

+ Trait Implementations +

+
+

impl<'a, 'c> Queryable for InProgress<'a, 'c>
[src]

impl<'a, 'c> Pullable for InProgress<'a, 'c>
[src]

impl<'a, 'c> HasSchema for InProgress<'a, 'c>
[src]

Return true if the provided entid identifies an attribute in this schema.

+

Return true if the provided ident identifies an attribute in this schema.

+

Important traits for &'a [u8]

impl<'a, 'c> VersionedStore for InProgress<'a, 'c>
[src]

Check whether the provided vocabulary is present in the store. If it isn't, make it so.

+

Check whether the provided vocabularies are present in the store at the correct version and with all defined attributes. If any are not, invoke the pre function on the provided VocabularySource, install or upgrade the necessary vocabularies, then invoke post. Returns Ok if all of these steps succeed. Read more

+

Check whether the vocabulary described by the provided metadata is present in the store.

+

Make sure that our expectations of the core vocabulary — basic types and attributes — are met.

+
+

+ Auto Trait Implementations +

+
+

impl<'a, 'c> !Send for InProgress<'a, 'c>

impl<'a, 'c> !Sync for InProgress<'a, 'c>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/struct.InProgressRead.html b/docs/apis/rust/0.7.0/mentat/conn/struct.InProgressRead.html new file mode 100644 index 00000000..9c4fddcd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/struct.InProgressRead.html @@ -0,0 +1,140 @@ + + + + + + + + + + mentat::conn::InProgressRead - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::conn::InProgressRead + + [] + + [src]

pub struct InProgressRead<'a, 'c>(_);

Represents an in-progress set of reads to the store. Just like InProgress, +which is read-write, but only allows for reads.

+
+

+ Trait Implementations +

+
+

impl<'a, 'c> Queryable for InProgressRead<'a, 'c>
[src]

impl<'a, 'c> Pullable for InProgressRead<'a, 'c>
[src]

impl<'a, 'c> HasSchema for InProgressRead<'a, 'c>
[src]

Return true if the provided entid identifies an attribute in this schema.

+

Return true if the provided ident identifies an attribute in this schema.

+

Important traits for &'a [u8]

+

+ Auto Trait Implementations +

+
+

impl<'a, 'c> !Send for InProgressRead<'a, 'c>

impl<'a, 'c> !Sync for InProgressRead<'a, 'c>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/struct.Metadata.html b/docs/apis/rust/0.7.0/mentat/conn/struct.Metadata.html new file mode 100644 index 00000000..3a8aa9dc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/struct.Metadata.html @@ -0,0 +1,162 @@ + + + + + + + + + + mentat::conn::Metadata - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::conn::Metadata + + [] + + [src]

pub struct Metadata {
+    pub generation: u64,
+    pub partition_map: PartitionMap,
+    pub schema: Arc<Schema>,
+    pub attribute_cache: SQLiteAttributeCache,
+}

Connection metadata required to query from, or apply transactions to, a Mentat store.

+

Owned data for the volatile parts (generation and partition map), and Arc for the infrequently +changing parts (schema) that we want to share across threads.

+

See https://github.com/mozilla/mentat/wiki/Thoughts:-modeling-db-conn-in-Rust.

+

+ Fields

+ + + + + + + + +

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl Send for Metadata

impl Sync for Metadata

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/trait.Pullable.html b/docs/apis/rust/0.7.0/mentat/conn/trait.Pullable.html new file mode 100644 index 00000000..576b2742 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/trait.Pullable.html @@ -0,0 +1,144 @@ + + + + + + + + + + mentat::conn::Pullable - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat::conn::Pullable + + [] + + [src]

pub trait Pullable {
+    fn pull_attributes_for_entities<E, A>(
        &self,
        entities: E,
        attributes: A
    ) -> Result<BTreeMap<Entid, ValueRc<StructuredMap>>>
    where
        E: IntoIterator<Item = Entid>,
        A: IntoIterator<Item = Entid>
; +
fn pull_attributes_for_entity<A>(
        &self,
        entity: Entid,
        attributes: A
    ) -> Result<StructuredMap>
    where
        A: IntoIterator<Item = Entid>
; +}
+

+ Required Methods +

+
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/trait.Queryable.html b/docs/apis/rust/0.7.0/mentat/conn/trait.Queryable.html new file mode 100644 index 00000000..d6ff46a4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/trait.Queryable.html @@ -0,0 +1,147 @@ + + + + + + + + + + mentat::conn::Queryable - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat::conn::Queryable + + [] + + [src]

pub trait Queryable {
+    fn q_explain<T>(&self, query: &str, inputs: T) -> Result<QueryExplanation>
    where
        T: Into<Option<QueryInputs>>
; +
fn q_once<T>(&self, query: &str, inputs: T) -> Result<QueryOutput>
    where
        T: Into<Option<QueryInputs>>
; +
fn q_prepare<T>(&self, query: &str, inputs: T) -> PreparedResult
    where
        T: Into<Option<QueryInputs>>
; +
fn lookup_values_for_attribute<E>(
        &self,
        entity: E,
        attribute: &Keyword
    ) -> Result<Vec<TypedValue>>
    where
        E: Into<Entid>
; +
fn lookup_value_for_attribute<E>(
        &self,
        entity: E,
        attribute: &Keyword
    ) -> Result<Option<TypedValue>>
    where
        E: Into<Entid>
; +}
+

+ Required Methods +

+
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/conn/trait.Syncable.html b/docs/apis/rust/0.7.0/mentat/conn/trait.Syncable.html new file mode 100644 index 00000000..2293a865 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/conn/trait.Syncable.html @@ -0,0 +1,141 @@ + + + + + + + + + + mentat::conn::Syncable - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat::conn::Syncable + + [] + + [src]

pub trait Syncable {
+    fn sync(&mut self, server_uri: &String, user_uuid: &String) -> Result<()>;
+}
+

+ Required Methods +

+
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/constant.CORE_SCHEMA_VERSION.html b/docs/apis/rust/0.7.0/mentat/constant.CORE_SCHEMA_VERSION.html new file mode 100644 index 00000000..d761b059 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/constant.CORE_SCHEMA_VERSION.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat::CORE_SCHEMA_VERSION - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat::CORE_SCHEMA_VERSION + + [] + + [src]

pub const CORE_SCHEMA_VERSION: u32 = 1
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/constant.DB_SCHEMA_CORE.html b/docs/apis/rust/0.7.0/mentat/constant.DB_SCHEMA_CORE.html new file mode 100644 index 00000000..0c7eba6e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/constant.DB_SCHEMA_CORE.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat::DB_SCHEMA_CORE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat::DB_SCHEMA_CORE + + [] + + [src]

pub const DB_SCHEMA_CORE: i64 = 40
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/entity_builder/BuildTerms.t.html b/docs/apis/rust/0.7.0/mentat/entity_builder/BuildTerms.t.html new file mode 100644 index 00000000..a84b8af5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/entity_builder/BuildTerms.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.BuildTerms.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/entity_builder/EntityBuilder.t.html b/docs/apis/rust/0.7.0/mentat/entity_builder/EntityBuilder.t.html new file mode 100644 index 00000000..243e8abe --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/entity_builder/EntityBuilder.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.EntityBuilder.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/entity_builder/FromThing.t.html b/docs/apis/rust/0.7.0/mentat/entity_builder/FromThing.t.html new file mode 100644 index 00000000..964e1022 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/entity_builder/FromThing.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.FromThing.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/entity_builder/InProgressBuilder.t.html b/docs/apis/rust/0.7.0/mentat/entity_builder/InProgressBuilder.t.html new file mode 100644 index 00000000..4fa2ef15 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/entity_builder/InProgressBuilder.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.InProgressBuilder.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/entity_builder/IntoThing.t.html b/docs/apis/rust/0.7.0/mentat/entity_builder/IntoThing.t.html new file mode 100644 index 00000000..1fbf012e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/entity_builder/IntoThing.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.IntoThing.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/entity_builder/TermBuilder.t.html b/docs/apis/rust/0.7.0/mentat/entity_builder/TermBuilder.t.html new file mode 100644 index 00000000..b175ef10 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/entity_builder/TermBuilder.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.TermBuilder.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/entity_builder/Terms.t.html b/docs/apis/rust/0.7.0/mentat/entity_builder/Terms.t.html new file mode 100644 index 00000000..0ecca172 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/entity_builder/Terms.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Terms.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/entity_builder/index.html b/docs/apis/rust/0.7.0/mentat/entity_builder/index.html new file mode 100644 index 00000000..20527007 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/entity_builder/index.html @@ -0,0 +1,178 @@ + + + + + + + + + + mentat::entity_builder - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat::entity_builder + + [] + + [src]

Structs

+ + + + + + + + + + + + +
EntityBuilder + +
InProgressBuilder + +
TermBuilder + +

Traits

+ + + + + + + + + + + + +
BuildTerms + +
FromThing + +
IntoThing + +

Type Definitions

+ + + + +
Terms + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/entity_builder/sidebar-items.js b/docs/apis/rust/0.7.0/mentat/entity_builder/sidebar-items.js new file mode 100644 index 00000000..a1a09901 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/entity_builder/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["EntityBuilder",""],["InProgressBuilder",""],["TermBuilder",""]],"trait":[["BuildTerms",""],["FromThing",""],["IntoThing",""]],"type":[["Terms",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/entity_builder/struct.EntityBuilder.html b/docs/apis/rust/0.7.0/mentat/entity_builder/struct.EntityBuilder.html new file mode 100644 index 00000000..0c1769ff --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/entity_builder/struct.EntityBuilder.html @@ -0,0 +1,145 @@ + + + + + + + + + + mentat::entity_builder::EntityBuilder - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::entity_builder::EntityBuilder + + [] + + [src]

pub struct EntityBuilder<T: BuildTerms + Sized> { /* fields omitted */ }
+

+ Methods +

+

impl<T> EntityBuilder<T> where
    T: BuildTerms
[src]

impl<'a, 'c> EntityBuilder<InProgressBuilder<'a, 'c>>
[src]

Build the terms from this builder and transact them against the current +InProgress. This method always returns the InProgress -- failure doesn't +imply an automatic rollback.

+

Transact the contents of the builder and commit the InProgress. If any +step fails, roll back. Return the TxReport.

+
+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl<T> !Send for EntityBuilder<T>

impl<T> !Sync for EntityBuilder<T>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/entity_builder/struct.InProgressBuilder.html b/docs/apis/rust/0.7.0/mentat/entity_builder/struct.InProgressBuilder.html new file mode 100644 index 00000000..5078f7a1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/entity_builder/struct.InProgressBuilder.html @@ -0,0 +1,145 @@ + + + + + + + + + + mentat::entity_builder::InProgressBuilder - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::entity_builder::InProgressBuilder + + [] + + [src]

pub struct InProgressBuilder<'a, 'c> { /* fields omitted */ }
+

+ Methods +

+

impl<'a, 'c> InProgressBuilder<'a, 'c>
[src]

Build the terms from this builder and transact them against the current +InProgress. This method always returns the InProgress -- failure doesn't +imply an automatic rollback.

+

Transact the contents of the builder and commit the InProgress. If any +step fails, roll back. Return the TxReport.

+

impl<'a, 'c> InProgressBuilder<'a, 'c>
[src]

+

+ Trait Implementations +

+
+

impl<'a, 'c> BuildTerms for InProgressBuilder<'a, 'c>
[src]

+

+ Auto Trait Implementations +

+
+

impl<'a, 'c> !Send for InProgressBuilder<'a, 'c>

impl<'a, 'c> !Sync for InProgressBuilder<'a, 'c>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/entity_builder/struct.TermBuilder.html b/docs/apis/rust/0.7.0/mentat/entity_builder/struct.TermBuilder.html new file mode 100644 index 00000000..a8fc71f7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/entity_builder/struct.TermBuilder.html @@ -0,0 +1,140 @@ + + + + + + + + + + mentat::entity_builder::TermBuilder - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::entity_builder::TermBuilder + + [] + + [src]

pub struct TermBuilder { /* fields omitted */ }
+

+ Methods +

+

impl TermBuilder
[src]

+

+ Trait Implementations +

+
+

impl BuildTerms for TermBuilder
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for TermBuilder

impl !Sync for TermBuilder

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/entity_builder/trait.BuildTerms.html b/docs/apis/rust/0.7.0/mentat/entity_builder/trait.BuildTerms.html new file mode 100644 index 00000000..7c4d0e19 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/entity_builder/trait.BuildTerms.html @@ -0,0 +1,146 @@ + + + + + + + + + + mentat::entity_builder::BuildTerms - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat::entity_builder::BuildTerms + + [] + + [src]

pub trait BuildTerms where
    Self: Sized
{ + fn named_tempid(&mut self, name: String) -> TempIdHandle; +
fn describe_tempid(self, name: &str) -> EntityBuilder<Self>; +
fn describe<E>(self, entity: E) -> EntityBuilder<Self>
    where
        E: IntoThing<KnownEntidOr<TempIdHandle>>
; +
fn add<E, V>(&mut self, e: E, a: KnownEntid, v: V) -> Result<()>
    where
        E: IntoThing<KnownEntidOr<TempIdHandle>>,
        V: IntoThing<TypedValueOr<TempIdHandle>>
; +
fn retract<E, V>(&mut self, e: E, a: KnownEntid, v: V) -> Result<()>
    where
        E: IntoThing<KnownEntidOr<TempIdHandle>>,
        V: IntoThing<TypedValueOr<TempIdHandle>>
; +}
+

+ Required Methods +

+
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/entity_builder/trait.FromThing.html b/docs/apis/rust/0.7.0/mentat/entity_builder/trait.FromThing.html new file mode 100644 index 00000000..17a3c8d2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/entity_builder/trait.FromThing.html @@ -0,0 +1,145 @@ + + + + + + + + + + mentat::entity_builder::FromThing - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat::entity_builder::FromThing + + [] + + [src]

pub trait FromThing<T> {
+    fn from_thing(v: T) -> Self;
+}
+

+ Required Methods +

+
+

+

+ Implementations on Foreign Types +

+

impl<'a> FromThing<&'a TempIdHandle> for TypedValueOr<TempIdHandle>
[src]

impl FromThing<TempIdHandle> for TypedValueOr<TempIdHandle>
[src]

impl FromThing<TypedValue> for TypedValueOr<TempIdHandle>
[src]

impl FromThing<TempIdHandle> for KnownEntidOr<TempIdHandle>
[src]

impl<'a> FromThing<&'a KnownEntid> for KnownEntidOr<TempIdHandle>
[src]

impl FromThing<KnownEntid> for KnownEntidOr<TempIdHandle>
[src]

impl FromThing<KnownEntid> for TypedValueOr<TempIdHandle>
[src]

+

+ Implementors +

+
    +
  • impl<T> FromThing<T> for T
  • +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/entity_builder/trait.IntoThing.html b/docs/apis/rust/0.7.0/mentat/entity_builder/trait.IntoThing.html new file mode 100644 index 00000000..a90c611b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/entity_builder/trait.IntoThing.html @@ -0,0 +1,141 @@ + + + + + + + + + + mentat::entity_builder::IntoThing - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat::entity_builder::IntoThing + + [] + + [src]

pub trait IntoThing<T>: Sized {
+    fn into_thing(self) -> T;
+}
+

+ Required Methods +

+
+

+

+ Implementors +

+
    +
  • impl<I, F> IntoThing<I> for F where
        I: FromThing<F>, 
  • +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/entity_builder/type.Terms.html b/docs/apis/rust/0.7.0/mentat/entity_builder/type.Terms.html new file mode 100644 index 00000000..19c7b9db --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/entity_builder/type.Terms.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat::entity_builder::Terms - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat::entity_builder::Terms + + [] + + [src]

type Terms = (Vec<TermWithTempIds>, InternSet<TempId>);
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/enum.Binding.html b/docs/apis/rust/0.7.0/mentat/enum.Binding.html new file mode 100644 index 00000000..4cd6e378 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/enum.Binding.html @@ -0,0 +1,166 @@ + + + + + + + + + + mentat::Binding - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat::Binding + + [] + + [src]

pub enum Binding {
+    Scalar(TypedValue),
+    Vec(Arc<Vec<Binding>>),
+    Map(Arc<StructuredMap>),
+}

The values bound in a query specification can be:

+
    +
  • Vecs of structured values, for multi-valued component attributes or nested expressions.
  • +
  • Single structured values, for single-valued component attributes or nested expressions.
  • +
  • Single typed values, for simple attributes.
  • +
+

The Binding enum defines these three options.

+

Datomic also supports structured inputs; at present Mentat does not, but this type +would also serve that purpose.

+

Note that maps are not ordered, and so Binding is neither Ord nor PartialOrd.

+

+ Variants

+ +

+ Methods +

+

impl Binding
[src]

impl Binding
[src]

Returns true if the provided type is Some and matches this value's type, or if the +provided type is None.

+

impl Binding
[src]

+

+ Trait Implementations +

+
+

impl Clone for Binding
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<StructuredMap> for Binding
[src]

Performs the conversion.

+

impl From<Vec<Binding>> for Binding
[src]

Performs the conversion.

+

impl<T> From<T> for Binding where
    T: Into<TypedValue>, 
[src]

Performs the conversion.

+

impl Eq for Binding
[src]

impl PartialEq<Binding> for Binding
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for Binding
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for Binding

impl Sync for Binding

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/enum.FindSpec.html b/docs/apis/rust/0.7.0/mentat/enum.FindSpec.html new file mode 100644 index 00000000..f0ffaac7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/enum.FindSpec.html @@ -0,0 +1,192 @@ + + + + + + + + + + mentat::FindSpec - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat::FindSpec + + [] + + [src]

pub enum FindSpec {
+    FindRel(Vec<Element>),
+    FindColl(Element),
+    FindTuple(Vec<Element>),
+    FindScalar(Element),
+}

A definition of the first part of a find query: the +[:find ?foo ?bar…] bit.

+

There are four different kinds of find specs, allowing you to query for +a single value, a collection of values from different entities, a single +tuple (relation), or a collection of tuples.

+

Examples:

+ +
+
+
+  let elements = vec![
+    Element::Variable(Variable::from_valid_name("?foo")),
+    Element::Variable(Variable::from_valid_name("?bar")),
+  ];
+  let rel = FindSpec::FindRel(elements);
+
+  if let FindSpec::FindRel(elements) = rel {
+    assert_eq!(2, elements.len());
+  }
+
+

+ Variants

+

Returns an array of arrays, represented as a single array with length a multiple of width.

+

Returns an array of scalars, usually homogeneous. +This is equivalent to mapping over the results of a FindRel, +returning the first value of each.

+

Returns a single tuple: a heterogeneous array of scalars. Equivalent to +taking the first result from a FindRel.

+

Returns a single scalar value. Equivalent to taking the first result +from a FindColl.

+
+

+ Methods +

+

impl FindSpec
[src]

Returns true if the provided FindSpec returns at most one result.

+

Returns true if the provided FindSpec cares about distinct results.

+

I use the words "cares about" because find is generally defined in terms of producing distinct +results at the Datalog level.

+

Two of the find specs (scalar and tuple) produce only a single result. Those don't need to be +run with SELECT DISTINCT, because we're only consuming a single result. Those queries will be +run with LIMIT 1.

+

Additionally, some projections cannot produce duplicate results: [:find (max ?x) …], for +example.

+

This function gives us the hook to add that logic when we're ready.

+

Beyond this, DISTINCT is not always needed. For example, in some kinds of accumulation or +sampling projections we might not need to do it at the SQL level because we're consuming into +a dupe-eliminating data structure like a Set, or we know that a particular query cannot produce +duplicate results.

+

Important traits for Box<R>

+

+ Trait Implementations +

+
+

impl Eq for FindSpec
[src]

impl PartialEq<FindSpec> for FindSpec
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for FindSpec
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for FindSpec

impl !Sync for FindSpec

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/enum.QueryResults.html b/docs/apis/rust/0.7.0/mentat/enum.QueryResults.html new file mode 100644 index 00000000..c629173b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/enum.QueryResults.html @@ -0,0 +1,153 @@ + + + + + + + + + + mentat::QueryResults - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat::QueryResults + + [] + + [src]

pub enum QueryResults {
+    Scalar(Option<Binding>),
+    Tuple(Option<Vec<Binding>>),
+    Coll(Vec<Binding>),
+    Rel(RelResult<Binding>),
+}

+ Variants

+ +

+ Methods +

+

impl QueryResults
[src]

+

+ Trait Implementations +

+
+

impl Clone for QueryResults
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<QueryOutput> for QueryResults
[src]

Performs the conversion.

+

impl Eq for QueryResults
[src]

impl PartialEq<QueryResults> for QueryResults
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for QueryResults
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for QueryResults

impl Sync for QueryResults

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/enum.TypedValue.html b/docs/apis/rust/0.7.0/mentat/enum.TypedValue.html new file mode 100644 index 00000000..e375f81e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/enum.TypedValue.html @@ -0,0 +1,206 @@ + + + + + + + + + + mentat::TypedValue - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat::TypedValue + + [] + + [src]

pub enum TypedValue {
+    Ref(i64),
+    Boolean(bool),
+    Long(i64),
+    Double(OrderedFloat<f64>),
+    Instant(DateTime<Utc>),
+    String(Arc<String>),
+    Keyword(Arc<Keyword>),
+    Uuid(Uuid),
+}

Represents a value that can be stored in a Mentat store.

+

+ Variants

+ +

+ Methods +

+

impl TypedValue
[src]

Returns true if the provided type is Some and matches this value's type, or if the +provided type is None.

+

Construct a new TypedValue::Keyword instance by cloning the provided +values and wrapping them in a new ValueRc. This is expensive, so this might +be best limited to tests.

+

Construct a new TypedValue::String instance by cloning the provided +value and wrapping it in a new ValueRc. This is expensive, so this might +be best limited to tests.

+

Construct a new TypedValue::Instant instance from the provided +microsecond timestamp.

+

impl TypedValue
[src]

+

+ Trait Implementations +

+
+

impl PartialOrd<TypedValue> for TypedValue
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Clone for TypedValue
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<DateTime<Utc>> for TypedValue
[src]

Truncate the provided DateTime to microsecond precision, and return the corresponding +TypedValue::Instant.

+

Performs the conversion.

+

impl From<Uuid> for TypedValue
[src]

Performs the conversion.

+

impl From<String> for TypedValue
[src]

Performs the conversion.

+

impl From<bool> for TypedValue
[src]

Performs the conversion.

+

impl From<Box<String>> for TypedValue
[src]

Performs the conversion.

+

impl From<i32> for TypedValue
[src]

Performs the conversion.

+

impl From<Rc<Keyword>> for TypedValue
[src]

Performs the conversion.

+

impl<'a> From<&'a str> for TypedValue
[src]

Performs the conversion.

+

impl From<Keyword> for TypedValue
[src]

Performs the conversion.

+

impl From<Rc<String>> for TypedValue
[src]

Performs the conversion.

+

impl From<Arc<String>> for TypedValue
[src]

Performs the conversion.

+

impl From<Arc<Keyword>> for TypedValue
[src]

Performs the conversion.

+

impl From<u32> for TypedValue
[src]

Performs the conversion.

+

impl From<f64> for TypedValue
[src]

Performs the conversion.

+

impl From<KnownEntid> for TypedValue
[src]

Performs the conversion.

+

impl Ord for TypedValue
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<'de> Deserialize<'de> for TypedValue
[src]

Deserialize this value from the given Serde deserializer. Read more

+

impl Hash for TypedValue
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for TypedValue
[src]

impl PartialEq<TypedValue> for TypedValue
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for TypedValue
[src]

Formats the value using the given formatter. Read more

+

impl Serialize for TypedValue
[src]

Serialize this value into the given Serde serializer. Read more

+

impl TransactableValue for TypedValue
[src]

Coerce this value place into the given type. This is where we perform schema-aware coercion, for example coercing an integral value into a ref where appropriate. Read more

+

Make an entity place out of this value place. This is where we limit values in nested maps to valid entity places. Read more

+

impl TypedSQLValue for TypedValue
[src]

Given a SQLite value and a value_type_tag, return the corresponding TypedValue.

+

Given an EDN value, return a corresponding Mentat TypedValue.

+

An EDN Value does not encode a unique Mentat ValueType, so the composition +from_edn_value(first(to_edn_value_pair(...))) loses information. Additionally, there are +EDN values which are not Mentat typed values.

+

This function is deterministic.

+

Return the corresponding SQLite value and value_type_tag pair.

+

Return the corresponding EDN value and value_type pair.

+

impl FromThing<TypedValue> for TypedValueOr<TempIdHandle>
[src]

+

+ Auto Trait Implementations +

+
+

impl Send for TypedValue

impl Sync for TypedValue

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/enum.ValueType.html b/docs/apis/rust/0.7.0/mentat/enum.ValueType.html new file mode 100644 index 00000000..169c7205 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/enum.ValueType.html @@ -0,0 +1,187 @@ + + + + + + + + + + mentat::ValueType - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat::ValueType + + [] + + [src]

#[repr(u32)] +
pub enum ValueType { + Ref, + Boolean, + Instant, + Long, + Double, + String, + Keyword, + Uuid, +}

The attribute of each Mentat assertion has a :db/valueType constraining the value to a +particular set. Mentat recognizes the following :db/valueType values.

+

+ Variants

+ +

+ Methods +

+

impl ValueType
[src]

impl ValueType
[src]

+

+ Trait Implementations +

+
+

impl SQLValueType for ValueType
[src]

Return a pair of the ValueTypeTag for this value type, and the SQLTypeAffinity required to distinguish it from any other types that share the same tag. Read more

+

Returns true if the provided integer is in the SQLite value space of this type. For +example, 1 is how we encode true.

+ +
+use mentat_core::{ValueType, SQLValueType};
+assert!(!ValueType::Instant.accommodates_integer(1493399581314));
+assert!(!ValueType::Instant.accommodates_integer(1493399581314000));
+assert!(ValueType::Boolean.accommodates_integer(1));
+assert!(!ValueType::Boolean.accommodates_integer(-1));
+assert!(!ValueType::Boolean.accommodates_integer(10));
+assert!(!ValueType::String.accommodates_integer(10));
+

impl PartialOrd<ValueType> for ValueType
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Copy for ValueType
[src]

impl Clone for ValueType
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<ValueType> for ValueTypeSet
[src]

Performs the conversion.

+

impl Ord for ValueType
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Extend<ValueType> for ValueTypeSet
[src]

Extends a collection with the contents of an iterator. Read more

+

impl Hash for ValueType
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for ValueType
[src]

impl PartialEq<ValueType> for ValueType
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl FromIterator<ValueType> for ValueTypeSet
[src]

Creates a value from an iterator. Read more

+

impl Display for ValueType
[src]

Formats the value using the given formatter. Read more

+

impl Debug for ValueType
[src]

Formats the value using the given formatter. Read more

+

impl CLike for ValueType
[src]

Converts a C-like enum to a u32. The value must be <= 31.

+

Converts a u32 to a C-like enum. This method only needs to be safe for possible return values of to_u32 of this trait. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for ValueType

impl Sync for ValueType

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/errors/MentatError.t.html b/docs/apis/rust/0.7.0/mentat/errors/MentatError.t.html new file mode 100644 index 00000000..c19162f0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/errors/MentatError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.MentatError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/errors/Result.t.html b/docs/apis/rust/0.7.0/mentat/errors/Result.t.html new file mode 100644 index 00000000..865910f9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/errors/Result.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Result.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/errors/enum.MentatError.html b/docs/apis/rust/0.7.0/mentat/errors/enum.MentatError.html new file mode 100644 index 00000000..35857632 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/errors/enum.MentatError.html @@ -0,0 +1,159 @@ + + + + + + + + + + mentat::errors::MentatError - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat::errors::MentatError + + [] + + [src]

pub enum MentatError {
+    PathAlreadyExists(String),
+    UnboundVariables(BTreeSet<String>),
+    InvalidArgumentName(String),
+    UnknownAttribute(String),
+    InvalidVocabularyVersion,
+    ConflictingAttributeDefinitions(StringVersionStringAttributeAttribute),
+    ExistingVocabularyTooNew(StringVersionVersion),
+    UnexpectedCoreSchema(VersionOption<Version>),
+    UnexpectedLostTransactRace,
+    MissingCoreVocabulary(Keyword),
+    PreparedQuerySchemaMismatch,
+    ValueTypeMismatch(ValueTypeValueType),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Debug for MentatError
[src]

Formats the value using the given formatter. Read more

+

impl Fail for MentatError
[src]

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

+

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

+

Provides context for this failure. Read more

+

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

+

Important traits for Causes<'f>

Returns a iterator over the causes of this Fail with itself as the first item and the root_cause as the final item. Read more

+

Returns the "root cause" of this Fail - the last value in the cause chain which does not return an underlying cause. Read more

+

impl Display for MentatError
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for MentatError

impl Sync for MentatError

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/errors/index.html b/docs/apis/rust/0.7.0/mentat/errors/index.html new file mode 100644 index 00000000..0e67bc41 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/errors/index.html @@ -0,0 +1,142 @@ + + + + + + + + + + mentat::errors - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat::errors + + [] + + [src]

Enums

+ + + + +
MentatError + +

Type Definitions

+ + + + +
Result + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/errors/sidebar-items.js b/docs/apis/rust/0.7.0/mentat/errors/sidebar-items.js new file mode 100644 index 00000000..4c6c080f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/errors/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["MentatError",""]],"type":[["Result",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/errors/type.Result.html b/docs/apis/rust/0.7.0/mentat/errors/type.Result.html new file mode 100644 index 00000000..335e85c8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/errors/type.Result.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat::errors::Result - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat::errors::Result + + [] + + [src]

type Result<T> = Result<T, Error>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/fn.new_connection.html b/docs/apis/rust/0.7.0/mentat/fn.new_connection.html new file mode 100644 index 00000000..2a1debd1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/fn.new_connection.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat::new_connection - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat::new_connection + + [] + + [src]

pub fn new_connection<T>(uri: T) -> Result<Connection, Error> where
    T: AsRef<Path>, 
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/ident/EntId.t.html b/docs/apis/rust/0.7.0/mentat/ident/EntId.t.html new file mode 100644 index 00000000..904b92da --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/ident/EntId.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.EntId.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/ident/ToEntId.t.html b/docs/apis/rust/0.7.0/mentat/ident/ToEntId.t.html new file mode 100644 index 00000000..dd537da0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/ident/ToEntId.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.ToEntId.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/ident/ToIdent.t.html b/docs/apis/rust/0.7.0/mentat/ident/ToIdent.t.html new file mode 100644 index 00000000..51809620 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/ident/ToIdent.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.ToIdent.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/ident/index.html b/docs/apis/rust/0.7.0/mentat/ident/index.html new file mode 100644 index 00000000..e92f769c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/ident/index.html @@ -0,0 +1,151 @@ + + + + + + + + + + mentat::ident - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat::ident + + [] + + [src]

Traits

+ + + + + + + + +
ToEntId +

The ability to transform idents into the corresponding entid.

+ +
ToIdent +

The ability to transform entity identifiers (entids) into keyword names (idents).

+ +

Type Definitions

+ + + + +
EntId + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/ident/sidebar-items.js b/docs/apis/rust/0.7.0/mentat/ident/sidebar-items.js new file mode 100644 index 00000000..05294239 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/ident/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"trait":[["ToEntId","The ability to transform idents into the corresponding entid."],["ToIdent","The ability to transform entity identifiers (entids) into keyword names (idents)."]],"type":[["EntId",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/ident/trait.ToEntId.html b/docs/apis/rust/0.7.0/mentat/ident/trait.ToEntId.html new file mode 100644 index 00000000..fea18664 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/ident/trait.ToEntId.html @@ -0,0 +1,141 @@ + + + + + + + + + + mentat::ident::ToEntId - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat::ident::ToEntId + + [] + + [src]

pub trait ToEntId {
+    fn entid(&self, ident: &Keyword) -> Option<EntId>;
+}

The ability to transform idents into the corresponding entid.

+
+

+ Required Methods +

+
+

+

+ Implementors +

+
    +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/ident/trait.ToIdent.html b/docs/apis/rust/0.7.0/mentat/ident/trait.ToIdent.html new file mode 100644 index 00000000..3c5dca24 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/ident/trait.ToIdent.html @@ -0,0 +1,141 @@ + + + + + + + + + + mentat::ident::ToIdent - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat::ident::ToIdent + + [] + + [src]

pub trait ToIdent {
+    fn ident(&self, entid: EntId) -> Option<Keyword>;
+}

The ability to transform entity identifiers (entids) into keyword names (idents).

+
+

+ Required Methods +

+
+

+

+ Implementors +

+
    +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/ident/type.EntId.html b/docs/apis/rust/0.7.0/mentat/ident/type.EntId.html new file mode 100644 index 00000000..627c5493 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/ident/type.EntId.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat::ident::EntId - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat::ident::EntId + + [] + + [src]

type EntId = u32;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/index.html b/docs/apis/rust/0.7.0/mentat/index.html new file mode 100644 index 00000000..a2b06fe2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/index.html @@ -0,0 +1,422 @@ + + + + + + + + + + mentat - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Crate mentat + + [] + + [src]

Re-exports

+
pub extern crate edn;
pub use query::IntoResult;
pub use query::QueryExecutionResult;
pub use query::QueryExplanation;
pub use query::QueryPlanStep;
pub use query::q_once;
pub use query_builder::QueryBuilder;
pub use conn::CacheAction;
pub use conn::CacheDirection;
pub use conn::Conn;
pub use conn::InProgress;
pub use conn::Metadata;
pub use conn::Pullable;
pub use conn::Queryable;
pub use conn::Syncable;
pub use store::Store;

Modules

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
conn + +
entity_builder + +
errors + +
ident + +
query + +
query_builder + +
store + +
vocabulary +

This module exposes an interface for programmatic management of vocabularies.

+ +

Macros

+ + + + + + + + + + + + +
bail + +
kw +

Produce the appropriate Keyword for the provided namespace and name. +This lives here because we can't re-export macros: +https://github.com/rust-lang/rust/issues/29638.

+ +
var +

Produce the appropriate Variable for the provided valid ?-prefixed name. +This lives here because we can't re-export macros: +https://github.com/rust-lang/rust/issues/29638.

+ +

Structs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Attribute +

A Mentat schema attribute has a value type and several other flags determining how assertions +with the attribute are interpreted.

+ +
DateTime +

ISO 8601 combined date and time with time zone.

+ +
Keyword +

A keyword is a symbol, optionally with a namespace, that prints with a leading colon. +This concept is imported from Clojure, as it features in EDN and the query +syntax that we use.

+ +
KnownEntid +

An entid that's either already in the store, or newly allocated to a tempid. +TODO: we'd like to link this in some way to the lifetime of a particular PartitionMap.

+ +
PlainSymbol +

A simplification of Clojure's Symbol.

+ +
QueryInputs +

Define the inputs to a query. This is in two parts: a set of values known now, and a set of +types known now. +The separate map of types is to allow queries to be algebrized without full knowledge of +the bindings that will be used at execution time. +When built correctly, types is guaranteed to contain the types of values -- use +QueryInputs::new or QueryInputs::with_values to construct an instance.

+ +
QueryOutput + +
RelResult +

The result you get from a 'rel' query, like:

+ +
Schema +

Represents a Mentat schema.

+ +
TxObserver + +
TxReport +

A transaction report summarizes an applied transaction.

+ +
Utc +

The UTC time zone. This is the most efficient time zone when you don't need the local time. +It is also used as an offset (which is also a dummy type).

+ +
Uuid +

A Universally Unique Identifier (UUID).

+ +
Variable + +

Enums

+ + + + + + + + + + + + + + + + + + + + +
Binding +

The values bound in a query specification can be:

+ +
FindSpec +

A definition of the first part of a find query: the +[:find ?foo ?bar…] bit.

+ +
QueryResults + +
TypedValue +

Represents a value that can be stored in a Mentat store.

+ +
ValueType +

The attribute of each Mentat assertion has a :db/valueType constraining the value to a +particular set. Mentat recognizes the following :db/valueType values.

+ +

Constants

+ + + + + + + + +
CORE_SCHEMA_VERSION + +
DB_SCHEMA_CORE + +

Traits

+ + + + +
HasSchema + +

Functions

+ + + + +
new_connection + +

Type Definitions

+ + + + + + + + +
AttributeSet + +
Entid +

Represents one entid in the entid space.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/kw.m.html b/docs/apis/rust/0.7.0/mentat/kw.m.html new file mode 100644 index 00000000..7080aaae --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/kw.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.kw.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/macro.bail!.html b/docs/apis/rust/0.7.0/mentat/macro.bail!.html new file mode 100644 index 00000000..6a9910ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/macro.bail!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.bail.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/macro.bail.html b/docs/apis/rust/0.7.0/mentat/macro.bail.html new file mode 100644 index 00000000..3fddf64c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/macro.bail.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat::bail - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat::bail + + [] + + [src]

+macro_rules! bail {
+    ($e:expr) => { ... };
+}
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/macro.kw!.html b/docs/apis/rust/0.7.0/mentat/macro.kw!.html new file mode 100644 index 00000000..7080aaae --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/macro.kw!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.kw.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/macro.kw.html b/docs/apis/rust/0.7.0/mentat/macro.kw.html new file mode 100644 index 00000000..15f5c21a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/macro.kw.html @@ -0,0 +1,135 @@ + + + + + + + + + + mentat::kw - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat::kw + + [] + + [src]

+macro_rules! kw {
+    ( : $n:ident ) => { ... };
+    ( : $ns:ident / $n:ident ) => { ... };
+    ( : $ns:ident$(. $nss:ident)+ / $n:ident ) => { ... };
+}
+

Produce the appropriate Keyword for the provided namespace and name. +This lives here because we can't re-export macros: +https://github.com/rust-lang/rust/issues/29638.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/macro.var!.html b/docs/apis/rust/0.7.0/mentat/macro.var!.html new file mode 100644 index 00000000..01319fac --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/macro.var!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.var.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/macro.var.html b/docs/apis/rust/0.7.0/mentat/macro.var.html new file mode 100644 index 00000000..71ca6d8e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/macro.var.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat::var - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat::var + + [] + + [src]

+macro_rules! var {
+    ( ? $var:ident ) => { ... };
+}
+

Produce the appropriate Variable for the provided valid ?-prefixed name. +This lives here because we can't re-export macros: +https://github.com/rust-lang/rust/issues/29638.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/new_connection.v.html b/docs/apis/rust/0.7.0/mentat/new_connection.v.html new file mode 100644 index 00000000..b4f28b0a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/new_connection.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.new_connection.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/IntoResult.t.html b/docs/apis/rust/0.7.0/mentat/query/IntoResult.t.html new file mode 100644 index 00000000..76b87282 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/IntoResult.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.IntoResult.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/Keyword.t.html b/docs/apis/rust/0.7.0/mentat/query/Keyword.t.html new file mode 100644 index 00000000..2ff7981f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/Keyword.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/Known.t.html b/docs/apis/rust/0.7.0/mentat/query/Known.t.html new file mode 100644 index 00000000..723467bb --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/Known.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Known.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/PlainSymbol.t.html b/docs/apis/rust/0.7.0/mentat/query/PlainSymbol.t.html new file mode 100644 index 00000000..4c20195d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/PlainSymbol.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.PlainSymbol.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/PreparedQuery.t.html b/docs/apis/rust/0.7.0/mentat/query/PreparedQuery.t.html new file mode 100644 index 00000000..4dd4cb58 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/PreparedQuery.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.PreparedQuery.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/PreparedResult.t.html b/docs/apis/rust/0.7.0/mentat/query/PreparedResult.t.html new file mode 100644 index 00000000..214bca83 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/PreparedResult.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.PreparedResult.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/QueryExecutionResult.t.html b/docs/apis/rust/0.7.0/mentat/query/QueryExecutionResult.t.html new file mode 100644 index 00000000..9192f7a2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/QueryExecutionResult.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.QueryExecutionResult.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/QueryExplanation.t.html b/docs/apis/rust/0.7.0/mentat/query/QueryExplanation.t.html new file mode 100644 index 00000000..ac26df29 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/QueryExplanation.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.QueryExplanation.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/QueryInputs.t.html b/docs/apis/rust/0.7.0/mentat/query/QueryInputs.t.html new file mode 100644 index 00000000..e805aadc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/QueryInputs.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.QueryInputs.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/QueryOutput.t.html b/docs/apis/rust/0.7.0/mentat/query/QueryOutput.t.html new file mode 100644 index 00000000..56ae12d8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/QueryOutput.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.QueryOutput.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/QueryPlanStep.t.html b/docs/apis/rust/0.7.0/mentat/query/QueryPlanStep.t.html new file mode 100644 index 00000000..520ec07d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/QueryPlanStep.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.QueryPlanStep.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/QueryResults.t.html b/docs/apis/rust/0.7.0/mentat/query/QueryResults.t.html new file mode 100644 index 00000000..b52d422e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/QueryResults.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.QueryResults.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/RelResult.t.html b/docs/apis/rust/0.7.0/mentat/query/RelResult.t.html new file mode 100644 index 00000000..28847dea --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/RelResult.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.RelResult.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/Variable.t.html b/docs/apis/rust/0.7.0/mentat/query/Variable.t.html new file mode 100644 index 00000000..37fb069f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/Variable.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Variable.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/enum.PreparedQuery.html b/docs/apis/rust/0.7.0/mentat/query/enum.PreparedQuery.html new file mode 100644 index 00000000..07c8f905 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/enum.PreparedQuery.html @@ -0,0 +1,162 @@ + + + + + + + + + + mentat::query::PreparedQuery - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat::query::PreparedQuery + + [] + + [src]

pub enum PreparedQuery<'sqlite> {
+    Empty {
+        find_spec: Rc<FindSpec>,
+    },
+    Constant {
+        select: ConstantProjector,
+    },
+    Bound {
+        statement: Statement<'sqlite>,
+        schema: Schema,
+        connection: &'sqlite Connection,
+        args: Vec<(String, Rc<Value>)>,
+        projector: Box<Projector>,
+    },
+}

+ Variants

+

Fields of Empty

+ +

Fields of Constant

+ +

Fields of Bound

+ +
+

+ Methods +

+

impl<'sqlite> PreparedQuery<'sqlite>
[src]

+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl<'sqlite> !Send for PreparedQuery<'sqlite>

impl<'sqlite> !Sync for PreparedQuery<'sqlite>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/enum.QueryExplanation.html b/docs/apis/rust/0.7.0/mentat/query/enum.QueryExplanation.html new file mode 100644 index 00000000..96964fc5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/enum.QueryExplanation.html @@ -0,0 +1,153 @@ + + + + + + + + + + mentat::query::QueryExplanation - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat::query::QueryExplanation + + [] + + [src]

pub enum QueryExplanation {
+    KnownEmpty(EmptyBecause),
+    KnownConstant,
+    ExecutionPlan {
+        query: SQLQuery,
+        steps: Vec<QueryPlanStep>,
+    },
+}

A struct describing information about how Mentat would execute a query.

+

+ Variants

+

A query known in advance to be empty, and why we believe that.

+

A query known in advance to return a constant value.

+

A query that takes actual work to execute.

+

Fields of ExecutionPlan

+ +

The translated query and any bindings.

+

The output of SQLite's EXPLAIN QUERY PLAN.

+
+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/enum.QueryResults.html b/docs/apis/rust/0.7.0/mentat/query/enum.QueryResults.html new file mode 100644 index 00000000..36fb60b9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/enum.QueryResults.html @@ -0,0 +1,153 @@ + + + + + + + + + + mentat::query::QueryResults - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat::query::QueryResults + + [] + + [src]

pub enum QueryResults {
+    Scalar(Option<Binding>),
+    Tuple(Option<Vec<Binding>>),
+    Coll(Vec<Binding>),
+    Rel(RelResult<Binding>),
+}

+ Variants

+ +

+ Methods +

+

impl QueryResults
[src]

+

+ Trait Implementations +

+
+

impl Clone for QueryResults
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<QueryOutput> for QueryResults
[src]

Performs the conversion.

+

impl Eq for QueryResults
[src]

impl PartialEq<QueryResults> for QueryResults
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for QueryResults
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for QueryResults

impl Sync for QueryResults

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/fn.lookup_value.html b/docs/apis/rust/0.7.0/mentat/query/fn.lookup_value.html new file mode 100644 index 00000000..376df1b4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/fn.lookup_value.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat::query::lookup_value - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat::query::lookup_value + + [] + + [src]

pub fn lookup_value<'sqlite, 'schema, 'cache, E, A>(
    sqlite: &'sqlite Connection,
    known: Known,
    entity: E,
    attribute: A
) -> Result<Option<TypedValue>> where
    E: Into<Entid>,
    A: Into<Entid>, 

Return a single value for the provided entity and attribute. +If the attribute is multi-valued, an arbitrary value is returned. +If no value is present for that entity, None is returned. +If attribute isn't an attribute, None is returned.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/fn.lookup_value_for_attribute.html b/docs/apis/rust/0.7.0/mentat/query/fn.lookup_value_for_attribute.html new file mode 100644 index 00000000..ade4547a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/fn.lookup_value_for_attribute.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat::query::lookup_value_for_attribute - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat::query::lookup_value_for_attribute + + [] + + [src]

pub fn lookup_value_for_attribute<'sqlite, 'attribute, E>(
    sqlite: &'sqlite Connection,
    known: Known,
    entity: E,
    attribute: &'attribute Keyword
) -> Result<Option<TypedValue>> where
    E: Into<Entid>, 

Return a single value for the provided entity and attribute. +If the attribute is multi-valued, an arbitrary value is returned. +If no value is present for that entity, None is returned. +If attribute doesn't name an attribute, an error is returned.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/fn.lookup_values.html b/docs/apis/rust/0.7.0/mentat/query/fn.lookup_values.html new file mode 100644 index 00000000..aa81dd3b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/fn.lookup_values.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat::query::lookup_values - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat::query::lookup_values + + [] + + [src]

pub fn lookup_values<'sqlite, E, A>(
    sqlite: &'sqlite Connection,
    known: Known,
    entity: E,
    attribute: A
) -> Result<Vec<TypedValue>> where
    E: Into<Entid>,
    A: Into<Entid>, 
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/fn.lookup_values_for_attribute.html b/docs/apis/rust/0.7.0/mentat/query/fn.lookup_values_for_attribute.html new file mode 100644 index 00000000..91ed1c85 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/fn.lookup_values_for_attribute.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat::query::lookup_values_for_attribute - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat::query::lookup_values_for_attribute + + [] + + [src]

pub fn lookup_values_for_attribute<'sqlite, 'attribute, E>(
    sqlite: &'sqlite Connection,
    known: Known,
    entity: E,
    attribute: &'attribute Keyword
) -> Result<Vec<TypedValue>> where
    E: Into<Entid>, 
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/fn.q_explain.html b/docs/apis/rust/0.7.0/mentat/query/fn.q_explain.html new file mode 100644 index 00000000..8a56520b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/fn.q_explain.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat::query::q_explain - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat::query::q_explain + + [] + + [src]

pub fn q_explain<'sqlite, 'query, T>(
    sqlite: &'sqlite Connection,
    known: Known,
    query: &'query str,
    inputs: T
) -> Result<QueryExplanation> where
    T: Into<Option<QueryInputs>>, 
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/fn.q_once.html b/docs/apis/rust/0.7.0/mentat/query/fn.q_once.html new file mode 100644 index 00000000..67691342 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/fn.q_once.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat::query::q_once - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat::query::q_once + + [] + + [src]

pub fn q_once<'sqlite, 'query, T>(
    sqlite: &'sqlite Connection,
    known: Known,
    query: &'query str,
    inputs: T
) -> QueryExecutionResult where
    T: Into<Option<QueryInputs>>, 

Take an EDN query string, a reference to an open SQLite connection, a Mentat schema, and an +optional collection of input bindings (which should be keyed by "?varname"), and execute the +query immediately, blocking the current thread. +Returns a structure that corresponds to the kind of input query, populated with TypedValue +instances. +The caller is responsible for ensuring that the SQLite connection has an open transaction if +isolation is required.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/fn.q_prepare.html b/docs/apis/rust/0.7.0/mentat/query/fn.q_prepare.html new file mode 100644 index 00000000..37a97d8e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/fn.q_prepare.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat::query::q_prepare - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat::query::q_prepare + + [] + + [src]

pub fn q_prepare<'sqlite, 'schema, 'cache, 'query, T>(
    sqlite: &'sqlite Connection,
    known: Known<'schema, 'cache>,
    query: &'query str,
    inputs: T
) -> PreparedResult<'sqlite> where
    T: Into<Option<QueryInputs>>, 
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/fn.q_uncached.html b/docs/apis/rust/0.7.0/mentat/query/fn.q_uncached.html new file mode 100644 index 00000000..b82689da --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/fn.q_uncached.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat::query::q_uncached - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat::query::q_uncached + + [] + + [src]

pub fn q_uncached<'sqlite, 'schema, 'query, T>(
    sqlite: &'sqlite Connection,
    schema: &'schema Schema,
    query: &'query str,
    inputs: T
) -> QueryExecutionResult where
    T: Into<Option<QueryInputs>>, 

Just like q_once, but doesn't use any cached values.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/index.html b/docs/apis/rust/0.7.0/mentat/query/index.html new file mode 100644 index 00000000..81fcb8d5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/index.html @@ -0,0 +1,319 @@ + + + + + + + + + + mentat::query - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat::query + + [] + + [src]

Structs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Keyword +

A keyword is a symbol, optionally with a namespace, that prints with a leading colon. +This concept is imported from Clojure, as it features in EDN and the query +syntax that we use.

+ +
Known +

A convenience wrapper around things known in memory: the schema and caches. +We use a trait object here to avoid making dozens of functions generic over the type +of the cache. If performance becomes a concern, we should hard-code specific kinds of +cache right here, and/or eliminate the Option.

+ +
PlainSymbol +

A simplification of Clojure's Symbol.

+ +
QueryInputs +

Define the inputs to a query. This is in two parts: a set of values known now, and a set of +types known now. +The separate map of types is to allow queries to be algebrized without full knowledge of +the bindings that will be used at execution time. +When built correctly, types is guaranteed to contain the types of values -- use +QueryInputs::new or QueryInputs::with_values to construct an instance.

+ +
QueryOutput + +
QueryPlanStep +

A single row in the output of SQLite's EXPLAIN QUERY PLAN. +See https://www.sqlite.org/eqp.html for an explanation of each field.

+ +
RelResult +

The result you get from a 'rel' query, like:

+ +
Variable + +

Enums

+ + + + + + + + + + + + +
PreparedQuery + +
QueryExplanation +

A struct describing information about how Mentat would execute a query.

+ +
QueryResults + +

Traits

+ + + + +
IntoResult + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lookup_value +

Return a single value for the provided entity and attribute. +If the attribute is multi-valued, an arbitrary value is returned. +If no value is present for that entity, None is returned. +If attribute isn't an attribute, None is returned.

+ +
lookup_value_for_attribute +

Return a single value for the provided entity and attribute. +If the attribute is multi-valued, an arbitrary value is returned. +If no value is present for that entity, None is returned. +If attribute doesn't name an attribute, an error is returned.

+ +
lookup_values + +
lookup_values_for_attribute + +
q_explain + +
q_once +

Take an EDN query string, a reference to an open SQLite connection, a Mentat schema, and an +optional collection of input bindings (which should be keyed by "?varname"), and execute the +query immediately, blocking the current thread. +Returns a structure that corresponds to the kind of input query, populated with TypedValue +instances. +The caller is responsible for ensuring that the SQLite connection has an open transaction if +isolation is required.

+ +
q_prepare + +
q_uncached +

Just like q_once, but doesn't use any cached values.

+ +

Type Definitions

+ + + + + + + + +
PreparedResult + +
QueryExecutionResult + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/lookup_value.v.html b/docs/apis/rust/0.7.0/mentat/query/lookup_value.v.html new file mode 100644 index 00000000..3367212c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/lookup_value.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.lookup_value.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/lookup_value_for_attribute.v.html b/docs/apis/rust/0.7.0/mentat/query/lookup_value_for_attribute.v.html new file mode 100644 index 00000000..03e4746e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/lookup_value_for_attribute.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.lookup_value_for_attribute.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/lookup_values.v.html b/docs/apis/rust/0.7.0/mentat/query/lookup_values.v.html new file mode 100644 index 00000000..a95a084d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/lookup_values.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.lookup_values.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/lookup_values_for_attribute.v.html b/docs/apis/rust/0.7.0/mentat/query/lookup_values_for_attribute.v.html new file mode 100644 index 00000000..3062337b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/lookup_values_for_attribute.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.lookup_values_for_attribute.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/q_explain.v.html b/docs/apis/rust/0.7.0/mentat/query/q_explain.v.html new file mode 100644 index 00000000..85dca8b5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/q_explain.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.q_explain.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/q_once.v.html b/docs/apis/rust/0.7.0/mentat/query/q_once.v.html new file mode 100644 index 00000000..1ed24e17 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/q_once.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.q_once.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/q_prepare.v.html b/docs/apis/rust/0.7.0/mentat/query/q_prepare.v.html new file mode 100644 index 00000000..b5d23874 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/q_prepare.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.q_prepare.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/q_uncached.v.html b/docs/apis/rust/0.7.0/mentat/query/q_uncached.v.html new file mode 100644 index 00000000..bf84a574 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/q_uncached.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.q_uncached.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/sidebar-items.js b/docs/apis/rust/0.7.0/mentat/query/sidebar-items.js new file mode 100644 index 00000000..325d7ede --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["PreparedQuery",""],["QueryExplanation","A struct describing information about how Mentat would execute a query."],["QueryResults",""]],"fn":[["lookup_value","Return a single value for the provided entity and attribute. If the attribute is multi-valued, an arbitrary value is returned. If no value is present for that entity, `None` is returned. If `attribute` isn't an attribute, `None` is returned."],["lookup_value_for_attribute","Return a single value for the provided entity and attribute. If the attribute is multi-valued, an arbitrary value is returned. If no value is present for that entity, `None` is returned. If `attribute` doesn't name an attribute, an error is returned."],["lookup_values",""],["lookup_values_for_attribute",""],["q_explain",""],["q_once","Take an EDN query string, a reference to an open SQLite connection, a Mentat schema, and an optional collection of input bindings (which should be keyed by `\"?varname\"`), and execute the query immediately, blocking the current thread. Returns a structure that corresponds to the kind of input query, populated with `TypedValue` instances. The caller is responsible for ensuring that the SQLite connection has an open transaction if isolation is required."],["q_prepare",""],["q_uncached","Just like `q_once`, but doesn't use any cached values."]],"struct":[["Keyword","A keyword is a symbol, optionally with a namespace, that prints with a leading colon. This concept is imported from Clojure, as it features in EDN and the query syntax that we use."],["Known","A convenience wrapper around things known in memory: the schema and caches. We use a trait object here to avoid making dozens of functions generic over the type of the cache. If performance becomes a concern, we should hard-code specific kinds of cache right here, and/or eliminate the Option."],["PlainSymbol","A simplification of Clojure's Symbol."],["QueryInputs","Define the inputs to a query. This is in two parts: a set of values known now, and a set of types known now. The separate map of types is to allow queries to be algebrized without full knowledge of the bindings that will be used at execution time. When built correctly, `types` is guaranteed to contain the types of `values` -- use `QueryInputs::new` or `QueryInputs::with_values` to construct an instance."],["QueryOutput",""],["QueryPlanStep","A single row in the output of SQLite's `EXPLAIN QUERY PLAN`. See https://www.sqlite.org/eqp.html for an explanation of each field."],["RelResult","The result you get from a 'rel' query, like:"],["Variable",""]],"trait":[["IntoResult",""]],"type":[["PreparedResult",""],["QueryExecutionResult",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/struct.Keyword.html b/docs/apis/rust/0.7.0/mentat/query/struct.Keyword.html new file mode 100644 index 00000000..0413fb02 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/struct.Keyword.html @@ -0,0 +1,240 @@ + + + + + + + + + + mentat::query::Keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::query::Keyword + + [] + + [src]

pub struct Keyword(_);

A keyword is a symbol, optionally with a namespace, that prints with a leading colon. +This concept is imported from Clojure, as it features in EDN and the query +syntax that we use.

+

Clojure's constraints are looser than ours, allowing empty namespaces or +names:

+
user=> (keyword "" "")
+:/
+user=> (keyword "foo" "")
+:foo/
+user=> (keyword "" "bar")
+:/bar
+
+

We think that's nonsense, so we only allow keywords like :bar and :foo/bar, +with both namespace and main parts containing no whitespace and no colon or slash:

+ +
+let bar     = Keyword::plain("bar");                         // :bar
+let foo_bar = Keyword::namespaced("foo", "bar");        // :foo/bar
+assert_eq!("bar", bar.name());
+assert_eq!(None, bar.namespace());
+assert_eq!("bar", foo_bar.name());
+assert_eq!(Some("foo"), foo_bar.namespace());
+

If you're not sure whether your input is well-formed, you should use a +parser or a reader function first to validate. TODO: implement read.

+

Callers are expected to follow these rules: +http://www.clojure.org/reference/reader#_symbols

+

Future: fast equality (interning?) for keywords.

+
+

+ Methods +

+

impl Keyword
[src]

impl Keyword
[src]

Creates a new Keyword.

+

Examples

+
+let keyword = Keyword::namespaced("foo", "bar");
+assert_eq!(keyword.to_string(), ":foo/bar");
+

See also the kw! macro in the main mentat crate.

+

Whether this Keyword should be interpreted in reverse order. For example, +the two following snippets are identical:

+
[?y :person/friend ?x]
+[?x :person/hired ?y]
+
+[?y :person/friend ?x]
+[?y :person/_hired ?x]
+
+

Examples

+
+assert!(!Keyword::namespaced("foo", "bar").is_backward());
+assert!(Keyword::namespaced("foo", "_bar").is_backward());
+

Whether this Keyword should be interpreted in forward order. +See symbols::Keyword::is_backward.

+

Examples

+
+assert!(Keyword::namespaced("foo", "bar").is_forward());
+assert!(!Keyword::namespaced("foo", "_bar").is_forward());
+

Returns a Keyword with the same namespace and a +'backward' name. See symbols::Keyword::is_backward.

+

Returns a forward name if passed a reversed keyword; i.e., this +function is its own inverse.

+

Examples

+
+let nsk = Keyword::namespaced("foo", "bar");
+assert!(!nsk.is_backward());
+assert_eq!(":foo/bar", nsk.to_string());
+
+let reversed = nsk.to_reversed();
+assert!(reversed.is_backward());
+assert_eq!(":foo/_bar", reversed.to_string());
+

If this Keyword is 'backward' (see symbols::Keyword::is_backward), +return Some('forward name'); otherwise, return None.

+

Examples

+
+let nsk = Keyword::namespaced("foo", "bar");
+assert_eq!(None, nsk.unreversed());
+
+let reversed = nsk.to_reversed();
+assert_eq!(Some(nsk), reversed.unreversed());
+
+

+ Trait Implementations +

+
+

impl PartialOrd<Keyword> for Keyword
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Clone for Keyword
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<Keyword> for PatternValuePlace
[src]

Performs the conversion.

+

impl From<Keyword> for PatternNonValuePlace
[src]

Performs the conversion.

+

impl Ord for Keyword
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<'de> Deserialize<'de> for Keyword
[src]

Deserialize this value from the given Serde deserializer. Read more

+

impl Hash for Keyword
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for Keyword
[src]

impl PartialEq<Keyword> for Keyword
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for Keyword
[src]

Print the keyword in EDN format.

+

Examples

+
+assert_eq!(":baz", Keyword::plain("baz").to_string());
+assert_eq!(":bar/baz", Keyword::namespaced("bar", "baz").to_string());
+assert_eq!(":bar/_baz", Keyword::namespaced("bar", "baz").to_reversed().to_string());
+assert_eq!(":bar/baz", Keyword::namespaced("bar", "baz").to_reversed().to_reversed().to_string());
+

impl Debug for Keyword
[src]

Formats the value using the given formatter. Read more

+

impl Serialize for Keyword
[src]

Serialize this value into the given Serde serializer. Read more

+

impl From<Keyword> for TypedValue
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl Send for Keyword

impl Sync for Keyword

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/struct.Known.html b/docs/apis/rust/0.7.0/mentat/query/struct.Known.html new file mode 100644 index 00000000..25c2dd4e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/struct.Known.html @@ -0,0 +1,160 @@ + + + + + + + + + + mentat::query::Known - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::query::Known + + [] + + [src]

pub struct Known<'s, 'c> {
+    pub schema: &'s Schema,
+    pub cache: Option<&'c (CachedAttributes + 'c)>,
+}

A convenience wrapper around things known in memory: the schema and caches. +We use a trait object here to avoid making dozens of functions generic over the type +of the cache. If performance becomes a concern, we should hard-code specific kinds of +cache right here, and/or eliminate the Option.

+

+ Fields

+ + + + +

+ Methods +

+

impl<'s, 'c> Known<'s, 'c>
[src]

impl<'s, 'c> Known<'s, 'c>
[src]

This is CachedAttributes, but with handy generic parameters. +Why not make the trait generic? Because then we can't use it as a trait object in Known.

+

+

+ Trait Implementations +

+
+

impl<'s, 'c> Copy for Known<'s, 'c>
[src]

impl<'s, 'c> Clone for Known<'s, 'c>
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+
+

+ Auto Trait Implementations +

+
+

impl<'s, 'c> !Send for Known<'s, 'c>

impl<'s, 'c> !Sync for Known<'s, 'c>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/struct.PlainSymbol.html b/docs/apis/rust/0.7.0/mentat/query/struct.PlainSymbol.html new file mode 100644 index 00000000..7d898d42 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/struct.PlainSymbol.html @@ -0,0 +1,166 @@ + + + + + + + + + + mentat::query::PlainSymbol - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::query::PlainSymbol + + [] + + [src]

pub struct PlainSymbol(pub String);

A simplification of Clojure's Symbol.

+
+

+ Methods +

+

impl PlainSymbol
[src]

Return the name of the symbol without any leading '?' or '$'.

+ +
+assert_eq!("foo", PlainSymbol::plain("?foo").name());
+assert_eq!("foo", PlainSymbol::plain("$foo").name());
+assert_eq!("!foo", PlainSymbol::plain("!foo").name());
+

+

+ Trait Implementations +

+
+

impl PartialOrd<PlainSymbol> for PlainSymbol
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Clone for PlainSymbol
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Ord for PlainSymbol
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Hash for PlainSymbol
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for PlainSymbol
[src]

impl PartialEq<PlainSymbol> for PlainSymbol
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for PlainSymbol
[src]

Print the symbol in EDN format.

+

Examples

+
+assert_eq!("baz", PlainSymbol::plain("baz").to_string());
+

impl Debug for PlainSymbol
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for PlainSymbol

impl Sync for PlainSymbol

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/struct.QueryInputs.html b/docs/apis/rust/0.7.0/mentat/query/struct.QueryInputs.html new file mode 100644 index 00000000..fccfaa1b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/struct.QueryInputs.html @@ -0,0 +1,147 @@ + + + + + + + + + + mentat::query::QueryInputs - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::query::QueryInputs + + [] + + [src]

pub struct QueryInputs { /* fields omitted */ }

Define the inputs to a query. This is in two parts: a set of values known now, and a set of +types known now. +The separate map of types is to allow queries to be algebrized without full knowledge of +the bindings that will be used at execution time. +When built correctly, types is guaranteed to contain the types of values -- use +QueryInputs::new or QueryInputs::with_values to construct an instance.

+
+

+ Methods +

+

impl QueryInputs
[src]

+

+ Trait Implementations +

+
+

impl Default for QueryInputs
[src]

Returns the "default value" for a type. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for QueryInputs

impl !Sync for QueryInputs

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/struct.QueryOutput.html b/docs/apis/rust/0.7.0/mentat/query/struct.QueryOutput.html new file mode 100644 index 00000000..10d7c6b6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/struct.QueryOutput.html @@ -0,0 +1,156 @@ + + + + + + + + + + mentat::query::QueryOutput - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::query::QueryOutput + + [] + + [src]

pub struct QueryOutput {
+    pub spec: Rc<FindSpec>,
+    pub results: QueryResults,
+}

+ Fields

+ + + + +

+ Methods +

+

impl QueryOutput
[src]

Important traits for Box<R>

+

+ Trait Implementations +

+
+

impl From<QueryOutput> for QueryResults
[src]

Performs the conversion.

+

impl Eq for QueryOutput
[src]

impl PartialEq<QueryOutput> for QueryOutput
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for QueryOutput
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for QueryOutput

impl !Sync for QueryOutput

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/struct.QueryPlanStep.html b/docs/apis/rust/0.7.0/mentat/query/struct.QueryPlanStep.html new file mode 100644 index 00000000..b39eab28 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/struct.QueryPlanStep.html @@ -0,0 +1,160 @@ + + + + + + + + + + mentat::query::QueryPlanStep - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::query::QueryPlanStep + + [] + + [src]

pub struct QueryPlanStep {
+    pub select_id: i32,
+    pub order: i32,
+    pub from: i32,
+    pub detail: String,
+}

A single row in the output of SQLite's EXPLAIN QUERY PLAN. +See https://www.sqlite.org/eqp.html for an explanation of each field.

+

+ Fields

+ + + + + + + + +

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl Send for QueryPlanStep

impl Sync for QueryPlanStep

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/struct.RelResult.html b/docs/apis/rust/0.7.0/mentat/query/struct.RelResult.html new file mode 100644 index 00000000..9ef380d9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/struct.RelResult.html @@ -0,0 +1,183 @@ + + + + + + + + + + mentat::query::RelResult - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::query::RelResult + + [] + + [src]

pub struct RelResult<T> {
+    pub width: usize,
+    pub values: Vec<T>,
+}

The result you get from a 'rel' query, like:

+
[:find ?person ?name
+ :where [?person :person/name ?name]]
+
+

There are three ways to get data out of a RelResult:

+
    +
  • By iterating over rows as slices. Use result.rows(). This is efficient and is +recommended in two cases: +
      +
    1. If you don't need to take ownership of the resulting values (e.g., you're comparing +or making a modified clone).
    2. +
    3. When the data you're retrieving is cheap to clone. All scalar values are relatively +cheap: they're either small values or Rc.
    4. +
    +
  • +
  • By direct reference to a row by index, using result.row(i). This also returns +a reference.
  • +
  • By consuming the results using into_iter. This allocates short-lived vectors, +but gives you ownership of the enclosed TypedValues.
  • +
+

+ Fields

+ + + + +

+ Methods +

+

impl<T> RelResult<T>
[src]

Important traits for Chunks<'a, T>

+

+ Trait Implementations +

+
+

impl<T> IntoIterator for RelResult<T>
[src]

+

The type of the elements being iterated over.

+

+

Which kind of iterator are we turning this into?

+

Creates an iterator from a value. Read more

+

impl<T> Clone for RelResult<T> where
    T: Clone
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<Vec<Vec<TypedValue>>> for RelResult<Binding>
[src]

Performs the conversion.

+

impl<T> Eq for RelResult<T> where
    T: Eq
[src]

impl<T> PartialEq<RelResult<T>> for RelResult<T> where
    T: PartialEq<T>, 
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl<T> Debug for RelResult<T> where
    T: Debug
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl<T> Send for RelResult<T> where
    T: Send

impl<T> Sync for RelResult<T> where
    T: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/struct.Variable.html b/docs/apis/rust/0.7.0/mentat/query/struct.Variable.html new file mode 100644 index 00000000..1d55bfeb --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/struct.Variable.html @@ -0,0 +1,162 @@ + + + + + + + + + + mentat::query::Variable - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::query::Variable + + [] + + [src]

pub struct Variable(pub Rc<PlainSymbol>);
+

+ Methods +

+

impl Variable
[src]

Return a new Variable, assuming that the provided string is a valid name.

+

impl Variable
[src]

TODO: intern strings. #398.

+
+

+ Trait Implementations +

+
+

impl PartialOrd<Variable> for Variable
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Clone for Variable
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<Variable> for Element
[src]

Performs the conversion.

+

impl Ord for Variable
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Hash for Variable
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for Variable
[src]

impl PartialEq<Variable> for Variable
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for Variable
[src]

Formats the value using the given formatter. Read more

+

impl Debug for Variable
[src]

Formats the value using the given formatter. Read more

+

impl FromValue<Variable> for Variable
[src]

If the provided EDN value is a PlainSymbol beginning with '?', return +it wrapped in a Variable. If not, return None. +TODO: intern strings. #398.

+
+

+ Auto Trait Implementations +

+
+

impl !Send for Variable

impl !Sync for Variable

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/trait.IntoResult.html b/docs/apis/rust/0.7.0/mentat/query/trait.IntoResult.html new file mode 100644 index 00000000..2898062a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/trait.IntoResult.html @@ -0,0 +1,144 @@ + + + + + + + + + + mentat::query::IntoResult - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat::query::IntoResult + + [] + + [src]

pub trait IntoResult {
+    fn into_scalar_result(self) -> Result<Option<Binding>>;
+
fn into_coll_result(self) -> Result<Vec<Binding>>; +
fn into_tuple_result(self) -> Result<Option<Vec<Binding>>>; +
fn into_rel_result(self) -> Result<RelResult<Binding>>; +}
+

+ Required Methods +

+ +

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/type.PreparedResult.html b/docs/apis/rust/0.7.0/mentat/query/type.PreparedResult.html new file mode 100644 index 00000000..289dcdd2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/type.PreparedResult.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat::query::PreparedResult - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat::query::PreparedResult + + [] + + [src]

type PreparedResult<'sqlite> = Result<PreparedQuery<'sqlite>>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query/type.QueryExecutionResult.html b/docs/apis/rust/0.7.0/mentat/query/type.QueryExecutionResult.html new file mode 100644 index 00000000..affcb833 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query/type.QueryExecutionResult.html @@ -0,0 +1,131 @@ + + + + + + + + + + mentat::query::QueryExecutionResult - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat::query::QueryExecutionResult + + [] + + [src]

type QueryExecutionResult = Result<QueryOutput>;
+

+ Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query_builder/QueryBuilder.t.html b/docs/apis/rust/0.7.0/mentat/query_builder/QueryBuilder.t.html new file mode 100644 index 00000000..ce8cc39b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query_builder/QueryBuilder.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.QueryBuilder.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query_builder/index.html b/docs/apis/rust/0.7.0/mentat/query_builder/index.html new file mode 100644 index 00000000..a2332169 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query_builder/index.html @@ -0,0 +1,134 @@ + + + + + + + + + + mentat::query_builder - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat::query_builder + + [] + + [src]

Structs

+ + + + +
QueryBuilder + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query_builder/sidebar-items.js b/docs/apis/rust/0.7.0/mentat/query_builder/sidebar-items.js new file mode 100644 index 00000000..cb33f66b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query_builder/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["QueryBuilder",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/query_builder/struct.QueryBuilder.html b/docs/apis/rust/0.7.0/mentat/query_builder/struct.QueryBuilder.html new file mode 100644 index 00000000..8b4c838f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/query_builder/struct.QueryBuilder.html @@ -0,0 +1,140 @@ + + + + + + + + + + mentat::query_builder::QueryBuilder - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::query_builder::QueryBuilder + + [] + + [src]

pub struct QueryBuilder<'a> { /* fields omitted */ }
+

+ Methods +

+

impl<'a> QueryBuilder<'a>
[src]

Important traits for &'a mut R

Important traits for &'a mut R

Important traits for &'a mut R

Important traits for &'a mut R

Important traits for &'a mut R

Important traits for &'a mut R

+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl<'a> !Send for QueryBuilder<'a>

impl<'a> !Sync for QueryBuilder<'a>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/sidebar-items.js b/docs/apis/rust/0.7.0/mentat/sidebar-items.js new file mode 100644 index 00000000..90b2f611 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"constant":[["CORE_SCHEMA_VERSION",""],["DB_SCHEMA_CORE",""]],"enum":[["Binding","The values bound in a query specification can be:"],["FindSpec","A definition of the first part of a find query: the `[:find ?foo ?bar…]` bit."],["QueryResults",""],["TypedValue","Represents a value that can be stored in a Mentat store."],["ValueType","The attribute of each Mentat assertion has a :db/valueType constraining the value to a particular set. Mentat recognizes the following :db/valueType values."]],"fn":[["new_connection",""]],"macro":[["bail",""],["kw","Produce the appropriate `Keyword` for the provided namespace and name. This lives here because we can't re-export macros: https://github.com/rust-lang/rust/issues/29638."],["var","Produce the appropriate `Variable` for the provided valid ?-prefixed name. This lives here because we can't re-export macros: https://github.com/rust-lang/rust/issues/29638."]],"mod":[["conn",""],["entity_builder",""],["errors",""],["ident",""],["query",""],["query_builder",""],["store",""],["vocabulary","This module exposes an interface for programmatic management of vocabularies."]],"struct":[["Attribute","A Mentat schema attribute has a value type and several other flags determining how assertions with the attribute are interpreted."],["DateTime","ISO 8601 combined date and time with time zone."],["Keyword","A keyword is a symbol, optionally with a namespace, that prints with a leading colon. This concept is imported from Clojure, as it features in EDN and the query syntax that we use."],["KnownEntid","An entid that's either already in the store, or newly allocated to a tempid. TODO: we'd like to link this in some way to the lifetime of a particular PartitionMap."],["PlainSymbol","A simplification of Clojure's Symbol."],["QueryInputs","Define the inputs to a query. This is in two parts: a set of values known now, and a set of types known now. The separate map of types is to allow queries to be algebrized without full knowledge of the bindings that will be used at execution time. When built correctly, `types` is guaranteed to contain the types of `values` -- use `QueryInputs::new` or `QueryInputs::with_values` to construct an instance."],["QueryOutput",""],["RelResult","The result you get from a 'rel' query, like:"],["Schema","Represents a Mentat schema."],["TxObserver",""],["TxReport","A transaction report summarizes an applied transaction."],["Utc","The UTC time zone. This is the most efficient time zone when you don't need the local time. It is also used as an offset (which is also a dummy type)."],["Uuid","A Universally Unique Identifier (UUID)."],["Variable",""]],"trait":[["HasSchema",""]],"type":[["AttributeSet",""],["Entid","Represents one entid in the entid space."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/store/Store.t.html b/docs/apis/rust/0.7.0/mentat/store/Store.t.html new file mode 100644 index 00000000..df3a3c40 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/store/Store.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Store.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/store/index.html b/docs/apis/rust/0.7.0/mentat/store/index.html new file mode 100644 index 00000000..7244780f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/store/index.html @@ -0,0 +1,136 @@ + + + + + + + + + + mentat::store - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat::store + + [] + + [src]

Structs

+ + + + +
Store +

A convenience wrapper around a single SQLite connection and a Conn. This is suitable +for applications that don't require complex connection management.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/store/sidebar-items.js b/docs/apis/rust/0.7.0/mentat/store/sidebar-items.js new file mode 100644 index 00000000..ac7dbfc6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/store/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["Store","A convenience wrapper around a single SQLite connection and a Conn. This is suitable for applications that don't require complex connection management."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/store/struct.Store.html b/docs/apis/rust/0.7.0/mentat/store/struct.Store.html new file mode 100644 index 00000000..8b496b1b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/store/struct.Store.html @@ -0,0 +1,145 @@ + + + + + + + + + + mentat::store::Store - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::store::Store + + [] + + [src]

pub struct Store { /* fields omitted */ }

A convenience wrapper around a single SQLite connection and a Conn. This is suitable +for applications that don't require complex connection management.

+
+

+ Methods +

+

impl Store
[src]

Open a store at the supplied path, ensuring that it includes the bootstrap schema.

+

Returns a totally blank store with no bootstrap schema. Use open instead.

+

impl Store
[src]

Intended for use from tests.

+

impl Store
[src]

+

+ Trait Implementations +

+
+

impl Queryable for Store
[src]

impl Pullable for Store
[src]

impl Syncable for Store
[src]

+

+ Auto Trait Implementations +

+
+

impl Send for Store

impl !Sync for Store

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/struct.Attribute.html b/docs/apis/rust/0.7.0/mentat/struct.Attribute.html new file mode 100644 index 00000000..542de315 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/struct.Attribute.html @@ -0,0 +1,216 @@ + + + + + + + + + + mentat::Attribute - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::Attribute + + [] + + [src]

pub struct Attribute {
+    pub value_type: ValueType,
+    pub multival: bool,
+    pub unique: Option<Unique>,
+    pub index: bool,
+    pub fulltext: bool,
+    pub component: bool,
+    pub no_history: bool,
+}

A Mentat schema attribute has a value type and several other flags determining how assertions +with the attribute are interpreted.

+

TODO: consider packing this into a bitfield or similar.

+

+ Fields

+ +

The associated value type, i.e., :db/valueType?

+
+ +

true if this attribute is multi-valued, i.e., it is :db/cardinality :db.cardinality/many. false if this attribute is single-valued (the default), i.e., it +is :db/cardinality :db.cardinality/one.

+
+ +

None if this attribute is neither unique-value nor unique-identity.

+

Some(attribute::Unique::Value) if this attribute is unique-value, i.e., it is :db/unique :db.unique/value.

+

Unique-value means that there is at most one assertion with the attribute and a +particular value in the datom store. Unique-value attributes can be used in lookup-refs.

+

Some(attribute::Unique::Identity) if this attribute is unique-identity, i.e., it is :db/unique :db.unique/identity.

+

Unique-identity attributes always have value type Ref.

+

Unique-identity means that the attribute is unique-value and that they can be used in +lookup-refs and will automatically upsert where appropriate.

+
+ +

true if this attribute is automatically indexed, i.e., it is :db/indexing true.

+
+ +

true if this attribute is automatically fulltext indexed, i.e., it is :db/fulltext true.

+

Fulltext attributes always have string values.

+
+ +

true if this attribute is a component, i.e., it is :db/isComponent true.

+

Component attributes always have value type Ref.

+

They are used to compose entities from component sub-entities: they are fetched recursively +by pull expressions, and they are automatically recursively deleted where appropriate.

+
+ +

true if this attribute doesn't require history to be kept, i.e., it is :db/noHistory true.

+
+

+ Methods +

+

impl Attribute
[src]

Combine several attribute flags into a bitfield used in temporary search tables.

+

+

+ Trait Implementations +

+
+

impl PartialOrd<Attribute> for Attribute
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Clone for Attribute
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Ord for Attribute
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Hash for Attribute
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for Attribute
[src]

impl PartialEq<Attribute> for Attribute
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for Attribute
[src]

Formats the value using the given formatter. Read more

+

impl Default for Attribute
[src]

Returns the "default value" for a type. Read more

+

impl AttributeValidation for Attribute
[src]

+

+ Auto Trait Implementations +

+
+

impl Send for Attribute

impl Sync for Attribute

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/struct.DateTime.html b/docs/apis/rust/0.7.0/mentat/struct.DateTime.html new file mode 100644 index 00000000..fbe702f9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/struct.DateTime.html @@ -0,0 +1,349 @@ + + + + + + + + + + mentat::DateTime - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::DateTime + + [] + + [src]

pub struct DateTime<Tz> where
    Tz: TimeZone
{ /* fields omitted */ }

ISO 8601 combined date and time with time zone.

+

There are some constructors implemented here (the from_* methods), but +the general-purpose constructors are all via the methods on the +TimeZone implementations.

+
+

+ Methods +

+

impl<Tz> DateTime<Tz> where
    Tz: TimeZone
[src]

Makes a new DateTime with given UTC datetime and offset. +The local datetime should be constructed via the TimeZone trait.

+

Example

+
+use chrono::{DateTime, TimeZone, NaiveDateTime, Utc};
+
+let dt = DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(61, 0), Utc);
+assert_eq!(Utc.timestamp(61, 0), dt);
+

Retrieves a date component.

+

Retrieves a time component. +Unlike date, this is not associated to the time zone.

+

Returns the number of non-leap seconds since January 1, 1970 0:00:00 UTC +(aka "UNIX timestamp").

+

Returns the number of non-leap-milliseconds since January 1, 1970 UTC

+

Note that this does reduce the number of years that can be represented +from ~584 Billion to ~584 Million. (If this is a problem, please file +an issue to let me know what domain needs millisecond precision over +billions of years, I'm curious.)

+

Example

+
+use chrono::Utc;
+use chrono::TimeZone;
+
+let dt = Utc.ymd(1970, 1, 1).and_hms_milli(0, 0, 1, 444);
+assert_eq!(dt.timestamp_millis(), 1_444);
+
+let dt = Utc.ymd(2001, 9, 9).and_hms_milli(1, 46, 40, 555);
+assert_eq!(dt.timestamp_millis(), 1_000_000_000_555);
+

Returns the number of non-leap-nanoseconds since January 1, 1970 UTC

+

Note that this does reduce the number of years that can be represented +from ~584 Billion to ~584. (If this is a problem, please file +an issue to let me know what domain needs nanosecond precision over +millenia, I'm curious.)

+

Example

+
+use chrono::Utc;
+use chrono::TimeZone;
+
+let dt = Utc.ymd(1970, 1, 1).and_hms_nano(0, 0, 1, 444);
+assert_eq!(dt.timestamp_nanos(), 1_000_000_444);
+
+let dt = Utc.ymd(2001, 9, 9).and_hms_nano(1, 46, 40, 555);
+assert_eq!(dt.timestamp_nanos(), 1_000_000_000_000_000_555);
+

Returns the number of milliseconds since the last second boundary

+

warning: in event of a leap second, this may exceed 999

+

note: this is not the number of milliseconds since January 1, 1970 0:00:00 UTC

+

Returns the number of microseconds since the last second boundary

+

warning: in event of a leap second, this may exceed 999_999

+

note: this is not the number of microseconds since January 1, 1970 0:00:00 UTC

+

Returns the number of nanoseconds since the last second boundary

+

warning: in event of a leap second, this may exceed 999_999_999

+

note: this is not the number of nanoseconds since January 1, 1970 0:00:00 UTC

+

Retrieves an associated offset from UTC.

+

Retrieves an associated time zone.

+

Changes the associated time zone. +This does not change the actual DateTime (but will change the string representation).

+

Adds given Duration to the current date and time.

+

Returns None when it will result in overflow.

+

Subtracts given Duration from the current date and time.

+

Returns None when it will result in overflow.

+

Subtracts another DateTime from the current date and time. +This does not overflow or underflow at all.

+

Returns a view to the naive UTC datetime.

+

Returns a view to the naive local datetime.

+

impl DateTime<FixedOffset>
[src]

Parses an RFC 2822 date and time string such as Tue, 1 Jul 2003 10:52:37 +0200, +then returns a new DateTime with a parsed FixedOffset.

+

Parses an RFC 3339 and ISO 8601 date and time string such as 1996-12-19T16:39:57-08:00, +then returns a new DateTime with a parsed FixedOffset.

+

Why isn't this named parse_from_iso8601? That's because ISO 8601 allows some freedom +over the syntax and RFC 3339 exercises that freedom to rigidly define a fixed format.

+

Parses a string with the specified format string and +returns a new DateTime with a parsed FixedOffset. +See the format::strftime module +on the supported escape sequences.

+

See also Offset::datetime_from_str which gives a local DateTime on specific time zone.

+

Note that this method requires a timezone in the string. See +NaiveDateTime::parse_from_str +for a version that does not require a timezone in the to-be-parsed str.

+

Example

+
+use chrono::{DateTime, FixedOffset, TimeZone};
+
+let dt = DateTime::parse_from_str(
+    "1983 Apr 13 12:09:14.274 +0000", "%Y %b %d %H:%M:%S%.3f %z");
+assert_eq!(dt, Ok(FixedOffset::east(0).ymd(1983, 4, 13).and_hms_milli(12, 9, 14, 274)));
+

impl<Tz> DateTime<Tz> where
    Tz: TimeZone,
    <Tz as TimeZone>::Offset: Display
[src]

Returns an RFC 2822 date and time string such as Tue, 1 Jul 2003 10:52:37 +0200.

+

Returns an RFC 3339 and ISO 8601 date and time string such as 1996-12-19T16:39:57-08:00.

+

Return an RFC 3339 and ISO 8601 date and time string with subseconds +formatted as per a SecondsFormat. If passed use_z true and the +timezone is UTC (offset 0), use 'Z', as per +Fixed::TimezoneOffsetColonZ. +If passed use_z false, use +Fixed::TimezoneOffsetColon.

+

Examples

+
+let dt = Utc.ymd(2018, 1, 26).and_hms_micro(18, 30, 9, 453_829);
+assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Millis, false),
+           "2018-01-26T18:30:09.453+00:00");
+assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Millis, true),
+           "2018-01-26T18:30:09.453Z");
+assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Secs, true),
+           "2018-01-26T18:30:09Z");
+
+let pst = FixedOffset::east(8 * 60 * 60);
+let dt = pst.ymd(2018, 1, 26).and_hms_micro(10, 30, 9, 453_829);
+assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Secs, true),
+           "2018-01-26T10:30:09+08:00");
+

Formats the combined date and time with the specified formatting items.

+

Formats the combined date and time with the specified format string. +See the format::strftime module +on the supported escape sequences.

+
+

+ Trait Implementations +

+
+

impl ToMicros for DateTime<Utc>
[src]

impl FromMicros for DateTime<Utc>
[src]

impl<Tz> Copy for DateTime<Tz> where
    Tz: TimeZone,
    <Tz as TimeZone>::Offset: Copy
[src]

impl<Tz> PartialOrd<DateTime<Tz>> for DateTime<Tz> where
    Tz: TimeZone
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl<Tz> Clone for DateTime<Tz> where
    Tz: TimeZone + Clone,
    <Tz as TimeZone>::Offset: Clone
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<Tz> Add<FixedOffset> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<Tz> Add<Duration> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<Tz> From<DateTime<Tz>> for SystemTime where
    Tz: TimeZone
[src]

Performs the conversion.

+

impl From<SystemTime> for DateTime<Local>
[src]

Performs the conversion.

+

impl From<SystemTime> for DateTime<Utc>
[src]

Performs the conversion.

+

impl<Tz> Serialize for DateTime<Tz> where
    Tz: TimeZone
[src]

Serialize into a rfc3339 time string

+

See the serde module for alternate +serializations.

+

impl<Tz> Sub<Duration> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<Tz> Sub<DateTime<Tz>> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<Tz> Sub<FixedOffset> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl FromStr for DateTime<FixedOffset>
[src]

+

The associated error which can be returned from parsing.

+

Parses a string s to return a value of this type. Read more

+

impl FromStr for DateTime<Local>
[src]

+

The associated error which can be returned from parsing.

+

Parses a string s to return a value of this type. Read more

+

impl FromStr for DateTime<Utc>
[src]

+

The associated error which can be returned from parsing.

+

Parses a string s to return a value of this type. Read more

+

impl<Tz> Ord for DateTime<Tz> where
    Tz: TimeZone
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<Tz> Hash for DateTime<Tz> where
    Tz: TimeZone
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl<Tz> Eq for DateTime<Tz> where
    Tz: TimeZone
[src]

impl<Tz, Tz2> PartialEq<DateTime<Tz2>> for DateTime<Tz> where
    Tz: TimeZone,
    Tz2: TimeZone
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl<'de> Deserialize<'de> for DateTime<FixedOffset>
[src]

Deserialize a value that optionally includes a timezone offset in its +string representation

+

The value to be deserialized must be an rfc3339 string.

+

See the serde module for alternate +deserialization formats.

+

Deserialize this value from the given Serde deserializer. Read more

+

impl<'de> Deserialize<'de> for DateTime<Utc>
[src]

Deserialize into a UTC value

+

The value to be deserialized must be an rfc3339 string.

+

See the serde module for alternate +deserialization formats.

+

Deserialize this value from the given Serde deserializer. Read more

+

impl<'de> Deserialize<'de> for DateTime<Local>
[src]

Deserialize a value that includes no timezone in its string +representation

+

The value to be deserialized must be an rfc3339 string.

+

See the serde module for alternate +serialization formats.

+

Deserialize this value from the given Serde deserializer. Read more

+

impl<Tz> Timelike for DateTime<Tz> where
    Tz: TimeZone
[src]

Returns the hour number from 0 to 23.

+

Returns the minute number from 0 to 59.

+

Returns the second number from 0 to 59.

+

Returns the number of nanoseconds since the whole non-leap second. The range from 1,000,000,000 to 1,999,999,999 represents the leap second. Read more

+

Makes a new value with the hour number changed. Read more

+

Makes a new value with the minute number changed. Read more

+

Makes a new value with the second number changed. Read more

+

Makes a new value with nanoseconds since the whole non-leap second changed. Read more

+

Returns the hour number from 1 to 12 with a boolean flag, which is false for AM and true for PM. Read more

+

Returns the number of non-leap seconds past the last midnight.

+

impl<Tz> Display for DateTime<Tz> where
    Tz: TimeZone,
    <Tz as TimeZone>::Offset: Display
[src]

Formats the value using the given formatter. Read more

+

impl<Tz> Send for DateTime<Tz> where
    Tz: TimeZone,
    <Tz as TimeZone>::Offset: Send
[src]

impl<Tz> Datelike for DateTime<Tz> where
    Tz: TimeZone
[src]

Returns the year number in the calendar date.

+

Returns the month number starting from 1. Read more

+

Returns the month number starting from 0. Read more

+

Returns the day of month starting from 1. Read more

+

Returns the day of month starting from 0. Read more

+

Returns the day of year starting from 1. Read more

+

Returns the day of year starting from 0. Read more

+

Returns the day of week.

+

Returns the ISO week.

+

Makes a new value with the year number changed. Read more

+

Makes a new value with the month number (starting from 1) changed. Read more

+

Makes a new value with the month number (starting from 0) changed. Read more

+

Makes a new value with the day of month (starting from 1) changed. Read more

+

Makes a new value with the day of month (starting from 0) changed. Read more

+

Makes a new value with the day of year (starting from 1) changed. Read more

+

Makes a new value with the day of year (starting from 0) changed. Read more

+

Returns the absolute year number starting from 1 with a boolean flag, which is false when the year predates the epoch (BCE/BC) and true otherwise (CE/AD). Read more

+

Returns the number of days since January 1, 1 (Day 1) in the proleptic Gregorian calendar.

+

impl<Tz> Debug for DateTime<Tz> where
    Tz: TimeZone
[src]

Formats the value using the given formatter. Read more

+

impl From<DateTime<Utc>> for TypedValue
[src]

Truncate the provided DateTime to microsecond precision, and return the corresponding +TypedValue::Instant.

+

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl<Tz> Sync for DateTime<Tz> where
    <Tz as TimeZone>::Offset: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/struct.Keyword.html b/docs/apis/rust/0.7.0/mentat/struct.Keyword.html new file mode 100644 index 00000000..fbeadc83 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/struct.Keyword.html @@ -0,0 +1,240 @@ + + + + + + + + + + mentat::Keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::Keyword + + [] + + [src]

pub struct Keyword(_);

A keyword is a symbol, optionally with a namespace, that prints with a leading colon. +This concept is imported from Clojure, as it features in EDN and the query +syntax that we use.

+

Clojure's constraints are looser than ours, allowing empty namespaces or +names:

+
user=> (keyword "" "")
+:/
+user=> (keyword "foo" "")
+:foo/
+user=> (keyword "" "bar")
+:/bar
+
+

We think that's nonsense, so we only allow keywords like :bar and :foo/bar, +with both namespace and main parts containing no whitespace and no colon or slash:

+ +
+let bar     = Keyword::plain("bar");                         // :bar
+let foo_bar = Keyword::namespaced("foo", "bar");        // :foo/bar
+assert_eq!("bar", bar.name());
+assert_eq!(None, bar.namespace());
+assert_eq!("bar", foo_bar.name());
+assert_eq!(Some("foo"), foo_bar.namespace());
+

If you're not sure whether your input is well-formed, you should use a +parser or a reader function first to validate. TODO: implement read.

+

Callers are expected to follow these rules: +http://www.clojure.org/reference/reader#_symbols

+

Future: fast equality (interning?) for keywords.

+
+

+ Methods +

+

impl Keyword
[src]

impl Keyword
[src]

Creates a new Keyword.

+

Examples

+
+let keyword = Keyword::namespaced("foo", "bar");
+assert_eq!(keyword.to_string(), ":foo/bar");
+

See also the kw! macro in the main mentat crate.

+

Whether this Keyword should be interpreted in reverse order. For example, +the two following snippets are identical:

+
[?y :person/friend ?x]
+[?x :person/hired ?y]
+
+[?y :person/friend ?x]
+[?y :person/_hired ?x]
+
+

Examples

+
+assert!(!Keyword::namespaced("foo", "bar").is_backward());
+assert!(Keyword::namespaced("foo", "_bar").is_backward());
+

Whether this Keyword should be interpreted in forward order. +See symbols::Keyword::is_backward.

+

Examples

+
+assert!(Keyword::namespaced("foo", "bar").is_forward());
+assert!(!Keyword::namespaced("foo", "_bar").is_forward());
+

Returns a Keyword with the same namespace and a +'backward' name. See symbols::Keyword::is_backward.

+

Returns a forward name if passed a reversed keyword; i.e., this +function is its own inverse.

+

Examples

+
+let nsk = Keyword::namespaced("foo", "bar");
+assert!(!nsk.is_backward());
+assert_eq!(":foo/bar", nsk.to_string());
+
+let reversed = nsk.to_reversed();
+assert!(reversed.is_backward());
+assert_eq!(":foo/_bar", reversed.to_string());
+

If this Keyword is 'backward' (see symbols::Keyword::is_backward), +return Some('forward name'); otherwise, return None.

+

Examples

+
+let nsk = Keyword::namespaced("foo", "bar");
+assert_eq!(None, nsk.unreversed());
+
+let reversed = nsk.to_reversed();
+assert_eq!(Some(nsk), reversed.unreversed());
+
+

+ Trait Implementations +

+
+

impl PartialOrd<Keyword> for Keyword
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Clone for Keyword
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<Keyword> for PatternValuePlace
[src]

Performs the conversion.

+

impl From<Keyword> for PatternNonValuePlace
[src]

Performs the conversion.

+

impl Ord for Keyword
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<'de> Deserialize<'de> for Keyword
[src]

Deserialize this value from the given Serde deserializer. Read more

+

impl Hash for Keyword
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for Keyword
[src]

impl PartialEq<Keyword> for Keyword
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for Keyword
[src]

Print the keyword in EDN format.

+

Examples

+
+assert_eq!(":baz", Keyword::plain("baz").to_string());
+assert_eq!(":bar/baz", Keyword::namespaced("bar", "baz").to_string());
+assert_eq!(":bar/_baz", Keyword::namespaced("bar", "baz").to_reversed().to_string());
+assert_eq!(":bar/baz", Keyword::namespaced("bar", "baz").to_reversed().to_reversed().to_string());
+

impl Debug for Keyword
[src]

Formats the value using the given formatter. Read more

+

impl Serialize for Keyword
[src]

Serialize this value into the given Serde serializer. Read more

+

impl From<Keyword> for TypedValue
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl Send for Keyword

impl Sync for Keyword

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/struct.KnownEntid.html b/docs/apis/rust/0.7.0/mentat/struct.KnownEntid.html new file mode 100644 index 00000000..fc94386b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/struct.KnownEntid.html @@ -0,0 +1,155 @@ + + + + + + + + + + mentat::KnownEntid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::KnownEntid + + [] + + [src]

pub struct KnownEntid(pub i64);

An entid that's either already in the store, or newly allocated to a tempid. +TODO: we'd like to link this in some way to the lifetime of a particular PartitionMap.

+
+

+ Trait Implementations +

+
+

impl PartialOrd<KnownEntid> for KnownEntid
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Copy for KnownEntid
[src]

impl Clone for KnownEntid
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<KnownEntid> for i64
[src]

Performs the conversion.

+

impl From<KnownEntid> for TypedValue
[src]

Performs the conversion.

+

impl Ord for KnownEntid
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Hash for KnownEntid
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for KnownEntid
[src]

impl PartialEq<KnownEntid> for KnownEntid
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for KnownEntid
[src]

Formats the value using the given formatter. Read more

+

impl<'a> FromThing<&'a KnownEntid> for KnownEntidOr<TempIdHandle>
[src]

impl FromThing<KnownEntid> for KnownEntidOr<TempIdHandle>
[src]

impl FromThing<KnownEntid> for TypedValueOr<TempIdHandle>
[src]

+

+ Auto Trait Implementations +

+
+

impl Send for KnownEntid

impl Sync for KnownEntid

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/struct.PlainSymbol.html b/docs/apis/rust/0.7.0/mentat/struct.PlainSymbol.html new file mode 100644 index 00000000..cfc6883b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/struct.PlainSymbol.html @@ -0,0 +1,166 @@ + + + + + + + + + + mentat::PlainSymbol - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::PlainSymbol + + [] + + [src]

pub struct PlainSymbol(pub String);

A simplification of Clojure's Symbol.

+
+

+ Methods +

+

impl PlainSymbol
[src]

Return the name of the symbol without any leading '?' or '$'.

+ +
+assert_eq!("foo", PlainSymbol::plain("?foo").name());
+assert_eq!("foo", PlainSymbol::plain("$foo").name());
+assert_eq!("!foo", PlainSymbol::plain("!foo").name());
+

+

+ Trait Implementations +

+
+

impl PartialOrd<PlainSymbol> for PlainSymbol
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Clone for PlainSymbol
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Ord for PlainSymbol
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Hash for PlainSymbol
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for PlainSymbol
[src]

impl PartialEq<PlainSymbol> for PlainSymbol
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for PlainSymbol
[src]

Print the symbol in EDN format.

+

Examples

+
+assert_eq!("baz", PlainSymbol::plain("baz").to_string());
+

impl Debug for PlainSymbol
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for PlainSymbol

impl Sync for PlainSymbol

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/struct.QueryInputs.html b/docs/apis/rust/0.7.0/mentat/struct.QueryInputs.html new file mode 100644 index 00000000..9ab594a5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/struct.QueryInputs.html @@ -0,0 +1,147 @@ + + + + + + + + + + mentat::QueryInputs - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::QueryInputs + + [] + + [src]

pub struct QueryInputs { /* fields omitted */ }

Define the inputs to a query. This is in two parts: a set of values known now, and a set of +types known now. +The separate map of types is to allow queries to be algebrized without full knowledge of +the bindings that will be used at execution time. +When built correctly, types is guaranteed to contain the types of values -- use +QueryInputs::new or QueryInputs::with_values to construct an instance.

+
+

+ Methods +

+

impl QueryInputs
[src]

+

+ Trait Implementations +

+
+

impl Default for QueryInputs
[src]

Returns the "default value" for a type. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for QueryInputs

impl !Sync for QueryInputs

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/struct.QueryOutput.html b/docs/apis/rust/0.7.0/mentat/struct.QueryOutput.html new file mode 100644 index 00000000..a4a59d11 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/struct.QueryOutput.html @@ -0,0 +1,156 @@ + + + + + + + + + + mentat::QueryOutput - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::QueryOutput + + [] + + [src]

pub struct QueryOutput {
+    pub spec: Rc<FindSpec>,
+    pub results: QueryResults,
+}

+ Fields

+ + + + +

+ Methods +

+

impl QueryOutput
[src]

Important traits for Box<R>

+

+ Trait Implementations +

+
+

impl From<QueryOutput> for QueryResults
[src]

Performs the conversion.

+

impl Eq for QueryOutput
[src]

impl PartialEq<QueryOutput> for QueryOutput
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for QueryOutput
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for QueryOutput

impl !Sync for QueryOutput

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/struct.RelResult.html b/docs/apis/rust/0.7.0/mentat/struct.RelResult.html new file mode 100644 index 00000000..3e70ab1f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/struct.RelResult.html @@ -0,0 +1,183 @@ + + + + + + + + + + mentat::RelResult - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::RelResult + + [] + + [src]

pub struct RelResult<T> {
+    pub width: usize,
+    pub values: Vec<T>,
+}

The result you get from a 'rel' query, like:

+
[:find ?person ?name
+ :where [?person :person/name ?name]]
+
+

There are three ways to get data out of a RelResult:

+
    +
  • By iterating over rows as slices. Use result.rows(). This is efficient and is +recommended in two cases: +
      +
    1. If you don't need to take ownership of the resulting values (e.g., you're comparing +or making a modified clone).
    2. +
    3. When the data you're retrieving is cheap to clone. All scalar values are relatively +cheap: they're either small values or Rc.
    4. +
    +
  • +
  • By direct reference to a row by index, using result.row(i). This also returns +a reference.
  • +
  • By consuming the results using into_iter. This allocates short-lived vectors, +but gives you ownership of the enclosed TypedValues.
  • +
+

+ Fields

+ + + + +

+ Methods +

+

impl<T> RelResult<T>
[src]

Important traits for Chunks<'a, T>

+

+ Trait Implementations +

+
+

impl<T> IntoIterator for RelResult<T>
[src]

+

The type of the elements being iterated over.

+

+

Which kind of iterator are we turning this into?

+

Creates an iterator from a value. Read more

+

impl<T> Clone for RelResult<T> where
    T: Clone
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<Vec<Vec<TypedValue>>> for RelResult<Binding>
[src]

Performs the conversion.

+

impl<T> Eq for RelResult<T> where
    T: Eq
[src]

impl<T> PartialEq<RelResult<T>> for RelResult<T> where
    T: PartialEq<T>, 
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl<T> Debug for RelResult<T> where
    T: Debug
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl<T> Send for RelResult<T> where
    T: Send

impl<T> Sync for RelResult<T> where
    T: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/struct.Schema.html b/docs/apis/rust/0.7.0/mentat/struct.Schema.html new file mode 100644 index 00000000..512f12d4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/struct.Schema.html @@ -0,0 +1,195 @@ + + + + + + + + + + mentat::Schema - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::Schema + + [] + + [src]

pub struct Schema {
+    pub entid_map: BTreeMap<i64, Keyword>,
+    pub ident_map: BTreeMap<Keyword, i64>,
+    pub attribute_map: BTreeMap<i64, Attribute>,
+    pub component_attributes: Vec<i64>,
+}

Represents a Mentat schema.

+

Maintains the mapping between string idents and positive integer entids; and exposes the schema +flags associated to a given entid (equivalently, ident).

+

TODO: consider a single bi-directional map instead of separate ident->entid and entid->ident +maps.

+

+ Fields

+ +

Map entid->ident.

+

Invariant: is the inverse map of ident_map.

+
+ +

Map ident->entid.

+

Invariant: is the inverse map of entid_map.

+
+ +

Map entid->attribute flags.

+

Invariant: key-set is the same as the key-set of entid_map (equivalently, the value-set of +ident_map).

+
+ +

Maintain a vec of unique attribute IDs for which the corresponding attribute in attribute_map +has .component == true.

+
+

+ Methods +

+

impl Schema
[src]

Returns an symbolic representation of the schema suitable for applying across Mentat stores.

+

+

+ Trait Implementations +

+
+

impl HasSchema for Schema
[src]

Return true if the provided entid identifies an attribute in this schema.

+

Return true if the provided ident identifies an attribute in this schema.

+

Important traits for &'a [u8]

impl PartialOrd<Schema> for Schema
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Clone for Schema
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Ord for Schema
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Hash for Schema
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for Schema
[src]

impl PartialEq<Schema> for Schema
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for Schema
[src]

Formats the value using the given formatter. Read more

+

impl Default for Schema
[src]

Returns the "default value" for a type. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for Schema

impl Sync for Schema

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/struct.TxObserver.html b/docs/apis/rust/0.7.0/mentat/struct.TxObserver.html new file mode 100644 index 00000000..eda22292 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/struct.TxObserver.html @@ -0,0 +1,140 @@ + + + + + + + + + + mentat::TxObserver - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::TxObserver + + [] + + [src]

pub struct TxObserver { /* fields omitted */ }
+

+ Methods +

+

impl TxObserver
[src]

+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl Send for TxObserver

impl Sync for TxObserver

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/struct.TxReport.html b/docs/apis/rust/0.7.0/mentat/struct.TxReport.html new file mode 100644 index 00000000..c65b00a5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/struct.TxReport.html @@ -0,0 +1,175 @@ + + + + + + + + + + mentat::TxReport - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::TxReport + + [] + + [src]

pub struct TxReport {
+    pub tx_id: i64,
+    pub tx_instant: DateTime<Utc>,
+    pub tempids: BTreeMap<String, i64>,
+}

A transaction report summarizes an applied transaction.

+

+ Fields

+ +

The transaction ID of the transaction.

+
+ +

The timestamp when the transaction began to be committed.

+
+ +

A map from string literal tempid to resolved or allocated entid.

+

Every string literal tempid presented to the transactor either resolves via upsert to an +existing entid, or is allocated a new entid. (It is possible for multiple distinct string +literal tempids to all unify to a single freshly allocated entid.)

+
+

+ Trait Implementations +

+
+

impl Clone for TxReport
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Hash for TxReport
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for TxReport
[src]

impl Debug for TxReport
[src]

Formats the value using the given formatter. Read more

+

impl PartialOrd<TxReport> for TxReport
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Ord for TxReport
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialEq<TxReport> for TxReport
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for TxReport

impl Sync for TxReport

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/struct.Utc.html b/docs/apis/rust/0.7.0/mentat/struct.Utc.html new file mode 100644 index 00000000..d3f4d673 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/struct.Utc.html @@ -0,0 +1,182 @@ + + + + + + + + + + mentat::Utc - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::Utc + + [] + + [src]

pub struct Utc;

The UTC time zone. This is the most efficient time zone when you don't need the local time. +It is also used as an offset (which is also a dummy type).

+

Using the TimeZone methods +on the UTC struct is the preferred way to construct DateTime<Utc> +instances.

+

Example

+
+use chrono::{DateTime, TimeZone, NaiveDateTime, Utc};
+
+let dt = DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(61, 0), Utc);
+
+assert_eq!(Utc.timestamp(61, 0), dt);
+assert_eq!(Utc.ymd(1970, 1, 1).and_hms(0, 1, 1), dt);
+
+

+ Methods +

+

impl Utc
[src]

Returns a Date which corresponds to the current date.

+

Returns a DateTime which corresponds to the current date.

+
+

+ Trait Implementations +

+
+

impl Copy for Utc
[src]

impl Clone for Utc
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Offset for Utc
[src]

Returns the fixed offset from UTC to the local time stored.

+

impl Eq for Utc
[src]

impl PartialEq<Utc> for Utc
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for Utc
[src]

Formats the value using the given formatter. Read more

+

impl Debug for Utc
[src]

Formats the value using the given formatter. Read more

+

impl TimeZone for Utc
[src]

+

An associated offset type. This type is used to store the actual offset in date and time types. The original TimeZone value can be recovered via TimeZone::from_offset. Read more

+

Reconstructs the time zone from the offset.

+

Creates the offset(s) for given local NaiveDate if possible.

+

Creates the offset(s) for given local NaiveDateTime if possible.

+

Creates the offset for given UTC NaiveDate. This cannot fail.

+

Creates the offset for given UTC NaiveDateTime. This cannot fail.

+

Makes a new Date from year, month, day and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. Read more

+

Makes a new Date from year, month, day and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. Read more

+

Makes a new Date from year, day of year (DOY or "ordinal") and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. Read more

+

Makes a new Date from year, day of year (DOY or "ordinal") and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. Read more

+

Makes a new Date from ISO week date (year and week number), day of the week (DOW) and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. The resulting Date may have a different year from the input year. Read more

+

Makes a new Date from ISO week date (year and week number), day of the week (DOW) and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. The resulting Date may have a different year from the input year. Read more

+

Makes a new DateTime from the number of non-leap seconds since January 1, 1970 0:00:00 UTC (aka "UNIX timestamp") and the number of nanoseconds since the last whole non-leap second. Read more

+

Makes a new DateTime from the number of non-leap seconds since January 1, 1970 0:00:00 UTC (aka "UNIX timestamp") and the number of nanoseconds since the last whole non-leap second. Read more

+

Parses a string with the specified format string and returns a DateTime with the current offset. See the format::strftime module on the supported escape sequences. Read more

+

Converts the local NaiveDate to the timezone-aware Date if possible.

+

Converts the local NaiveDateTime to the timezone-aware DateTime if possible.

+

Converts the UTC NaiveDate to the local time. The UTC is continuous and thus this cannot fail (but can give the duplicate local time). Read more

+

Converts the UTC NaiveDateTime to the local time. The UTC is continuous and thus this cannot fail (but can give the duplicate local time). Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for Utc

impl Sync for Utc

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/struct.Uuid.html b/docs/apis/rust/0.7.0/mentat/struct.Uuid.html new file mode 100644 index 00000000..867baea3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/struct.Uuid.html @@ -0,0 +1,323 @@ + + + + + + + + + + mentat::Uuid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::Uuid + + [] + + [src]

pub struct Uuid { /* fields omitted */ }

A Universally Unique Identifier (UUID).

+
+

+ Methods +

+

impl Uuid
[src]

The 'nil UUID'.

+

The nil UUID is special form of UUID that is specified to have all +128 bits set to zero, as defined in IETF RFC 4122 Section 4.1.7.

+

Examples

+

Basic usage:

+ +
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+
+assert_eq!(uuid.hyphenated().to_string(),
+           "00000000-0000-0000-0000-000000000000");
+

Creates a new Uuid.

+

Note that not all versions can be generated currently and None will be +returned if the specified version cannot be generated.

+

To generate a random UUID (UuidVersion::Random), then the v4 +feature must be enabled for this crate.

+

Creates a random Uuid.

+

This uses the rand crate's default task RNG as the source of random numbers. +If you'd like to use a custom generator, don't use this method: use the +rand::Rand trait's rand() method instead.

+

Note that usage of this method requires the v4 feature of this crate +to be enabled.

+

Examples

+

Basic usage:

+ +
+use uuid::Uuid;
+
+let uuid = Uuid::new_v4();
+

Creates a Uuid from four field values.

+

Errors

+

This function will return an error if d4's length is not 8 bytes.

+

Examples

+

Basic usage:

+ +
+use uuid::Uuid;
+
+let d4 = [12, 3, 9, 56, 54, 43, 8, 9];
+
+let uuid = Uuid::from_fields(42, 12, 5, &d4);
+let uuid = uuid.map(|uuid| uuid.hyphenated().to_string());
+
+let expected_uuid = Ok(String::from("0000002a-000c-0005-0c03-0938362b0809"));
+
+assert_eq!(expected_uuid, uuid);
+

An invalid length:

+ +
+use uuid::Uuid;
+use uuid::ParseError;
+
+let d4 = [12];
+
+let uuid = Uuid::from_fields(42, 12, 5, &d4);
+
+let expected_uuid = Err(ParseError::InvalidLength(1));
+
+assert_eq!(expected_uuid, uuid);
+

Creates a Uuid using the supplied bytes.

+

Errors

+

This function will return an error if b has any length other than 16.

+

Examples

+

Basic usage:

+ +
+use uuid::Uuid;
+
+let bytes = [4, 54, 67, 12, 43, 2, 98, 76,
+             32, 50, 87, 5, 1, 33, 43, 87];
+
+let uuid = Uuid::from_bytes(&bytes);
+let uuid = uuid.map(|uuid| uuid.hyphenated().to_string());
+
+let expected_uuid = Ok(String::from("0436430c-2b02-624c-2032-570501212b57"));
+
+assert_eq!(expected_uuid, uuid);
+

An incorrect number of bytes:

+ +
+use uuid::Uuid;
+use uuid::ParseError;
+
+let bytes = [4, 54, 67, 12, 43, 2, 98, 76];
+
+let uuid = Uuid::from_bytes(&bytes);
+
+let expected_uuid = Err(ParseError::InvalidLength(8));
+
+assert_eq!(expected_uuid, uuid);
+

Returns the variant of the Uuid structure.

+

This determines the interpretation of the structure of the UUID. +Currently only the RFC4122 variant is generated by this module.

+ +

Returns the version number of the Uuid.

+

This represents the algorithm used to generate the contents.

+

Currently only the Random (V4) algorithm is supported by this +module. There are security and privacy implications for using +older versions - see Wikipedia: Universally Unique Identifier for +details.

+ +

Returns the version of the Uuid.

+

This represents the algorithm used to generate the contents

+

Return an array of 16 octets containing the UUID data

+

Examples

+
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+assert_eq!(uuid.as_bytes(), &[0; 16]);
+
+let uuid = Uuid::parse_str("936DA01F9ABD4d9d80C702AF85C822A8").unwrap();
+assert_eq!(uuid.as_bytes(),
+           &[147, 109, 160, 31, 154, 189, 77, 157,
+             128, 199, 2, 175, 133, 200, 34, 168]);
+

Returns a wrapper which when formatted via fmt::Display will format a +string of 32 hexadecimal digits.

+

Examples

+
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+assert_eq!(uuid.simple().to_string(),
+           "00000000000000000000000000000000");
+

Returns a wrapper which when formatted via fmt::Display will format a +string of hexadecimal digits separated into groups with a hyphen.

+

Examples

+
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+assert_eq!(uuid.hyphenated().to_string(),
+           "00000000-0000-0000-0000-000000000000");
+

Returns a wrapper which when formatted via fmt::Display will format a +string of the UUID as a full URN string.

+

Examples

+
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+assert_eq!(uuid.urn().to_string(),
+           "urn:uuid:00000000-0000-0000-0000-000000000000");
+

Returns an Optional Tuple of (u64, u16) representing the timestamp and +counter portion of a V1 UUID. If the supplied UUID is not V1, this +will return None

+

Parses a Uuid from a string of hexadecimal digits with optional hyphens.

+

Any of the formats generated by this module (simple, hyphenated, urn) are +supported by this parsing function.

+

Tests if the UUID is nil

+
+

+ Trait Implementations +

+
+

impl Debug for Uuid
[src]

Formats the value using the given formatter. Read more

+

impl Display for Uuid
[src]

Formats the value using the given formatter. Read more

+

impl PartialEq<Uuid> for Uuid
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Hash for Uuid
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for Uuid
[src]

impl FromStr for Uuid
[src]

+

The associated error which can be returned from parsing.

+

Parse a hex string and interpret as a Uuid.

+

Accepted formats are a sequence of 32 hexadecimal characters, +with or without hyphens (grouped as 8, 4, 4, 4, 12).

+

impl Ord for Uuid
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<'de> Deserialize<'de> for Uuid
[src]

Deserialize this value from the given Serde deserializer. Read more

+

impl Rand for Uuid
[src]

Generates a random Uuid (V4 conformant).

+

Generates a random instance of this type using the specified source of randomness. Read more

+

impl Clone for Uuid
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for Uuid
[src]

impl PartialOrd<Uuid> for Uuid
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Serialize for Uuid
[src]

Serialize this value into the given Serde serializer. Read more

+

impl Default for Uuid
[src]

Returns the nil UUID, which is all zeroes

+

impl From<Uuid> for TypedValue
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl Send for Uuid

impl Sync for Uuid

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/struct.Variable.html b/docs/apis/rust/0.7.0/mentat/struct.Variable.html new file mode 100644 index 00000000..32ee020d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/struct.Variable.html @@ -0,0 +1,162 @@ + + + + + + + + + + mentat::Variable - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::Variable + + [] + + [src]

pub struct Variable(pub Rc<PlainSymbol>);
+

+ Methods +

+

impl Variable
[src]

Return a new Variable, assuming that the provided string is a valid name.

+

impl Variable
[src]

TODO: intern strings. #398.

+
+

+ Trait Implementations +

+
+

impl PartialOrd<Variable> for Variable
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Clone for Variable
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<Variable> for Element
[src]

Performs the conversion.

+

impl Ord for Variable
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Hash for Variable
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for Variable
[src]

impl PartialEq<Variable> for Variable
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for Variable
[src]

Formats the value using the given formatter. Read more

+

impl Debug for Variable
[src]

Formats the value using the given formatter. Read more

+

impl FromValue<Variable> for Variable
[src]

If the provided EDN value is a PlainSymbol beginning with '?', return +it wrapped in a Variable. If not, return None. +TODO: intern strings. #398.

+
+

+ Auto Trait Implementations +

+
+

impl !Send for Variable

impl !Sync for Variable

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/trait.HasSchema.html b/docs/apis/rust/0.7.0/mentat/trait.HasSchema.html new file mode 100644 index 00000000..e8bd3cfe --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/trait.HasSchema.html @@ -0,0 +1,152 @@ + + + + + + + + + + mentat::HasSchema - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat::HasSchema + + [] + + [src]

pub trait HasSchema {
+    fn entid_for_type(&self, t: ValueType) -> Option<KnownEntid>;
+
fn get_ident<T>(&self, x: T) -> Option<&Keyword>
    where
        T: Into<i64>
; +
fn get_entid(&self, x: &Keyword) -> Option<KnownEntid>; +
fn attribute_for_entid<T>(&self, x: T) -> Option<&Attribute>
    where
        T: Into<i64>
; +
fn attribute_for_ident(
        &self,
        ident: &Keyword
    ) -> Option<(&Attribute, KnownEntid)>; +
fn is_attribute<T>(&self, x: T) -> bool
    where
        T: Into<i64>
; +
fn identifies_attribute(&self, x: &Keyword) -> bool; +
fn component_attributes(&self) -> &[i64]; +}
+

+ Required Methods +

+
+

Return true if the provided entid identifies an attribute in this schema.

+

Return true if the provided ident identifies an attribute in this schema.

+
Important traits for &'a [u8]

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/type.AttributeSet.html b/docs/apis/rust/0.7.0/mentat/type.AttributeSet.html new file mode 100644 index 00000000..092b5dee --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/type.AttributeSet.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat::AttributeSet - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat::AttributeSet + + [] + + [src]

type AttributeSet = BTreeSet<i64>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/type.Entid.html b/docs/apis/rust/0.7.0/mentat/type.Entid.html new file mode 100644 index 00000000..d46f84b9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/type.Entid.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat::Entid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat::Entid + + [] + + [src]

type Entid = i64;

Represents one entid in the entid space.

+

Per https://www.sqlite.org/datatype3.html (see also http://stackoverflow.com/a/8499544), SQLite +stores signed integers up to 64 bits in size. Since u32 is not appropriate for our use case, we +use i64 rather than manually truncating u64 to u63 and casting to i64 throughout the codebase.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/var.m.html b/docs/apis/rust/0.7.0/mentat/var.m.html new file mode 100644 index 00000000..01319fac --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/var.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.var.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/AttributeBuilder.t.html b/docs/apis/rust/0.7.0/mentat/vocabulary/AttributeBuilder.t.html new file mode 100644 index 00000000..29a7993b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/AttributeBuilder.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.AttributeBuilder.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/Datom.t.html b/docs/apis/rust/0.7.0/mentat/vocabulary/Datom.t.html new file mode 100644 index 00000000..663bd8f7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/Datom.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Datom.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/Definition.t.html b/docs/apis/rust/0.7.0/mentat/vocabulary/Definition.t.html new file mode 100644 index 00000000..56fbfe68 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/Definition.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Definition.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/HasVocabularies.t.html b/docs/apis/rust/0.7.0/mentat/vocabulary/HasVocabularies.t.html new file mode 100644 index 00000000..68e8c837 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/HasVocabularies.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.HasVocabularies.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/SimpleVocabularySource.t.html b/docs/apis/rust/0.7.0/mentat/vocabulary/SimpleVocabularySource.t.html new file mode 100644 index 00000000..a6589444 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/SimpleVocabularySource.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.SimpleVocabularySource.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/Version.t.html b/docs/apis/rust/0.7.0/mentat/vocabulary/Version.t.html new file mode 100644 index 00000000..9e7ed8ab --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/Version.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Version.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/VersionedStore.t.html b/docs/apis/rust/0.7.0/mentat/vocabulary/VersionedStore.t.html new file mode 100644 index 00000000..47d1543a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/VersionedStore.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.VersionedStore.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/Vocabularies.t.html b/docs/apis/rust/0.7.0/mentat/vocabulary/Vocabularies.t.html new file mode 100644 index 00000000..b1c5d7a7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/Vocabularies.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Vocabularies.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/Vocabulary.t.html b/docs/apis/rust/0.7.0/mentat/vocabulary/Vocabulary.t.html new file mode 100644 index 00000000..dbb5e645 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/Vocabulary.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Vocabulary.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/VocabularyCheck.t.html b/docs/apis/rust/0.7.0/mentat/vocabulary/VocabularyCheck.t.html new file mode 100644 index 00000000..fbb8f047 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/VocabularyCheck.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.VocabularyCheck.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/VocabularyOutcome.t.html b/docs/apis/rust/0.7.0/mentat/vocabulary/VocabularyOutcome.t.html new file mode 100644 index 00000000..bcefc9b1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/VocabularyOutcome.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.VocabularyOutcome.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/VocabularySource.t.html b/docs/apis/rust/0.7.0/mentat/vocabulary/VocabularySource.t.html new file mode 100644 index 00000000..818ba156 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/VocabularySource.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.VocabularySource.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/VocabularyStatus.t.html b/docs/apis/rust/0.7.0/mentat/vocabulary/VocabularyStatus.t.html new file mode 100644 index 00000000..cf2b88fc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/VocabularyStatus.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.VocabularyStatus.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/attribute/Unique.t.html b/docs/apis/rust/0.7.0/mentat/vocabulary/attribute/Unique.t.html new file mode 100644 index 00000000..aee9aa27 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/attribute/Unique.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Unique.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/attribute/enum.Unique.html b/docs/apis/rust/0.7.0/mentat/vocabulary/attribute/enum.Unique.html new file mode 100644 index 00000000..2754c599 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/attribute/enum.Unique.html @@ -0,0 +1,160 @@ + + + + + + + + + + mentat::vocabulary::attribute::Unique - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat::vocabulary::attribute::Unique + + [] + + [src]

pub enum Unique {
+    Value,
+    Identity,
+}

+ Variants

+ +

+ Methods +

+

impl Unique
[src]

+

+ Trait Implementations +

+
+

impl PartialOrd<Unique> for Unique
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Copy for Unique
[src]

impl Clone for Unique
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Ord for Unique
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Hash for Unique
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for Unique
[src]

impl PartialEq<Unique> for Unique
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for Unique
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for Unique

impl Sync for Unique

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/attribute/index.html b/docs/apis/rust/0.7.0/mentat/vocabulary/attribute/index.html new file mode 100644 index 00000000..ccc5a4da --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/attribute/index.html @@ -0,0 +1,134 @@ + + + + + + + + + + mentat::vocabulary::attribute - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat::vocabulary::attribute + + [] + + [src]

Enums

+ + + + +
Unique + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/attribute/sidebar-items.js b/docs/apis/rust/0.7.0/mentat/vocabulary/attribute/sidebar-items.js new file mode 100644 index 00000000..ff7358c9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/attribute/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["Unique",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/enum.VocabularyCheck.html b/docs/apis/rust/0.7.0/mentat/vocabulary/enum.VocabularyCheck.html new file mode 100644 index 00000000..3b72df9f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/enum.VocabularyCheck.html @@ -0,0 +1,166 @@ + + + + + + + + + + mentat::vocabulary::VocabularyCheck - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat::vocabulary::VocabularyCheck + + [] + + [src]

pub enum VocabularyCheck<'definition> {
+    NotPresent,
+    Present,
+    PresentButNeedsUpdate {
+        older_version: Vocabulary,
+    },
+    PresentButTooNew {
+        newer_version: Vocabulary,
+    },
+    PresentButMissingAttributes {
+        attributes: Vec<&'definition (Keyword, Attribute)>,
+    },
+}

This enum captures the various relationships between a particular vocabulary pair — one +Definition and one Vocabulary, if present.

+

+ Variants

+

The provided definition is not already present in the store.

+

The provided definition is present in the store, and all of its attributes exist.

+

The provided definition is present in the store with an earlier version number.

+

Fields of PresentButNeedsUpdate

+ +

The provided definition is present in the store with a more recent version number.

+

Fields of PresentButTooNew

+ +

The provided definition is present in the store, but some of its attributes are not.

+

Fields of PresentButMissingAttributes

+ +
+

+ Trait Implementations +

+
+

impl<'definition> Debug for VocabularyCheck<'definition>
[src]

Formats the value using the given formatter. Read more

+

impl<'definition> Eq for VocabularyCheck<'definition>
[src]

impl<'definition> PartialEq for VocabularyCheck<'definition>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl<'definition> Send for VocabularyCheck<'definition>

impl<'definition> Sync for VocabularyCheck<'definition>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/enum.VocabularyOutcome.html b/docs/apis/rust/0.7.0/mentat/vocabulary/enum.VocabularyOutcome.html new file mode 100644 index 00000000..bb01f512 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/enum.VocabularyOutcome.html @@ -0,0 +1,154 @@ + + + + + + + + + + mentat::vocabulary::VocabularyOutcome - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat::vocabulary::VocabularyOutcome + + [] + + [src]

pub enum VocabularyOutcome {
+    Installed,
+    InstalledMissingAttributes,
+    Existed,
+    Upgraded,
+}

This enum captures the outcome of attempting to ensure that a vocabulary definition is present +and up-to-date in the store.

+

+ Variants

+

The vocabulary was absent and has been installed.

+

The vocabulary was present with this version, but some attributes were absent. +They have been installed.

+

The vocabulary was present, at the correct version, and all attributes were present.

+

The vocabulary was present, at an older version, and it has been upgraded. Any +missing attributes were installed.

+
+

+ Trait Implementations +

+
+

impl Debug for VocabularyOutcome
[src]

Formats the value using the given formatter. Read more

+

impl Eq for VocabularyOutcome
[src]

impl PartialEq for VocabularyOutcome
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/index.html b/docs/apis/rust/0.7.0/mentat/vocabulary/index.html new file mode 100644 index 00000000..a1a4335a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/index.html @@ -0,0 +1,320 @@ + + + + + + + + + + mentat::vocabulary - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat::vocabulary + + [] + + [src]

This module exposes an interface for programmatic management of vocabularies.

+

A vocabulary is defined by a name, a version number, and a collection of attribute definitions.

+

Operations on vocabularies can include migrations between versions. These are defined +programmatically as a pair of functions, pre and post, that are invoked prior to +an upgrade.

+

A Mentat store exposes, via the HasSchema trait, operations to read +vocabularies by name or in bulk.

+

An in-progress transaction (InProgress) further exposes a trait, +VersionedStore, which allows for a vocabulary definition to be +checked for existence in the store, and transacted if needed.

+

Typical use is the following:

+ +
+#[macro_use(kw)]
+extern crate mentat;
+
+use mentat::{
+    Store,
+    ValueType,
+};
+
+use mentat::vocabulary;
+use mentat::vocabulary::{
+    Definition,
+    HasVocabularies,
+    VersionedStore,
+    VocabularyOutcome,
+};
+
+fn main() {
+    let mut store = Store::open("").expect("connected");
+
+    {
+        // Read the list of installed vocabularies.
+        let reader = store.begin_read().expect("began read");
+        let vocabularies = reader.read_vocabularies().expect("read");
+        for (name, vocabulary) in vocabularies.iter() {
+            println!("Vocab {} is at version {}.", name, vocabulary.version);
+            for &(ref name, ref attr) in vocabulary.attributes().iter() {
+                println!("  >> {} ({})", name, attr.value_type);
+            }
+        }
+    }
+
+    {
+        let mut in_progress = store.begin_transaction().expect("began transaction");
+
+        // Make sure the core vocabulary exists.
+        in_progress.verify_core_schema().expect("verified");
+
+        // Make sure our vocabulary is installed, and install if necessary.
+        in_progress.ensure_vocabulary(&Definition {
+            name: kw!(:example/links),
+            version: 1,
+            attributes: vec![
+                (kw!(:link/title),
+                 vocabulary::AttributeBuilder::helpful()
+                   .value_type(ValueType::String)
+                   .multival(false)
+                   .fulltext(true)
+                   .build()),
+            ],
+            pre: Definition::no_op,
+            post: Definition::no_op,
+        }).expect("ensured");
+
+        // Now we can do stuff.
+        in_progress.transact("[{:link/title \"Title\"}]").expect("transacts");
+        in_progress.commit().expect("commits");
+    }
+}
+

A similar approach is taken using the +VocabularyProvider trait to handle migrations across +multiple vocabularies.

+

Modules

+ + + + +
attribute + +

Structs

+ + + + + + + + + + + + + + + + + + + + +
AttributeBuilder + +
Definition +

A definition of an attribute that is independent of a particular store.

+ +
SimpleVocabularySource +

A convenience struct to package simple pre and post functions with a collection of +vocabulary Definitions.

+ +
Vocabularies +

A collection of named Vocabulary instances, as retrieved from the store.

+ +
Vocabulary +

A definition of a vocabulary as retrieved from a particular store.

+ +

Enums

+ + + + + + + + +
VocabularyCheck +

This enum captures the various relationships between a particular vocabulary pair — one +Definition and one Vocabulary, if present.

+ +
VocabularyOutcome +

This enum captures the outcome of attempting to ensure that a vocabulary definition is present +and up-to-date in the store.

+ +

Traits

+ + + + + + + + + + + + + + + + +
HasVocabularies +

This trait captures the ability to retrieve and describe stored vocabularies.

+ +
VersionedStore +

This trait captures the ability of a store to check and install/upgrade vocabularies.

+ +
VocabularySource +

Implement VocabularySource to have full programmatic control over how a set of Definitions +are checked against and transacted into a store.

+ +
VocabularyStatus +

VocabularyStatus is passed to pre function when attempting to add or upgrade vocabularies +via ensure_vocabularies. This is how you can find the status and versions of existing +vocabularies — you can retrieve the requested definition and the resulting VocabularyCheck +by name.

+ +

Type Definitions

+ + + + + + + + +
Datom + +
Version + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/sidebar-items.js b/docs/apis/rust/0.7.0/mentat/vocabulary/sidebar-items.js new file mode 100644 index 00000000..f8742e6f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["VocabularyCheck","This enum captures the various relationships between a particular vocabulary pair — one `Definition` and one `Vocabulary`, if present."],["VocabularyOutcome","This enum captures the outcome of attempting to ensure that a vocabulary definition is present and up-to-date in the store."]],"mod":[["attribute",""]],"struct":[["AttributeBuilder",""],["Definition","A definition of an attribute that is independent of a particular store."],["SimpleVocabularySource","A convenience struct to package simple `pre` and `post` functions with a collection of vocabulary `Definition`s."],["Vocabularies","A collection of named `Vocabulary` instances, as retrieved from the store."],["Vocabulary","A definition of a vocabulary as retrieved from a particular store."]],"trait":[["HasVocabularies","This trait captures the ability to retrieve and describe stored vocabularies."],["VersionedStore","This trait captures the ability of a store to check and install/upgrade vocabularies."],["VocabularySource","Implement `VocabularySource` to have full programmatic control over how a set of `Definition`s are checked against and transacted into a store."],["VocabularyStatus","`VocabularyStatus` is passed to `pre` function when attempting to add or upgrade vocabularies via `ensure_vocabularies`. This is how you can find the status and versions of existing vocabularies — you can retrieve the requested definition and the resulting `VocabularyCheck` by name."]],"type":[["Datom",""],["Version",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/struct.AttributeBuilder.html b/docs/apis/rust/0.7.0/mentat/vocabulary/struct.AttributeBuilder.html new file mode 100644 index 00000000..49ee517a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/struct.AttributeBuilder.html @@ -0,0 +1,198 @@ + + + + + + + + + + mentat::vocabulary::AttributeBuilder - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::vocabulary::AttributeBuilder + + [] + + [src]

pub struct AttributeBuilder {
+    pub value_type: Option<ValueType>,
+    pub multival: Option<bool>,
+    pub unique: Option<Option<Unique>>,
+    pub index: Option<bool>,
+    pub fulltext: Option<bool>,
+    pub component: Option<bool>,
+    pub no_history: Option<bool>,
+    // some fields omitted
+}

+ Fields

+ + + + + + + + + + + + + + +

+ Methods +

+

impl AttributeBuilder
[src]

Make a new AttributeBuilder for human consumption: it will help you +by flipping relevant flags.

+

Make a new AttributeBuilder from an existing Attribute. This is important to allow +retraction. Only attributes that we allow to change are duplicated here.

+

Important traits for Vec<u8>

+

+ Trait Implementations +

+
+

impl Clone for AttributeBuilder
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Hash for AttributeBuilder
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for AttributeBuilder
[src]

impl Debug for AttributeBuilder
[src]

Formats the value using the given formatter. Read more

+

impl PartialOrd<AttributeBuilder> for AttributeBuilder
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Ord for AttributeBuilder
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialEq<AttributeBuilder> for AttributeBuilder
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Default for AttributeBuilder
[src]

Returns the "default value" for a type. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/struct.Definition.html b/docs/apis/rust/0.7.0/mentat/vocabulary/struct.Definition.html new file mode 100644 index 00000000..6bfcc90a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/struct.Definition.html @@ -0,0 +1,264 @@ + + + + + + + + + + mentat::vocabulary::Definition - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::vocabulary::Definition + + [] + + [src]

pub struct Definition {
+    pub name: Keyword,
+    pub version: Version,
+    pub attributes: Vec<(Keyword, Attribute)>,
+    pub pre: fn(_: &mut InProgress, _: &Vocabulary) -> Result<()>,
+    pub post: fn(_: &mut InProgress, _: &Vocabulary) -> Result<()>,
+}

A definition of an attribute that is independent of a particular store.

+

Attribute instances not only aren't named, but don't even have entids.

+

We need two kinds of structure: an abstract definition of a vocabulary in terms of names, +and a concrete instance of a vocabulary in a particular store.

+

Definition is the former, and Vocabulary is the latter.

+

Note that, because it's possible to 'flesh out' a vocabulary with attributes without bumping +its version number, we need to track the attributes that the application cares about — it's +not enough to know the name and version. Indeed, we even care about the details of each attribute, +because that's how we'll detect errors.

+

Definition includes two additional fields: functions to run if this vocabulary is being +upgraded. pre and post are run before and after the definition is transacted against the +store. Each is called with the existing Vocabulary instance so that they can do version +checks or employ more fine-grained logic.

+

+ Fields

+ + + + + + + + + + +

+ Methods +

+

impl Definition
[src]

+
+#[macro_use(kw)]
+extern crate mentat;
+
+use mentat::{
+    HasSchema,
+    IntoResult,
+    Queryable,
+    Store,
+    TypedValue,
+    ValueType,
+};
+
+use mentat::entity_builder::{
+    BuildTerms,
+    TermBuilder,
+};
+
+use mentat::vocabulary;
+use mentat::vocabulary::{
+    AttributeBuilder,
+    Definition,
+    HasVocabularies,
+    VersionedStore,
+};
+
+fn main() {
+    let mut store = Store::open("").expect("connected");
+    let mut in_progress = store.begin_transaction().expect("began transaction");
+
+    // Make sure the core vocabulary exists.
+    in_progress.verify_core_schema().expect("verified");
+
+    // Make sure our vocabulary is installed, and install if necessary.
+    in_progress.ensure_vocabulary(&Definition {
+        name: kw!(:example/links),
+        version: 2,
+        attributes: vec![
+            (kw!(:link/title),
+             AttributeBuilder::helpful()
+               .value_type(ValueType::String)
+               .multival(false)
+               .fulltext(true)
+               .build()),
+        ],
+        pre: |ip, from| {
+            // Version one allowed multiple titles; version two
+            // doesn't. Retract any duplicates we find.
+            if from.version < 2 {
+                let link_title = ip.get_entid(&kw!(:link/title)).unwrap();
+
+                let results = ip.q_once(r#"
+                    [:find ?e ?t2
+                     :where [?e :link/title ?t1]
+                            [?e :link/title ?t2]
+                            [(unpermute ?t1 ?t2)]]
+                "#, None).into_rel_result()?;
+
+                if !results.is_empty() {
+                    let mut builder = TermBuilder::new();
+                    for row in results.into_iter() {
+                        let mut r = row.into_iter();
+                        let e = r.next().and_then(|e| e.into_known_entid()).expect("entity");
+                        let obsolete = r.next().expect("value").val().expect("typed value");
+                        builder.retract(e, link_title, obsolete)?;
+                    }
+                    ip.transact_builder(builder)?;
+                }
+            }
+            Ok(())
+        },
+        post: |_ip, from| {
+            println!("We migrated :example/links from version {}", from.version);
+            Ok(())
+        },
+    }).expect("ensured");
+
+    // Now we can do stuff.
+    in_progress.transact("[{:link/title \"Title\"}]").expect("transacts");
+    in_progress.commit().expect("commits");
+}
+

+

+ Trait Implementations +

+
+

impl Clone for Definition
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for Definition

impl Sync for Definition

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/struct.SimpleVocabularySource.html b/docs/apis/rust/0.7.0/mentat/vocabulary/struct.SimpleVocabularySource.html new file mode 100644 index 00000000..53316d7c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/struct.SimpleVocabularySource.html @@ -0,0 +1,162 @@ + + + + + + + + + + mentat::vocabulary::SimpleVocabularySource - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::vocabulary::SimpleVocabularySource + + [] + + [src]

pub struct SimpleVocabularySource {
+    pub definitions: Vec<Definition>,
+    pub pre: Option<fn(_: &mut InProgress) -> Result<()>>,
+    pub post: Option<fn(_: &mut InProgress) -> Result<()>>,
+}

A convenience struct to package simple pre and post functions with a collection of +vocabulary Definitions.

+

+ Fields

+ + + + + + +

+ Methods +

+

impl SimpleVocabularySource
[src]

+

+ Trait Implementations +

+
+

impl VocabularySource for SimpleVocabularySource
[src]

Called before the supplied Definitions are transacted. Do not commit the InProgress. If this function returns Err, the entire vocabulary operation will fail. Read more

+

Called after the supplied Definitions are transacted. Do not commit the InProgress. If this function returns Err, the entire vocabulary operation will fail. Read more

+

Important traits for Vec<u8>

Called to obtain the list of Definitions to install. This will be called before pre.

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/struct.Vocabularies.html b/docs/apis/rust/0.7.0/mentat/vocabulary/struct.Vocabularies.html new file mode 100644 index 00000000..96a1d459 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/struct.Vocabularies.html @@ -0,0 +1,145 @@ + + + + + + + + + + mentat::vocabulary::Vocabularies - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::vocabulary::Vocabularies + + [] + + [src]

pub struct Vocabularies(pub BTreeMap<Keyword, Vocabulary>);

A collection of named Vocabulary instances, as retrieved from the store.

+
+

+ Methods +

+

impl Vocabularies
[src]

Important traits for Iter<'a, K, V>

+

+ Trait Implementations +

+
+

impl Debug for Vocabularies
[src]

Formats the value using the given formatter. Read more

+

impl Default for Vocabularies
[src]

Returns the "default value" for a type. Read more

+

impl Clone for Vocabularies
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for Vocabularies

impl Sync for Vocabularies

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/struct.Vocabulary.html b/docs/apis/rust/0.7.0/mentat/vocabulary/struct.Vocabulary.html new file mode 100644 index 00000000..7a72b384 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/struct.Vocabulary.html @@ -0,0 +1,161 @@ + + + + + + + + + + mentat::vocabulary::Vocabulary - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat::vocabulary::Vocabulary + + [] + + [src]

pub struct Vocabulary {
+    pub entity: Entid,
+    pub version: Version,
+    // some fields omitted
+}

A definition of a vocabulary as retrieved from a particular store.

+

A Vocabulary is just like Definition, but concrete: its name and attributes are identified +by Entid, not Keyword.

+

+ Fields

+ + + + +

+ Methods +

+

impl Vocabulary
[src]

Important traits for Vec<u8>

+

+ Trait Implementations +

+
+

impl Clone for Vocabulary
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for Vocabulary
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Vocabulary
[src]

impl PartialEq for Vocabulary
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for Vocabulary

impl Sync for Vocabulary

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/trait.HasVocabularies.html b/docs/apis/rust/0.7.0/mentat/vocabulary/trait.HasVocabularies.html new file mode 100644 index 00000000..81ee03a9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/trait.HasVocabularies.html @@ -0,0 +1,143 @@ + + + + + + + + + + mentat::vocabulary::HasVocabularies - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat::vocabulary::HasVocabularies + + [] + + [src]

pub trait HasVocabularies {
+    fn read_vocabularies(&self) -> Result<Vocabularies>;
+
fn read_vocabulary_named(
        &self,
        name: &Keyword
    ) -> Result<Option<Vocabulary>>; +}

This trait captures the ability to retrieve and describe stored vocabularies.

+
+

+ Required Methods +

+ +

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/trait.VersionedStore.html b/docs/apis/rust/0.7.0/mentat/vocabulary/trait.VersionedStore.html new file mode 100644 index 00000000..eac1fe3d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/trait.VersionedStore.html @@ -0,0 +1,160 @@ + + + + + + + + + + mentat::vocabulary::VersionedStore - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat::vocabulary::VersionedStore + + [] + + [src]

pub trait VersionedStore: HasVocabularies + HasSchema {
+    fn ensure_vocabulary(
        &mut self,
        definition: &Definition
    ) -> Result<VocabularyOutcome>; +
fn ensure_vocabularies(
        &mut self,
        vocabularies: &mut VocabularySource
    ) -> Result<BTreeMap<Keyword, VocabularyOutcome>>; + + fn check_vocabulary<'definition>(
        &self,
        definition: &'definition Definition
    ) -> Result<VocabularyCheck<'definition>> { ... } +
fn verify_core_schema(&self) -> Result<()> { ... } +}

This trait captures the ability of a store to check and install/upgrade vocabularies.

+
+

+ Required Methods +

+
+

Check whether the provided vocabulary is present in the store. If it isn't, make it so.

+

Check whether the provided vocabularies are present in the store at the correct +version and with all defined attributes. If any are not, invoke the pre +function on the provided VocabularySource, install or upgrade the necessary vocabularies, +then invoke post. Returns Ok if all of these steps succeed.

+

Use this function instead of calling ensure_vocabulary if you need to have pre/post +functions invoked when vocabulary changes are necessary.

+
+

+ Provided Methods +

+
+

Check whether the vocabulary described by the provided metadata is present in the store.

+

Make sure that our expectations of the core vocabulary — basic types and attributes — are met.

+
+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/trait.VocabularySource.html b/docs/apis/rust/0.7.0/mentat/vocabulary/trait.VocabularySource.html new file mode 100644 index 00000000..c6f75cdf --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/trait.VocabularySource.html @@ -0,0 +1,156 @@ + + + + + + + + + + mentat::vocabulary::VocabularySource - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat::vocabulary::VocabularySource + + [] + + [src]

pub trait VocabularySource {
+    fn definitions(&mut self) -> Vec<Definition>;
+
+    fn pre(
        &mut self,
        _in_progress: &mut InProgress,
        _checks: &VocabularyStatus
    ) -> Result<()> { ... } +
fn post(&mut self, _in_progress: &mut InProgress) -> Result<()> { ... } +}

Implement VocabularySource to have full programmatic control over how a set of Definitions +are checked against and transacted into a store.

+
+

+ Required Methods +

+
+
Important traits for Vec<u8>

Called to obtain the list of Definitions to install. This will be called before pre.

+
+

+ Provided Methods +

+
+

Called before the supplied Definitions are transacted. Do not commit the InProgress. +If this function returns Err, the entire vocabulary operation will fail.

+

Called after the supplied Definitions are transacted. Do not commit the InProgress. +If this function returns Err, the entire vocabulary operation will fail.

+
+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/trait.VocabularyStatus.html b/docs/apis/rust/0.7.0/mentat/vocabulary/trait.VocabularyStatus.html new file mode 100644 index 00000000..ce8c77b8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/trait.VocabularyStatus.html @@ -0,0 +1,145 @@ + + + + + + + + + + mentat::vocabulary::VocabularyStatus - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat::vocabulary::VocabularyStatus + + [] + + [src]

pub trait VocabularyStatus {
+    fn get(&self, name: &Keyword) -> Option<(&Definition, &VocabularyCheck)>;
+
fn version(&self, name: &Keyword) -> Option<Version>; +}

VocabularyStatus is passed to pre function when attempting to add or upgrade vocabularies +via ensure_vocabularies. This is how you can find the status and versions of existing +vocabularies — you can retrieve the requested definition and the resulting VocabularyCheck +by name.

+
+

+ Required Methods +

+
+

+

+ Implementors +

+
    +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/type.Datom.html b/docs/apis/rust/0.7.0/mentat/vocabulary/type.Datom.html new file mode 100644 index 00000000..88b66ce8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/type.Datom.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat::vocabulary::Datom - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat::vocabulary::Datom + + [] + + [src]

type Datom = (Entid, Entid, TypedValue);
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat/vocabulary/type.Version.html b/docs/apis/rust/0.7.0/mentat/vocabulary/type.Version.html new file mode 100644 index 00000000..6d183239 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat/vocabulary/type.Version.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat::vocabulary::Version - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat::vocabulary::Version + + [] + + [src]

type Version = u32;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/CliError.t.html b/docs/apis/rust/0.7.0/mentat_cli/CliError.t.html new file mode 100644 index 00000000..8c772c9e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/CliError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.CliError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/bail.m.html b/docs/apis/rust/0.7.0/mentat_cli/bail.m.html new file mode 100644 index 00000000..6a9910ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/bail.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.bail.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_CACHE.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_CACHE.v.html new file mode 100644 index 00000000..2951b17a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_CACHE.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_CACHE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_CLOSE.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_CLOSE.v.html new file mode 100644 index 00000000..6dcd5121 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_CLOSE.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_CLOSE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_EXIT_LONG.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_EXIT_LONG.v.html new file mode 100644 index 00000000..b2d39c2e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_EXIT_LONG.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_EXIT_LONG.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_EXIT_SHORT.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_EXIT_SHORT.v.html new file mode 100644 index 00000000..6cb05d3e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_EXIT_SHORT.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_EXIT_SHORT.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_HELP.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_HELP.v.html new file mode 100644 index 00000000..73dfe546 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_HELP.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_HELP.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_IMPORT_LONG.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_IMPORT_LONG.v.html new file mode 100644 index 00000000..7d31c88d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_IMPORT_LONG.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_IMPORT_LONG.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_IMPORT_SHORT.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_IMPORT_SHORT.v.html new file mode 100644 index 00000000..eb51b427 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_IMPORT_SHORT.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_IMPORT_SHORT.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_OPEN.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_OPEN.v.html new file mode 100644 index 00000000..bd286960 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_OPEN.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_OPEN.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_OPEN_EMPTY.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_OPEN_EMPTY.v.html new file mode 100644 index 00000000..f9930007 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_OPEN_EMPTY.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_OPEN_EMPTY.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_OPEN_EMPTY_ENCRYPTED.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_OPEN_EMPTY_ENCRYPTED.v.html new file mode 100644 index 00000000..b614015f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_OPEN_EMPTY_ENCRYPTED.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_OPEN_EMPTY_ENCRYPTED.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_OPEN_ENCRYPTED.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_OPEN_ENCRYPTED.v.html new file mode 100644 index 00000000..b35e7328 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_OPEN_ENCRYPTED.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_OPEN_ENCRYPTED.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_QUERY_EXPLAIN_LONG.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_QUERY_EXPLAIN_LONG.v.html new file mode 100644 index 00000000..6bb20eea --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_QUERY_EXPLAIN_LONG.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_QUERY_EXPLAIN_LONG.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_QUERY_EXPLAIN_SHORT.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_QUERY_EXPLAIN_SHORT.v.html new file mode 100644 index 00000000..0ea057ae --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_QUERY_EXPLAIN_SHORT.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_QUERY_EXPLAIN_SHORT.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_QUERY_LONG.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_QUERY_LONG.v.html new file mode 100644 index 00000000..fc82fa0a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_QUERY_LONG.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_QUERY_LONG.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_QUERY_PREPARED_LONG.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_QUERY_PREPARED_LONG.v.html new file mode 100644 index 00000000..b3a71548 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_QUERY_PREPARED_LONG.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_QUERY_PREPARED_LONG.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_QUERY_SHORT.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_QUERY_SHORT.v.html new file mode 100644 index 00000000..174d0b26 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_QUERY_SHORT.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_QUERY_SHORT.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_SCHEMA.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_SCHEMA.v.html new file mode 100644 index 00000000..16f5734a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_SCHEMA.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_SCHEMA.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_SYNC.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_SYNC.v.html new file mode 100644 index 00000000..1124da3a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_SYNC.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_SYNC.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_TIMER_LONG.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_TIMER_LONG.v.html new file mode 100644 index 00000000..3f82806d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_TIMER_LONG.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_TIMER_LONG.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_TRANSACT_LONG.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_TRANSACT_LONG.v.html new file mode 100644 index 00000000..59258cd0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_TRANSACT_LONG.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_TRANSACT_LONG.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_TRANSACT_SHORT.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_TRANSACT_SHORT.v.html new file mode 100644 index 00000000..98a2db64 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/COMMAND_TRANSACT_SHORT.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.COMMAND_TRANSACT_SHORT.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/Command.t.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/Command.t.html new file mode 100644 index 00000000..3378695d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/Command.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Command.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/command.v.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/command.v.html new file mode 100644 index 00000000..dca4bd76 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/command.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.command.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/enum.Command.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/enum.Command.html new file mode 100644 index 00000000..eaccb1d6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/enum.Command.html @@ -0,0 +1,168 @@ + + + + + + + + + + mentat_cli::command_parser::Command - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_cli::command_parser::Command + + [] + + [src]

pub enum Command {
+    Cache(StringCacheDirection),
+    Close,
+    Exit,
+    Help(Vec<String>),
+    Import(String),
+    Open(String),
+    OpenEmpty(String),
+    OpenEncrypted(StringString),
+    OpenEmptyEncrypted(StringString),
+    Query(String),
+    QueryExplain(String),
+    QueryPrepared(String),
+    Schema,
+    Sync(Vec<String>),
+    Timer(bool),
+    Transact(String),
+}

+ Variants

+ +

+ Methods +

+

impl Command
[src]

is_complete returns true if no more input is required for the command to be successfully executed. +false is returned if the command is not considered valid. +Defaults to true for all commands except Query and Transact. +TODO: for query and transact commands, they will be considered complete if a parsable EDN has been entered as an argument

+

+

+ Trait Implementations +

+
+

impl Clone for Command
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for Command
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Command
[src]

impl PartialEq for Command
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for Command

impl Sync for Command

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/fn.command.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/fn.command.html new file mode 100644 index 00000000..7dfb75dd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/fn.command.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::command - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_cli::command_parser::command + + [] + + [src]

pub fn command(s: &str) -> Result<Command, Error>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/index.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/index.html new file mode 100644 index 00000000..660fbb7a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/index.html @@ -0,0 +1,290 @@ + + + + + + + + + + mentat_cli::command_parser - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_cli::command_parser + + [] + + [src]

Enums

+ + + + +
Command + +

Statics

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
COMMAND_CACHE + +
COMMAND_CLOSE + +
COMMAND_EXIT_LONG + +
COMMAND_EXIT_SHORT + +
COMMAND_HELP + +
COMMAND_IMPORT_LONG + +
COMMAND_IMPORT_SHORT + +
COMMAND_OPEN + +
COMMAND_OPEN_EMPTY + +
COMMAND_OPEN_EMPTY_ENCRYPTED + +
COMMAND_OPEN_ENCRYPTED + +
COMMAND_QUERY_EXPLAIN_LONG + +
COMMAND_QUERY_EXPLAIN_SHORT + +
COMMAND_QUERY_LONG + +
COMMAND_QUERY_PREPARED_LONG + +
COMMAND_QUERY_SHORT + +
COMMAND_SCHEMA + +
COMMAND_SYNC + +
COMMAND_TIMER_LONG + +
COMMAND_TRANSACT_LONG + +
COMMAND_TRANSACT_SHORT + +

Functions

+ + + + +
command + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_cli/command_parser/sidebar-items.js new file mode 100644 index 00000000..013a5efc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["Command",""]],"fn":[["command",""]],"static":[["COMMAND_CACHE",""],["COMMAND_CLOSE",""],["COMMAND_EXIT_LONG",""],["COMMAND_EXIT_SHORT",""],["COMMAND_HELP",""],["COMMAND_IMPORT_LONG",""],["COMMAND_IMPORT_SHORT",""],["COMMAND_OPEN",""],["COMMAND_OPEN_EMPTY",""],["COMMAND_OPEN_EMPTY_ENCRYPTED",""],["COMMAND_OPEN_ENCRYPTED",""],["COMMAND_QUERY_EXPLAIN_LONG",""],["COMMAND_QUERY_EXPLAIN_SHORT",""],["COMMAND_QUERY_LONG",""],["COMMAND_QUERY_PREPARED_LONG",""],["COMMAND_QUERY_SHORT",""],["COMMAND_SCHEMA",""],["COMMAND_SYNC",""],["COMMAND_TIMER_LONG",""],["COMMAND_TRANSACT_LONG",""],["COMMAND_TRANSACT_SHORT",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_CACHE.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_CACHE.html new file mode 100644 index 00000000..2c7dd522 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_CACHE.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_CACHE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_CACHE + + [] + + [src]

pub static COMMAND_CACHE: &'static str = &"cache"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_CLOSE.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_CLOSE.html new file mode 100644 index 00000000..a18fe178 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_CLOSE.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_CLOSE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_CLOSE + + [] + + [src]

pub static COMMAND_CLOSE: &'static str = &"close"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_EXIT_LONG.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_EXIT_LONG.html new file mode 100644 index 00000000..255a625c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_EXIT_LONG.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_EXIT_LONG - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_EXIT_LONG + + [] + + [src]

pub static COMMAND_EXIT_LONG: &'static str = &"exit"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_EXIT_SHORT.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_EXIT_SHORT.html new file mode 100644 index 00000000..ffdc146a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_EXIT_SHORT.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_EXIT_SHORT - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_EXIT_SHORT + + [] + + [src]

pub static COMMAND_EXIT_SHORT: &'static str = &"e"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_HELP.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_HELP.html new file mode 100644 index 00000000..5e5a42c6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_HELP.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_HELP - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_HELP + + [] + + [src]

pub static COMMAND_HELP: &'static str = &"help"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_IMPORT_LONG.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_IMPORT_LONG.html new file mode 100644 index 00000000..a0162b35 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_IMPORT_LONG.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_IMPORT_LONG - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_IMPORT_LONG + + [] + + [src]

pub static COMMAND_IMPORT_LONG: &'static str = &"import"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_IMPORT_SHORT.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_IMPORT_SHORT.html new file mode 100644 index 00000000..17b6d2f0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_IMPORT_SHORT.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_IMPORT_SHORT - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_IMPORT_SHORT + + [] + + [src]

pub static COMMAND_IMPORT_SHORT: &'static str = &"i"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_OPEN.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_OPEN.html new file mode 100644 index 00000000..11c370e1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_OPEN.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_OPEN - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_OPEN + + [] + + [src]

pub static COMMAND_OPEN: &'static str = &"open"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_OPEN_EMPTY.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_OPEN_EMPTY.html new file mode 100644 index 00000000..ffbd6386 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_OPEN_EMPTY.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_OPEN_EMPTY - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_OPEN_EMPTY + + [] + + [src]

pub static COMMAND_OPEN_EMPTY: &'static str = &"empty"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_OPEN_EMPTY_ENCRYPTED.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_OPEN_EMPTY_ENCRYPTED.html new file mode 100644 index 00000000..da91bffe --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_OPEN_EMPTY_ENCRYPTED.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_OPEN_EMPTY_ENCRYPTED - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_OPEN_EMPTY_ENCRYPTED + + [] + + [src]

pub static COMMAND_OPEN_EMPTY_ENCRYPTED: &'static str = &"empty_encrypted"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_OPEN_ENCRYPTED.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_OPEN_ENCRYPTED.html new file mode 100644 index 00000000..c9ea8254 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_OPEN_ENCRYPTED.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_OPEN_ENCRYPTED - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_OPEN_ENCRYPTED + + [] + + [src]

pub static COMMAND_OPEN_ENCRYPTED: &'static str = &"open_encrypted"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_QUERY_EXPLAIN_LONG.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_QUERY_EXPLAIN_LONG.html new file mode 100644 index 00000000..50dc8dd2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_QUERY_EXPLAIN_LONG.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_QUERY_EXPLAIN_LONG - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_QUERY_EXPLAIN_LONG + + [] + + [src]

pub static COMMAND_QUERY_EXPLAIN_LONG: &'static str = &"explain_query"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_QUERY_EXPLAIN_SHORT.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_QUERY_EXPLAIN_SHORT.html new file mode 100644 index 00000000..79a12a8d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_QUERY_EXPLAIN_SHORT.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_QUERY_EXPLAIN_SHORT - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_QUERY_EXPLAIN_SHORT + + [] + + [src]

pub static COMMAND_QUERY_EXPLAIN_SHORT: &'static str = &"eq"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_QUERY_LONG.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_QUERY_LONG.html new file mode 100644 index 00000000..18cc1f98 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_QUERY_LONG.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_QUERY_LONG - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_QUERY_LONG + + [] + + [src]

pub static COMMAND_QUERY_LONG: &'static str = &"query"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_QUERY_PREPARED_LONG.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_QUERY_PREPARED_LONG.html new file mode 100644 index 00000000..ff5738af --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_QUERY_PREPARED_LONG.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_QUERY_PREPARED_LONG - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_QUERY_PREPARED_LONG + + [] + + [src]

pub static COMMAND_QUERY_PREPARED_LONG: &'static str = &"query_prepared"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_QUERY_SHORT.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_QUERY_SHORT.html new file mode 100644 index 00000000..3b9b7e65 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_QUERY_SHORT.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_QUERY_SHORT - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_QUERY_SHORT + + [] + + [src]

pub static COMMAND_QUERY_SHORT: &'static str = &"q"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_SCHEMA.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_SCHEMA.html new file mode 100644 index 00000000..dcfb08f9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_SCHEMA.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_SCHEMA - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_SCHEMA + + [] + + [src]

pub static COMMAND_SCHEMA: &'static str = &"schema"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_SYNC.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_SYNC.html new file mode 100644 index 00000000..0ccaa130 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_SYNC.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_SYNC - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_SYNC + + [] + + [src]

pub static COMMAND_SYNC: &'static str = &"sync"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_TIMER_LONG.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_TIMER_LONG.html new file mode 100644 index 00000000..a7e04a18 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_TIMER_LONG.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_TIMER_LONG - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_TIMER_LONG + + [] + + [src]

pub static COMMAND_TIMER_LONG: &'static str = &"timer"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_TRANSACT_LONG.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_TRANSACT_LONG.html new file mode 100644 index 00000000..44189a53 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_TRANSACT_LONG.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_TRANSACT_LONG - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_TRANSACT_LONG + + [] + + [src]

pub static COMMAND_TRANSACT_LONG: &'static str = &"transact"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_TRANSACT_SHORT.html b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_TRANSACT_SHORT.html new file mode 100644 index 00000000..24fbd3ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/command_parser/static.COMMAND_TRANSACT_SHORT.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::command_parser::COMMAND_TRANSACT_SHORT - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_cli::command_parser::COMMAND_TRANSACT_SHORT + + [] + + [src]

pub static COMMAND_TRANSACT_SHORT: &'static str = &"t"
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/enum.CliError.html b/docs/apis/rust/0.7.0/mentat_cli/enum.CliError.html new file mode 100644 index 00000000..eec6a69a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/enum.CliError.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_cli::CliError - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_cli::CliError + + [] + + [src]

pub enum CliError {
+    CommandParse(String),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Debug for CliError
[src]

Formats the value using the given formatter. Read more

+

impl Fail for CliError
[src]

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

+

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

+

Provides context for this failure. Read more

+

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

+

Important traits for Causes<'f>

Returns a iterator over the causes of this Fail with itself as the first item and the root_cause as the final item. Read more

+

Returns the "root cause" of this Fail - the last value in the cause chain which does not return an underlying cause. Read more

+

impl Display for CliError
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for CliError

impl Sync for CliError

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/fn.run.html b/docs/apis/rust/0.7.0/mentat_cli/fn.run.html new file mode 100644 index 00000000..127d6360 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/fn.run.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_cli::run - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_cli::run + + [] + + [src]

pub fn run() -> i32
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/fn.version.html b/docs/apis/rust/0.7.0/mentat_cli/fn.version.html new file mode 100644 index 00000000..5150a5f6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/fn.version.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_cli::version - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_cli::version + + [] + + [src]

pub fn version() -> &'static str

Returns a version string.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/index.html b/docs/apis/rust/0.7.0/mentat_cli/index.html new file mode 100644 index 00000000..74c305de --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/index.html @@ -0,0 +1,180 @@ + + + + + + + + + + mentat_cli - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Crate mentat_cli + + [] + + [src]

Modules

+ + + + + + + + + + + + +
command_parser + +
input + +
repl + +

Macros

+ + + + +
bail + +

Enums

+ + + + +
CliError + +

Functions

+ + + + + + + + +
run + +
version +

Returns a version string.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/input/InputReader.t.html b/docs/apis/rust/0.7.0/mentat_cli/input/InputReader.t.html new file mode 100644 index 00000000..9a7bf865 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/input/InputReader.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.InputReader.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/input/InputResult.t.html b/docs/apis/rust/0.7.0/mentat_cli/input/InputResult.t.html new file mode 100644 index 00000000..076c7526 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/input/InputResult.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.InputResult.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/input/enum.InputResult.html b/docs/apis/rust/0.7.0/mentat_cli/input/enum.InputResult.html new file mode 100644 index 00000000..55ff5464 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/input/enum.InputResult.html @@ -0,0 +1,151 @@ + + + + + + + + + + mentat_cli::input::InputResult - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_cli::input::InputResult + + [] + + [src]

pub enum InputResult {
+    MetaCommand(Command),
+    Empty,
+    More,
+    Eof,
+}

Possible results from reading input from InputReader

+

+ Variants

+

mentat command as input; (name, rest of line)

+

An empty line

+

Needs more input

+

End of file reached

+
+

+ Trait Implementations +

+
+

impl Clone for InputResult
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for InputResult
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for InputResult

impl Sync for InputResult

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/input/index.html b/docs/apis/rust/0.7.0/mentat_cli/input/index.html new file mode 100644 index 00000000..b1e8dcd8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/input/index.html @@ -0,0 +1,144 @@ + + + + + + + + + + mentat_cli::input - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_cli::input + + [] + + [src]

Structs

+ + + + +
InputReader +

Reads input from stdin

+ +

Enums

+ + + + +
InputResult +

Possible results from reading input from InputReader

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/input/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_cli/input/sidebar-items.js new file mode 100644 index 00000000..f3eec4b8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/input/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["InputResult","Possible results from reading input from `InputReader`"]],"struct":[["InputReader","Reads input from `stdin`"]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/input/struct.InputReader.html b/docs/apis/rust/0.7.0/mentat_cli/input/struct.InputReader.html new file mode 100644 index 00000000..262891c1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/input/struct.InputReader.html @@ -0,0 +1,146 @@ + + + + + + + + + + mentat_cli::input::InputReader - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_cli::input::InputReader + + [] + + [src]

pub struct InputReader { /* fields omitted */ }

Reads input from stdin

+
+

+ Methods +

+

impl InputReader
[src]

Constructs a new InputReader reading from stdin.

+

Returns whether the InputReader is reading from a TTY.

+

Reads a single command, item, or statement from stdin. +Returns More if further input is required for a complete result. +In this case, the input received so far is buffered internally.

+
+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl !Send for InputReader

impl !Sync for InputReader

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/macro.bail!.html b/docs/apis/rust/0.7.0/mentat_cli/macro.bail!.html new file mode 100644 index 00000000..6a9910ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/macro.bail!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.bail.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/macro.bail.html b/docs/apis/rust/0.7.0/mentat_cli/macro.bail.html new file mode 100644 index 00000000..c6a029ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/macro.bail.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_cli::bail - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_cli::bail + + [] + + [src]

+macro_rules! bail {
+    ($e:expr) => { ... };
+}
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/repl/Repl.t.html b/docs/apis/rust/0.7.0/mentat_cli/repl/Repl.t.html new file mode 100644 index 00000000..e5d6e811 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/repl/Repl.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Repl.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/repl/index.html b/docs/apis/rust/0.7.0/mentat_cli/repl/index.html new file mode 100644 index 00000000..3ac16d14 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/repl/index.html @@ -0,0 +1,135 @@ + + + + + + + + + + mentat_cli::repl - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_cli::repl + + [] + + [src]

Structs

+ + + + +
Repl +

Executes input and maintains state of persistent items.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/repl/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_cli/repl/sidebar-items.js new file mode 100644 index 00000000..08daa2af --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/repl/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["Repl","Executes input and maintains state of persistent items."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/repl/struct.Repl.html b/docs/apis/rust/0.7.0/mentat_cli/repl/struct.Repl.html new file mode 100644 index 00000000..5f6db9f5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/repl/struct.Repl.html @@ -0,0 +1,143 @@ + + + + + + + + + + mentat_cli::repl::Repl - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_cli::repl::Repl + + [] + + [src]

pub struct Repl { /* fields omitted */ }

Executes input and maintains state of persistent items.

+
+

+ Methods +

+

impl Repl
[src]

Constructs a new Repl.

+

Runs the REPL interactively.

+

+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl Send for Repl

impl !Sync for Repl

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/run.v.html b/docs/apis/rust/0.7.0/mentat_cli/run.v.html new file mode 100644 index 00000000..71d328da --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/run.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.run.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_cli/sidebar-items.js new file mode 100644 index 00000000..ac0e6324 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["CliError",""]],"fn":[["run",""],["version","Returns a version string."]],"macro":[["bail",""]],"mod":[["command_parser",""],["input",""],["repl",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_cli/version.v.html b/docs/apis/rust/0.7.0/mentat_cli/version.v.html new file mode 100644 index 00000000..c9cb0753 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_cli/version.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.version.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/Attribute.t.html b/docs/apis/rust/0.7.0/mentat_core/Attribute.t.html new file mode 100644 index 00000000..d929c865 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/Attribute.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Attribute.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/AttributeBitFlags.t.html b/docs/apis/rust/0.7.0/mentat_core/AttributeBitFlags.t.html new file mode 100644 index 00000000..fe00e7a4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/AttributeBitFlags.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.AttributeBitFlags.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/AttributeMap.t.html b/docs/apis/rust/0.7.0/mentat_core/AttributeMap.t.html new file mode 100644 index 00000000..ff918644 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/AttributeMap.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.AttributeMap.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/Binding.t.html b/docs/apis/rust/0.7.0/mentat_core/Binding.t.html new file mode 100644 index 00000000..04563187 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/Binding.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Binding.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/CachedAttributes.t.html b/docs/apis/rust/0.7.0/mentat_core/CachedAttributes.t.html new file mode 100644 index 00000000..7a476253 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/CachedAttributes.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.CachedAttributes.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/Cloned.t.html b/docs/apis/rust/0.7.0/mentat_core/Cloned.t.html new file mode 100644 index 00000000..25b3eebc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/Cloned.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.Cloned.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/DateTime.t.html b/docs/apis/rust/0.7.0/mentat_core/DateTime.t.html new file mode 100644 index 00000000..4f28f679 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/DateTime.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DateTime.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/EdnParseError.t.html b/docs/apis/rust/0.7.0/mentat_core/EdnParseError.t.html new file mode 100644 index 00000000..35bf0518 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/EdnParseError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.EdnParseError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/Entid.t.html b/docs/apis/rust/0.7.0/mentat_core/Entid.t.html new file mode 100644 index 00000000..a33a5c5a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/Entid.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Entid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/EntidMap.t.html b/docs/apis/rust/0.7.0/mentat_core/EntidMap.t.html new file mode 100644 index 00000000..b9a3af56 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/EntidMap.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.EntidMap.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/FromMicros.t.html b/docs/apis/rust/0.7.0/mentat_core/FromMicros.t.html new file mode 100644 index 00000000..1238d6c4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/FromMicros.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.FromMicros.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/FromRc.t.html b/docs/apis/rust/0.7.0/mentat_core/FromRc.t.html new file mode 100644 index 00000000..8361d3b4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/FromRc.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.FromRc.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/HasSchema.t.html b/docs/apis/rust/0.7.0/mentat_core/HasSchema.t.html new file mode 100644 index 00000000..5c26521f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/HasSchema.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.HasSchema.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/IdentMap.t.html b/docs/apis/rust/0.7.0/mentat_core/IdentMap.t.html new file mode 100644 index 00000000..41b7caec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/IdentMap.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.IdentMap.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/Keyword.t.html b/docs/apis/rust/0.7.0/mentat_core/Keyword.t.html new file mode 100644 index 00000000..2ff7981f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/Keyword.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/KnownEntid.t.html b/docs/apis/rust/0.7.0/mentat_core/KnownEntid.t.html new file mode 100644 index 00000000..f715cf77 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/KnownEntid.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.KnownEntid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/SQLTypeAffinity.t.html b/docs/apis/rust/0.7.0/mentat_core/SQLTypeAffinity.t.html new file mode 100644 index 00000000..97135df8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/SQLTypeAffinity.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.SQLTypeAffinity.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/SQLValueType.t.html b/docs/apis/rust/0.7.0/mentat_core/SQLValueType.t.html new file mode 100644 index 00000000..9e0e4f4b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/SQLValueType.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.SQLValueType.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/SQLValueTypeSet.t.html b/docs/apis/rust/0.7.0/mentat_core/SQLValueTypeSet.t.html new file mode 100644 index 00000000..0f144ded --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/SQLValueTypeSet.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.SQLValueTypeSet.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/Schema.t.html b/docs/apis/rust/0.7.0/mentat_core/Schema.t.html new file mode 100644 index 00000000..176b0419 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/Schema.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Schema.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/StructuredMap.t.html b/docs/apis/rust/0.7.0/mentat_core/StructuredMap.t.html new file mode 100644 index 00000000..e9f8a4bc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/StructuredMap.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.StructuredMap.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/Timelike.t.html b/docs/apis/rust/0.7.0/mentat_core/Timelike.t.html new file mode 100644 index 00000000..37c6621c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/Timelike.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.Timelike.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/ToMicros.t.html b/docs/apis/rust/0.7.0/mentat_core/ToMicros.t.html new file mode 100644 index 00000000..d8a8c7fd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/ToMicros.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.ToMicros.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/TypedValue.t.html b/docs/apis/rust/0.7.0/mentat_core/TypedValue.t.html new file mode 100644 index 00000000..8b0ac4a6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/TypedValue.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.TypedValue.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/UpdateableCache.t.html b/docs/apis/rust/0.7.0/mentat_core/UpdateableCache.t.html new file mode 100644 index 00000000..5332c362 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/UpdateableCache.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.UpdateableCache.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/Utc.t.html b/docs/apis/rust/0.7.0/mentat_core/Utc.t.html new file mode 100644 index 00000000..dda32b3b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/Utc.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Utc.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/Uuid.t.html b/docs/apis/rust/0.7.0/mentat_core/Uuid.t.html new file mode 100644 index 00000000..60b8c2f7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/Uuid.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Uuid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/ValueRc.t.html b/docs/apis/rust/0.7.0/mentat_core/ValueRc.t.html new file mode 100644 index 00000000..73d9bfdb --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/ValueRc.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.ValueRc.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/ValueType.t.html b/docs/apis/rust/0.7.0/mentat_core/ValueType.t.html new file mode 100644 index 00000000..2809fdde --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/ValueType.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.ValueType.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/ValueTypeSet.t.html b/docs/apis/rust/0.7.0/mentat_core/ValueTypeSet.t.html new file mode 100644 index 00000000..0f4e8b21 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/ValueTypeSet.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ValueTypeSet.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/ValueTypeTag.t.html b/docs/apis/rust/0.7.0/mentat_core/ValueTypeTag.t.html new file mode 100644 index 00000000..d1a3e0ce --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/ValueTypeTag.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.ValueTypeTag.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/attribute/Unique.t.html b/docs/apis/rust/0.7.0/mentat_core/attribute/Unique.t.html new file mode 100644 index 00000000..aee9aa27 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/attribute/Unique.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Unique.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/attribute/enum.Unique.html b/docs/apis/rust/0.7.0/mentat_core/attribute/enum.Unique.html new file mode 100644 index 00000000..8901edb5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/attribute/enum.Unique.html @@ -0,0 +1,160 @@ + + + + + + + + + + mentat_core::attribute::Unique - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_core::attribute::Unique + + [] + + [src]

pub enum Unique {
+    Value,
+    Identity,
+}

+ Variants

+ +

+ Methods +

+

impl Unique
[src]

+

+ Trait Implementations +

+
+

impl Clone for Unique
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for Unique
[src]

impl Debug for Unique
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Unique
[src]

impl Hash for Unique
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for Unique
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for Unique
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for Unique
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for Unique

impl Sync for Unique

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/attribute/index.html b/docs/apis/rust/0.7.0/mentat_core/attribute/index.html new file mode 100644 index 00000000..c066e3cc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/attribute/index.html @@ -0,0 +1,134 @@ + + + + + + + + + + mentat_core::attribute - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_core::attribute + + [] + + [src]

Enums

+ + + + +
Unique + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/attribute/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_core/attribute/sidebar-items.js new file mode 100644 index 00000000..ff7358c9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/attribute/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["Unique",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/cache/CachedAttributes.t.html b/docs/apis/rust/0.7.0/mentat_core/cache/CachedAttributes.t.html new file mode 100644 index 00000000..7a476253 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/cache/CachedAttributes.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.CachedAttributes.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/cache/UpdateableCache.t.html b/docs/apis/rust/0.7.0/mentat_core/cache/UpdateableCache.t.html new file mode 100644 index 00000000..5332c362 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/cache/UpdateableCache.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.UpdateableCache.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/cache/trait.CachedAttributes.html b/docs/apis/rust/0.7.0/mentat_core/cache/trait.CachedAttributes.html new file mode 100644 index 00000000..3d229e66 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/cache/trait.CachedAttributes.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_core/trait.CachedAttributes.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/cache/trait.UpdateableCache.html b/docs/apis/rust/0.7.0/mentat_core/cache/trait.UpdateableCache.html new file mode 100644 index 00000000..1d3b51a7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/cache/trait.UpdateableCache.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_core/trait.UpdateableCache.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/counter/RcCounter.t.html b/docs/apis/rust/0.7.0/mentat_core/counter/RcCounter.t.html new file mode 100644 index 00000000..7fd02c12 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/counter/RcCounter.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.RcCounter.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/counter/index.html b/docs/apis/rust/0.7.0/mentat_core/counter/index.html new file mode 100644 index 00000000..aa45738f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/counter/index.html @@ -0,0 +1,134 @@ + + + + + + + + + + mentat_core::counter - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_core::counter + + [] + + [src]

Structs

+ + + + +
RcCounter + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/counter/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_core/counter/sidebar-items.js new file mode 100644 index 00000000..991fd16f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/counter/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["RcCounter",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/counter/struct.RcCounter.html b/docs/apis/rust/0.7.0/mentat_core/counter/struct.RcCounter.html new file mode 100644 index 00000000..ff110c9b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/counter/struct.RcCounter.html @@ -0,0 +1,154 @@ + + + + + + + + + + mentat_core::counter::RcCounter - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::counter::RcCounter + + [] + + [src]

pub struct RcCounter { /* fields omitted */ }
+

+ Methods +

+

impl RcCounter
[src]

A simple shared counter.

+

Return the next value in the sequence.

+ +
+use mentat_core::counter::RcCounter;
+
+let c = RcCounter::with_initial(3);
+assert_eq!(c.next(), 3);
+assert_eq!(c.next(), 4);
+let d = c.clone();
+assert_eq!(d.next(), 5);
+assert_eq!(c.next(), 6);
+
+

+ Trait Implementations +

+
+

impl Clone for RcCounter
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for RcCounter

impl !Sync for RcCounter

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/enum.AttributeBitFlags.html b/docs/apis/rust/0.7.0/mentat_core/enum.AttributeBitFlags.html new file mode 100644 index 00000000..0fa8ea52 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/enum.AttributeBitFlags.html @@ -0,0 +1,147 @@ + + + + + + + + + + mentat_core::AttributeBitFlags - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_core::AttributeBitFlags + + [] + + [src]

pub enum AttributeBitFlags {
+    IndexAVET,
+    IndexVAET,
+    IndexFulltext,
+    UniqueValue,
+}

Bit flags used in flags0 column in temporary tables created during search, +such as the search_results, inexact_searches and exact_searches tables. +When moving to a more concrete table, such as datoms, they are expanded out +via these flags and put into their own column rather than a bit field.

+

+ Variants

+ +

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/enum.Binding.html b/docs/apis/rust/0.7.0/mentat_core/enum.Binding.html new file mode 100644 index 00000000..218f1b73 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/enum.Binding.html @@ -0,0 +1,166 @@ + + + + + + + + + + mentat_core::Binding - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_core::Binding + + [] + + [src]

pub enum Binding {
+    Scalar(TypedValue),
+    Vec(ValueRc<Vec<Binding>>),
+    Map(ValueRc<StructuredMap>),
+}

The values bound in a query specification can be:

+
    +
  • Vecs of structured values, for multi-valued component attributes or nested expressions.
  • +
  • Single structured values, for single-valued component attributes or nested expressions.
  • +
  • Single typed values, for simple attributes.
  • +
+

The Binding enum defines these three options.

+

Datomic also supports structured inputs; at present Mentat does not, but this type +would also serve that purpose.

+

Note that maps are not ordered, and so Binding is neither Ord nor PartialOrd.

+

+ Variants

+ +

+ Methods +

+

impl Binding
[src]

impl Binding
[src]

Returns true if the provided type is Some and matches this value's type, or if the +provided type is None.

+

impl Binding
[src]

+

+ Trait Implementations +

+
+

impl Clone for Binding
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for Binding
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Binding
[src]

impl PartialEq for Binding
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl<T> From<T> for Binding where
    T: Into<TypedValue>, 
[src]

Performs the conversion.

+

impl From<StructuredMap> for Binding
[src]

Performs the conversion.

+

impl From<Vec<Binding>> for Binding
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl Send for Binding

impl Sync for Binding

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/enum.SQLTypeAffinity.html b/docs/apis/rust/0.7.0/mentat_core/enum.SQLTypeAffinity.html new file mode 100644 index 00000000..a0526256 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/enum.SQLTypeAffinity.html @@ -0,0 +1,160 @@ + + + + + + + + + + mentat_core::SQLTypeAffinity - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_core::SQLTypeAffinity + + [] + + [src]

pub enum SQLTypeAffinity {
+    Null,
+    Integer,
+    Real,
+    Text,
+    Blob,
+}

Type safe representation of the possible return values from SQLite's typeof

+

+ Variants

+ +

+ Trait Implementations +

+
+

impl Clone for SQLTypeAffinity
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for SQLTypeAffinity
[src]

impl Debug for SQLTypeAffinity
[src]

Formats the value using the given formatter. Read more

+

impl Eq for SQLTypeAffinity
[src]

impl Hash for SQLTypeAffinity
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for SQLTypeAffinity
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for SQLTypeAffinity
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for SQLTypeAffinity
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/enum.TypedValue.html b/docs/apis/rust/0.7.0/mentat_core/enum.TypedValue.html new file mode 100644 index 00000000..2cc7ebc4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/enum.TypedValue.html @@ -0,0 +1,194 @@ + + + + + + + + + + mentat_core::TypedValue - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_core::TypedValue + + [] + + [src]

pub enum TypedValue {
+    Ref(Entid),
+    Boolean(bool),
+    Long(i64),
+    Double(OrderedFloat<f64>),
+    Instant(DateTime<Utc>),
+    String(ValueRc<String>),
+    Keyword(ValueRc<Keyword>),
+    Uuid(Uuid),
+}

Represents a value that can be stored in a Mentat store.

+

+ Variants

+ +

+ Methods +

+

impl TypedValue
[src]

Returns true if the provided type is Some and matches this value's type, or if the +provided type is None.

+

Construct a new TypedValue::Keyword instance by cloning the provided +values and wrapping them in a new ValueRc. This is expensive, so this might +be best limited to tests.

+

Construct a new TypedValue::String instance by cloning the provided +value and wrapping it in a new ValueRc. This is expensive, so this might +be best limited to tests.

+

Construct a new TypedValue::Instant instance from the provided +microsecond timestamp.

+

impl TypedValue
[src]

+

+ Trait Implementations +

+
+

impl From<KnownEntid> for TypedValue
[src]

Performs the conversion.

+

impl Clone for TypedValue
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for TypedValue
[src]

Formats the value using the given formatter. Read more

+

impl Eq for TypedValue
[src]

impl Hash for TypedValue
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for TypedValue
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for TypedValue
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for TypedValue
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl From<bool> for TypedValue
[src]

Performs the conversion.

+

impl From<DateTime<Utc>> for TypedValue
[src]

Truncate the provided DateTime to microsecond precision, and return the corresponding +TypedValue::Instant.

+

Performs the conversion.

+

impl From<Uuid> for TypedValue
[src]

Performs the conversion.

+

impl<'a> From<&'a str> for TypedValue
[src]

Performs the conversion.

+

impl From<Arc<String>> for TypedValue
[src]

Performs the conversion.

+

impl From<Rc<String>> for TypedValue
[src]

Performs the conversion.

+

impl From<Box<String>> for TypedValue
[src]

Performs the conversion.

+

impl From<String> for TypedValue
[src]

Performs the conversion.

+

impl From<Arc<Keyword>> for TypedValue
[src]

Performs the conversion.

+

impl From<Rc<Keyword>> for TypedValue
[src]

Performs the conversion.

+

impl From<Keyword> for TypedValue
[src]

Performs the conversion.

+

impl From<u32> for TypedValue
[src]

Performs the conversion.

+

impl From<i32> for TypedValue
[src]

Performs the conversion.

+

impl From<f64> for TypedValue
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl Send for TypedValue

impl Sync for TypedValue

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/enum.ValueType.html b/docs/apis/rust/0.7.0/mentat_core/enum.ValueType.html new file mode 100644 index 00000000..4f61bd11 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/enum.ValueType.html @@ -0,0 +1,187 @@ + + + + + + + + + + mentat_core::ValueType - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_core::ValueType + + [] + + [src]

#[repr(u32)] +
pub enum ValueType { + Ref, + Boolean, + Instant, + Long, + Double, + String, + Keyword, + Uuid, +}

The attribute of each Mentat assertion has a :db/valueType constraining the value to a +particular set. Mentat recognizes the following :db/valueType values.

+

+ Variants

+ +

+ Methods +

+

impl ValueType
[src]

impl ValueType
[src]

+

+ Trait Implementations +

+
+

impl Clone for ValueType
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for ValueType
[src]

impl Debug for ValueType
[src]

Formats the value using the given formatter. Read more

+

impl Eq for ValueType
[src]

impl Hash for ValueType
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for ValueType
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for ValueType
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for ValueType
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl CLike for ValueType
[src]

Converts a C-like enum to a u32. The value must be <= 31.

+

Converts a u32 to a C-like enum. This method only needs to be safe for possible return values of to_u32 of this trait. Read more

+

impl Display for ValueType
[src]

Formats the value using the given formatter. Read more

+

impl From<ValueType> for ValueTypeSet
[src]

Performs the conversion.

+

impl FromIterator<ValueType> for ValueTypeSet
[src]

Creates a value from an iterator. Read more

+

impl Extend<ValueType> for ValueTypeSet
[src]

Extends a collection with the contents of an iterator. Read more

+

impl SQLValueType for ValueType
[src]

Return a pair of the ValueTypeTag for this value type, and the SQLTypeAffinity required to distinguish it from any other types that share the same tag. Read more

+

Returns true if the provided integer is in the SQLite value space of this type. For +example, 1 is how we encode true.

+ +
+use mentat_core::{ValueType, SQLValueType};
+assert!(!ValueType::Instant.accommodates_integer(1493399581314));
+assert!(!ValueType::Instant.accommodates_integer(1493399581314000));
+assert!(ValueType::Boolean.accommodates_integer(1));
+assert!(!ValueType::Boolean.accommodates_integer(-1));
+assert!(!ValueType::Boolean.accommodates_integer(10));
+assert!(!ValueType::String.accommodates_integer(10));
+
+

+ Auto Trait Implementations +

+
+

impl Send for ValueType

impl Sync for ValueType

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/fn.now.html b/docs/apis/rust/0.7.0/mentat_core/fn.now.html new file mode 100644 index 00000000..84a9bc3d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/fn.now.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_core::now - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_core::now + + [] + + [src]

pub fn now() -> DateTime<Utc>

Return the current time as a UTC DateTime instance with microsecond precision.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/fn.parse_query.html b/docs/apis/rust/0.7.0/mentat_core/fn.parse_query.html new file mode 100644 index 00000000..2862d32c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/fn.parse_query.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_core::parse_query - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_core::parse_query + + [] + +

pub fn parse_query(__input: &'input str) -> Result<ParsedQuery, ParseError>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/index.html b/docs/apis/rust/0.7.0/mentat_core/index.html new file mode 100644 index 00000000..1f84f266 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/index.html @@ -0,0 +1,456 @@ + + + + + + + + + + mentat_core - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Crate mentat_core + + [] + + [src]

Modules

+ + + + + + + + + + + + + + + + + + + + +
attribute + +
counter + +
intern_set + +
util + +
values + +

Macros

+ + + + + + + + +
interpose +

A helper macro to sequentially process an iterable sequence, +evaluating a block between each pair of items.

+ +
interpose_iter +

A helper to bind name to values in across, running body for each value, +and running inter between each value. See interpose for examples.

+ +

Structs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Attribute +

A Mentat schema attribute has a value type and several other flags determining how assertions +with the attribute are interpreted.

+ +
DateTime +

ISO 8601 combined date and time with time zone.

+ +
EdnParseError + +
Keyword +

A keyword is a symbol, optionally with a namespace, that prints with a leading colon. +This concept is imported from Clojure, as it features in EDN and the query +syntax that we use.

+ +
KnownEntid +

An entid that's either already in the store, or newly allocated to a tempid. +TODO: we'd like to link this in some way to the lifetime of a particular PartitionMap.

+ +
Schema +

Represents a Mentat schema.

+ +
StructuredMap +

A pull expression expands a binding into a structure. The returned structure +associates attributes named in the input or retrieved from the store with values. +This association is a StructuredMap.

+ +
Utc +

The UTC time zone. This is the most efficient time zone when you don't need the local time. +It is also used as an offset (which is also a dummy type).

+ +
Uuid +

A Universally Unique Identifier (UUID).

+ +
ValueTypeSet + +

Enums

+ + + + + + + + + + + + + + + + + + + + +
AttributeBitFlags +

Bit flags used in flags0 column in temporary tables created during search, +such as the search_results, inexact_searches and exact_searches tables. +When moving to a more concrete table, such as datoms, they are expanded out +via these flags and put into their own column rather than a bit field.

+ +
Binding +

The values bound in a query specification can be:

+ +
SQLTypeAffinity +

Type safe representation of the possible return values from SQLite's typeof

+ +
TypedValue +

Represents a value that can be stored in a Mentat store.

+ +
ValueType +

The attribute of each Mentat assertion has a :db/valueType constraining the value to a +particular set. Mentat recognizes the following :db/valueType values.

+ +

Traits

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CachedAttributes + +
Cloned + +
FromMicros + +
FromRc + +
HasSchema + +
SQLValueType + +
SQLValueTypeSet +

We have an enum of types, ValueType. It can be collected into a set, ValueTypeSet. Each type +is associated with a type tag, which is how a type is represented in, e.g., SQL storage. Types +can share type tags, because backing SQL storage is able to differentiate between some types +(e.g., longs and doubles), and so distinct tags aren't necessary. That association is defined by +SQLValueType. That trait similarly extends to ValueTypeSet, which maps a collection of types +into a collection of tags.

+ +
Timelike +

The common set of methods for time component.

+ +
ToMicros + +
UpdateableCache + +

Functions

+ + + + + + + + +
now +

Return the current time as a UTC DateTime instance with microsecond precision.

+ +
parse_query + +

Type Definitions

+ + + + + + + + + + + + + + + + + + + + + + + + +
AttributeMap +

Map attribute entids to Attribute instances.

+ +
Entid +

Represents one entid in the entid space.

+ +
EntidMap +

Map positive integer entids (1) to Keyword idents (:db/ident).

+ +
IdentMap +

Map Keyword idents (:db/ident) to positive integer entids (1).

+ +
ValueRc +

This type alias exists to allow us to use different boxing mechanisms for values. +This type must implement FromRc and Cloned, and a From implementation must exist for +TypedValue.

+ +
ValueTypeTag + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/intern_set/InternSet.t.html b/docs/apis/rust/0.7.0/mentat_core/intern_set/InternSet.t.html new file mode 100644 index 00000000..d6a1b6b0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/intern_set/InternSet.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.InternSet.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/intern_set/index.html b/docs/apis/rust/0.7.0/mentat_core/intern_set/index.html new file mode 100644 index 00000000..b6248e1e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/intern_set/index.html @@ -0,0 +1,137 @@ + + + + + + + + + + mentat_core::intern_set - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_core::intern_set + + [] + + [src]

Structs

+ + + + +
InternSet +

An InternSet allows to "intern" some potentially large values, maintaining a single value +instance owned by the InternSet and leaving consumers with lightweight ref-counted handles to +the large owned value. This can avoid expensive clone() operations.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/intern_set/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_core/intern_set/sidebar-items.js new file mode 100644 index 00000000..0936f579 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/intern_set/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["InternSet","An `InternSet` allows to \"intern\" some potentially large values, maintaining a single value instance owned by the `InternSet` and leaving consumers with lightweight ref-counted handles to the large owned value. This can avoid expensive clone() operations."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/intern_set/struct.InternSet.html b/docs/apis/rust/0.7.0/mentat_core/intern_set/struct.InternSet.html new file mode 100644 index 00000000..cea125b5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/intern_set/struct.InternSet.html @@ -0,0 +1,177 @@ + + + + + + + + + + mentat_core::intern_set::InternSet - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::intern_set::InternSet + + [] + + [src]

pub struct InternSet<T> where
    T: Eq + Hash
{ + pub inner: HashSet<Rc<T>>, +}

An InternSet allows to "intern" some potentially large values, maintaining a single value +instance owned by the InternSet and leaving consumers with lightweight ref-counted handles to +the large owned value. This can avoid expensive clone() operations.

+

In Mentat, such large values might be strings or arbitrary [a v] pairs.

+

See https://en.wikipedia.org/wiki/String_interning for discussion.

+

+ Fields

+ + +

+ Methods +

+

impl<T> InternSet<T> where
    T: Eq + Hash
[src]

Intern a value, providing a ref-counted handle to the interned value.

+ +
+use std::rc::Rc;
+use mentat_core::intern_set::InternSet;
+
+let mut s = InternSet::new();
+
+let one = "foo".to_string();
+let two = Rc::new("foo".to_string());
+
+let out_one = s.intern(one);
+assert_eq!(out_one, two);
+// assert!(!&out_one.ptr_eq(&two));      // Nightly-only.
+
+let out_two = s.intern(two);
+assert_eq!(out_one, out_two);
+assert_eq!(1, s.inner.len());
+// assert!(&out_one.ptr_eq(&out_two));   // Nightly-only.
+
+

+ Trait Implementations +

+
+

impl<T: Clone> Clone for InternSet<T> where
    T: Eq + Hash
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<T: Debug> Debug for InternSet<T> where
    T: Eq + Hash
[src]

Formats the value using the given formatter. Read more

+

impl<T: Default> Default for InternSet<T> where
    T: Eq + Hash
[src]

Returns the "default value" for a type. Read more

+

impl<T: Eq> Eq for InternSet<T> where
    T: Eq + Hash
[src]

impl<T: PartialEq> PartialEq for InternSet<T> where
    T: Eq + Hash
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl<T> !Send for InternSet<T>

impl<T> !Sync for InternSet<T>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/interpose.m.html b/docs/apis/rust/0.7.0/mentat_core/interpose.m.html new file mode 100644 index 00000000..1dd1c2b9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/interpose.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.interpose.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/interpose_iter.m.html b/docs/apis/rust/0.7.0/mentat_core/interpose_iter.m.html new file mode 100644 index 00000000..516ea166 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/interpose_iter.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.interpose_iter.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/macro.interpose!.html b/docs/apis/rust/0.7.0/mentat_core/macro.interpose!.html new file mode 100644 index 00000000..1dd1c2b9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/macro.interpose!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.interpose.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/macro.interpose.html b/docs/apis/rust/0.7.0/mentat_core/macro.interpose.html new file mode 100644 index 00000000..a8908e2e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/macro.interpose.html @@ -0,0 +1,139 @@ + + + + + + + + + + mentat_core::interpose - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_core::interpose + + [] + + [src]

+macro_rules! interpose {
+    ( $name: pat, $across: expr, $body: block, $inter: block ) => { ... };
+}
+

A helper macro to sequentially process an iterable sequence, +evaluating a block between each pair of items.

+

This is used to simply and efficiently produce output like

+
  1, 2, 3
+
+

or

+
x = 1 AND y = 2
+
+

without producing an intermediate string sequence.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/macro.interpose_iter!.html b/docs/apis/rust/0.7.0/mentat_core/macro.interpose_iter!.html new file mode 100644 index 00000000..516ea166 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/macro.interpose_iter!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.interpose_iter.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/macro.interpose_iter.html b/docs/apis/rust/0.7.0/mentat_core/macro.interpose_iter.html new file mode 100644 index 00000000..67ace2d3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/macro.interpose_iter.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_core::interpose_iter - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_core::interpose_iter + + [] + + [src]

+macro_rules! interpose_iter {
+    ( $name: pat, $across: expr, $body: block, $inter: block ) => { ... };
+}
+

A helper to bind name to values in across, running body for each value, +and running inter between each value. See interpose for examples.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/now.v.html b/docs/apis/rust/0.7.0/mentat_core/now.v.html new file mode 100644 index 00000000..0f8d9fb7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/now.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.now.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/parse_query.v.html b/docs/apis/rust/0.7.0/mentat_core/parse_query.v.html new file mode 100644 index 00000000..4eb8e1d6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/parse_query.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.parse_query.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_core/sidebar-items.js new file mode 100644 index 00000000..4a60666b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["AttributeBitFlags","Bit flags used in `flags0` column in temporary tables created during search, such as the `search_results`, `inexact_searches` and `exact_searches` tables. When moving to a more concrete table, such as `datoms`, they are expanded out via these flags and put into their own column rather than a bit field."],["Binding","The values bound in a query specification can be:"],["SQLTypeAffinity","Type safe representation of the possible return values from SQLite's `typeof`"],["TypedValue","Represents a value that can be stored in a Mentat store."],["ValueType","The attribute of each Mentat assertion has a :db/valueType constraining the value to a particular set. Mentat recognizes the following :db/valueType values."]],"fn":[["now","Return the current time as a UTC `DateTime` instance with microsecond precision."],["parse_query",""]],"macro":[["interpose","A helper macro to sequentially process an iterable sequence, evaluating a block between each pair of items."],["interpose_iter","A helper to bind `name` to values in `across`, running `body` for each value, and running `inter` between each value. See `interpose` for examples."]],"mod":[["attribute",""],["counter",""],["intern_set",""],["util",""],["values",""]],"struct":[["Attribute","A Mentat schema attribute has a value type and several other flags determining how assertions with the attribute are interpreted."],["DateTime","ISO 8601 combined date and time with time zone."],["EdnParseError",""],["Keyword","A keyword is a symbol, optionally with a namespace, that prints with a leading colon. This concept is imported from Clojure, as it features in EDN and the query syntax that we use."],["KnownEntid","An entid that's either already in the store, or newly allocated to a tempid. TODO: we'd like to link this in some way to the lifetime of a particular PartitionMap."],["Schema","Represents a Mentat schema."],["StructuredMap","A pull expression expands a binding into a structure. The returned structure associates attributes named in the input or retrieved from the store with values. This association is a `StructuredMap`."],["Utc","The UTC time zone. This is the most efficient time zone when you don't need the local time. It is also used as an offset (which is also a dummy type)."],["Uuid","A Universally Unique Identifier (UUID)."],["ValueTypeSet",""]],"trait":[["CachedAttributes",""],["Cloned",""],["FromMicros",""],["FromRc",""],["HasSchema",""],["SQLValueType",""],["SQLValueTypeSet","We have an enum of types, `ValueType`. It can be collected into a set, `ValueTypeSet`. Each type is associated with a type tag, which is how a type is represented in, e.g., SQL storage. Types can share type tags, because backing SQL storage is able to differentiate between some types (e.g., longs and doubles), and so distinct tags aren't necessary. That association is defined by `SQLValueType`. That trait similarly extends to `ValueTypeSet`, which maps a collection of types into a collection of tags."],["Timelike","The common set of methods for time component."],["ToMicros",""],["UpdateableCache",""]],"type":[["AttributeMap","Map attribute entids to `Attribute` instances."],["Entid","Represents one entid in the entid space."],["EntidMap","Map positive integer entids (`1`) to `Keyword` idents (`:db/ident`)."],["IdentMap","Map `Keyword` idents (`:db/ident`) to positive integer entids (`1`)."],["ValueRc","This type alias exists to allow us to use different boxing mechanisms for values. This type must implement `FromRc` and `Cloned`, and a `From` implementation must exist for `TypedValue`."],["ValueTypeTag",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/sql_types/SQLTypeAffinity.t.html b/docs/apis/rust/0.7.0/mentat_core/sql_types/SQLTypeAffinity.t.html new file mode 100644 index 00000000..97135df8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/sql_types/SQLTypeAffinity.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.SQLTypeAffinity.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/sql_types/SQLValueType.t.html b/docs/apis/rust/0.7.0/mentat_core/sql_types/SQLValueType.t.html new file mode 100644 index 00000000..9e0e4f4b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/sql_types/SQLValueType.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.SQLValueType.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/sql_types/SQLValueTypeSet.t.html b/docs/apis/rust/0.7.0/mentat_core/sql_types/SQLValueTypeSet.t.html new file mode 100644 index 00000000..0f144ded --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/sql_types/SQLValueTypeSet.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.SQLValueTypeSet.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/sql_types/enum.SQLTypeAffinity.html b/docs/apis/rust/0.7.0/mentat_core/sql_types/enum.SQLTypeAffinity.html new file mode 100644 index 00000000..83194af3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/sql_types/enum.SQLTypeAffinity.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_core/enum.SQLTypeAffinity.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/sql_types/trait.SQLValueType.html b/docs/apis/rust/0.7.0/mentat_core/sql_types/trait.SQLValueType.html new file mode 100644 index 00000000..b4bc4354 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/sql_types/trait.SQLValueType.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_core/trait.SQLValueType.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/sql_types/trait.SQLValueTypeSet.html b/docs/apis/rust/0.7.0/mentat_core/sql_types/trait.SQLValueTypeSet.html new file mode 100644 index 00000000..c7ad7544 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/sql_types/trait.SQLValueTypeSet.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_core/trait.SQLValueTypeSet.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/struct.Attribute.html b/docs/apis/rust/0.7.0/mentat_core/struct.Attribute.html new file mode 100644 index 00000000..ed41c807 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/struct.Attribute.html @@ -0,0 +1,216 @@ + + + + + + + + + + mentat_core::Attribute - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::Attribute + + [] + + [src]

pub struct Attribute {
+    pub value_type: ValueType,
+    pub multival: bool,
+    pub unique: Option<Unique>,
+    pub index: bool,
+    pub fulltext: bool,
+    pub component: bool,
+    pub no_history: bool,
+}

A Mentat schema attribute has a value type and several other flags determining how assertions +with the attribute are interpreted.

+

TODO: consider packing this into a bitfield or similar.

+

+ Fields

+ +

The associated value type, i.e., :db/valueType?

+
+ +

true if this attribute is multi-valued, i.e., it is :db/cardinality :db.cardinality/many. false if this attribute is single-valued (the default), i.e., it +is :db/cardinality :db.cardinality/one.

+
+ +

None if this attribute is neither unique-value nor unique-identity.

+

Some(attribute::Unique::Value) if this attribute is unique-value, i.e., it is :db/unique :db.unique/value.

+

Unique-value means that there is at most one assertion with the attribute and a +particular value in the datom store. Unique-value attributes can be used in lookup-refs.

+

Some(attribute::Unique::Identity) if this attribute is unique-identity, i.e., it is :db/unique :db.unique/identity.

+

Unique-identity attributes always have value type Ref.

+

Unique-identity means that the attribute is unique-value and that they can be used in +lookup-refs and will automatically upsert where appropriate.

+
+ +

true if this attribute is automatically indexed, i.e., it is :db/indexing true.

+
+ +

true if this attribute is automatically fulltext indexed, i.e., it is :db/fulltext true.

+

Fulltext attributes always have string values.

+
+ +

true if this attribute is a component, i.e., it is :db/isComponent true.

+

Component attributes always have value type Ref.

+

They are used to compose entities from component sub-entities: they are fetched recursively +by pull expressions, and they are automatically recursively deleted where appropriate.

+
+ +

true if this attribute doesn't require history to be kept, i.e., it is :db/noHistory true.

+
+

+ Methods +

+

impl Attribute
[src]

Combine several attribute flags into a bitfield used in temporary search tables.

+

+

+ Trait Implementations +

+
+

impl Clone for Attribute
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for Attribute
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Attribute
[src]

impl Hash for Attribute
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for Attribute
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for Attribute
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for Attribute
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Default for Attribute
[src]

Returns the "default value" for a type. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for Attribute

impl Sync for Attribute

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/struct.DateTime.html b/docs/apis/rust/0.7.0/mentat_core/struct.DateTime.html new file mode 100644 index 00000000..a8847c01 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/struct.DateTime.html @@ -0,0 +1,349 @@ + + + + + + + + + + mentat_core::DateTime - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::DateTime + + [] + + [src]

pub struct DateTime<Tz> where
    Tz: TimeZone
{ /* fields omitted */ }

ISO 8601 combined date and time with time zone.

+

There are some constructors implemented here (the from_* methods), but +the general-purpose constructors are all via the methods on the +TimeZone implementations.

+
+

+ Methods +

+

impl<Tz> DateTime<Tz> where
    Tz: TimeZone
[src]

Makes a new DateTime with given UTC datetime and offset. +The local datetime should be constructed via the TimeZone trait.

+

Example

+
+use chrono::{DateTime, TimeZone, NaiveDateTime, Utc};
+
+let dt = DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(61, 0), Utc);
+assert_eq!(Utc.timestamp(61, 0), dt);
+

Retrieves a date component.

+

Retrieves a time component. +Unlike date, this is not associated to the time zone.

+

Returns the number of non-leap seconds since January 1, 1970 0:00:00 UTC +(aka "UNIX timestamp").

+

Returns the number of non-leap-milliseconds since January 1, 1970 UTC

+

Note that this does reduce the number of years that can be represented +from ~584 Billion to ~584 Million. (If this is a problem, please file +an issue to let me know what domain needs millisecond precision over +billions of years, I'm curious.)

+

Example

+
+use chrono::Utc;
+use chrono::TimeZone;
+
+let dt = Utc.ymd(1970, 1, 1).and_hms_milli(0, 0, 1, 444);
+assert_eq!(dt.timestamp_millis(), 1_444);
+
+let dt = Utc.ymd(2001, 9, 9).and_hms_milli(1, 46, 40, 555);
+assert_eq!(dt.timestamp_millis(), 1_000_000_000_555);
+

Returns the number of non-leap-nanoseconds since January 1, 1970 UTC

+

Note that this does reduce the number of years that can be represented +from ~584 Billion to ~584. (If this is a problem, please file +an issue to let me know what domain needs nanosecond precision over +millenia, I'm curious.)

+

Example

+
+use chrono::Utc;
+use chrono::TimeZone;
+
+let dt = Utc.ymd(1970, 1, 1).and_hms_nano(0, 0, 1, 444);
+assert_eq!(dt.timestamp_nanos(), 1_000_000_444);
+
+let dt = Utc.ymd(2001, 9, 9).and_hms_nano(1, 46, 40, 555);
+assert_eq!(dt.timestamp_nanos(), 1_000_000_000_000_000_555);
+

Returns the number of milliseconds since the last second boundary

+

warning: in event of a leap second, this may exceed 999

+

note: this is not the number of milliseconds since January 1, 1970 0:00:00 UTC

+

Returns the number of microseconds since the last second boundary

+

warning: in event of a leap second, this may exceed 999_999

+

note: this is not the number of microseconds since January 1, 1970 0:00:00 UTC

+

Returns the number of nanoseconds since the last second boundary

+

warning: in event of a leap second, this may exceed 999_999_999

+

note: this is not the number of nanoseconds since January 1, 1970 0:00:00 UTC

+

Retrieves an associated offset from UTC.

+

Retrieves an associated time zone.

+

Changes the associated time zone. +This does not change the actual DateTime (but will change the string representation).

+

Adds given Duration to the current date and time.

+

Returns None when it will result in overflow.

+

Subtracts given Duration from the current date and time.

+

Returns None when it will result in overflow.

+

Subtracts another DateTime from the current date and time. +This does not overflow or underflow at all.

+

Returns a view to the naive UTC datetime.

+

Returns a view to the naive local datetime.

+

impl DateTime<FixedOffset>
[src]

Parses an RFC 2822 date and time string such as Tue, 1 Jul 2003 10:52:37 +0200, +then returns a new DateTime with a parsed FixedOffset.

+

Parses an RFC 3339 and ISO 8601 date and time string such as 1996-12-19T16:39:57-08:00, +then returns a new DateTime with a parsed FixedOffset.

+

Why isn't this named parse_from_iso8601? That's because ISO 8601 allows some freedom +over the syntax and RFC 3339 exercises that freedom to rigidly define a fixed format.

+

Parses a string with the specified format string and +returns a new DateTime with a parsed FixedOffset. +See the format::strftime module +on the supported escape sequences.

+

See also Offset::datetime_from_str which gives a local DateTime on specific time zone.

+

Note that this method requires a timezone in the string. See +NaiveDateTime::parse_from_str +for a version that does not require a timezone in the to-be-parsed str.

+

Example

+
+use chrono::{DateTime, FixedOffset, TimeZone};
+
+let dt = DateTime::parse_from_str(
+    "1983 Apr 13 12:09:14.274 +0000", "%Y %b %d %H:%M:%S%.3f %z");
+assert_eq!(dt, Ok(FixedOffset::east(0).ymd(1983, 4, 13).and_hms_milli(12, 9, 14, 274)));
+

impl<Tz> DateTime<Tz> where
    Tz: TimeZone,
    <Tz as TimeZone>::Offset: Display
[src]

Returns an RFC 2822 date and time string such as Tue, 1 Jul 2003 10:52:37 +0200.

+

Returns an RFC 3339 and ISO 8601 date and time string such as 1996-12-19T16:39:57-08:00.

+

Return an RFC 3339 and ISO 8601 date and time string with subseconds +formatted as per a SecondsFormat. If passed use_z true and the +timezone is UTC (offset 0), use 'Z', as per +Fixed::TimezoneOffsetColonZ. +If passed use_z false, use +Fixed::TimezoneOffsetColon.

+

Examples

+
+let dt = Utc.ymd(2018, 1, 26).and_hms_micro(18, 30, 9, 453_829);
+assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Millis, false),
+           "2018-01-26T18:30:09.453+00:00");
+assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Millis, true),
+           "2018-01-26T18:30:09.453Z");
+assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Secs, true),
+           "2018-01-26T18:30:09Z");
+
+let pst = FixedOffset::east(8 * 60 * 60);
+let dt = pst.ymd(2018, 1, 26).and_hms_micro(10, 30, 9, 453_829);
+assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Secs, true),
+           "2018-01-26T10:30:09+08:00");
+

Formats the combined date and time with the specified formatting items.

+

Formats the combined date and time with the specified format string. +See the format::strftime module +on the supported escape sequences.

+
+

+ Trait Implementations +

+
+

impl<Tz> Copy for DateTime<Tz> where
    Tz: TimeZone,
    <Tz as TimeZone>::Offset: Copy
[src]

impl<Tz> PartialOrd<DateTime<Tz>> for DateTime<Tz> where
    Tz: TimeZone
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl<Tz> Clone for DateTime<Tz> where
    Tz: TimeZone + Clone,
    <Tz as TimeZone>::Offset: Clone
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<Tz> Add<FixedOffset> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<Tz> Add<Duration> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<Tz> From<DateTime<Tz>> for SystemTime where
    Tz: TimeZone
[src]

Performs the conversion.

+

impl From<SystemTime> for DateTime<Local>
[src]

Performs the conversion.

+

impl From<SystemTime> for DateTime<Utc>
[src]

Performs the conversion.

+

impl<Tz> Serialize for DateTime<Tz> where
    Tz: TimeZone
[src]

Serialize into a rfc3339 time string

+

See the serde module for alternate +serializations.

+

impl<Tz> Sub<Duration> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<Tz> Sub<DateTime<Tz>> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<Tz> Sub<FixedOffset> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl FromStr for DateTime<FixedOffset>
[src]

+

The associated error which can be returned from parsing.

+

Parses a string s to return a value of this type. Read more

+

impl FromStr for DateTime<Local>
[src]

+

The associated error which can be returned from parsing.

+

Parses a string s to return a value of this type. Read more

+

impl FromStr for DateTime<Utc>
[src]

+

The associated error which can be returned from parsing.

+

Parses a string s to return a value of this type. Read more

+

impl<Tz> Ord for DateTime<Tz> where
    Tz: TimeZone
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<Tz> Hash for DateTime<Tz> where
    Tz: TimeZone
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl<Tz> Eq for DateTime<Tz> where
    Tz: TimeZone
[src]

impl<Tz, Tz2> PartialEq<DateTime<Tz2>> for DateTime<Tz> where
    Tz: TimeZone,
    Tz2: TimeZone
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl<'de> Deserialize<'de> for DateTime<FixedOffset>
[src]

Deserialize a value that optionally includes a timezone offset in its +string representation

+

The value to be deserialized must be an rfc3339 string.

+

See the serde module for alternate +deserialization formats.

+

Deserialize this value from the given Serde deserializer. Read more

+

impl<'de> Deserialize<'de> for DateTime<Utc>
[src]

Deserialize into a UTC value

+

The value to be deserialized must be an rfc3339 string.

+

See the serde module for alternate +deserialization formats.

+

Deserialize this value from the given Serde deserializer. Read more

+

impl<'de> Deserialize<'de> for DateTime<Local>
[src]

Deserialize a value that includes no timezone in its string +representation

+

The value to be deserialized must be an rfc3339 string.

+

See the serde module for alternate +serialization formats.

+

Deserialize this value from the given Serde deserializer. Read more

+

impl<Tz> Timelike for DateTime<Tz> where
    Tz: TimeZone
[src]

Returns the hour number from 0 to 23.

+

Returns the minute number from 0 to 59.

+

Returns the second number from 0 to 59.

+

Returns the number of nanoseconds since the whole non-leap second. The range from 1,000,000,000 to 1,999,999,999 represents the leap second. Read more

+

Makes a new value with the hour number changed. Read more

+

Makes a new value with the minute number changed. Read more

+

Makes a new value with the second number changed. Read more

+

Makes a new value with nanoseconds since the whole non-leap second changed. Read more

+

Returns the hour number from 1 to 12 with a boolean flag, which is false for AM and true for PM. Read more

+

Returns the number of non-leap seconds past the last midnight.

+

impl<Tz> Display for DateTime<Tz> where
    Tz: TimeZone,
    <Tz as TimeZone>::Offset: Display
[src]

Formats the value using the given formatter. Read more

+

impl<Tz> Send for DateTime<Tz> where
    Tz: TimeZone,
    <Tz as TimeZone>::Offset: Send
[src]

impl<Tz> Datelike for DateTime<Tz> where
    Tz: TimeZone
[src]

Returns the year number in the calendar date.

+

Returns the month number starting from 1. Read more

+

Returns the month number starting from 0. Read more

+

Returns the day of month starting from 1. Read more

+

Returns the day of month starting from 0. Read more

+

Returns the day of year starting from 1. Read more

+

Returns the day of year starting from 0. Read more

+

Returns the day of week.

+

Returns the ISO week.

+

Makes a new value with the year number changed. Read more

+

Makes a new value with the month number (starting from 1) changed. Read more

+

Makes a new value with the month number (starting from 0) changed. Read more

+

Makes a new value with the day of month (starting from 1) changed. Read more

+

Makes a new value with the day of month (starting from 0) changed. Read more

+

Makes a new value with the day of year (starting from 1) changed. Read more

+

Makes a new value with the day of year (starting from 0) changed. Read more

+

Returns the absolute year number starting from 1 with a boolean flag, which is false when the year predates the epoch (BCE/BC) and true otherwise (CE/AD). Read more

+

Returns the number of days since January 1, 1 (Day 1) in the proleptic Gregorian calendar.

+

impl<Tz> Debug for DateTime<Tz> where
    Tz: TimeZone
[src]

Formats the value using the given formatter. Read more

+

impl ToMicros for DateTime<Utc>

impl FromMicros for DateTime<Utc>

impl From<DateTime<Utc>> for TypedValue
[src]

Truncate the provided DateTime to microsecond precision, and return the corresponding +TypedValue::Instant.

+

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl<Tz> Sync for DateTime<Tz> where
    <Tz as TimeZone>::Offset: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/struct.EdnParseError.html b/docs/apis/rust/0.7.0/mentat_core/struct.EdnParseError.html new file mode 100644 index 00000000..7fc2ffc0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/struct.EdnParseError.html @@ -0,0 +1,166 @@ + + + + + + + + + + mentat_core::EdnParseError - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::EdnParseError + + [] + +

pub struct EdnParseError {
+    pub line: usize,
+    pub column: usize,
+    pub offset: usize,
+    pub expected: HashSet<&'static str, RandomState>,
+}

+ Fields

+ + + + + + + + +

+ Trait Implementations +

+
+

impl Clone for ParseError

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Eq for ParseError

impl PartialEq<ParseError> for ParseError

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for ParseError

Formats the value using the given formatter. Read more

+

impl Debug for ParseError

Formats the value using the given formatter. Read more

+

impl Error for ParseError

A short description of the error. Read more

+

The lower-level cause of this error, if any. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for ParseError

impl Sync for ParseError

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/struct.Keyword.html b/docs/apis/rust/0.7.0/mentat_core/struct.Keyword.html new file mode 100644 index 00000000..2c6ad371 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/struct.Keyword.html @@ -0,0 +1,240 @@ + + + + + + + + + + mentat_core::Keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::Keyword + + [] + +

pub struct Keyword(_);

A keyword is a symbol, optionally with a namespace, that prints with a leading colon. +This concept is imported from Clojure, as it features in EDN and the query +syntax that we use.

+

Clojure's constraints are looser than ours, allowing empty namespaces or +names:

+
user=> (keyword "" "")
+:/
+user=> (keyword "foo" "")
+:foo/
+user=> (keyword "" "bar")
+:/bar
+
+

We think that's nonsense, so we only allow keywords like :bar and :foo/bar, +with both namespace and main parts containing no whitespace and no colon or slash:

+ +
+let bar     = Keyword::plain("bar");                         // :bar
+let foo_bar = Keyword::namespaced("foo", "bar");        // :foo/bar
+assert_eq!("bar", bar.name());
+assert_eq!(None, bar.namespace());
+assert_eq!("bar", foo_bar.name());
+assert_eq!(Some("foo"), foo_bar.namespace());
+

If you're not sure whether your input is well-formed, you should use a +parser or a reader function first to validate. TODO: implement read.

+

Callers are expected to follow these rules: +http://www.clojure.org/reference/reader#_symbols

+

Future: fast equality (interning?) for keywords.

+
+

+ Methods +

+

impl Keyword

impl Keyword

Creates a new Keyword.

+

Examples

+
+let keyword = Keyword::namespaced("foo", "bar");
+assert_eq!(keyword.to_string(), ":foo/bar");
+

See also the kw! macro in the main mentat crate.

+

Whether this Keyword should be interpreted in reverse order. For example, +the two following snippets are identical:

+
[?y :person/friend ?x]
+[?x :person/hired ?y]
+
+[?y :person/friend ?x]
+[?y :person/_hired ?x]
+
+

Examples

+
+assert!(!Keyword::namespaced("foo", "bar").is_backward());
+assert!(Keyword::namespaced("foo", "_bar").is_backward());
+

Whether this Keyword should be interpreted in forward order. +See symbols::Keyword::is_backward.

+

Examples

+
+assert!(Keyword::namespaced("foo", "bar").is_forward());
+assert!(!Keyword::namespaced("foo", "_bar").is_forward());
+

Returns a Keyword with the same namespace and a +'backward' name. See symbols::Keyword::is_backward.

+

Returns a forward name if passed a reversed keyword; i.e., this +function is its own inverse.

+

Examples

+
+let nsk = Keyword::namespaced("foo", "bar");
+assert!(!nsk.is_backward());
+assert_eq!(":foo/bar", nsk.to_string());
+
+let reversed = nsk.to_reversed();
+assert!(reversed.is_backward());
+assert_eq!(":foo/_bar", reversed.to_string());
+

If this Keyword is 'backward' (see symbols::Keyword::is_backward), +return Some('forward name'); otherwise, return None.

+

Examples

+
+let nsk = Keyword::namespaced("foo", "bar");
+assert_eq!(None, nsk.unreversed());
+
+let reversed = nsk.to_reversed();
+assert_eq!(Some(nsk), reversed.unreversed());
+
+

+ Trait Implementations +

+
+

impl PartialOrd<Keyword> for Keyword

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Clone for Keyword

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<Keyword> for PatternValuePlace

Performs the conversion.

+

impl From<Keyword> for PatternNonValuePlace

Performs the conversion.

+

impl Ord for Keyword

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<'de> Deserialize<'de> for Keyword

Deserialize this value from the given Serde deserializer. Read more

+

impl Hash for Keyword

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for Keyword

impl PartialEq<Keyword> for Keyword

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for Keyword

Print the keyword in EDN format.

+

Examples

+
+assert_eq!(":baz", Keyword::plain("baz").to_string());
+assert_eq!(":bar/baz", Keyword::namespaced("bar", "baz").to_string());
+assert_eq!(":bar/_baz", Keyword::namespaced("bar", "baz").to_reversed().to_string());
+assert_eq!(":bar/baz", Keyword::namespaced("bar", "baz").to_reversed().to_reversed().to_string());
+

impl Debug for Keyword

Formats the value using the given formatter. Read more

+

impl Serialize for Keyword

Serialize this value into the given Serde serializer. Read more

+

impl From<Keyword> for TypedValue
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl Send for Keyword

impl Sync for Keyword

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/struct.KnownEntid.html b/docs/apis/rust/0.7.0/mentat_core/struct.KnownEntid.html new file mode 100644 index 00000000..99d71a44 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/struct.KnownEntid.html @@ -0,0 +1,155 @@ + + + + + + + + + + mentat_core::KnownEntid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::KnownEntid + + [] + + [src]

pub struct KnownEntid(pub Entid);

An entid that's either already in the store, or newly allocated to a tempid. +TODO: we'd like to link this in some way to the lifetime of a particular PartitionMap.

+
+

+ Trait Implementations +

+
+

impl Clone for KnownEntid
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for KnownEntid
[src]

impl Debug for KnownEntid
[src]

Formats the value using the given formatter. Read more

+

impl Hash for KnownEntid
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for KnownEntid
[src]

impl PartialEq for KnownEntid
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Ord for KnownEntid
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for KnownEntid
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl From<KnownEntid> for Entid
[src]

Performs the conversion.

+

impl From<KnownEntid> for TypedValue
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl Send for KnownEntid

impl Sync for KnownEntid

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/struct.Schema.html b/docs/apis/rust/0.7.0/mentat_core/struct.Schema.html new file mode 100644 index 00000000..b226383f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/struct.Schema.html @@ -0,0 +1,195 @@ + + + + + + + + + + mentat_core::Schema - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::Schema + + [] + + [src]

pub struct Schema {
+    pub entid_map: EntidMap,
+    pub ident_map: IdentMap,
+    pub attribute_map: AttributeMap,
+    pub component_attributes: Vec<Entid>,
+}

Represents a Mentat schema.

+

Maintains the mapping between string idents and positive integer entids; and exposes the schema +flags associated to a given entid (equivalently, ident).

+

TODO: consider a single bi-directional map instead of separate ident->entid and entid->ident +maps.

+

+ Fields

+ +

Map entid->ident.

+

Invariant: is the inverse map of ident_map.

+
+ +

Map ident->entid.

+

Invariant: is the inverse map of entid_map.

+
+ +

Map entid->attribute flags.

+

Invariant: key-set is the same as the key-set of entid_map (equivalently, the value-set of +ident_map).

+
+ +

Maintain a vec of unique attribute IDs for which the corresponding attribute in attribute_map +has .component == true.

+
+

+ Methods +

+

impl Schema
[src]

Returns an symbolic representation of the schema suitable for applying across Mentat stores.

+

+

+ Trait Implementations +

+
+

impl Clone for Schema
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for Schema
[src]

Formats the value using the given formatter. Read more

+

impl Default for Schema
[src]

Returns the "default value" for a type. Read more

+

impl Eq for Schema
[src]

impl Hash for Schema
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for Schema
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for Schema
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for Schema
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl HasSchema for Schema
[src]

Return true if the provided entid identifies an attribute in this schema.

+

Return true if the provided ident identifies an attribute in this schema.

+

Important traits for &'a [u8]

+

+ Auto Trait Implementations +

+
+

impl Send for Schema

impl Sync for Schema

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/struct.StructuredMap.html b/docs/apis/rust/0.7.0/mentat_core/struct.StructuredMap.html new file mode 100644 index 00000000..3d18918a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/struct.StructuredMap.html @@ -0,0 +1,159 @@ + + + + + + + + + + mentat_core::StructuredMap - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::StructuredMap + + [] + + [src]

pub struct StructuredMap(pub IndexMap<ValueRc<Keyword>, Binding>);

A pull expression expands a binding into a structure. The returned structure +associates attributes named in the input or retrieved from the store with values. +This association is a StructuredMap.

+

Note that 'attributes' in Datomic's case can mean:

+
    +
  • Reversed attribute keywords (:artist/_country).
  • +
  • An alias using :as (:artist/name :as "Band name").
  • +
+

We entirely support the former, and partially support the latter -- you can alias +using a different keyword only.

+
+

+ Methods +

+

impl StructuredMap
[src]

+

+ Trait Implementations +

+
+

impl From<StructuredMap> for Binding
[src]

Performs the conversion.

+

impl Clone for StructuredMap
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for StructuredMap
[src]

Formats the value using the given formatter. Read more

+

impl Default for StructuredMap
[src]

Returns the "default value" for a type. Read more

+

impl Eq for StructuredMap
[src]

impl PartialEq for StructuredMap
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl From<IndexMap<ValueRc<Keyword>, Binding>> for StructuredMap
[src]

Performs the conversion.

+

impl<T> From<Vec<(Keyword, T)>> for StructuredMap where
    T: Into<Binding>, 
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl Send for StructuredMap

impl Sync for StructuredMap

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/struct.Utc.html b/docs/apis/rust/0.7.0/mentat_core/struct.Utc.html new file mode 100644 index 00000000..59c1e3e1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/struct.Utc.html @@ -0,0 +1,182 @@ + + + + + + + + + + mentat_core::Utc - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::Utc + + [] + + [src]

pub struct Utc;

The UTC time zone. This is the most efficient time zone when you don't need the local time. +It is also used as an offset (which is also a dummy type).

+

Using the TimeZone methods +on the UTC struct is the preferred way to construct DateTime<Utc> +instances.

+

Example

+
+use chrono::{DateTime, TimeZone, NaiveDateTime, Utc};
+
+let dt = DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(61, 0), Utc);
+
+assert_eq!(Utc.timestamp(61, 0), dt);
+assert_eq!(Utc.ymd(1970, 1, 1).and_hms(0, 1, 1), dt);
+
+

+ Methods +

+

impl Utc
[src]

Returns a Date which corresponds to the current date.

+

Returns a DateTime which corresponds to the current date.

+
+

+ Trait Implementations +

+
+

impl Copy for Utc
[src]

impl Clone for Utc
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Offset for Utc
[src]

Returns the fixed offset from UTC to the local time stored.

+

impl Eq for Utc
[src]

impl PartialEq<Utc> for Utc
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for Utc
[src]

Formats the value using the given formatter. Read more

+

impl Debug for Utc
[src]

Formats the value using the given formatter. Read more

+

impl TimeZone for Utc
[src]

+

An associated offset type. This type is used to store the actual offset in date and time types. The original TimeZone value can be recovered via TimeZone::from_offset. Read more

+

Reconstructs the time zone from the offset.

+

Creates the offset(s) for given local NaiveDate if possible.

+

Creates the offset(s) for given local NaiveDateTime if possible.

+

Creates the offset for given UTC NaiveDate. This cannot fail.

+

Creates the offset for given UTC NaiveDateTime. This cannot fail.

+

Makes a new Date from year, month, day and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. Read more

+

Makes a new Date from year, month, day and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. Read more

+

Makes a new Date from year, day of year (DOY or "ordinal") and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. Read more

+

Makes a new Date from year, day of year (DOY or "ordinal") and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. Read more

+

Makes a new Date from ISO week date (year and week number), day of the week (DOW) and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. The resulting Date may have a different year from the input year. Read more

+

Makes a new Date from ISO week date (year and week number), day of the week (DOW) and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. The resulting Date may have a different year from the input year. Read more

+

Makes a new DateTime from the number of non-leap seconds since January 1, 1970 0:00:00 UTC (aka "UNIX timestamp") and the number of nanoseconds since the last whole non-leap second. Read more

+

Makes a new DateTime from the number of non-leap seconds since January 1, 1970 0:00:00 UTC (aka "UNIX timestamp") and the number of nanoseconds since the last whole non-leap second. Read more

+

Parses a string with the specified format string and returns a DateTime with the current offset. See the format::strftime module on the supported escape sequences. Read more

+

Converts the local NaiveDate to the timezone-aware Date if possible.

+

Converts the local NaiveDateTime to the timezone-aware DateTime if possible.

+

Converts the UTC NaiveDate to the local time. The UTC is continuous and thus this cannot fail (but can give the duplicate local time). Read more

+

Converts the UTC NaiveDateTime to the local time. The UTC is continuous and thus this cannot fail (but can give the duplicate local time). Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for Utc

impl Sync for Utc

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/struct.Uuid.html b/docs/apis/rust/0.7.0/mentat_core/struct.Uuid.html new file mode 100644 index 00000000..52bd6db9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/struct.Uuid.html @@ -0,0 +1,323 @@ + + + + + + + + + + mentat_core::Uuid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::Uuid + + [] + + [src]

pub struct Uuid { /* fields omitted */ }

A Universally Unique Identifier (UUID).

+
+

+ Methods +

+

impl Uuid
[src]

The 'nil UUID'.

+

The nil UUID is special form of UUID that is specified to have all +128 bits set to zero, as defined in IETF RFC 4122 Section 4.1.7.

+

Examples

+

Basic usage:

+ +
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+
+assert_eq!(uuid.hyphenated().to_string(),
+           "00000000-0000-0000-0000-000000000000");
+

Creates a new Uuid.

+

Note that not all versions can be generated currently and None will be +returned if the specified version cannot be generated.

+

To generate a random UUID (UuidVersion::Random), then the v4 +feature must be enabled for this crate.

+

Creates a random Uuid.

+

This uses the rand crate's default task RNG as the source of random numbers. +If you'd like to use a custom generator, don't use this method: use the +rand::Rand trait's rand() method instead.

+

Note that usage of this method requires the v4 feature of this crate +to be enabled.

+

Examples

+

Basic usage:

+ +
+use uuid::Uuid;
+
+let uuid = Uuid::new_v4();
+

Creates a Uuid from four field values.

+

Errors

+

This function will return an error if d4's length is not 8 bytes.

+

Examples

+

Basic usage:

+ +
+use uuid::Uuid;
+
+let d4 = [12, 3, 9, 56, 54, 43, 8, 9];
+
+let uuid = Uuid::from_fields(42, 12, 5, &d4);
+let uuid = uuid.map(|uuid| uuid.hyphenated().to_string());
+
+let expected_uuid = Ok(String::from("0000002a-000c-0005-0c03-0938362b0809"));
+
+assert_eq!(expected_uuid, uuid);
+

An invalid length:

+ +
+use uuid::Uuid;
+use uuid::ParseError;
+
+let d4 = [12];
+
+let uuid = Uuid::from_fields(42, 12, 5, &d4);
+
+let expected_uuid = Err(ParseError::InvalidLength(1));
+
+assert_eq!(expected_uuid, uuid);
+

Creates a Uuid using the supplied bytes.

+

Errors

+

This function will return an error if b has any length other than 16.

+

Examples

+

Basic usage:

+ +
+use uuid::Uuid;
+
+let bytes = [4, 54, 67, 12, 43, 2, 98, 76,
+             32, 50, 87, 5, 1, 33, 43, 87];
+
+let uuid = Uuid::from_bytes(&bytes);
+let uuid = uuid.map(|uuid| uuid.hyphenated().to_string());
+
+let expected_uuid = Ok(String::from("0436430c-2b02-624c-2032-570501212b57"));
+
+assert_eq!(expected_uuid, uuid);
+

An incorrect number of bytes:

+ +
+use uuid::Uuid;
+use uuid::ParseError;
+
+let bytes = [4, 54, 67, 12, 43, 2, 98, 76];
+
+let uuid = Uuid::from_bytes(&bytes);
+
+let expected_uuid = Err(ParseError::InvalidLength(8));
+
+assert_eq!(expected_uuid, uuid);
+

Returns the variant of the Uuid structure.

+

This determines the interpretation of the structure of the UUID. +Currently only the RFC4122 variant is generated by this module.

+ +

Returns the version number of the Uuid.

+

This represents the algorithm used to generate the contents.

+

Currently only the Random (V4) algorithm is supported by this +module. There are security and privacy implications for using +older versions - see Wikipedia: Universally Unique Identifier for +details.

+ +

Returns the version of the Uuid.

+

This represents the algorithm used to generate the contents

+

Return an array of 16 octets containing the UUID data

+

Examples

+
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+assert_eq!(uuid.as_bytes(), &[0; 16]);
+
+let uuid = Uuid::parse_str("936DA01F9ABD4d9d80C702AF85C822A8").unwrap();
+assert_eq!(uuid.as_bytes(),
+           &[147, 109, 160, 31, 154, 189, 77, 157,
+             128, 199, 2, 175, 133, 200, 34, 168]);
+

Returns a wrapper which when formatted via fmt::Display will format a +string of 32 hexadecimal digits.

+

Examples

+
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+assert_eq!(uuid.simple().to_string(),
+           "00000000000000000000000000000000");
+

Returns a wrapper which when formatted via fmt::Display will format a +string of hexadecimal digits separated into groups with a hyphen.

+

Examples

+
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+assert_eq!(uuid.hyphenated().to_string(),
+           "00000000-0000-0000-0000-000000000000");
+

Returns a wrapper which when formatted via fmt::Display will format a +string of the UUID as a full URN string.

+

Examples

+
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+assert_eq!(uuid.urn().to_string(),
+           "urn:uuid:00000000-0000-0000-0000-000000000000");
+

Returns an Optional Tuple of (u64, u16) representing the timestamp and +counter portion of a V1 UUID. If the supplied UUID is not V1, this +will return None

+

Parses a Uuid from a string of hexadecimal digits with optional hyphens.

+

Any of the formats generated by this module (simple, hyphenated, urn) are +supported by this parsing function.

+

Tests if the UUID is nil

+
+

+ Trait Implementations +

+
+

impl Debug for Uuid
[src]

Formats the value using the given formatter. Read more

+

impl Display for Uuid
[src]

Formats the value using the given formatter. Read more

+

impl PartialEq<Uuid> for Uuid
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Hash for Uuid
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for Uuid
[src]

impl FromStr for Uuid
[src]

+

The associated error which can be returned from parsing.

+

Parse a hex string and interpret as a Uuid.

+

Accepted formats are a sequence of 32 hexadecimal characters, +with or without hyphens (grouped as 8, 4, 4, 4, 12).

+

impl Ord for Uuid
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<'de> Deserialize<'de> for Uuid
[src]

Deserialize this value from the given Serde deserializer. Read more

+

impl Rand for Uuid
[src]

Generates a random Uuid (V4 conformant).

+

Generates a random instance of this type using the specified source of randomness. Read more

+

impl Clone for Uuid
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for Uuid
[src]

impl PartialOrd<Uuid> for Uuid
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Serialize for Uuid
[src]

Serialize this value into the given Serde serializer. Read more

+

impl Default for Uuid
[src]

Returns the nil UUID, which is all zeroes

+

impl From<Uuid> for TypedValue
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl Send for Uuid

impl Sync for Uuid

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/struct.ValueTypeSet.html b/docs/apis/rust/0.7.0/mentat_core/struct.ValueTypeSet.html new file mode 100644 index 00000000..1c0e7f4a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/struct.ValueTypeSet.html @@ -0,0 +1,165 @@ + + + + + + + + + + mentat_core::ValueTypeSet - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::ValueTypeSet + + [] + + [src]

pub struct ValueTypeSet(pub EnumSet<ValueType>);
+

+ Methods +

+

impl ValueTypeSet
[src]

Return a set containing only t.

+

Return a set containing Double and Long.

+

Return a set containing Double, Long, and Instant.

+

Return a set containing Ref and Keyword.

+

Return a set containing Ref and Long.

+

impl ValueTypeSet
[src]

Returns a set containing all the types in this set and other.

+

Returns the set difference between self and other, which is the +set of items in self that are not in other.

+

Return an arbitrary type that's part of this set. +For a set containing a single type, this will be that type.

+

Returns true if self and other contain no items in common.

+

Important traits for Iter<E>

impl ValueTypeSet
[src]

+

+ Trait Implementations +

+
+

impl Clone for ValueTypeSet
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for ValueTypeSet
[src]

impl Debug for ValueTypeSet
[src]

Formats the value using the given formatter. Read more

+

impl Eq for ValueTypeSet
[src]

impl PartialEq for ValueTypeSet
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Default for ValueTypeSet
[src]

Returns the "default value" for a type. Read more

+

impl From<ValueType> for ValueTypeSet
[src]

Performs the conversion.

+

impl IntoIterator for ValueTypeSet
[src]

+

The type of the elements being iterated over.

+

+

Which kind of iterator are we turning this into?

+

Creates an iterator from a value. Read more

+

impl FromIterator<ValueType> for ValueTypeSet
[src]

Creates a value from an iterator. Read more

+

impl Extend<ValueType> for ValueTypeSet
[src]

Extends a collection with the contents of an iterator. Read more

+

impl SQLValueTypeSet for ValueTypeSet
[src]

+

+ Auto Trait Implementations +

+
+

impl Send for ValueTypeSet

impl Sync for ValueTypeSet

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/trait.CachedAttributes.html b/docs/apis/rust/0.7.0/mentat_core/trait.CachedAttributes.html new file mode 100644 index 00000000..492eaef4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/trait.CachedAttributes.html @@ -0,0 +1,147 @@ + + + + + + + + + + mentat_core::CachedAttributes - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_core::CachedAttributes + + [] + + [src]

pub trait CachedAttributes {
+    fn is_attribute_cached_reverse(&self, entid: Entid) -> bool;
+
fn is_attribute_cached_forward(&self, entid: Entid) -> bool; +
fn has_cached_attributes(&self) -> bool; +
fn get_values_for_entid(
        &self,
        schema: &Schema,
        attribute: Entid,
        entid: Entid
    ) -> Option<&Vec<TypedValue>>; +
fn get_value_for_entid(
        &self,
        schema: &Schema,
        attribute: Entid,
        entid: Entid
    ) -> Option<&TypedValue>; +
fn get_entid_for_value(
        &self,
        attribute: Entid,
        value: &TypedValue
    ) -> Option<Entid>; +
fn get_entids_for_value(
        &self,
        attribute: Entid,
        value: &TypedValue
    ) -> Option<&BTreeSet<Entid>>; +}
+

+ Required Methods +

+
+

Reverse lookup.

+

+

+ Implementors +

+
    +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/trait.Cloned.html b/docs/apis/rust/0.7.0/mentat_core/trait.Cloned.html new file mode 100644 index 00000000..365055e1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/trait.Cloned.html @@ -0,0 +1,145 @@ + + + + + + + + + + mentat_core::Cloned - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_core::Cloned + + [] + +

pub trait Cloned<T> {
+    fn cloned(&self) -> T;
+
fn to_value_rc(&self) -> Arc<T>; +}
+

+ Required Methods +

+
+

+

+ Implementations on Foreign Types +

+

impl<T> Cloned<T> for Box<T> where
    T: Clone + Clone

impl<T> Cloned<T> for Rc<T> where
    T: Clone + Clone

impl<T> Cloned<T> for Arc<T> where
    T: Clone + Clone

+

+ Implementors +

+
    +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/trait.FromMicros.html b/docs/apis/rust/0.7.0/mentat_core/trait.FromMicros.html new file mode 100644 index 00000000..8d059adf --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/trait.FromMicros.html @@ -0,0 +1,141 @@ + + + + + + + + + + mentat_core::FromMicros - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_core::FromMicros + + [] + +

pub trait FromMicros {
+    fn from_micros(ts: i64) -> Self;
+}
+

+ Required Methods +

+
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/trait.FromRc.html b/docs/apis/rust/0.7.0/mentat_core/trait.FromRc.html new file mode 100644 index 00000000..768bdbaa --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/trait.FromRc.html @@ -0,0 +1,145 @@ + + + + + + + + + + mentat_core::FromRc - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_core::FromRc + + [] + +

pub trait FromRc<T> {
+    fn from_rc(val: Rc<T>) -> Self;
+
fn from_arc(val: Arc<T>) -> Self; +}
+

+ Required Methods +

+
+

+

+ Implementations on Foreign Types +

+

impl<T> FromRc<T> for Rc<T> where
    T: Clone

impl<T> FromRc<T> for Arc<T> where
    T: Clone

impl<T> FromRc<T> for Box<T> where
    T: Clone

Important traits for Box<R>

Important traits for Box<R>

+

+ Implementors +

+
    +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/trait.HasSchema.html b/docs/apis/rust/0.7.0/mentat_core/trait.HasSchema.html new file mode 100644 index 00000000..de2774bc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/trait.HasSchema.html @@ -0,0 +1,150 @@ + + + + + + + + + + mentat_core::HasSchema - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_core::HasSchema + + [] + + [src]

pub trait HasSchema {
+    fn entid_for_type(&self, t: ValueType) -> Option<KnownEntid>;
+
fn get_ident<T>(&self, x: T) -> Option<&Keyword>
    where
        T: Into<Entid>
; +
fn get_entid(&self, x: &Keyword) -> Option<KnownEntid>; +
fn attribute_for_entid<T>(&self, x: T) -> Option<&Attribute>
    where
        T: Into<Entid>
; +
fn attribute_for_ident(
        &self,
        ident: &Keyword
    ) -> Option<(&Attribute, KnownEntid)>; +
fn is_attribute<T>(&self, x: T) -> bool
    where
        T: Into<Entid>
; +
fn identifies_attribute(&self, x: &Keyword) -> bool; +
fn component_attributes(&self) -> &[Entid]; +}
+

+ Required Methods +

+
+

Return true if the provided entid identifies an attribute in this schema.

+

Return true if the provided ident identifies an attribute in this schema.

+
Important traits for &'a [u8]

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/trait.SQLValueType.html b/docs/apis/rust/0.7.0/mentat_core/trait.SQLValueType.html new file mode 100644 index 00000000..49873290 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/trait.SQLValueType.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::SQLValueType - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_core::SQLValueType + + [] + + [src]

pub trait SQLValueType {
+    fn value_type_tag(&self) -> ValueTypeTag;
+
fn accommodates_integer(&self, int: i64) -> bool; +
fn sql_representation(&self) -> (ValueTypeTag, Option<SQLTypeAffinity>); +}
+

+ Required Methods +

+
+

Return a pair of the ValueTypeTag for this value type, and the SQLTypeAffinity required +to distinguish it from any other types that share the same tag.

+

Background: The tag alone is not enough to determine the type of a value, since multiple +ValueTypes may share the same tag (for example, ValueType::Long and ValueType::Double). +However, each ValueType can be determined by checking both the tag and the type's affinity.

+
+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/trait.SQLValueTypeSet.html b/docs/apis/rust/0.7.0/mentat_core/trait.SQLValueTypeSet.html new file mode 100644 index 00000000..8bb24f74 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/trait.SQLValueTypeSet.html @@ -0,0 +1,149 @@ + + + + + + + + + + mentat_core::SQLValueTypeSet - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_core::SQLValueTypeSet + + [] + + [src]

pub trait SQLValueTypeSet {
+    fn value_type_tags(&self) -> BTreeSet<ValueTypeTag>;
+
fn has_unique_type_tag(&self) -> bool; +
fn unique_type_tag(&self) -> Option<ValueTypeTag>; +}

We have an enum of types, ValueType. It can be collected into a set, ValueTypeSet. Each type +is associated with a type tag, which is how a type is represented in, e.g., SQL storage. Types +can share type tags, because backing SQL storage is able to differentiate between some types +(e.g., longs and doubles), and so distinct tags aren't necessary. That association is defined by +SQLValueType. That trait similarly extends to ValueTypeSet, which maps a collection of types +into a collection of tags.

+
+

+ Required Methods +

+ +

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/trait.Timelike.html b/docs/apis/rust/0.7.0/mentat_core/trait.Timelike.html new file mode 100644 index 00000000..aa9b73ef --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/trait.Timelike.html @@ -0,0 +1,378 @@ + + + + + + + + + + mentat_core::Timelike - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_core::Timelike + + [] + + [src]

pub trait Timelike {
+    fn hour(&self) -> u32;
+
fn minute(&self) -> u32; +
fn second(&self) -> u32; +
fn nanosecond(&self) -> u32; +
fn with_hour(&self, hour: u32) -> Option<Self>; +
fn with_minute(&self, min: u32) -> Option<Self>; +
fn with_second(&self, sec: u32) -> Option<Self>; +
fn with_nanosecond(&self, nano: u32) -> Option<Self>; + + fn hour12(&self) -> (bool, u32) { ... } +
fn num_seconds_from_midnight(&self) -> u32 { ... } +}

The common set of methods for time component.

+
+

+ Required Methods +

+
+

Returns the hour number from 0 to 23.

+

Returns the minute number from 0 to 59.

+

Returns the second number from 0 to 59.

+

Returns the number of nanoseconds since the whole non-leap second. +The range from 1,000,000,000 to 1,999,999,999 represents +the leap second.

+

Makes a new value with the hour number changed.

+

Returns None when the resulting value would be invalid.

+

Makes a new value with the minute number changed.

+

Returns None when the resulting value would be invalid.

+

Makes a new value with the second number changed.

+

Returns None when the resulting value would be invalid. +As with the second method, +the input range is restricted to 0 through 59.

+

Makes a new value with nanoseconds since the whole non-leap second changed.

+

Returns None when the resulting value would be invalid. +As with the nanosecond method, +the input range can exceed 1,000,000,000 for leap seconds.

+
+

+ Provided Methods +

+
+

Returns the hour number from 1 to 12 with a boolean flag, +which is false for AM and true for PM.

+

Returns the number of non-leap seconds past the last midnight.

+
+

+ Implementations on Foreign Types +

+

impl Timelike for NaiveDateTime
[src]

Returns the hour number from 0 to 23.

+

See also the NaiveTime::hour method.

+

Example

+
+use chrono::{NaiveDate, NaiveDateTime, Timelike};
+
+let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 56, 789);
+assert_eq!(dt.hour(), 12);
+

Returns the minute number from 0 to 59.

+

See also the NaiveTime::minute method.

+

Example

+
+use chrono::{NaiveDate, NaiveDateTime, Timelike};
+
+let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 56, 789);
+assert_eq!(dt.minute(), 34);
+

Returns the second number from 0 to 59.

+

See also the NaiveTime::second method.

+

Example

+
+use chrono::{NaiveDate, NaiveDateTime, Timelike};
+
+let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 56, 789);
+assert_eq!(dt.second(), 56);
+

Returns the number of nanoseconds since the whole non-leap second. +The range from 1,000,000,000 to 1,999,999,999 represents +the leap second.

+

See also the +NaiveTime::nanosecond method.

+

Example

+
+use chrono::{NaiveDate, NaiveDateTime, Timelike};
+
+let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 56, 789);
+assert_eq!(dt.nanosecond(), 789_000_000);
+

Makes a new NaiveDateTime with the hour number changed.

+

Returns None when the resulting NaiveDateTime would be invalid.

+

See also the +NaiveTime::with_hour method.

+

Example

+
+use chrono::{NaiveDate, NaiveDateTime, Timelike};
+
+let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 56, 789);
+assert_eq!(dt.with_hour(7),
+           Some(NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(7, 34, 56, 789)));
+assert_eq!(dt.with_hour(24), None);
+

Makes a new NaiveDateTime with the minute number changed.

+

Returns None when the resulting NaiveDateTime would be invalid.

+

See also the +NaiveTime::with_minute method.

+

Example

+
+use chrono::{NaiveDate, NaiveDateTime, Timelike};
+
+let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 56, 789);
+assert_eq!(dt.with_minute(45),
+           Some(NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 45, 56, 789)));
+assert_eq!(dt.with_minute(60), None);
+

Makes a new NaiveDateTime with the second number changed.

+

Returns None when the resulting NaiveDateTime would be invalid. +As with the second method, +the input range is restricted to 0 through 59.

+

See also the +NaiveTime::with_second method.

+

Example

+
+use chrono::{NaiveDate, NaiveDateTime, Timelike};
+
+let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 56, 789);
+assert_eq!(dt.with_second(17),
+           Some(NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 17, 789)));
+assert_eq!(dt.with_second(60), None);
+

Makes a new NaiveDateTime with nanoseconds since the whole non-leap second changed.

+

Returns None when the resulting NaiveDateTime would be invalid. +As with the nanosecond method, +the input range can exceed 1,000,000,000 for leap seconds.

+

See also the +NaiveTime::with_nanosecond +method.

+

Example

+
+use chrono::{NaiveDate, NaiveDateTime, Timelike};
+
+let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 56, 789);
+assert_eq!(dt.with_nanosecond(333_333_333),
+           Some(NaiveDate::from_ymd(2015, 9, 8).and_hms_nano(12, 34, 56, 333_333_333)));
+assert_eq!(dt.with_nanosecond(1_333_333_333), // leap second
+           Some(NaiveDate::from_ymd(2015, 9, 8).and_hms_nano(12, 34, 56, 1_333_333_333)));
+assert_eq!(dt.with_nanosecond(2_000_000_000), None);
+

impl Timelike for NaiveTime
[src]

Returns the hour number from 0 to 23.

+

Example

+
+use chrono::{NaiveTime, Timelike};
+
+assert_eq!(NaiveTime::from_hms(0, 0, 0).hour(), 0);
+assert_eq!(NaiveTime::from_hms_nano(23, 56, 4, 12_345_678).hour(), 23);
+

Returns the minute number from 0 to 59.

+

Example

+
+use chrono::{NaiveTime, Timelike};
+
+assert_eq!(NaiveTime::from_hms(0, 0, 0).minute(), 0);
+assert_eq!(NaiveTime::from_hms_nano(23, 56, 4, 12_345_678).minute(), 56);
+

Returns the second number from 0 to 59.

+

Example

+
+use chrono::{NaiveTime, Timelike};
+
+assert_eq!(NaiveTime::from_hms(0, 0, 0).second(), 0);
+assert_eq!(NaiveTime::from_hms_nano(23, 56, 4, 12_345_678).second(), 4);
+

This method never returns 60 even when it is a leap second. +(Why?) +Use the proper formatting method to get a human-readable representation.

+ +
+let leap = NaiveTime::from_hms_milli(23, 59, 59, 1_000);
+assert_eq!(leap.second(), 59);
+assert_eq!(leap.format("%H:%M:%S").to_string(), "23:59:60");
+

Returns the number of nanoseconds since the whole non-leap second. +The range from 1,000,000,000 to 1,999,999,999 represents +the leap second.

+

Example

+
+use chrono::{NaiveTime, Timelike};
+
+assert_eq!(NaiveTime::from_hms(0, 0, 0).nanosecond(), 0);
+assert_eq!(NaiveTime::from_hms_nano(23, 56, 4, 12_345_678).nanosecond(), 12_345_678);
+

Leap seconds may have seemingly out-of-range return values. +You can reduce the range with time.nanosecond() % 1_000_000_000, or +use the proper formatting method to get a human-readable representation.

+ +
+let leap = NaiveTime::from_hms_milli(23, 59, 59, 1_000);
+assert_eq!(leap.nanosecond(), 1_000_000_000);
+assert_eq!(leap.format("%H:%M:%S%.9f").to_string(), "23:59:60.000000000");
+

Makes a new NaiveTime with the hour number changed.

+

Returns None when the resulting NaiveTime would be invalid.

+

Example

+
+use chrono::{NaiveTime, Timelike};
+
+let dt = NaiveTime::from_hms_nano(23, 56, 4, 12_345_678);
+assert_eq!(dt.with_hour(7), Some(NaiveTime::from_hms_nano(7, 56, 4, 12_345_678)));
+assert_eq!(dt.with_hour(24), None);
+

Makes a new NaiveTime with the minute number changed.

+

Returns None when the resulting NaiveTime would be invalid.

+

Example

+
+use chrono::{NaiveTime, Timelike};
+
+let dt = NaiveTime::from_hms_nano(23, 56, 4, 12_345_678);
+assert_eq!(dt.with_minute(45), Some(NaiveTime::from_hms_nano(23, 45, 4, 12_345_678)));
+assert_eq!(dt.with_minute(60), None);
+

Makes a new NaiveTime with the second number changed.

+

Returns None when the resulting NaiveTime would be invalid. +As with the second method, +the input range is restricted to 0 through 59.

+

Example

+
+use chrono::{NaiveTime, Timelike};
+
+let dt = NaiveTime::from_hms_nano(23, 56, 4, 12_345_678);
+assert_eq!(dt.with_second(17), Some(NaiveTime::from_hms_nano(23, 56, 17, 12_345_678)));
+assert_eq!(dt.with_second(60), None);
+

Makes a new NaiveTime with nanoseconds since the whole non-leap second changed.

+

Returns None when the resulting NaiveTime would be invalid. +As with the nanosecond method, +the input range can exceed 1,000,000,000 for leap seconds.

+

Example

+
+use chrono::{NaiveTime, Timelike};
+
+let dt = NaiveTime::from_hms_nano(23, 56, 4, 12_345_678);
+assert_eq!(dt.with_nanosecond(333_333_333),
+           Some(NaiveTime::from_hms_nano(23, 56, 4, 333_333_333)));
+assert_eq!(dt.with_nanosecond(2_000_000_000), None);
+

Leap seconds can theoretically follow any whole second. +The following would be a proper leap second at the time zone offset of UTC-00:03:57 +(there are several historical examples comparable to this "non-sense" offset), +and therefore is allowed.

+ +
+assert_eq!(dt.with_nanosecond(1_333_333_333),
+           Some(NaiveTime::from_hms_nano(23, 56, 4, 1_333_333_333)));
+

Returns the number of non-leap seconds past the last midnight.

+

Example

+
+use chrono::{NaiveTime, Timelike};
+
+assert_eq!(NaiveTime::from_hms(1, 2, 3).num_seconds_from_midnight(),
+           3723);
+assert_eq!(NaiveTime::from_hms_nano(23, 56, 4, 12_345_678).num_seconds_from_midnight(),
+           86164);
+assert_eq!(NaiveTime::from_hms_milli(23, 59, 59, 1_000).num_seconds_from_midnight(),
+           86399);
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/trait.ToMicros.html b/docs/apis/rust/0.7.0/mentat_core/trait.ToMicros.html new file mode 100644 index 00000000..d4e064e4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/trait.ToMicros.html @@ -0,0 +1,141 @@ + + + + + + + + + + mentat_core::ToMicros - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_core::ToMicros + + [] + +

pub trait ToMicros {
+    fn to_micros(&self) -> i64;
+}
+

+ Required Methods +

+
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/trait.UpdateableCache.html b/docs/apis/rust/0.7.0/mentat_core/trait.UpdateableCache.html new file mode 100644 index 00000000..28b8bf67 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/trait.UpdateableCache.html @@ -0,0 +1,140 @@ + + + + + + + + + + mentat_core::UpdateableCache - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_core::UpdateableCache + + [] + + [src]

pub trait UpdateableCache<Error = Error> {
+    fn update<I>(
        &mut self,
        schema: &Schema,
        retractions: I,
        assertions: I
    ) -> Result<(), Error>
    where
        I: Iterator<Item = (Entid, Entid, TypedValue)>
; +}
+

+ Required Methods +

+
+

+

+ Implementors +

+
    +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/type.AttributeMap.html b/docs/apis/rust/0.7.0/mentat_core/type.AttributeMap.html new file mode 100644 index 00000000..d38cb29b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/type.AttributeMap.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_core::AttributeMap - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_core::AttributeMap + + [] + + [src]

type AttributeMap = BTreeMap<Entid, Attribute>;

Map attribute entids to Attribute instances.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/type.Entid.html b/docs/apis/rust/0.7.0/mentat_core/type.Entid.html new file mode 100644 index 00000000..0998ac8f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/type.Entid.html @@ -0,0 +1,136 @@ + + + + + + + + + + mentat_core::Entid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_core::Entid + + [] + + [src]

type Entid = i64;

Represents one entid in the entid space.

+

Per https://www.sqlite.org/datatype3.html (see also http://stackoverflow.com/a/8499544), SQLite +stores signed integers up to 64 bits in size. Since u32 is not appropriate for our use case, we +use i64 rather than manually truncating u64 to u63 and casting to i64 throughout the codebase.

+
+

+ Trait Implementations +

+
+

impl From<KnownEntid> for Entid
[src]

Performs the conversion.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/type.EntidMap.html b/docs/apis/rust/0.7.0/mentat_core/type.EntidMap.html new file mode 100644 index 00000000..1f98d6f3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/type.EntidMap.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_core::EntidMap - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_core::EntidMap + + [] + + [src]

type EntidMap = BTreeMap<Entid, Keyword>;

Map positive integer entids (1) to Keyword idents (:db/ident).

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/type.IdentMap.html b/docs/apis/rust/0.7.0/mentat_core/type.IdentMap.html new file mode 100644 index 00000000..ef602d2e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/type.IdentMap.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_core::IdentMap - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_core::IdentMap + + [] + + [src]

type IdentMap = BTreeMap<Keyword, Entid>;

Map Keyword idents (:db/ident) to positive integer entids (1).

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/type.ValueRc.html b/docs/apis/rust/0.7.0/mentat_core/type.ValueRc.html new file mode 100644 index 00000000..c393e48d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/type.ValueRc.html @@ -0,0 +1,129 @@ + + + + + + + + + + mentat_core::ValueRc - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_core::ValueRc + + [] + +

type ValueRc<T> = Arc<T>;

This type alias exists to allow us to use different boxing mechanisms for values. +This type must implement FromRc and Cloned, and a From implementation must exist for +TypedValue.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/type.ValueTypeTag.html b/docs/apis/rust/0.7.0/mentat_core/type.ValueTypeTag.html new file mode 100644 index 00000000..7777fa09 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/type.ValueTypeTag.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_core::ValueTypeTag - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_core::ValueTypeTag + + [] + + [src]

type ValueTypeTag = i32;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/types/Binding.t.html b/docs/apis/rust/0.7.0/mentat_core/types/Binding.t.html new file mode 100644 index 00000000..04563187 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/types/Binding.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Binding.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/types/Entid.t.html b/docs/apis/rust/0.7.0/mentat_core/types/Entid.t.html new file mode 100644 index 00000000..a33a5c5a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/types/Entid.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Entid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/types/KnownEntid.t.html b/docs/apis/rust/0.7.0/mentat_core/types/KnownEntid.t.html new file mode 100644 index 00000000..f715cf77 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/types/KnownEntid.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.KnownEntid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/types/StructuredMap.t.html b/docs/apis/rust/0.7.0/mentat_core/types/StructuredMap.t.html new file mode 100644 index 00000000..e9f8a4bc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/types/StructuredMap.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.StructuredMap.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/types/TypedValue.t.html b/docs/apis/rust/0.7.0/mentat_core/types/TypedValue.t.html new file mode 100644 index 00000000..8b0ac4a6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/types/TypedValue.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.TypedValue.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/types/ValueType.t.html b/docs/apis/rust/0.7.0/mentat_core/types/ValueType.t.html new file mode 100644 index 00000000..2809fdde --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/types/ValueType.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.ValueType.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/types/ValueTypeTag.t.html b/docs/apis/rust/0.7.0/mentat_core/types/ValueTypeTag.t.html new file mode 100644 index 00000000..d1a3e0ce --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/types/ValueTypeTag.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.ValueTypeTag.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/types/enum.Binding.html b/docs/apis/rust/0.7.0/mentat_core/types/enum.Binding.html new file mode 100644 index 00000000..b417844b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/types/enum.Binding.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_core/enum.Binding.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/types/enum.TypedValue.html b/docs/apis/rust/0.7.0/mentat_core/types/enum.TypedValue.html new file mode 100644 index 00000000..ec2a73a3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/types/enum.TypedValue.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_core/enum.TypedValue.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/types/enum.ValueType.html b/docs/apis/rust/0.7.0/mentat_core/types/enum.ValueType.html new file mode 100644 index 00000000..c8b24505 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/types/enum.ValueType.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_core/enum.ValueType.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/types/fn.now.html b/docs/apis/rust/0.7.0/mentat_core/types/fn.now.html new file mode 100644 index 00000000..46fc7b76 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/types/fn.now.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_core/fn.now.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/types/now.v.html b/docs/apis/rust/0.7.0/mentat_core/types/now.v.html new file mode 100644 index 00000000..0f8d9fb7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/types/now.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.now.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/types/struct.KnownEntid.html b/docs/apis/rust/0.7.0/mentat_core/types/struct.KnownEntid.html new file mode 100644 index 00000000..c0cdbc63 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/types/struct.KnownEntid.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_core/struct.KnownEntid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/types/struct.StructuredMap.html b/docs/apis/rust/0.7.0/mentat_core/types/struct.StructuredMap.html new file mode 100644 index 00000000..42ee8820 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/types/struct.StructuredMap.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_core/struct.StructuredMap.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/types/type.Entid.html b/docs/apis/rust/0.7.0/mentat_core/types/type.Entid.html new file mode 100644 index 00000000..34571f9a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/types/type.Entid.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_core/type.Entid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/types/type.ValueTypeTag.html b/docs/apis/rust/0.7.0/mentat_core/types/type.ValueTypeTag.html new file mode 100644 index 00000000..10251051 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/types/type.ValueTypeTag.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_core/type.ValueTypeTag.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/util/Either.t.html b/docs/apis/rust/0.7.0/mentat_core/util/Either.t.html new file mode 100644 index 00000000..5e1c4d8c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/util/Either.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Either.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/util/OptionEffect.t.html b/docs/apis/rust/0.7.0/mentat_core/util/OptionEffect.t.html new file mode 100644 index 00000000..af278a68 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/util/OptionEffect.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.OptionEffect.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/util/ResultEffect.t.html b/docs/apis/rust/0.7.0/mentat_core/util/ResultEffect.t.html new file mode 100644 index 00000000..7f6d73d2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/util/ResultEffect.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.ResultEffect.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/util/enum.Either.html b/docs/apis/rust/0.7.0/mentat_core/util/enum.Either.html new file mode 100644 index 00000000..c1ebafa6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/util/enum.Either.html @@ -0,0 +1,160 @@ + + + + + + + + + + mentat_core::util::Either - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_core::util::Either + + [] + + [src]

pub enum Either<L, R> {
+    Left(L),
+    Right(R),
+}

+ Variants

+ +

+ Methods +

+

impl<L, R> Either<L, R>
[src]

+

+ Trait Implementations +

+
+

impl<L: Clone, R: Clone> Clone for Either<L, R>
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<L: Debug, R: Debug> Debug for Either<L, R>
[src]

Formats the value using the given formatter. Read more

+

impl<L: Eq, R: Eq> Eq for Either<L, R>
[src]

impl<L: Hash, R: Hash> Hash for Either<L, R>
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl<L: Ord, R: Ord> Ord for Either<L, R>
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<L: PartialOrd, R: PartialOrd> PartialOrd for Either<L, R>
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl<L: PartialEq, R: PartialEq> PartialEq for Either<L, R>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl<L, R> Send for Either<L, R> where
    L: Send,
    R: Send

impl<L, R> Sync for Either<L, R> where
    L: Sync,
    R: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/util/index.html b/docs/apis/rust/0.7.0/mentat_core/util/index.html new file mode 100644 index 00000000..4ad89538 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/util/index.html @@ -0,0 +1,151 @@ + + + + + + + + + + mentat_core::util - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_core::util + + [] + + [src]

Enums

+ + + + +
Either + +

Traits

+ + + + + + + + +
OptionEffect +

Side-effect chaining on Option.

+ +
ResultEffect +

Side-effect chaining on Result.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/util/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_core/util/sidebar-items.js new file mode 100644 index 00000000..913d3b78 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/util/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["Either",""]],"trait":[["OptionEffect","Side-effect chaining on `Option`."],["ResultEffect","Side-effect chaining on `Result`."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/util/trait.OptionEffect.html b/docs/apis/rust/0.7.0/mentat_core/util/trait.OptionEffect.html new file mode 100644 index 00000000..32ecc731 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/util/trait.OptionEffect.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::util::OptionEffect - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_core::util::OptionEffect + + [] + + [src]

pub trait OptionEffect<T> {
+    fn when_none<F: FnOnce()>(self, f: F) -> Self;
+
fn when_some<F: FnOnce()>(self, f: F) -> Self; +}

Side-effect chaining on Option.

+
+

+ Required Methods +

+
+

Invoke f if self is None, returning self.

+

Invoke f if self is Some, returning self.

+
+

+ Implementations on Foreign Types +

+

impl<T> OptionEffect<T> for Option<T>
[src]

+

+ Implementors +

+
    +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/util/trait.ResultEffect.html b/docs/apis/rust/0.7.0/mentat_core/util/trait.ResultEffect.html new file mode 100644 index 00000000..f64b36f5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/util/trait.ResultEffect.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::util::ResultEffect - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_core::util::ResultEffect + + [] + + [src]

pub trait ResultEffect<T> {
+    fn when_ok<F: FnOnce()>(self, f: F) -> Self;
+
fn when_err<F: FnOnce()>(self, f: F) -> Self; +}

Side-effect chaining on Result.

+
+

+ Required Methods +

+
+

Invoke f if self is Ok, returning self.

+

Invoke f if self is Err, returning self.

+
+

+ Implementations on Foreign Types +

+

impl<T, E> ResultEffect<T> for Result<T, E>
[src]

+

+ Implementors +

+
    +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/value_type_set/ValueTypeSet.t.html b/docs/apis/rust/0.7.0/mentat_core/value_type_set/ValueTypeSet.t.html new file mode 100644 index 00000000..0f4e8b21 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/value_type_set/ValueTypeSet.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ValueTypeSet.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/value_type_set/struct.ValueTypeSet.html b/docs/apis/rust/0.7.0/mentat_core/value_type_set/struct.ValueTypeSet.html new file mode 100644 index 00000000..974ead78 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/value_type_set/struct.ValueTypeSet.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_core/struct.ValueTypeSet.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_ADD.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_ADD.t.html new file mode 100644 index 00000000..64fc92fd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_ADD.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_ADD.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_ALTER_ATTRIBUTE.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_ALTER_ATTRIBUTE.t.html new file mode 100644 index 00000000..4b60733b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_ALTER_ATTRIBUTE.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_ALTER_ATTRIBUTE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_CARDINALITY.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_CARDINALITY.t.html new file mode 100644 index 00000000..356fef05 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_CARDINALITY.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_CARDINALITY.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_CARDINALITY_MANY.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_CARDINALITY_MANY.t.html new file mode 100644 index 00000000..cf13f149 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_CARDINALITY_MANY.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_CARDINALITY_MANY.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_CARDINALITY_ONE.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_CARDINALITY_ONE.t.html new file mode 100644 index 00000000..914001ee --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_CARDINALITY_ONE.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_CARDINALITY_ONE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_FULLTEXT.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_FULLTEXT.t.html new file mode 100644 index 00000000..8e4c75ae --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_FULLTEXT.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_FULLTEXT.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_IDENT.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_IDENT.t.html new file mode 100644 index 00000000..3298874e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_IDENT.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_IDENT.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_INDEX.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_INDEX.t.html new file mode 100644 index 00000000..b30a7f28 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_INDEX.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_INDEX.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_INSTALL_ATTRIBUTE.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_INSTALL_ATTRIBUTE.t.html new file mode 100644 index 00000000..55a07dc2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_INSTALL_ATTRIBUTE.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_INSTALL_ATTRIBUTE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_IS_COMPONENT.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_IS_COMPONENT.t.html new file mode 100644 index 00000000..49a18958 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_IS_COMPONENT.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_IS_COMPONENT.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_NO_HISTORY.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_NO_HISTORY.t.html new file mode 100644 index 00000000..1aaf01db --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_NO_HISTORY.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_NO_HISTORY.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_PART_DB.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_PART_DB.t.html new file mode 100644 index 00000000..496a26ef --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_PART_DB.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_PART_DB.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_RETRACT.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_RETRACT.t.html new file mode 100644 index 00000000..330e9d5d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_RETRACT.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_RETRACT.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_BOOLEAN.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_BOOLEAN.t.html new file mode 100644 index 00000000..740c5cbf --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_BOOLEAN.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_TYPE_BOOLEAN.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_DOUBLE.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_DOUBLE.t.html new file mode 100644 index 00000000..5245a511 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_DOUBLE.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_TYPE_DOUBLE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_INSTANT.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_INSTANT.t.html new file mode 100644 index 00000000..2992484d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_INSTANT.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_TYPE_INSTANT.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_KEYWORD.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_KEYWORD.t.html new file mode 100644 index 00000000..52759299 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_KEYWORD.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_TYPE_KEYWORD.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_LONG.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_LONG.t.html new file mode 100644 index 00000000..6942c541 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_LONG.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_TYPE_LONG.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_REF.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_REF.t.html new file mode 100644 index 00000000..aabdd506 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_REF.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_TYPE_REF.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_STRING.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_STRING.t.html new file mode 100644 index 00000000..2e1a930d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_STRING.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_TYPE_STRING.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_URI.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_URI.t.html new file mode 100644 index 00000000..825213da --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_URI.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_TYPE_URI.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_UUID.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_UUID.t.html new file mode 100644 index 00000000..f6b9c72a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_TYPE_UUID.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_TYPE_UUID.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_UNIQUE.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_UNIQUE.t.html new file mode 100644 index 00000000..998021dd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_UNIQUE.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_UNIQUE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_UNIQUE_IDENTITY.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_UNIQUE_IDENTITY.t.html new file mode 100644 index 00000000..d1d440b5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_UNIQUE_IDENTITY.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_UNIQUE_IDENTITY.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_UNIQUE_VALUE.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_UNIQUE_VALUE.t.html new file mode 100644 index 00000000..8eaa82d0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_UNIQUE_VALUE.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_UNIQUE_VALUE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/DB_VALUE_TYPE.t.html b/docs/apis/rust/0.7.0/mentat_core/values/DB_VALUE_TYPE.t.html new file mode 100644 index 00000000..158a902f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/DB_VALUE_TYPE.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB_VALUE_TYPE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/index.html b/docs/apis/rust/0.7.0/mentat_core/values/index.html new file mode 100644 index 00000000..9aab27a2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/index.html @@ -0,0 +1,309 @@ + + + + + + + + + + mentat_core::values - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_core::values + + [] + + [src]

Structs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DB_ADD + +
DB_ALTER_ATTRIBUTE + +
DB_CARDINALITY + +
DB_CARDINALITY_MANY + +
DB_CARDINALITY_ONE + +
DB_FULLTEXT + +
DB_IDENT + +
DB_INDEX + +
DB_INSTALL_ATTRIBUTE + +
DB_IS_COMPONENT + +
DB_NO_HISTORY + +
DB_PART_DB + +
DB_RETRACT + +
DB_TYPE_BOOLEAN + +
DB_TYPE_DOUBLE + +
DB_TYPE_INSTANT + +
DB_TYPE_KEYWORD + +
DB_TYPE_LONG + +
DB_TYPE_REF + +
DB_TYPE_STRING + +
DB_TYPE_URI + +
DB_TYPE_UUID + +
DB_UNIQUE + +
DB_UNIQUE_IDENTITY + +
DB_UNIQUE_VALUE + +
DB_VALUE_TYPE + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_core/values/sidebar-items.js new file mode 100644 index 00000000..0708ab4b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["DB_ADD",""],["DB_ALTER_ATTRIBUTE",""],["DB_CARDINALITY",""],["DB_CARDINALITY_MANY",""],["DB_CARDINALITY_ONE",""],["DB_FULLTEXT",""],["DB_IDENT",""],["DB_INDEX",""],["DB_INSTALL_ATTRIBUTE",""],["DB_IS_COMPONENT",""],["DB_NO_HISTORY",""],["DB_PART_DB",""],["DB_RETRACT",""],["DB_TYPE_BOOLEAN",""],["DB_TYPE_DOUBLE",""],["DB_TYPE_INSTANT",""],["DB_TYPE_KEYWORD",""],["DB_TYPE_LONG",""],["DB_TYPE_REF",""],["DB_TYPE_STRING",""],["DB_TYPE_URI",""],["DB_TYPE_UUID",""],["DB_UNIQUE",""],["DB_UNIQUE_IDENTITY",""],["DB_UNIQUE_VALUE",""],["DB_VALUE_TYPE",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_ADD.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_ADD.html new file mode 100644 index 00000000..ef145d03 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_ADD.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_ADD - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_ADD + + [] + +

pub struct DB_ADD { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_ADD

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_ADD

+

+ Auto Trait Implementations +

+
+

impl Send for DB_ADD

impl Sync for DB_ADD

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_ALTER_ATTRIBUTE.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_ALTER_ATTRIBUTE.html new file mode 100644 index 00000000..52936f87 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_ALTER_ATTRIBUTE.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_ALTER_ATTRIBUTE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_ALTER_ATTRIBUTE + + [] + +

pub struct DB_ALTER_ATTRIBUTE { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_ALTER_ATTRIBUTE

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_ALTER_ATTRIBUTE

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_CARDINALITY.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_CARDINALITY.html new file mode 100644 index 00000000..b35eca01 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_CARDINALITY.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_CARDINALITY - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_CARDINALITY + + [] + +

pub struct DB_CARDINALITY { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_CARDINALITY

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_CARDINALITY

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_CARDINALITY_MANY.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_CARDINALITY_MANY.html new file mode 100644 index 00000000..29550023 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_CARDINALITY_MANY.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_CARDINALITY_MANY - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_CARDINALITY_MANY + + [] + +

pub struct DB_CARDINALITY_MANY { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_CARDINALITY_MANY

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_CARDINALITY_MANY

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_CARDINALITY_ONE.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_CARDINALITY_ONE.html new file mode 100644 index 00000000..76ec3f82 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_CARDINALITY_ONE.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_CARDINALITY_ONE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_CARDINALITY_ONE + + [] + +

pub struct DB_CARDINALITY_ONE { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_CARDINALITY_ONE

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_CARDINALITY_ONE

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_FULLTEXT.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_FULLTEXT.html new file mode 100644 index 00000000..e2b4ad54 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_FULLTEXT.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_FULLTEXT - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_FULLTEXT + + [] + +

pub struct DB_FULLTEXT { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_FULLTEXT

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_FULLTEXT

+

+ Auto Trait Implementations +

+
+

impl Send for DB_FULLTEXT

impl Sync for DB_FULLTEXT

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_IDENT.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_IDENT.html new file mode 100644 index 00000000..f4c9fae3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_IDENT.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_IDENT - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_IDENT + + [] + +

pub struct DB_IDENT { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_IDENT

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_IDENT

+

+ Auto Trait Implementations +

+
+

impl Send for DB_IDENT

impl Sync for DB_IDENT

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_INDEX.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_INDEX.html new file mode 100644 index 00000000..8f35842b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_INDEX.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_INDEX - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_INDEX + + [] + +

pub struct DB_INDEX { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_INDEX

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_INDEX

+

+ Auto Trait Implementations +

+
+

impl Send for DB_INDEX

impl Sync for DB_INDEX

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_INSTALL_ATTRIBUTE.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_INSTALL_ATTRIBUTE.html new file mode 100644 index 00000000..4128ea24 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_INSTALL_ATTRIBUTE.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_INSTALL_ATTRIBUTE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_INSTALL_ATTRIBUTE + + [] + +

pub struct DB_INSTALL_ATTRIBUTE { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_INSTALL_ATTRIBUTE

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_INSTALL_ATTRIBUTE

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_IS_COMPONENT.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_IS_COMPONENT.html new file mode 100644 index 00000000..40631b8c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_IS_COMPONENT.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_IS_COMPONENT - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_IS_COMPONENT + + [] + +

pub struct DB_IS_COMPONENT { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_IS_COMPONENT

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_IS_COMPONENT

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_NO_HISTORY.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_NO_HISTORY.html new file mode 100644 index 00000000..12de187b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_NO_HISTORY.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_NO_HISTORY - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_NO_HISTORY + + [] + +

pub struct DB_NO_HISTORY { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_NO_HISTORY

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_NO_HISTORY

+

+ Auto Trait Implementations +

+
+

impl Send for DB_NO_HISTORY

impl Sync for DB_NO_HISTORY

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_PART_DB.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_PART_DB.html new file mode 100644 index 00000000..3dd6ea4f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_PART_DB.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_PART_DB - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_PART_DB + + [] + +

pub struct DB_PART_DB { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_PART_DB

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_PART_DB

+

+ Auto Trait Implementations +

+
+

impl Send for DB_PART_DB

impl Sync for DB_PART_DB

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_RETRACT.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_RETRACT.html new file mode 100644 index 00000000..de2cdab4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_RETRACT.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_RETRACT - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_RETRACT + + [] + +

pub struct DB_RETRACT { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_RETRACT

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_RETRACT

+

+ Auto Trait Implementations +

+
+

impl Send for DB_RETRACT

impl Sync for DB_RETRACT

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_BOOLEAN.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_BOOLEAN.html new file mode 100644 index 00000000..174f894a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_BOOLEAN.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_TYPE_BOOLEAN - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_TYPE_BOOLEAN + + [] + +

pub struct DB_TYPE_BOOLEAN { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_TYPE_BOOLEAN

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_TYPE_BOOLEAN

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_DOUBLE.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_DOUBLE.html new file mode 100644 index 00000000..85d49c12 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_DOUBLE.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_TYPE_DOUBLE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_TYPE_DOUBLE + + [] + +

pub struct DB_TYPE_DOUBLE { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_TYPE_DOUBLE

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_TYPE_DOUBLE

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_INSTANT.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_INSTANT.html new file mode 100644 index 00000000..ac58f8bb --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_INSTANT.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_TYPE_INSTANT - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_TYPE_INSTANT + + [] + +

pub struct DB_TYPE_INSTANT { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_TYPE_INSTANT

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_TYPE_INSTANT

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_KEYWORD.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_KEYWORD.html new file mode 100644 index 00000000..6afb0d7b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_KEYWORD.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_TYPE_KEYWORD - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_TYPE_KEYWORD + + [] + +

pub struct DB_TYPE_KEYWORD { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_TYPE_KEYWORD

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_TYPE_KEYWORD

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_LONG.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_LONG.html new file mode 100644 index 00000000..4a30c095 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_LONG.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_TYPE_LONG - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_TYPE_LONG + + [] + +

pub struct DB_TYPE_LONG { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_TYPE_LONG

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_TYPE_LONG

+

+ Auto Trait Implementations +

+
+

impl Send for DB_TYPE_LONG

impl Sync for DB_TYPE_LONG

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_REF.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_REF.html new file mode 100644 index 00000000..c074744c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_REF.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_TYPE_REF - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_TYPE_REF + + [] + +

pub struct DB_TYPE_REF { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_TYPE_REF

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_TYPE_REF

+

+ Auto Trait Implementations +

+
+

impl Send for DB_TYPE_REF

impl Sync for DB_TYPE_REF

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_STRING.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_STRING.html new file mode 100644 index 00000000..79e9a3c6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_STRING.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_TYPE_STRING - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_TYPE_STRING + + [] + +

pub struct DB_TYPE_STRING { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_TYPE_STRING

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_TYPE_STRING

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_URI.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_URI.html new file mode 100644 index 00000000..2f378bc1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_URI.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_TYPE_URI - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_TYPE_URI + + [] + +

pub struct DB_TYPE_URI { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_TYPE_URI

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_TYPE_URI

+

+ Auto Trait Implementations +

+
+

impl Send for DB_TYPE_URI

impl Sync for DB_TYPE_URI

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_UUID.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_UUID.html new file mode 100644 index 00000000..8a3b1aa5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_TYPE_UUID.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_TYPE_UUID - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_TYPE_UUID + + [] + +

pub struct DB_TYPE_UUID { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_TYPE_UUID

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_TYPE_UUID

+

+ Auto Trait Implementations +

+
+

impl Send for DB_TYPE_UUID

impl Sync for DB_TYPE_UUID

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_UNIQUE.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_UNIQUE.html new file mode 100644 index 00000000..d0aabef7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_UNIQUE.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_UNIQUE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_UNIQUE + + [] + +

pub struct DB_UNIQUE { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_UNIQUE

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_UNIQUE

+

+ Auto Trait Implementations +

+
+

impl Send for DB_UNIQUE

impl Sync for DB_UNIQUE

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_UNIQUE_IDENTITY.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_UNIQUE_IDENTITY.html new file mode 100644 index 00000000..5fdd97bf --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_UNIQUE_IDENTITY.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_UNIQUE_IDENTITY - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_UNIQUE_IDENTITY + + [] + +

pub struct DB_UNIQUE_IDENTITY { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_UNIQUE_IDENTITY

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_UNIQUE_IDENTITY

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_UNIQUE_VALUE.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_UNIQUE_VALUE.html new file mode 100644 index 00000000..0203de42 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_UNIQUE_VALUE.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_UNIQUE_VALUE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_UNIQUE_VALUE + + [] + +

pub struct DB_UNIQUE_VALUE { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_UNIQUE_VALUE

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_UNIQUE_VALUE

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_VALUE_TYPE.html b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_VALUE_TYPE.html new file mode 100644 index 00000000..39729f4c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_core/values/struct.DB_VALUE_TYPE.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_core::values::DB_VALUE_TYPE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_core::values::DB_VALUE_TYPE + + [] + +

pub struct DB_VALUE_TYPE { /* fields omitted */ }
+

+ Methods from __Deref<Target = Value> +

+

Return a pretty string representation of this Value.

+

Performs default pattern matching between this value and some pattern. +Returns true if matching succeeds.

+

as_nil does not use the macro as it does not have an underlying +value, and returns Option<()>.

+

+

+ Trait Implementations +

+
+

impl __Deref for DB_VALUE_TYPE

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for DB_VALUE_TYPE

+

+ Auto Trait Implementations +

+
+

impl Send for DB_VALUE_TYPE

impl Sync for DB_VALUE_TYPE

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/AttributeBuilder.t.html b/docs/apis/rust/0.7.0/mentat_db/AttributeBuilder.t.html new file mode 100644 index 00000000..29a7993b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/AttributeBuilder.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.AttributeBuilder.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/AttributeValidation.t.html b/docs/apis/rust/0.7.0/mentat_db/AttributeValidation.t.html new file mode 100644 index 00000000..50e9888e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/AttributeValidation.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.AttributeValidation.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/CORE_SCHEMA_VERSION.v.html b/docs/apis/rust/0.7.0/mentat_db/CORE_SCHEMA_VERSION.v.html new file mode 100644 index 00000000..0bacaf6c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/CORE_SCHEMA_VERSION.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.CORE_SCHEMA_VERSION.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/TX0.v.html b/docs/apis/rust/0.7.0/mentat_db/TX0.v.html new file mode 100644 index 00000000..79f7e818 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/TX0.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.TX0.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/TransactWatcher.t.html b/docs/apis/rust/0.7.0/mentat_db/TransactWatcher.t.html new file mode 100644 index 00000000..169886db --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/TransactWatcher.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.TransactWatcher.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/USER0.v.html b/docs/apis/rust/0.7.0/mentat_db/USER0.v.html new file mode 100644 index 00000000..765e50db --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/USER0.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.USER0.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/bail.m.html b/docs/apis/rust/0.7.0/mentat_db/bail.m.html new file mode 100644 index 00000000..6a9910ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/bail.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.bail.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/bootstrap/CORE_SCHEMA_VERSION.v.html b/docs/apis/rust/0.7.0/mentat_db/bootstrap/CORE_SCHEMA_VERSION.v.html new file mode 100644 index 00000000..0bacaf6c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/bootstrap/CORE_SCHEMA_VERSION.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.CORE_SCHEMA_VERSION.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/bootstrap/TX0.v.html b/docs/apis/rust/0.7.0/mentat_db/bootstrap/TX0.v.html new file mode 100644 index 00000000..79f7e818 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/bootstrap/TX0.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.TX0.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/bootstrap/USER0.v.html b/docs/apis/rust/0.7.0/mentat_db/bootstrap/USER0.v.html new file mode 100644 index 00000000..765e50db --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/bootstrap/USER0.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.USER0.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/bootstrap/constant.CORE_SCHEMA_VERSION.html b/docs/apis/rust/0.7.0/mentat_db/bootstrap/constant.CORE_SCHEMA_VERSION.html new file mode 100644 index 00000000..c3cbc3e1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/bootstrap/constant.CORE_SCHEMA_VERSION.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_db/constant.CORE_SCHEMA_VERSION.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/bootstrap/constant.TX0.html b/docs/apis/rust/0.7.0/mentat_db/bootstrap/constant.TX0.html new file mode 100644 index 00000000..331bd3e7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/bootstrap/constant.TX0.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_db/constant.TX0.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/bootstrap/constant.USER0.html b/docs/apis/rust/0.7.0/mentat_db/bootstrap/constant.USER0.html new file mode 100644 index 00000000..ff67cc3e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/bootstrap/constant.USER0.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_db/constant.USER0.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/Aev.t.html b/docs/apis/rust/0.7.0/mentat_db/cache/Aev.t.html new file mode 100644 index 00000000..cfd0d5ca --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/Aev.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Aev.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/AevFactory.t.html b/docs/apis/rust/0.7.0/mentat_db/cache/AevFactory.t.html new file mode 100644 index 00000000..8fa58ed4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/AevFactory.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.AevFactory.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/AevRows.t.html b/docs/apis/rust/0.7.0/mentat_db/cache/AevRows.t.html new file mode 100644 index 00000000..e2fd2444 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/AevRows.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.AevRows.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/AttributeCache.t.html b/docs/apis/rust/0.7.0/mentat_db/cache/AttributeCache.t.html new file mode 100644 index 00000000..a022bbe9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/AttributeCache.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.AttributeCache.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/AttributeCaches.t.html b/docs/apis/rust/0.7.0/mentat_db/cache/AttributeCaches.t.html new file mode 100644 index 00000000..5d41676c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/AttributeCaches.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.AttributeCaches.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/AttributeSpec.t.html b/docs/apis/rust/0.7.0/mentat_db/cache/AttributeSpec.t.html new file mode 100644 index 00000000..e15a01d7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/AttributeSpec.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.AttributeSpec.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/CacheMap.t.html b/docs/apis/rust/0.7.0/mentat_db/cache/CacheMap.t.html new file mode 100644 index 00000000..9e873267 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/CacheMap.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.CacheMap.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/InProgressCacheTransactWatcher.t.html b/docs/apis/rust/0.7.0/mentat_db/cache/InProgressCacheTransactWatcher.t.html new file mode 100644 index 00000000..000d3d89 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/InProgressCacheTransactWatcher.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.InProgressCacheTransactWatcher.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/InProgressSQLiteAttributeCache.t.html b/docs/apis/rust/0.7.0/mentat_db/cache/InProgressSQLiteAttributeCache.t.html new file mode 100644 index 00000000..fe8a0527 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/InProgressSQLiteAttributeCache.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.InProgressSQLiteAttributeCache.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/SQLiteAttributeCache.t.html b/docs/apis/rust/0.7.0/mentat_db/cache/SQLiteAttributeCache.t.html new file mode 100644 index 00000000..b2ec489b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/SQLiteAttributeCache.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.SQLiteAttributeCache.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/enum.AttributeSpec.html b/docs/apis/rust/0.7.0/mentat_db/cache/enum.AttributeSpec.html new file mode 100644 index 00000000..7bf9608b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/enum.AttributeSpec.html @@ -0,0 +1,152 @@ + + + + + + + + + + mentat_db::cache::AttributeSpec - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_db::cache::AttributeSpec + + [] + + [src]

pub enum AttributeSpec {
+    All,
+    Specified {
+        fts: Vec<Entid>,
+        non_fts: Vec<Entid>,
+    },
+}

+ Variants

+

Fields of Specified

+ +
+

+ Methods +

+

impl AttributeSpec
[src]

+

+ Trait Implementations +

+
+

impl Clone for AttributeSpec
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for AttributeSpec

impl Sync for AttributeSpec

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/index.html b/docs/apis/rust/0.7.0/mentat_db/cache/index.html new file mode 100644 index 00000000..e84df086 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/index.html @@ -0,0 +1,202 @@ + + + + + + + + + + mentat_db::cache - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_db::cache + + [] + + [src]

Structs

+ + + + + + + + + + + + + + + + + + + + + + + + +
AevFactory + +
AevRows + +
AttributeCaches + +
InProgressCacheTransactWatcher + +
InProgressSQLiteAttributeCache +

We maintain a diff on top of the inner -- existing -- cache. +That involves tracking unregisterings and registerings.

+ +
SQLiteAttributeCache + +

Enums

+ + + + +
AttributeSpec + +

Traits

+ + + + +
AttributeCache + +

Type Definitions

+ + + + + + + + +
Aev + +
CacheMap + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_db/cache/sidebar-items.js new file mode 100644 index 00000000..eb6516ab --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["AttributeSpec",""]],"struct":[["AevFactory",""],["AevRows",""],["AttributeCaches",""],["InProgressCacheTransactWatcher",""],["InProgressSQLiteAttributeCache","We maintain a diff on top of the `inner` -- existing -- cache. That involves tracking unregisterings and registerings."],["SQLiteAttributeCache",""]],"trait":[["AttributeCache",""]],"type":[["Aev",""],["CacheMap",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/struct.AevFactory.html b/docs/apis/rust/0.7.0/mentat_db/cache/struct.AevFactory.html new file mode 100644 index 00000000..e187f57c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/struct.AevFactory.html @@ -0,0 +1,136 @@ + + + + + + + + + + mentat_db::cache::AevFactory - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::cache::AevFactory + + [] + + [src]

pub struct AevFactory { /* fields omitted */ }
+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl Send for AevFactory

impl Sync for AevFactory

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/struct.AevRows.html b/docs/apis/rust/0.7.0/mentat_db/cache/struct.AevRows.html new file mode 100644 index 00000000..b7b46d8d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/struct.AevRows.html @@ -0,0 +1,195 @@ + + + + + + + + + + mentat_db::cache::AevRows - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::cache::AevRows + + [] + + [src]

pub struct AevRows<'conn, F> { /* fields omitted */ }
+

+ Trait Implementations +

+
+

impl<'conn, F> Iterator for AevRows<'conn, F> where
    F: FnMut(&Row) -> Aev
[src]

Unwrap the Result from MappedRows. We could also use this opportunity to map_err it, but +for now it's convenient to avoid error handling.

+

+

The type of the elements being iterated over.

+

Advances the iterator and returns the next value. Read more

+

Returns the bounds on the remaining length of the iterator. Read more

+

Consumes the iterator, counting the number of iterations and returning it. Read more

+

Consumes the iterator, returning the last element. Read more

+

Returns the nth element of the iterator. Read more

+

Important traits for StepBy<I>

🔬 This is a nightly-only experimental API. (iterator_step_by)

unstable replacement of Range::step_by

+

Creates an iterator starting at the same point, but stepping by the given amount at each iteration. Read more

+

Important traits for Chain<A, B>

Takes two iterators and creates a new iterator over both in sequence. Read more

+

Important traits for Zip<A, B>

'Zips up' two iterators into a single iterator of pairs. Read more

+

Important traits for Map<I, F>

Takes a closure and creates an iterator which calls that closure on each element. Read more

+

Calls a closure on each element of an iterator. Read more

+

Important traits for Filter<I, P>

Creates an iterator which uses a closure to determine if an element should be yielded. Read more

+

Important traits for FilterMap<I, F>

Creates an iterator that both filters and maps. Read more

+

Important traits for Enumerate<I>

Creates an iterator which gives the current iteration count as well as the next value. Read more

+

Important traits for Peekable<I>

Creates an iterator which can use peek to look at the next element of the iterator without consuming it. Read more

+

Important traits for SkipWhile<I, P>

Creates an iterator that [skip]s elements based on a predicate. Read more

+

Important traits for TakeWhile<I, P>

Creates an iterator that yields elements based on a predicate. Read more

+

Important traits for Skip<I>

Creates an iterator that skips the first n elements. Read more

+

Important traits for Take<I>

Creates an iterator that yields its first n elements. Read more

+

Important traits for Scan<I, St, F>

An iterator adaptor similar to [fold] that holds internal state and produces a new iterator. Read more

+

Important traits for FlatMap<I, U, F>

Creates an iterator that works like map, but flattens nested structure. Read more

+

Important traits for Flatten<I>

🔬 This is a nightly-only experimental API. (iterator_flatten)

Creates an iterator that flattens nested structure. Read more

+

Important traits for Fuse<I>

Creates an iterator which ends after the first [None]. Read more

+

Important traits for Inspect<I, F>

Do something with each element of an iterator, passing the value on. Read more

+

Important traits for &'a mut R

Borrows an iterator, rather than consuming it. Read more

+

Transforms an iterator into a collection. Read more

+

Consumes an iterator, creating two collections from it. Read more

+

🔬 This is a nightly-only experimental API. (iterator_try_fold)

An iterator method that applies a function as long as it returns successfully, producing a single, final value. Read more

+

🔬 This is a nightly-only experimental API. (iterator_try_fold)

An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. Read more

+

An iterator method that applies a function, producing a single, final value. Read more

+

Tests if every element of the iterator matches a predicate. Read more

+

Tests if any element of the iterator matches a predicate. Read more

+

Searches for an element of an iterator that satisfies a predicate. Read more

+

Searches for an element in an iterator, returning its index. Read more

+

Searches for an element in an iterator from the right, returning its index. Read more

+

Returns the maximum element of an iterator. Read more

+

Returns the minimum element of an iterator. Read more

+

Returns the element that gives the maximum value from the specified function. Read more

+

Returns the element that gives the maximum value with respect to the specified comparison function. Read more

+

Returns the element that gives the minimum value from the specified function. Read more

+

Returns the element that gives the minimum value with respect to the specified comparison function. Read more

+

Important traits for Rev<I>

Reverses an iterator's direction. Read more

+

Converts an iterator of pairs into a pair of containers. Read more

+

Important traits for Cloned<I>

Creates an iterator which [clone]s all of its elements. Read more

+

Important traits for Cycle<I>

Repeats an iterator endlessly. Read more

+

Sums the elements of an iterator. Read more

+

Iterates over the entire iterator, multiplying all the elements Read more

+

Lexicographically compares the elements of this Iterator with those of another. Read more

+

Lexicographically compares the elements of this Iterator with those of another. Read more

+

Determines if the elements of this Iterator are equal to those of another. Read more

+

Determines if the elements of this Iterator are unequal to those of another. Read more

+

Determines if the elements of this Iterator are lexicographically less than those of another. Read more

+

Determines if the elements of this Iterator are lexicographically less or equal to those of another. Read more

+

Determines if the elements of this Iterator are lexicographically greater than those of another. Read more

+

Determines if the elements of this Iterator are lexicographically greater than or equal to those of another. Read more

+
+

+ Auto Trait Implementations +

+
+

impl<'conn, F> !Send for AevRows<'conn, F>

impl<'conn, F> !Sync for AevRows<'conn, F>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/struct.AttributeCaches.html b/docs/apis/rust/0.7.0/mentat_db/cache/struct.AttributeCaches.html new file mode 100644 index 00000000..b76c5c3d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/struct.AttributeCaches.html @@ -0,0 +1,153 @@ + + + + + + + + + + mentat_db::cache::AttributeCaches - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::cache::AttributeCaches + + [] + + [src]

pub struct AttributeCaches { /* fields omitted */ }
+

+ Methods +

+

impl AttributeCaches
[src]

impl AttributeCaches
[src]

Return a reference to the cache for the provided a, if a names an attribute that is +cached in the forward direction. If a doesn't name an attribute, or it's not cached at +all, or it's only cached in reverse (v to e, not e to v), None is returned.

+

Fetch the requested entities and attributes from the store and put them in the cache. +The caller is responsible for ensuring that entities is unique. +Attributes for which every entity is already cached will not be processed again.

+

Fetch the requested entities and attributes and put them in a new cache. +The caller is responsible for ensuring that entities is unique.

+
+

+ Trait Implementations +

+
+

impl Clone for AttributeCaches
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for AttributeCaches
[src]

Formats the value using the given formatter. Read more

+

impl Default for AttributeCaches
[src]

Returns the "default value" for a type. Read more

+

impl CachedAttributes for AttributeCaches
[src]

Reverse lookup.

+

impl UpdateableCache for AttributeCaches
[src]

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/struct.InProgressCacheTransactWatcher.html b/docs/apis/rust/0.7.0/mentat_db/cache/struct.InProgressCacheTransactWatcher.html new file mode 100644 index 00000000..a9107d98 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/struct.InProgressCacheTransactWatcher.html @@ -0,0 +1,137 @@ + + + + + + + + + + mentat_db::cache::InProgressCacheTransactWatcher - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::cache::InProgressCacheTransactWatcher + + [] + + [src]

pub struct InProgressCacheTransactWatcher<'a> { /* fields omitted */ }
+

+ Trait Implementations +

+
+

impl<'a> TransactWatcher for InProgressCacheTransactWatcher<'a>
[src]

Only return an error if you want to interrupt the transact! Called with the schema prior to the transact -- any attributes or attribute changes transacted during this transact are not reflected in the schema. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/struct.InProgressSQLiteAttributeCache.html b/docs/apis/rust/0.7.0/mentat_db/cache/struct.InProgressSQLiteAttributeCache.html new file mode 100644 index 00000000..acf3fff3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/struct.InProgressSQLiteAttributeCache.html @@ -0,0 +1,155 @@ + + + + + + + + + + mentat_db::cache::InProgressSQLiteAttributeCache - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::cache::InProgressSQLiteAttributeCache + + [] + + [src]

pub struct InProgressSQLiteAttributeCache {
+    pub overlay: AttributeCaches,
+    // some fields omitted
+}

We maintain a diff on top of the inner -- existing -- cache. +That involves tracking unregisterings and registerings.

+

+ Fields

+ + +

+ Methods +

+

impl InProgressSQLiteAttributeCache
[src]

impl InProgressSQLiteAttributeCache
[src]

Intended for use from tests.

+

Intended for use from tests.

+

impl InProgressSQLiteAttributeCache
[src]

+

+ Trait Implementations +

+
+

impl Debug for InProgressSQLiteAttributeCache
[src]

Formats the value using the given formatter. Read more

+

impl Default for InProgressSQLiteAttributeCache
[src]

Returns the "default value" for a type. Read more

+

impl UpdateableCache for InProgressSQLiteAttributeCache
[src]

impl CachedAttributes for InProgressSQLiteAttributeCache
[src]

Reverse lookup.

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/struct.SQLiteAttributeCache.html b/docs/apis/rust/0.7.0/mentat_db/cache/struct.SQLiteAttributeCache.html new file mode 100644 index 00000000..c00daab6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/struct.SQLiteAttributeCache.html @@ -0,0 +1,147 @@ + + + + + + + + + + mentat_db::cache::SQLiteAttributeCache - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::cache::SQLiteAttributeCache + + [] + + [src]

pub struct SQLiteAttributeCache { /* fields omitted */ }
+

+ Methods +

+

impl SQLiteAttributeCache
[src]

impl SQLiteAttributeCache
[src]

Intended for use from tests.

+

Intended for use from tests.

+
+

+ Trait Implementations +

+
+

impl Clone for SQLiteAttributeCache
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for SQLiteAttributeCache
[src]

Formats the value using the given formatter. Read more

+

impl Default for SQLiteAttributeCache
[src]

Returns the "default value" for a type. Read more

+

impl UpdateableCache for SQLiteAttributeCache
[src]

impl CachedAttributes for SQLiteAttributeCache
[src]

Reverse lookup.

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/trait.AttributeCache.html b/docs/apis/rust/0.7.0/mentat_db/cache/trait.AttributeCache.html new file mode 100644 index 00000000..cad7fcf6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/trait.AttributeCache.html @@ -0,0 +1,141 @@ + + + + + + + + + + mentat_db::cache::AttributeCache - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_db::cache::AttributeCache + + [] + + [src]

pub trait AttributeCache {
+    fn has_e(&self, e: Entid) -> bool;
+
fn binding_for_e(&self, e: Entid) -> Option<Binding>; +}
+

+ Required Methods +

+
+

+

+ Implementors +

+
    +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/type.Aev.html b/docs/apis/rust/0.7.0/mentat_db/cache/type.Aev.html new file mode 100644 index 00000000..fdfe0bac --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/type.Aev.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::cache::Aev - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::cache::Aev + + [] + + [src]

type Aev = (Entid, Entid, TypedValue);
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/cache/type.CacheMap.html b/docs/apis/rust/0.7.0/mentat_db/cache/type.CacheMap.html new file mode 100644 index 00000000..6f613bb5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/cache/type.CacheMap.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::cache::CacheMap - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::cache::CacheMap + + [] + + [src]

type CacheMap<K, V> = BTreeMap<K, V>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/constant.CORE_SCHEMA_VERSION.html b/docs/apis/rust/0.7.0/mentat_db/constant.CORE_SCHEMA_VERSION.html new file mode 100644 index 00000000..a1b1939e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/constant.CORE_SCHEMA_VERSION.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::CORE_SCHEMA_VERSION - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::CORE_SCHEMA_VERSION + + [] + + [src]

pub const CORE_SCHEMA_VERSION: u32 = 1
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/constant.TX0.html b/docs/apis/rust/0.7.0/mentat_db/constant.TX0.html new file mode 100644 index 00000000..3c78fcd8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/constant.TX0.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_db::TX0 - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::TX0 + + [] + + [src]

pub const TX0: i64 = 268435456

The first transaction ID applied to the knowledge base.

+

This is the start of the :db.part/tx partition.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/constant.USER0.html b/docs/apis/rust/0.7.0/mentat_db/constant.USER0.html new file mode 100644 index 00000000..caee6700 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/constant.USER0.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_db::USER0 - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::USER0 + + [] + + [src]

pub const USER0: i64 = 65536

This is the start of the :db.part/user partition.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/CURRENT_VERSION.v.html b/docs/apis/rust/0.7.0/mentat_db/db/CURRENT_VERSION.v.html new file mode 100644 index 00000000..ec0b7072 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/CURRENT_VERSION.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.CURRENT_VERSION.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/MentatStoring.t.html b/docs/apis/rust/0.7.0/mentat_db/db/MentatStoring.t.html new file mode 100644 index 00000000..e68a88bf --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/MentatStoring.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.MentatStoring.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/PartitionMapping.t.html b/docs/apis/rust/0.7.0/mentat_db/db/PartitionMapping.t.html new file mode 100644 index 00000000..19bf3ef1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/PartitionMapping.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.PartitionMapping.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/ReducedEntity.t.html b/docs/apis/rust/0.7.0/mentat_db/db/ReducedEntity.t.html new file mode 100644 index 00000000..801c77f0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/ReducedEntity.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.ReducedEntity.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/SearchType.t.html b/docs/apis/rust/0.7.0/mentat_db/db/SearchType.t.html new file mode 100644 index 00000000..e96416e2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/SearchType.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.SearchType.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/TypedSQLValue.t.html b/docs/apis/rust/0.7.0/mentat_db/db/TypedSQLValue.t.html new file mode 100644 index 00000000..71ab9a12 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/TypedSQLValue.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.TypedSQLValue.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/constant.CURRENT_VERSION.html b/docs/apis/rust/0.7.0/mentat_db/db/constant.CURRENT_VERSION.html new file mode 100644 index 00000000..70ba42f9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/constant.CURRENT_VERSION.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_db::db::CURRENT_VERSION - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::db::CURRENT_VERSION + + [] + + [src]

pub const CURRENT_VERSION: i32 = 1

Version history:

+

1: initial Rust Mentat schema.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/create_current_version.v.html b/docs/apis/rust/0.7.0/mentat_db/db/create_current_version.v.html new file mode 100644 index 00000000..507f8dcd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/create_current_version.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.create_current_version.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/create_empty_current_version.v.html b/docs/apis/rust/0.7.0/mentat_db/db/create_empty_current_version.v.html new file mode 100644 index 00000000..fc79c26e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/create_empty_current_version.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.create_empty_current_version.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/ensure_current_version.v.html b/docs/apis/rust/0.7.0/mentat_db/db/ensure_current_version.v.html new file mode 100644 index 00000000..055267f7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/ensure_current_version.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.ensure_current_version.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/enum.SearchType.html b/docs/apis/rust/0.7.0/mentat_db/db/enum.SearchType.html new file mode 100644 index 00000000..6cdac953 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/enum.SearchType.html @@ -0,0 +1,156 @@ + + + + + + + + + + mentat_db::db::SearchType - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_db::db::SearchType + + [] + + [src]

pub enum SearchType {
+    Exact,
+    Inexact,
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Clone for SearchType
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for SearchType
[src]

Formats the value using the given formatter. Read more

+

impl Eq for SearchType
[src]

impl Hash for SearchType
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for SearchType
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for SearchType
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for SearchType
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for SearchType

impl Sync for SearchType

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/fn.create_current_version.html b/docs/apis/rust/0.7.0/mentat_db/db/fn.create_current_version.html new file mode 100644 index 00000000..231f135c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/fn.create_current_version.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::db::create_current_version - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_db::db::create_current_version + + [] + + [src]

pub fn create_current_version(conn: &mut Connection) -> Result<DB>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/fn.create_empty_current_version.html b/docs/apis/rust/0.7.0/mentat_db/db/fn.create_empty_current_version.html new file mode 100644 index 00000000..3ab43691 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/fn.create_empty_current_version.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_db::db::create_empty_current_version - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_db::db::create_empty_current_version + + [] + + [src]

pub fn create_empty_current_version(
    conn: &mut Connection
) -> Result<(Transaction, DB)>

Do just enough work that either create_current_version or sync can populate the DB.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/fn.ensure_current_version.html b/docs/apis/rust/0.7.0/mentat_db/db/fn.ensure_current_version.html new file mode 100644 index 00000000..7f003b80 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/fn.ensure_current_version.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::db::ensure_current_version - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_db::db::ensure_current_version + + [] + + [src]

pub fn ensure_current_version(conn: &mut Connection) -> Result<DB>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/fn.new_connection.html b/docs/apis/rust/0.7.0/mentat_db/db/fn.new_connection.html new file mode 100644 index 00000000..e067637b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/fn.new_connection.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::db::new_connection - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_db::db::new_connection + + [] + + [src]

pub fn new_connection<T>(uri: T) -> Result<Connection> where
    T: AsRef<Path>, 
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/fn.read_db.html b/docs/apis/rust/0.7.0/mentat_db/db/fn.read_db.html new file mode 100644 index 00000000..e6c0bcf0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/fn.read_db.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_db::db::read_db - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_db::db::read_db + + [] + + [src]

pub fn read_db(conn: &Connection) -> Result<DB>

Read the materialized views from the given SQL store and return a Mentat DB for querying and +applying transactions.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/fn.update_metadata.html b/docs/apis/rust/0.7.0/mentat_db/db/fn.update_metadata.html new file mode 100644 index 00000000..33eb400e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/fn.update_metadata.html @@ -0,0 +1,129 @@ + + + + + + + + + + mentat_db::db::update_metadata - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_db::db::update_metadata + + [] + + [src]

pub fn update_metadata(
    conn: &Connection,
    _old_schema: &Schema,
    new_schema: &Schema,
    metadata_report: &MetadataReport
) -> Result<()>

Update the metadata materialized views based on the given metadata report.

+

This updates the "entids", "idents", and "schema" materialized views, copying directly from the +"datoms" and "transactions" table as appropriate.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/fn.update_partition_map.html b/docs/apis/rust/0.7.0/mentat_db/db/fn.update_partition_map.html new file mode 100644 index 00000000..38119347 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/fn.update_partition_map.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_db::db::update_partition_map - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_db::db::update_partition_map + + [] + + [src]

pub fn update_partition_map(
    conn: &Connection,
    partition_map: &PartitionMap
) -> Result<()>

Update the current partition map materialized view.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/index.html b/docs/apis/rust/0.7.0/mentat_db/db/index.html new file mode 100644 index 00000000..5619ad71 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/index.html @@ -0,0 +1,231 @@ + + + + + + + + + + mentat_db::db - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_db::db + + [] + + [src]

Enums

+ + + + +
SearchType + +

Constants

+ + + + +
CURRENT_VERSION +

Version history:

+ +

Traits

+ + + + + + + + + + + + +
MentatStoring +

MentatStoring will be the trait that encapsulates the storage layer. It is consumed by the +transaction processing layer.

+ +
PartitionMapping + +
TypedSQLValue + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
create_current_version + +
create_empty_current_version +

Do just enough work that either create_current_version or sync can populate the DB.

+ +
ensure_current_version + +
new_connection + +
read_db +

Read the materialized views from the given SQL store and return a Mentat DB for querying and +applying transactions.

+ +
update_metadata +

Update the metadata materialized views based on the given metadata report.

+ +
update_partition_map +

Update the current partition map materialized view.

+ +

Type Definitions

+ + + + +
ReducedEntity +

Internal representation of an [e a v added] datom, ready to be transacted against the store.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/new_connection.v.html b/docs/apis/rust/0.7.0/mentat_db/db/new_connection.v.html new file mode 100644 index 00000000..b4f28b0a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/new_connection.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.new_connection.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/read_db.v.html b/docs/apis/rust/0.7.0/mentat_db/db/read_db.v.html new file mode 100644 index 00000000..3e8a1c4e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/read_db.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.read_db.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_db/db/sidebar-items.js new file mode 100644 index 00000000..f7d0e393 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"constant":[["CURRENT_VERSION","Version history:"]],"enum":[["SearchType",""]],"fn":[["create_current_version",""],["create_empty_current_version","Do just enough work that either `create_current_version` or sync can populate the DB."],["ensure_current_version",""],["new_connection",""],["read_db","Read the materialized views from the given SQL store and return a Mentat `DB` for querying and applying transactions."],["update_metadata","Update the metadata materialized views based on the given metadata report."],["update_partition_map","Update the current partition map materialized view."]],"trait":[["MentatStoring","`MentatStoring` will be the trait that encapsulates the storage layer. It is consumed by the transaction processing layer."],["PartitionMapping",""],["TypedSQLValue",""]],"type":[["ReducedEntity","Internal representation of an [e a v added] datom, ready to be transacted against the store."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/trait.MentatStoring.html b/docs/apis/rust/0.7.0/mentat_db/db/trait.MentatStoring.html new file mode 100644 index 00000000..09f3cb4a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/trait.MentatStoring.html @@ -0,0 +1,174 @@ + + + + + + + + + + mentat_db::db::MentatStoring - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_db::db::MentatStoring + + [] + + [src]

pub trait MentatStoring {
+    fn resolve_avs<'a>(&self, avs: &'a [&'a AVPair]) -> Result<AVMap<'a>>;
+
fn begin_tx_application(&self) -> Result<()>; +
fn insert_non_fts_searches<'a>(
        &self,
        entities: &'a [ReducedEntity],
        search_type: SearchType
    ) -> Result<()>; +
fn insert_fts_searches<'a>(
        &self,
        entities: &'a [ReducedEntity],
        search_type: SearchType
    ) -> Result<()>; +
fn commit_transaction(&self, tx_id: Entid) -> Result<()>; +
fn committed_metadata_assertions(
        &self,
        tx_id: Entid
    ) -> Result<Vec<(Entid, Entid, TypedValue, bool)>>; +}

MentatStoring will be the trait that encapsulates the storage layer. It is consumed by the +transaction processing layer.

+

Right now, the only implementation of MentatStoring is the SQLite-specific SQL schema. In the +future, we might consider other SQL engines (perhaps with different fulltext indexing), or +entirely different data stores, say ones shaped like key-value stores.

+
+

+ Required Methods +

+
+

Given a slice of [a v] lookup-refs, look up the corresponding [e a v] triples.

+

It is assumed that the attribute a in each lookup-ref is :db/unique, so that at most one +matching [e a v] triple exists. (If this is not true, some matching entid e will be +chosen non-deterministically, if one exists.)

+

Returns a map &(a, v) -> e, to avoid cloning potentially large values. The keys of the map +are exactly those (a, v) pairs that have an assertion [e a v] in the store.

+

Begin (or prepare) the underlying storage layer for a new Mentat transaction.

+

Use this to create temporary tables, prepare indices, set pragmas, etc, before the initial +insert_non_fts_searches invocation.

+

Finalize the underlying storage layer after a Mentat transaction.

+

Use this to finalize temporary tables, complete indices, revert pragmas, etc, after the +final insert_non_fts_searches invocation.

+

Extract metadata-related [e a typed_value added] datoms committed in the given transaction.

+
+

+ Implementations on Foreign Types +

+

impl MentatStoring for Connection
[src]

Create empty temporary tables for search parameters and search results.

+

Insert search rows into temporary search tables.

+

Eventually, the details of this approach will be captured in +https://github.com/mozilla/mentat/wiki/Transacting:-entity-to-SQL-translation.

+

Insert search rows into temporary search tables.

+

Eventually, the details of this approach will be captured in +https://github.com/mozilla/mentat/wiki/Transacting:-entity-to-SQL-translation.

+

+

+ Implementors +

+
    +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/trait.PartitionMapping.html b/docs/apis/rust/0.7.0/mentat_db/db/trait.PartitionMapping.html new file mode 100644 index 00000000..09232a5d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/trait.PartitionMapping.html @@ -0,0 +1,143 @@ + + + + + + + + + + mentat_db::db::PartitionMapping - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_db::db::PartitionMapping + + [] + + [src]

pub trait PartitionMapping {
+    fn allocate_entid<S: ?Sized + Ord + Display>(
        &mut self,
        partition: &S
    ) -> i64
    where
        String: Borrow<S>
; +
fn allocate_entids<S: ?Sized + Ord + Display>(
        &mut self,
        partition: &S,
        n: usize
    ) -> Range<i64>
    where
        String: Borrow<S>
; +
fn contains_entid(&self, entid: Entid) -> bool; +}
+

+ Required Methods +

+
+

Important traits for Range<A>

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/trait.TypedSQLValue.html b/docs/apis/rust/0.7.0/mentat_db/db/trait.TypedSQLValue.html new file mode 100644 index 00000000..530d5ae0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/trait.TypedSQLValue.html @@ -0,0 +1,144 @@ + + + + + + + + + + mentat_db::db::TypedSQLValue - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_db::db::TypedSQLValue + + [] + + [src]

pub trait TypedSQLValue {
+    fn from_sql_value_pair(
        value: Value,
        value_type_tag: i32
    ) -> Result<TypedValue>; +
fn to_sql_value_pair<'a>(&'a self) -> (ToSqlOutput<'a>, i32); +
fn from_edn_value(value: &Value) -> Option<TypedValue>; +
fn to_edn_value_pair(&self) -> (Value, ValueType); +}
+

+ Required Methods +

+
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/type.ReducedEntity.html b/docs/apis/rust/0.7.0/mentat_db/db/type.ReducedEntity.html new file mode 100644 index 00000000..cfa17e70 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/type.ReducedEntity.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_db::db::ReducedEntity - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::db::ReducedEntity + + [] + + [src]

type ReducedEntity<'a> = (Entid, Entid, &'a Attribute, TypedValue, bool);

Internal representation of an [e a v added] datom, ready to be transacted against the store.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/update_metadata.v.html b/docs/apis/rust/0.7.0/mentat_db/db/update_metadata.v.html new file mode 100644 index 00000000..3b5c3cc2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/update_metadata.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.update_metadata.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/db/update_partition_map.v.html b/docs/apis/rust/0.7.0/mentat_db/db/update_partition_map.v.html new file mode 100644 index 00000000..1be19857 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/db/update_partition_map.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.update_partition_map.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/debug/index.html b/docs/apis/rust/0.7.0/mentat_db/debug/index.html new file mode 100644 index 00000000..7b7eeb7a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/debug/index.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::debug - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_db::debug + + [] + + [src]

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/debug/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_db/debug/sidebar-items.js new file mode 100644 index 00000000..48333d31 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/debug/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_ADD.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_ADD.v.html new file mode 100644 index 00000000..8bd7e48d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_ADD.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_ADD.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_ALTER_ATTRIBUTE.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_ALTER_ATTRIBUTE.v.html new file mode 100644 index 00000000..bc000001 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_ALTER_ATTRIBUTE.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_ALTER_ATTRIBUTE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_CARDINALITY.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_CARDINALITY.v.html new file mode 100644 index 00000000..e37644d1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_CARDINALITY.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_CARDINALITY.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_CARDINALITY_MANY.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_CARDINALITY_MANY.v.html new file mode 100644 index 00000000..5c100123 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_CARDINALITY_MANY.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_CARDINALITY_MANY.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_CARDINALITY_ONE.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_CARDINALITY_ONE.v.html new file mode 100644 index 00000000..bf5f1d39 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_CARDINALITY_ONE.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_CARDINALITY_ONE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_DOC.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_DOC.v.html new file mode 100644 index 00000000..59da2f4e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_DOC.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_DOC.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_EXCISE.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_EXCISE.v.html new file mode 100644 index 00000000..45b3b70a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_EXCISE.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_EXCISE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_EXCISE_ATTRS.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_EXCISE_ATTRS.v.html new file mode 100644 index 00000000..141b59bc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_EXCISE_ATTRS.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_EXCISE_ATTRS.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_EXCISE_BEFORE.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_EXCISE_BEFORE.v.html new file mode 100644 index 00000000..d592efff --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_EXCISE_BEFORE.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_EXCISE_BEFORE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_EXCISE_BEFORE_T.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_EXCISE_BEFORE_T.v.html new file mode 100644 index 00000000..25ae6049 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_EXCISE_BEFORE_T.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_EXCISE_BEFORE_T.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_FULLTEXT.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_FULLTEXT.v.html new file mode 100644 index 00000000..cce5fb05 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_FULLTEXT.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_FULLTEXT.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_IDENT.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_IDENT.v.html new file mode 100644 index 00000000..492a4c5b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_IDENT.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_IDENT.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_INDEX.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_INDEX.v.html new file mode 100644 index 00000000..480a520d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_INDEX.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_INDEX.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_INSTALL_ATTRIBUTE.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_INSTALL_ATTRIBUTE.v.html new file mode 100644 index 00000000..cca55210 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_INSTALL_ATTRIBUTE.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_INSTALL_ATTRIBUTE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_INSTALL_PARTITION.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_INSTALL_PARTITION.v.html new file mode 100644 index 00000000..1a821bbe --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_INSTALL_PARTITION.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_INSTALL_PARTITION.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_INSTALL_VALUE_TYPE.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_INSTALL_VALUE_TYPE.v.html new file mode 100644 index 00000000..6c93ecfb --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_INSTALL_VALUE_TYPE.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_INSTALL_VALUE_TYPE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_IS_COMPONENT.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_IS_COMPONENT.v.html new file mode 100644 index 00000000..0ba5e3a8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_IS_COMPONENT.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_IS_COMPONENT.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_NO_HISTORY.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_NO_HISTORY.v.html new file mode 100644 index 00000000..0f6b65b8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_NO_HISTORY.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_NO_HISTORY.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_PART_DB.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_PART_DB.v.html new file mode 100644 index 00000000..c119d432 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_PART_DB.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_PART_DB.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_PART_TX.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_PART_TX.v.html new file mode 100644 index 00000000..47d7d5ce --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_PART_TX.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_PART_TX.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_PART_USER.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_PART_USER.v.html new file mode 100644 index 00000000..8a532dc6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_PART_USER.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_PART_USER.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_RETRACT.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_RETRACT.v.html new file mode 100644 index 00000000..d5627547 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_RETRACT.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_RETRACT.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_SCHEMA_ATTRIBUTE.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_SCHEMA_ATTRIBUTE.v.html new file mode 100644 index 00000000..67f2dd1c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_SCHEMA_ATTRIBUTE.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_SCHEMA_ATTRIBUTE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_SCHEMA_CORE.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_SCHEMA_CORE.v.html new file mode 100644 index 00000000..2845e186 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_SCHEMA_CORE.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_SCHEMA_CORE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_SCHEMA_VERSION.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_SCHEMA_VERSION.v.html new file mode 100644 index 00000000..39f49d33 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_SCHEMA_VERSION.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_SCHEMA_VERSION.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_TX_INSTANT.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TX_INSTANT.v.html new file mode 100644 index 00000000..6f1ed07b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TX_INSTANT.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_TX_INSTANT.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_BOOLEAN.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_BOOLEAN.v.html new file mode 100644 index 00000000..05528441 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_BOOLEAN.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_TYPE_BOOLEAN.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_BYTES.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_BYTES.v.html new file mode 100644 index 00000000..dfb639c4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_BYTES.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_TYPE_BYTES.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_DOUBLE.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_DOUBLE.v.html new file mode 100644 index 00000000..25878ebc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_DOUBLE.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_TYPE_DOUBLE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_INSTANT.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_INSTANT.v.html new file mode 100644 index 00000000..b6de05f9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_INSTANT.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_TYPE_INSTANT.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_KEYWORD.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_KEYWORD.v.html new file mode 100644 index 00000000..7a76eeed --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_KEYWORD.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_TYPE_KEYWORD.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_LONG.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_LONG.v.html new file mode 100644 index 00000000..cd68c3fd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_LONG.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_TYPE_LONG.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_REF.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_REF.v.html new file mode 100644 index 00000000..04dead6f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_REF.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_TYPE_REF.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_STRING.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_STRING.v.html new file mode 100644 index 00000000..4fae70d7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_STRING.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_TYPE_STRING.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_URI.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_URI.v.html new file mode 100644 index 00000000..49bb2419 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_URI.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_TYPE_URI.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_UUID.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_UUID.v.html new file mode 100644 index 00000000..6bd6c9a4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_TYPE_UUID.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_TYPE_UUID.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_UNIQUE.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_UNIQUE.v.html new file mode 100644 index 00000000..d4ee004c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_UNIQUE.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_UNIQUE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_UNIQUE_IDENTITY.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_UNIQUE_IDENTITY.v.html new file mode 100644 index 00000000..496d45b9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_UNIQUE_IDENTITY.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_UNIQUE_IDENTITY.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_UNIQUE_VALUE.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_UNIQUE_VALUE.v.html new file mode 100644 index 00000000..f4e7343c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_UNIQUE_VALUE.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_UNIQUE_VALUE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/DB_VALUE_TYPE.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/DB_VALUE_TYPE.v.html new file mode 100644 index 00000000..e6296bb3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/DB_VALUE_TYPE.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to constant.DB_VALUE_TYPE.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/IDENTS_SQL_LIST.t.html b/docs/apis/rust/0.7.0/mentat_db/entids/IDENTS_SQL_LIST.t.html new file mode 100644 index 00000000..150c12d1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/IDENTS_SQL_LIST.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.IDENTS_SQL_LIST.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/METADATA_SQL_LIST.t.html b/docs/apis/rust/0.7.0/mentat_db/entids/METADATA_SQL_LIST.t.html new file mode 100644 index 00000000..e90d1884 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/METADATA_SQL_LIST.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.METADATA_SQL_LIST.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/SCHEMA_SQL_LIST.t.html b/docs/apis/rust/0.7.0/mentat_db/entids/SCHEMA_SQL_LIST.t.html new file mode 100644 index 00000000..1672d9d1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/SCHEMA_SQL_LIST.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.SCHEMA_SQL_LIST.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_ADD.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_ADD.html new file mode 100644 index 00000000..9a093d29 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_ADD.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_ADD - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_ADD + + [] + + [src]

pub const DB_ADD: Entid = 14
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_ALTER_ATTRIBUTE.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_ALTER_ATTRIBUTE.html new file mode 100644 index 00000000..04863631 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_ALTER_ATTRIBUTE.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_ALTER_ATTRIBUTE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_ALTER_ATTRIBUTE + + [] + + [src]

pub const DB_ALTER_ATTRIBUTE: Entid = 22
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_CARDINALITY.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_CARDINALITY.html new file mode 100644 index 00000000..872cccc5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_CARDINALITY.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_CARDINALITY - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_CARDINALITY + + [] + + [src]

pub const DB_CARDINALITY: Entid = 8
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_CARDINALITY_MANY.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_CARDINALITY_MANY.html new file mode 100644 index 00000000..e2673dac --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_CARDINALITY_MANY.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_CARDINALITY_MANY - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_CARDINALITY_MANY + + [] + + [src]

pub const DB_CARDINALITY_MANY: Entid = 34
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_CARDINALITY_ONE.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_CARDINALITY_ONE.html new file mode 100644 index 00000000..c5fda8d8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_CARDINALITY_ONE.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_CARDINALITY_ONE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_CARDINALITY_ONE + + [] + + [src]

pub const DB_CARDINALITY_ONE: Entid = 33
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_DOC.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_DOC.html new file mode 100644 index 00000000..eaa0c4dc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_DOC.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_DOC - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_DOC + + [] + + [src]

pub const DB_DOC: Entid = 37
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_EXCISE.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_EXCISE.html new file mode 100644 index 00000000..373be2eb --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_EXCISE.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_EXCISE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_EXCISE + + [] + + [src]

pub const DB_EXCISE: Entid = 18
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_EXCISE_ATTRS.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_EXCISE_ATTRS.html new file mode 100644 index 00000000..3638b9aa --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_EXCISE_ATTRS.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_EXCISE_ATTRS - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_EXCISE_ATTRS + + [] + + [src]

pub const DB_EXCISE_ATTRS: Entid = 19
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_EXCISE_BEFORE.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_EXCISE_BEFORE.html new file mode 100644 index 00000000..0261a4a1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_EXCISE_BEFORE.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_EXCISE_BEFORE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_EXCISE_BEFORE + + [] + + [src]

pub const DB_EXCISE_BEFORE: Entid = 21
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_EXCISE_BEFORE_T.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_EXCISE_BEFORE_T.html new file mode 100644 index 00000000..f71f3407 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_EXCISE_BEFORE_T.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_EXCISE_BEFORE_T - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_EXCISE_BEFORE_T + + [] + + [src]

pub const DB_EXCISE_BEFORE_T: Entid = 20
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_FULLTEXT.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_FULLTEXT.html new file mode 100644 index 00000000..a60f3dd7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_FULLTEXT.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_FULLTEXT - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_FULLTEXT + + [] + + [src]

pub const DB_FULLTEXT: Entid = 12
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_IDENT.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_IDENT.html new file mode 100644 index 00000000..bd7a6553 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_IDENT.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_IDENT - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_IDENT + + [] + + [src]

pub const DB_IDENT: Entid = 1
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_INDEX.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_INDEX.html new file mode 100644 index 00000000..d8cc37b0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_INDEX.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_INDEX - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_INDEX + + [] + + [src]

pub const DB_INDEX: Entid = 11
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_INSTALL_ATTRIBUTE.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_INSTALL_ATTRIBUTE.html new file mode 100644 index 00000000..0facaa65 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_INSTALL_ATTRIBUTE.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_INSTALL_ATTRIBUTE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_INSTALL_ATTRIBUTE + + [] + + [src]

pub const DB_INSTALL_ATTRIBUTE: Entid = 6
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_INSTALL_PARTITION.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_INSTALL_PARTITION.html new file mode 100644 index 00000000..e43e0d10 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_INSTALL_PARTITION.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_INSTALL_PARTITION - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_INSTALL_PARTITION + + [] + + [src]

pub const DB_INSTALL_PARTITION: Entid = 4
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_INSTALL_VALUE_TYPE.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_INSTALL_VALUE_TYPE.html new file mode 100644 index 00000000..faea7ea4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_INSTALL_VALUE_TYPE.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_INSTALL_VALUE_TYPE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_INSTALL_VALUE_TYPE + + [] + + [src]

pub const DB_INSTALL_VALUE_TYPE: Entid = 5
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_IS_COMPONENT.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_IS_COMPONENT.html new file mode 100644 index 00000000..a893dabe --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_IS_COMPONENT.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_IS_COMPONENT - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_IS_COMPONENT + + [] + + [src]

pub const DB_IS_COMPONENT: Entid = 10
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_NO_HISTORY.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_NO_HISTORY.html new file mode 100644 index 00000000..088b2788 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_NO_HISTORY.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_NO_HISTORY - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_NO_HISTORY + + [] + + [src]

pub const DB_NO_HISTORY: Entid = 13
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_PART_DB.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_PART_DB.html new file mode 100644 index 00000000..ec8d5a60 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_PART_DB.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_PART_DB - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_PART_DB + + [] + + [src]

pub const DB_PART_DB: Entid = 2
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_PART_TX.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_PART_TX.html new file mode 100644 index 00000000..ed09d60c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_PART_TX.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_PART_TX - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_PART_TX + + [] + + [src]

pub const DB_PART_TX: Entid = 17
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_PART_USER.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_PART_USER.html new file mode 100644 index 00000000..56abb65a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_PART_USER.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_PART_USER - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_PART_USER + + [] + + [src]

pub const DB_PART_USER: Entid = 16
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_RETRACT.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_RETRACT.html new file mode 100644 index 00000000..0cde409f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_RETRACT.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_RETRACT - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_RETRACT + + [] + + [src]

pub const DB_RETRACT: Entid = 15
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_SCHEMA_ATTRIBUTE.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_SCHEMA_ATTRIBUTE.html new file mode 100644 index 00000000..7cf7d6ed --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_SCHEMA_ATTRIBUTE.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_SCHEMA_ATTRIBUTE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_SCHEMA_ATTRIBUTE + + [] + + [src]

pub const DB_SCHEMA_ATTRIBUTE: Entid = 39
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_SCHEMA_CORE.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_SCHEMA_CORE.html new file mode 100644 index 00000000..f7413a49 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_SCHEMA_CORE.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_SCHEMA_CORE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_SCHEMA_CORE + + [] + + [src]

pub const DB_SCHEMA_CORE: Entid = 40
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_SCHEMA_VERSION.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_SCHEMA_VERSION.html new file mode 100644 index 00000000..7c3ab294 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_SCHEMA_VERSION.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_SCHEMA_VERSION - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_SCHEMA_VERSION + + [] + + [src]

pub const DB_SCHEMA_VERSION: Entid = 38
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TX_INSTANT.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TX_INSTANT.html new file mode 100644 index 00000000..60e495ff --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TX_INSTANT.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_TX_INSTANT - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_TX_INSTANT + + [] + + [src]

pub const DB_TX_INSTANT: Entid = 3
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_BOOLEAN.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_BOOLEAN.html new file mode 100644 index 00000000..e25a7b8f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_BOOLEAN.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_TYPE_BOOLEAN - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_TYPE_BOOLEAN + + [] + + [src]

pub const DB_TYPE_BOOLEAN: Entid = 30
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_BYTES.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_BYTES.html new file mode 100644 index 00000000..74293dae --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_BYTES.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_TYPE_BYTES - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_TYPE_BYTES + + [] + + [src]

pub const DB_TYPE_BYTES: Entid = 32
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_DOUBLE.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_DOUBLE.html new file mode 100644 index 00000000..26d9bd82 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_DOUBLE.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_TYPE_DOUBLE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_TYPE_DOUBLE + + [] + + [src]

pub const DB_TYPE_DOUBLE: Entid = 26
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_INSTANT.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_INSTANT.html new file mode 100644 index 00000000..2520f882 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_INSTANT.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_TYPE_INSTANT - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_TYPE_INSTANT + + [] + + [src]

pub const DB_TYPE_INSTANT: Entid = 31
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_KEYWORD.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_KEYWORD.html new file mode 100644 index 00000000..cdb5550c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_KEYWORD.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_TYPE_KEYWORD - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_TYPE_KEYWORD + + [] + + [src]

pub const DB_TYPE_KEYWORD: Entid = 24
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_LONG.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_LONG.html new file mode 100644 index 00000000..adb66a17 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_LONG.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_TYPE_LONG - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_TYPE_LONG + + [] + + [src]

pub const DB_TYPE_LONG: Entid = 25
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_REF.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_REF.html new file mode 100644 index 00000000..1514c54b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_REF.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_TYPE_REF - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_TYPE_REF + + [] + + [src]

pub const DB_TYPE_REF: Entid = 23
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_STRING.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_STRING.html new file mode 100644 index 00000000..e2395705 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_STRING.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_TYPE_STRING - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_TYPE_STRING + + [] + + [src]

pub const DB_TYPE_STRING: Entid = 27
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_URI.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_URI.html new file mode 100644 index 00000000..bf302fa5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_URI.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_TYPE_URI - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_TYPE_URI + + [] + + [src]

pub const DB_TYPE_URI: Entid = 29
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_UUID.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_UUID.html new file mode 100644 index 00000000..35d257a5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_TYPE_UUID.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_TYPE_UUID - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_TYPE_UUID + + [] + + [src]

pub const DB_TYPE_UUID: Entid = 28
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_UNIQUE.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_UNIQUE.html new file mode 100644 index 00000000..621ecb17 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_UNIQUE.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_UNIQUE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_UNIQUE + + [] + + [src]

pub const DB_UNIQUE: Entid = 9
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_UNIQUE_IDENTITY.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_UNIQUE_IDENTITY.html new file mode 100644 index 00000000..0b0f6116 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_UNIQUE_IDENTITY.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_UNIQUE_IDENTITY - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_UNIQUE_IDENTITY + + [] + + [src]

pub const DB_UNIQUE_IDENTITY: Entid = 36
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_UNIQUE_VALUE.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_UNIQUE_VALUE.html new file mode 100644 index 00000000..82a70b11 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_UNIQUE_VALUE.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_UNIQUE_VALUE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_UNIQUE_VALUE + + [] + + [src]

pub const DB_UNIQUE_VALUE: Entid = 35
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_VALUE_TYPE.html b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_VALUE_TYPE.html new file mode 100644 index 00000000..2dcc48e8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/constant.DB_VALUE_TYPE.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::entids::DB_VALUE_TYPE - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Constant mentat_db::entids::DB_VALUE_TYPE + + [] + + [src]

pub const DB_VALUE_TYPE: Entid = 7
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/fn.might_update_metadata.html b/docs/apis/rust/0.7.0/mentat_db/entids/fn.might_update_metadata.html new file mode 100644 index 00000000..9ba279b3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/fn.might_update_metadata.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_db::entids::might_update_metadata - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_db::entids::might_update_metadata + + [] + + [src]

pub fn might_update_metadata(attribute: Entid) -> bool

Return false if the given attribute will not change the metadata: recognized idents, schema, +partitions in the partition map.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/index.html b/docs/apis/rust/0.7.0/mentat_db/entids/index.html new file mode 100644 index 00000000..5186c7d8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/index.html @@ -0,0 +1,442 @@ + + + + + + + + + + mentat_db::entids - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_db::entids + + [] + + [src]

Structs

+ + + + + + + + + + + + +
IDENTS_SQL_LIST +

Attributes that are "ident related". These might change the "idents" materialized view.

+ +
METADATA_SQL_LIST +

Attributes that are "metadata" related. These might change one of the materialized views.

+ +
SCHEMA_SQL_LIST +

Attributes that are "schema related". These might change the "schema" materialized view.

+ +

Constants

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DB_ADD + +
DB_ALTER_ATTRIBUTE + +
DB_CARDINALITY + +
DB_CARDINALITY_MANY + +
DB_CARDINALITY_ONE + +
DB_DOC + +
DB_EXCISE + +
DB_EXCISE_ATTRS + +
DB_EXCISE_BEFORE + +
DB_EXCISE_BEFORE_T + +
DB_FULLTEXT + +
DB_IDENT + +
DB_INDEX + +
DB_INSTALL_ATTRIBUTE + +
DB_INSTALL_PARTITION + +
DB_INSTALL_VALUE_TYPE + +
DB_IS_COMPONENT + +
DB_NO_HISTORY + +
DB_PART_DB + +
DB_PART_TX + +
DB_PART_USER + +
DB_RETRACT + +
DB_SCHEMA_ATTRIBUTE + +
DB_SCHEMA_CORE + +
DB_SCHEMA_VERSION + +
DB_TX_INSTANT + +
DB_TYPE_BOOLEAN + +
DB_TYPE_BYTES + +
DB_TYPE_DOUBLE + +
DB_TYPE_INSTANT + +
DB_TYPE_KEYWORD + +
DB_TYPE_LONG + +
DB_TYPE_REF + +
DB_TYPE_STRING + +
DB_TYPE_URI + +
DB_TYPE_UUID + +
DB_UNIQUE + +
DB_UNIQUE_IDENTITY + +
DB_UNIQUE_VALUE + +
DB_VALUE_TYPE + +

Functions

+ + + + +
might_update_metadata +

Return false if the given attribute will not change the metadata: recognized idents, schema, +partitions in the partition map.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/might_update_metadata.v.html b/docs/apis/rust/0.7.0/mentat_db/entids/might_update_metadata.v.html new file mode 100644 index 00000000..73383b87 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/might_update_metadata.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.might_update_metadata.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_db/entids/sidebar-items.js new file mode 100644 index 00000000..e64566df --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"constant":[["DB_ADD",""],["DB_ALTER_ATTRIBUTE",""],["DB_CARDINALITY",""],["DB_CARDINALITY_MANY",""],["DB_CARDINALITY_ONE",""],["DB_DOC",""],["DB_EXCISE",""],["DB_EXCISE_ATTRS",""],["DB_EXCISE_BEFORE",""],["DB_EXCISE_BEFORE_T",""],["DB_FULLTEXT",""],["DB_IDENT",""],["DB_INDEX",""],["DB_INSTALL_ATTRIBUTE",""],["DB_INSTALL_PARTITION",""],["DB_INSTALL_VALUE_TYPE",""],["DB_IS_COMPONENT",""],["DB_NO_HISTORY",""],["DB_PART_DB",""],["DB_PART_TX",""],["DB_PART_USER",""],["DB_RETRACT",""],["DB_SCHEMA_ATTRIBUTE",""],["DB_SCHEMA_CORE",""],["DB_SCHEMA_VERSION",""],["DB_TX_INSTANT",""],["DB_TYPE_BOOLEAN",""],["DB_TYPE_BYTES",""],["DB_TYPE_DOUBLE",""],["DB_TYPE_INSTANT",""],["DB_TYPE_KEYWORD",""],["DB_TYPE_LONG",""],["DB_TYPE_REF",""],["DB_TYPE_STRING",""],["DB_TYPE_URI",""],["DB_TYPE_UUID",""],["DB_UNIQUE",""],["DB_UNIQUE_IDENTITY",""],["DB_UNIQUE_VALUE",""],["DB_VALUE_TYPE",""]],"fn":[["might_update_metadata","Return `false` if the given attribute will not change the metadata: recognized idents, schema, partitions in the partition map."]],"struct":[["IDENTS_SQL_LIST","Attributes that are \"ident related\". These might change the \"idents\" materialized view."],["METADATA_SQL_LIST","Attributes that are \"metadata\" related. These might change one of the materialized views."],["SCHEMA_SQL_LIST","Attributes that are \"schema related\". These might change the \"schema\" materialized view."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/struct.IDENTS_SQL_LIST.html b/docs/apis/rust/0.7.0/mentat_db/entids/struct.IDENTS_SQL_LIST.html new file mode 100644 index 00000000..cb7bdc94 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/struct.IDENTS_SQL_LIST.html @@ -0,0 +1,188 @@ + + + + + + + + + + mentat_db::entids::IDENTS_SQL_LIST - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::entids::IDENTS_SQL_LIST + + [] + +

pub struct IDENTS_SQL_LIST { /* fields omitted */ }

Attributes that are "ident related". These might change the "idents" materialized view.

+
+

+ Methods from __Deref<Target = String> +

+

Extracts a string slice containing the entire string.

+

Examples

+

Basic usage:

+ +
+let s = String::from("foo");
+
+assert_eq!("foo", s.as_str());
+

Returns this String's capacity, in bytes.

+

Examples

+

Basic usage:

+ +
+let s = String::with_capacity(10);
+
+assert!(s.capacity() >= 10);
+

Important traits for &'a [u8]

Returns a byte slice of this String's contents.

+

The inverse of this method is from_utf8.

+

Examples

+

Basic usage:

+ +
+let s = String::from("hello");
+
+assert_eq!(&[104, 101, 108, 108, 111], s.as_bytes());
+

Returns the length of this String, in bytes.

+

Examples

+

Basic usage:

+ +
+let a = String::from("foo");
+
+assert_eq!(a.len(), 3);
+

Returns true if this String has a length of zero.

+

Returns false otherwise.

+

Examples

+

Basic usage:

+ +
+let mut v = String::new();
+assert!(v.is_empty());
+
+v.push('a');
+assert!(!v.is_empty());
+
+

+ Trait Implementations +

+
+

impl __Deref for IDENTS_SQL_LIST

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for IDENTS_SQL_LIST

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/struct.METADATA_SQL_LIST.html b/docs/apis/rust/0.7.0/mentat_db/entids/struct.METADATA_SQL_LIST.html new file mode 100644 index 00000000..bd09393a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/struct.METADATA_SQL_LIST.html @@ -0,0 +1,188 @@ + + + + + + + + + + mentat_db::entids::METADATA_SQL_LIST - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::entids::METADATA_SQL_LIST + + [] + +

pub struct METADATA_SQL_LIST { /* fields omitted */ }

Attributes that are "metadata" related. These might change one of the materialized views.

+
+

+ Methods from __Deref<Target = String> +

+

Extracts a string slice containing the entire string.

+

Examples

+

Basic usage:

+ +
+let s = String::from("foo");
+
+assert_eq!("foo", s.as_str());
+

Returns this String's capacity, in bytes.

+

Examples

+

Basic usage:

+ +
+let s = String::with_capacity(10);
+
+assert!(s.capacity() >= 10);
+

Important traits for &'a [u8]

Returns a byte slice of this String's contents.

+

The inverse of this method is from_utf8.

+

Examples

+

Basic usage:

+ +
+let s = String::from("hello");
+
+assert_eq!(&[104, 101, 108, 108, 111], s.as_bytes());
+

Returns the length of this String, in bytes.

+

Examples

+

Basic usage:

+ +
+let a = String::from("foo");
+
+assert_eq!(a.len(), 3);
+

Returns true if this String has a length of zero.

+

Returns false otherwise.

+

Examples

+

Basic usage:

+ +
+let mut v = String::new();
+assert!(v.is_empty());
+
+v.push('a');
+assert!(!v.is_empty());
+
+

+ Trait Implementations +

+
+

impl __Deref for METADATA_SQL_LIST

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for METADATA_SQL_LIST

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/entids/struct.SCHEMA_SQL_LIST.html b/docs/apis/rust/0.7.0/mentat_db/entids/struct.SCHEMA_SQL_LIST.html new file mode 100644 index 00000000..4e51d8fb --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/entids/struct.SCHEMA_SQL_LIST.html @@ -0,0 +1,188 @@ + + + + + + + + + + mentat_db::entids::SCHEMA_SQL_LIST - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::entids::SCHEMA_SQL_LIST + + [] + +

pub struct SCHEMA_SQL_LIST { /* fields omitted */ }

Attributes that are "schema related". These might change the "schema" materialized view.

+
+

+ Methods from __Deref<Target = String> +

+

Extracts a string slice containing the entire string.

+

Examples

+

Basic usage:

+ +
+let s = String::from("foo");
+
+assert_eq!("foo", s.as_str());
+

Returns this String's capacity, in bytes.

+

Examples

+

Basic usage:

+ +
+let s = String::with_capacity(10);
+
+assert!(s.capacity() >= 10);
+

Important traits for &'a [u8]

Returns a byte slice of this String's contents.

+

The inverse of this method is from_utf8.

+

Examples

+

Basic usage:

+ +
+let s = String::from("hello");
+
+assert_eq!(&[104, 101, 108, 108, 111], s.as_bytes());
+

Returns the length of this String, in bytes.

+

Examples

+

Basic usage:

+ +
+let a = String::from("foo");
+
+assert_eq!(a.len(), 3);
+

Returns true if this String has a length of zero.

+

Returns false otherwise.

+

Examples

+

Basic usage:

+ +
+let mut v = String::new();
+assert!(v.is_empty());
+
+v.push('a');
+assert!(!v.is_empty());
+
+

+ Trait Implementations +

+
+

impl __Deref for SCHEMA_SQL_LIST

+

The resulting type after dereferencing.

+

Dereferences the value.

+

impl LazyStatic for SCHEMA_SQL_LIST

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/errors/CardinalityConflict.t.html b/docs/apis/rust/0.7.0/mentat_db/errors/CardinalityConflict.t.html new file mode 100644 index 00000000..0b887133 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/errors/CardinalityConflict.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.CardinalityConflict.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/errors/DbError.t.html b/docs/apis/rust/0.7.0/mentat_db/errors/DbError.t.html new file mode 100644 index 00000000..1cabb89b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/errors/DbError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.DbError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/errors/DbSqlError.t.html b/docs/apis/rust/0.7.0/mentat_db/errors/DbSqlError.t.html new file mode 100644 index 00000000..e503d5ab --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/errors/DbSqlError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DbSqlError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/errors/DbSqlErrorKind.t.html b/docs/apis/rust/0.7.0/mentat_db/errors/DbSqlErrorKind.t.html new file mode 100644 index 00000000..23f3121f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/errors/DbSqlErrorKind.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.DbSqlErrorKind.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/errors/InputError.t.html b/docs/apis/rust/0.7.0/mentat_db/errors/InputError.t.html new file mode 100644 index 00000000..adb4b491 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/errors/InputError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.InputError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/errors/Result.t.html b/docs/apis/rust/0.7.0/mentat_db/errors/Result.t.html new file mode 100644 index 00000000..865910f9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/errors/Result.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Result.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/errors/SchemaConstraintViolation.t.html b/docs/apis/rust/0.7.0/mentat_db/errors/SchemaConstraintViolation.t.html new file mode 100644 index 00000000..a3b8e5f7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/errors/SchemaConstraintViolation.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.SchemaConstraintViolation.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/errors/enum.CardinalityConflict.html b/docs/apis/rust/0.7.0/mentat_db/errors/enum.CardinalityConflict.html new file mode 100644 index 00000000..342d8d33 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/errors/enum.CardinalityConflict.html @@ -0,0 +1,160 @@ + + + + + + + + + + mentat_db::errors::CardinalityConflict - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_db::errors::CardinalityConflict + + [] + + [src]

pub enum CardinalityConflict {
+    CardinalityOneAddConflict {
+        e: Entid,
+        a: Entid,
+        vs: BTreeSet<TypedValue>,
+    },
+    AddRetractConflict {
+        e: Entid,
+        a: Entid,
+        vs: BTreeSet<TypedValue>,
+    },
+}

+ Variants

+

A cardinality one attribute has multiple assertions [e a v1], [e a v2], ....

+

Fields of CardinalityOneAddConflict

+ +

A datom has been both asserted and retracted, like [:db/add e a v] and [:db/retract e a v].

+

Fields of AddRetractConflict

+ +
+

+ Trait Implementations +

+
+

impl Clone for CardinalityConflict
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for CardinalityConflict
[src]

Formats the value using the given formatter. Read more

+

impl Eq for CardinalityConflict
[src]

impl PartialEq for CardinalityConflict
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/errors/enum.DbError.html b/docs/apis/rust/0.7.0/mentat_db/errors/enum.DbError.html new file mode 100644 index 00000000..756b6714 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/errors/enum.DbError.html @@ -0,0 +1,175 @@ + + + + + + + + + + mentat_db::errors::DbError - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_db::errors::DbError + + [] + + [src]

pub enum DbError {
+    NotYetImplemented(String),
+    BadValuePair(StringValueType),
+    BadSQLValuePair(Value, i32),
+    BadBootstrapDefinition(String),
+    BadSchemaAssertion(String),
+    UnrecognizedIdent(String),
+    UnrecognizedEntid(Entid),
+    UnknownAttribute(Entid),
+    CannotCacheNonUniqueAttributeInReverse(Entid),
+    SchemaAlterationFailed(String),
+    SchemaConstraintViolation(SchemaConstraintViolation),
+    InputError(InputError),
+    WrongTypeValueForFtsAssertion,
+}

+ Variants

+

We're just not done yet. Message that the feature is recognized but not yet +implemented.

+

We've been given a value that isn't the correct Mentat type.

+

We've got corrupt data in the SQL store: a value and value_type_tag don't line up. +TODO _1.data_type()

+

A bootstrap definition couldn't be parsed or installed. This is a programmer error, not +a runtime error.

+

A schema assertion couldn't be parsed.

+

An ident->entid mapping failed.

+

An entid->ident mapping failed. +We also use this error if you try to transact an entid that we didn't allocate, +in part because we blow the stack in error_chain if we define a new enum!

+

A transaction tried to violate a constraint of the schema of the Mentat store.

+

The transaction was malformed in some way (that was not recognized at parse time; for +example, in a way that is schema-dependent).

+
+

+ Trait Implementations +

+
+

impl Debug for DbError
[src]

Formats the value using the given formatter. Read more

+

impl Fail for DbError
[src]

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

+

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

+

Provides context for this failure. Read more

+

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

+

Important traits for Causes<'f>

Returns a iterator over the causes of this Fail with itself as the first item and the root_cause as the final item. Read more

+

Returns the "root cause" of this Fail - the last value in the cause chain which does not return an underlying cause. Read more

+

impl Display for DbError
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for DbError

impl Sync for DbError

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/errors/enum.DbSqlErrorKind.html b/docs/apis/rust/0.7.0/mentat_db/errors/enum.DbSqlErrorKind.html new file mode 100644 index 00000000..974fb3e3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/errors/enum.DbSqlErrorKind.html @@ -0,0 +1,165 @@ + + + + + + + + + + mentat_db::errors::DbSqlErrorKind - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_db::errors::DbSqlErrorKind + + [] + + [src]

pub enum DbSqlErrorKind {
+    CouldNotSetVersionPragma,
+    CouldNotGetVersionPragma,
+    CouldNotSearch,
+    TxInsertFailedToAddMissingDatoms,
+    TxInsertFailedToRetractDatoms,
+    DatomsUpdateFailedToRetract,
+    DatomsUpdateFailedToAdd,
+    FailedToCreateTempTables,
+    NonFtsInsertionIntoTempSearchTableFailed,
+    FtsInsertionFailed,
+    FtsInsertionIntoTempSearchTableFailed,
+    FtsFailedToDropSearchIds,
+    FailedToUpdatePartitionMap,
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl From<DbSqlErrorKind> for DbSqlError
[src]

Performs the conversion.

+

impl Copy for DbSqlErrorKind
[src]

impl Clone for DbSqlErrorKind
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Eq for DbSqlErrorKind
[src]

impl PartialEq for DbSqlErrorKind
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for DbSqlErrorKind
[src]

Formats the value using the given formatter. Read more

+

impl Fail for DbSqlErrorKind
[src]

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

+

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

+

Provides context for this failure. Read more

+

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

+

Important traits for Causes<'f>

Returns a iterator over the causes of this Fail with itself as the first item and the root_cause as the final item. Read more

+

Returns the "root cause" of this Fail - the last value in the cause chain which does not return an underlying cause. Read more

+

impl Display for DbSqlErrorKind
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/errors/enum.InputError.html b/docs/apis/rust/0.7.0/mentat_db/errors/enum.InputError.html new file mode 100644 index 00000000..245505eb --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/errors/enum.InputError.html @@ -0,0 +1,150 @@ + + + + + + + + + + mentat_db::errors::InputError - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_db::errors::InputError + + [] + + [src]

pub enum InputError {
+    BadDbId,
+    BadEntityPlace,
+}

+ Variants

+

Map notation included a bad :db/id value.

+

A value place cannot be interpreted as an entity place (for example, in nested map +notation).

+
+

+ Trait Implementations +

+
+

impl Clone for InputError
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for InputError
[src]

Formats the value using the given formatter. Read more

+

impl Eq for InputError
[src]

impl PartialEq for InputError
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for InputError
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for InputError

impl Sync for InputError

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/errors/enum.SchemaConstraintViolation.html b/docs/apis/rust/0.7.0/mentat_db/errors/enum.SchemaConstraintViolation.html new file mode 100644 index 00000000..f4568681 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/errors/enum.SchemaConstraintViolation.html @@ -0,0 +1,176 @@ + + + + + + + + + + mentat_db::errors::SchemaConstraintViolation - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_db::errors::SchemaConstraintViolation + + [] + + [src]

pub enum SchemaConstraintViolation {
+    ConflictingUpserts {
+        conflicting_upserts: BTreeMap<TempId, BTreeSet<KnownEntid>>,
+    },
+    TypeDisagreements {
+        conflicting_datoms: BTreeMap<(Entid, Entid, TypedValue), ValueType>,
+    },
+    CardinalityConflicts {
+        conflicts: Vec<CardinalityConflict>,
+    },
+}

+ Variants

+

A transaction tried to assert datoms where one tempid upserts to two (or more) distinct +entids.

+

Fields of ConflictingUpserts

+ +

A map from tempid to the entids it would upsert to.

+

In the future, we might even be able to attribute the upserts to particular (reduced) +datoms, i.e., to particular [e a v] triples that caused the constraint violation. +Attributing constraint violations to input data is more difficult to the multiple +rewriting passes the input undergoes.

+

A transaction tried to assert a datom or datoms with the wrong value v type(s).

+

Fields of TypeDisagreements

+ +

The key ([e a v]) has an invalid value v: it is not of the expected value type.

+

A transaction tried to assert datoms that don't observe the schema's cardinality constraints.

+

Fields of CardinalityConflicts

+ +
+

+ Trait Implementations +

+
+

impl Clone for SchemaConstraintViolation
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for SchemaConstraintViolation
[src]

Formats the value using the given formatter. Read more

+

impl Eq for SchemaConstraintViolation
[src]

impl PartialEq for SchemaConstraintViolation
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Fail for SchemaConstraintViolation
[src]

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

+

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

+

Provides context for this failure. Read more

+

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

+

Important traits for Causes<'f>

Returns a iterator over the causes of this Fail with itself as the first item and the root_cause as the final item. Read more

+

Returns the "root cause" of this Fail - the last value in the cause chain which does not return an underlying cause. Read more

+

impl Display for SchemaConstraintViolation
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/errors/index.html b/docs/apis/rust/0.7.0/mentat_db/errors/index.html new file mode 100644 index 00000000..2336a1f2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/errors/index.html @@ -0,0 +1,178 @@ + + + + + + + + + + mentat_db::errors - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_db::errors + + [] + + [src]

Structs

+ + + + +
DbSqlError + +

Enums

+ + + + + + + + + + + + + + + + + + + + +
CardinalityConflict + +
DbError + +
DbSqlErrorKind + +
InputError + +
SchemaConstraintViolation + +

Type Definitions

+ + + + +
Result + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/errors/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_db/errors/sidebar-items.js new file mode 100644 index 00000000..c88e0c88 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/errors/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["CardinalityConflict",""],["DbError",""],["DbSqlErrorKind",""],["InputError",""],["SchemaConstraintViolation",""]],"struct":[["DbSqlError",""]],"type":[["Result",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/errors/struct.DbSqlError.html b/docs/apis/rust/0.7.0/mentat_db/errors/struct.DbSqlError.html new file mode 100644 index 00000000..0eefe9eb --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/errors/struct.DbSqlError.html @@ -0,0 +1,150 @@ + + + + + + + + + + mentat_db::errors::DbSqlError - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::errors::DbSqlError + + [] + + [src]

pub struct DbSqlError { /* fields omitted */ }
+

+ Methods +

+

impl DbSqlError
[src]

+

+ Trait Implementations +

+
+

impl Debug for DbSqlError
[src]

Formats the value using the given formatter. Read more

+

impl Fail for DbSqlError
[src]

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

+

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

+

Provides context for this failure. Read more

+

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

+

Important traits for Causes<'f>

Returns a iterator over the causes of this Fail with itself as the first item and the root_cause as the final item. Read more

+

Returns the "root cause" of this Fail - the last value in the cause chain which does not return an underlying cause. Read more

+

impl Display for DbSqlError
[src]

Formats the value using the given formatter. Read more

+

impl From<DbSqlErrorKind> for DbSqlError
[src]

Performs the conversion.

+

impl From<Context<DbSqlErrorKind>> for DbSqlError
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl Send for DbSqlError

impl Sync for DbSqlError

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/errors/type.Result.html b/docs/apis/rust/0.7.0/mentat_db/errors/type.Result.html new file mode 100644 index 00000000..5b2c13ff --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/errors/type.Result.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::errors::Result - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::errors::Result + + [] + + [src]

type Result<T> = Result<T, Error>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/fn.repeat_values.html b/docs/apis/rust/0.7.0/mentat_db/fn.repeat_values.html new file mode 100644 index 00000000..14442d8a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/fn.repeat_values.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_db::repeat_values - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_db::repeat_values + + [] + + [src]

pub fn repeat_values(values_per_tuple: usize, tuples: usize) -> String

Prepare an SQL VALUES block, like (?, ?, ?), (?, ?, ?).

+

The number of values per tuple determines (?, ?, ?). The number of tuples determines (...), (...).

+

Examples

+
+assert_eq!(repeat_values(1, 3), "(?), (?), (?)".to_string());
+assert_eq!(repeat_values(3, 1), "(?, ?, ?)".to_string());
+assert_eq!(repeat_values(2, 2), "(?, ?), (?, ?)".to_string());
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/fn.to_namespaced_keyword.html b/docs/apis/rust/0.7.0/mentat_db/fn.to_namespaced_keyword.html new file mode 100644 index 00000000..cff24b5e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/fn.to_namespaced_keyword.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::to_namespaced_keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_db::to_namespaced_keyword + + [] + + [src]

pub fn to_namespaced_keyword(s: &str) -> Result<Keyword>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/fn.transact.html b/docs/apis/rust/0.7.0/mentat_db/fn.transact.html new file mode 100644 index 00000000..af1f8a85 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/fn.transact.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_db::transact - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_db::transact + + [] + + [src]

pub fn transact<'conn, 'a, I, V, W>(
    conn: &'conn Connection,
    partition_map: PartitionMap,
    schema_for_mutation: &'a Schema,
    schema: &'a Schema,
    watcher: W,
    entities: I
) -> Result<(TxReport, PartitionMap, Option<Schema>, W)> where
    I: IntoIterator<Item = Entity<V>>,
    V: TransactableValue,
    W: TransactWatcher

Transact the given entities against the given SQLite conn, using the given metadata. +If you want this work to occur inside a SQLite transaction, establish one on the connection +prior to calling this function.

+

This approach is explained in https://github.com/mozilla/mentat/wiki/Transacting.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/fn.transact_terms.html b/docs/apis/rust/0.7.0/mentat_db/fn.transact_terms.html new file mode 100644 index 00000000..b37c61f4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/fn.transact_terms.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_db::transact_terms - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_db::transact_terms + + [] + + [src]

pub fn transact_terms<'conn, 'a, I, W>(
    conn: &'conn Connection,
    partition_map: PartitionMap,
    schema_for_mutation: &'a Schema,
    schema: &'a Schema,
    watcher: W,
    terms: I,
    tempid_set: InternSet<TempId>
) -> Result<(TxReport, PartitionMap, Option<Schema>, W)> where
    I: IntoIterator<Item = TermWithTempIds>,
    W: TransactWatcher

Just like transact, but accepts lower-level inputs to allow bypassing the parser interface.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/index.html b/docs/apis/rust/0.7.0/mentat_db/index.html new file mode 100644 index 00000000..092834eb --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/index.html @@ -0,0 +1,274 @@ + + + + + + + + + + mentat_db - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Crate mentat_db + + [] + + [src]

Re-exports

+
pub use errors::DbError;
pub use errors::Result;
pub use errors::SchemaConstraintViolation;
pub use entids::DB_SCHEMA_CORE;
pub use db::TypedSQLValue;
pub use db::new_connection;
pub use tx_observer::InProgressObserverTransactWatcher;
pub use tx_observer::TxObservationService;
pub use tx_observer::TxObserver;
pub use types::AttributeSet;
pub use types::DB;
pub use types::PartitionMap;
pub use types::TransactableValue;
pub use types::TxReport;

Modules

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
cache + +
db + +
debug + +
entids + +
errors + +
internal_types +

Types used only within the transactor. These should not be exposed outside of this crate.

+ +
tx_observer + +
types + +

Macros

+ + + + +
bail + +

Structs

+ + + + +
AttributeBuilder + +

Constants

+ + + + + + + + + + + + +
CORE_SCHEMA_VERSION + +
TX0 +

The first transaction ID applied to the knowledge base.

+ +
USER0 +

This is the start of the :db.part/user partition.

+ +

Traits

+ + + + + + + + +
AttributeValidation + +
TransactWatcher + +

Functions

+ + + + + + + + + + + + + + + + +
repeat_values +

Prepare an SQL VALUES block, like (?, ?, ?), (?, ?, ?).

+ +
to_namespaced_keyword + +
transact +

Transact the given entities against the given SQLite conn, using the given metadata. +If you want this work to occur inside a SQLite transaction, establish one on the connection +prior to calling this function.

+ +
transact_terms +

Just like transact, but accepts lower-level inputs to allow bypassing the parser interface.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/KnownEntidOr.t.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/KnownEntidOr.t.html new file mode 100644 index 00000000..44859a03 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/KnownEntidOr.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.KnownEntidOr.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/LookupRef.t.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/LookupRef.t.html new file mode 100644 index 00000000..8d1685d0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/LookupRef.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.LookupRef.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/LookupRefOrTempId.t.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/LookupRefOrTempId.t.html new file mode 100644 index 00000000..e8381228 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/LookupRefOrTempId.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.LookupRefOrTempId.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/Population.t.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/Population.t.html new file mode 100644 index 00000000..53cebdc2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/Population.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Population.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/TempIdHandle.t.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/TempIdHandle.t.html new file mode 100644 index 00000000..e63951bb --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/TempIdHandle.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.TempIdHandle.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/TempIdMap.t.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/TempIdMap.t.html new file mode 100644 index 00000000..c54f2bf9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/TempIdMap.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.TempIdMap.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/Term.t.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/Term.t.html new file mode 100644 index 00000000..b906d974 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/Term.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Term.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/TermWithTempIds.t.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/TermWithTempIds.t.html new file mode 100644 index 00000000..275f4fb4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/TermWithTempIds.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.TermWithTempIds.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/TermWithTempIdsAndLookupRefs.t.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/TermWithTempIdsAndLookupRefs.t.html new file mode 100644 index 00000000..daf538c8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/TermWithTempIdsAndLookupRefs.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.TermWithTempIdsAndLookupRefs.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/TermWithoutTempIds.t.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/TermWithoutTempIds.t.html new file mode 100644 index 00000000..672b7921 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/TermWithoutTempIds.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.TermWithoutTempIds.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/TypedValueOr.t.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/TypedValueOr.t.html new file mode 100644 index 00000000..7dc8a71f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/TypedValueOr.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.TypedValueOr.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/enum.LookupRefOrTempId.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/enum.LookupRefOrTempId.html new file mode 100644 index 00000000..f0f7f14f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/enum.LookupRefOrTempId.html @@ -0,0 +1,159 @@ + + + + + + + + + + mentat_db::internal_types::LookupRefOrTempId - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_db::internal_types::LookupRefOrTempId + + [] + + [src]

pub enum LookupRefOrTempId {
+    LookupRef(LookupRef),
+    TempId(TempIdHandle),
+}

Internal representation of an entid on its way to resolution. We either have the simple case (a +numeric entid), a lookup-ref that still needs to be resolved (an atomized [a v] pair), or a temp +ID that needs to be upserted or allocated (an atomized tempid).

+

+ Variants

+ +

+ Trait Implementations +

+
+

impl Clone for LookupRefOrTempId
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for LookupRefOrTempId
[src]

Formats the value using the given formatter. Read more

+

impl Eq for LookupRefOrTempId
[src]

impl Hash for LookupRefOrTempId
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for LookupRefOrTempId
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for LookupRefOrTempId
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for LookupRefOrTempId
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/enum.Term.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/enum.Term.html new file mode 100644 index 00000000..46b4835c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/enum.Term.html @@ -0,0 +1,155 @@ + + + + + + + + + + mentat_db::internal_types::Term - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_db::internal_types::Term + + [] + + [src]

pub enum Term<E, V> {
+    AddOrRetract(OpType, E, Entid, V),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl<E: Clone, V: Clone> Clone for Term<E, V>
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<E: Debug, V: Debug> Debug for Term<E, V>
[src]

Formats the value using the given formatter. Read more

+

impl<E: Eq, V: Eq> Eq for Term<E, V>
[src]

impl<E: Hash, V: Hash> Hash for Term<E, V>
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl<E: Ord, V: Ord> Ord for Term<E, V>
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<E: PartialOrd, V: PartialOrd> PartialOrd for Term<E, V>
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl<E: PartialEq, V: PartialEq> PartialEq for Term<E, V>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl<E, V> Send for Term<E, V> where
    E: Send,
    V: Send

impl<E, V> Sync for Term<E, V> where
    E: Sync,
    V: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/fn.replace_lookup_ref.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/fn.replace_lookup_ref.html new file mode 100644 index 00000000..a1a8deda --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/fn.replace_lookup_ref.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_db::internal_types::replace_lookup_ref - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_db::internal_types::replace_lookup_ref + + [] + + [src]

pub fn replace_lookup_ref<T, U>(
    lookup_map: &AVMap,
    desired_or: Either<T, LookupRefOrTempId>,
    lift: U
) -> Result<Either<T, TempIdHandle>> where
    U: FnOnce(Entid) -> T, 

Given a KnownEntidOr or a TypedValueOr, replace any internal LookupRef with the entid from +the given map. Fail if any LookupRef cannot be replaced.

+

lift allows to specify how the entid found is mapped into the output type. (This could +also be an Into or From requirement.)

+

The reason for this awkward expression is that we're parameterizing over the type constructor +(EntidOr or TypedValueOr), which is not trivial to express in Rust. This only works because +they're both the same Result<...> type with different parameterizations.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/index.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/index.html new file mode 100644 index 00000000..c81d2088 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/index.html @@ -0,0 +1,219 @@ + + + + + + + + + + mentat_db::internal_types - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_db::internal_types + + [] + + [src]

Types used only within the transactor. These should not be exposed outside of this crate.

+

Enums

+ + + + + + + + +
LookupRefOrTempId +

Internal representation of an entid on its way to resolution. We either have the simple case (a +numeric entid), a lookup-ref that still needs to be resolved (an atomized [a v] pair), or a temp +ID that needs to be upserted or allocated (an atomized tempid).

+ +
Term + +

Functions

+ + + + +
replace_lookup_ref +

Given a KnownEntidOr or a TypedValueOr, replace any internal LookupRef with the entid from +the given map. Fail if any LookupRef cannot be replaced.

+ +

Type Definitions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KnownEntidOr + +
LookupRef + +
Population + +
TempIdHandle + +
TempIdMap + +
TermWithTempIds + +
TermWithTempIdsAndLookupRefs + +
TermWithoutTempIds + +
TypedValueOr + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/replace_lookup_ref.v.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/replace_lookup_ref.v.html new file mode 100644 index 00000000..36989e18 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/replace_lookup_ref.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.replace_lookup_ref.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_db/internal_types/sidebar-items.js new file mode 100644 index 00000000..3bc5d560 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["LookupRefOrTempId","Internal representation of an entid on its way to resolution. We either have the simple case (a numeric entid), a lookup-ref that still needs to be resolved (an atomized [a v] pair), or a temp ID that needs to be upserted or allocated (an atomized tempid)."],["Term",""]],"fn":[["replace_lookup_ref","Given a `KnownEntidOr` or a `TypedValueOr`, replace any internal `LookupRef` with the entid from the given map. Fail if any `LookupRef` cannot be replaced."]],"type":[["KnownEntidOr",""],["LookupRef",""],["Population",""],["TempIdHandle",""],["TempIdMap",""],["TermWithTempIds",""],["TermWithTempIdsAndLookupRefs",""],["TermWithoutTempIds",""],["TypedValueOr",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/type.KnownEntidOr.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.KnownEntidOr.html new file mode 100644 index 00000000..df1b2654 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.KnownEntidOr.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::internal_types::KnownEntidOr - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::internal_types::KnownEntidOr + + [] + + [src]

type KnownEntidOr<T> = Either<KnownEntid, T>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/type.LookupRef.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.LookupRef.html new file mode 100644 index 00000000..5392af43 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.LookupRef.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::internal_types::LookupRef - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::internal_types::LookupRef + + [] + + [src]

type LookupRef = Rc<AVPair>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/type.Population.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.Population.html new file mode 100644 index 00000000..13c49082 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.Population.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::internal_types::Population - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::internal_types::Population + + [] + + [src]

type Population = Vec<TermWithTempIds>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TempIdHandle.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TempIdHandle.html new file mode 100644 index 00000000..befcd45c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TempIdHandle.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::internal_types::TempIdHandle - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::internal_types::TempIdHandle + + [] + + [src]

type TempIdHandle = Rc<TempId>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TempIdMap.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TempIdMap.html new file mode 100644 index 00000000..8715db2a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TempIdMap.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::internal_types::TempIdMap - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::internal_types::TempIdMap + + [] + + [src]

type TempIdMap = HashMap<TempIdHandle, KnownEntid>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TermWithTempIds.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TermWithTempIds.html new file mode 100644 index 00000000..cbe879e7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TermWithTempIds.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::internal_types::TermWithTempIds - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::internal_types::TermWithTempIds + + [] + + [src]

type TermWithTempIds = Term<KnownEntidOr<TempIdHandle>, TypedValueOr<TempIdHandle>>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TermWithTempIdsAndLookupRefs.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TermWithTempIdsAndLookupRefs.html new file mode 100644 index 00000000..fd981c6c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TermWithTempIdsAndLookupRefs.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::internal_types::TermWithTempIdsAndLookupRefs - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::internal_types::TermWithTempIdsAndLookupRefs + + [] + + [src]

type TermWithTempIdsAndLookupRefs = Term<KnownEntidOr<LookupRefOrTempId>, TypedValueOr<LookupRefOrTempId>>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TermWithoutTempIds.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TermWithoutTempIds.html new file mode 100644 index 00000000..167adc8a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TermWithoutTempIds.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::internal_types::TermWithoutTempIds - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::internal_types::TermWithoutTempIds + + [] + + [src]

type TermWithoutTempIds = Term<KnownEntid, TypedValue>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TypedValueOr.html b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TypedValueOr.html new file mode 100644 index 00000000..5a4e7d7e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/internal_types/type.TypedValueOr.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::internal_types::TypedValueOr - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::internal_types::TypedValueOr + + [] + + [src]

type TypedValueOr<T> = Either<TypedValue, T>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/macro.bail!.html b/docs/apis/rust/0.7.0/mentat_db/macro.bail!.html new file mode 100644 index 00000000..6a9910ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/macro.bail!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.bail.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/macro.bail.html b/docs/apis/rust/0.7.0/mentat_db/macro.bail.html new file mode 100644 index 00000000..d4d8375a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/macro.bail.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_db::bail - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_db::bail + + [] + + [src]

+macro_rules! bail {
+    ($e:expr) => { ... };
+}
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/repeat_values.v.html b/docs/apis/rust/0.7.0/mentat_db/repeat_values.v.html new file mode 100644 index 00000000..c553d888 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/repeat_values.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.repeat_values.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/schema/AttributeBuilder.t.html b/docs/apis/rust/0.7.0/mentat_db/schema/AttributeBuilder.t.html new file mode 100644 index 00000000..29a7993b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/schema/AttributeBuilder.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.AttributeBuilder.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/schema/AttributeValidation.t.html b/docs/apis/rust/0.7.0/mentat_db/schema/AttributeValidation.t.html new file mode 100644 index 00000000..50e9888e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/schema/AttributeValidation.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.AttributeValidation.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/schema/struct.AttributeBuilder.html b/docs/apis/rust/0.7.0/mentat_db/schema/struct.AttributeBuilder.html new file mode 100644 index 00000000..8c803106 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/schema/struct.AttributeBuilder.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_db/struct.AttributeBuilder.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/schema/trait.AttributeValidation.html b/docs/apis/rust/0.7.0/mentat_db/schema/trait.AttributeValidation.html new file mode 100644 index 00000000..62bca5e6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/schema/trait.AttributeValidation.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_db/trait.AttributeValidation.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_db/sidebar-items.js new file mode 100644 index 00000000..f65cf78b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"constant":[["CORE_SCHEMA_VERSION",""],["TX0","The first transaction ID applied to the knowledge base."],["USER0","This is the start of the :db.part/user partition."]],"fn":[["repeat_values","Prepare an SQL `VALUES` block, like (?, ?, ?), (?, ?, ?)."],["to_namespaced_keyword",""],["transact","Transact the given `entities` against the given SQLite `conn`, using the given metadata. If you want this work to occur inside a SQLite transaction, establish one on the connection prior to calling this function."],["transact_terms","Just like `transact`, but accepts lower-level inputs to allow bypassing the parser interface."]],"macro":[["bail",""]],"mod":[["cache",""],["db",""],["debug",""],["entids",""],["errors",""],["internal_types","Types used only within the transactor. These should not be exposed outside of this crate."],["tx_observer",""],["types",""]],"struct":[["AttributeBuilder",""]],"trait":[["AttributeValidation",""],["TransactWatcher",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/struct.AttributeBuilder.html b/docs/apis/rust/0.7.0/mentat_db/struct.AttributeBuilder.html new file mode 100644 index 00000000..381bcc63 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/struct.AttributeBuilder.html @@ -0,0 +1,198 @@ + + + + + + + + + + mentat_db::AttributeBuilder - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::AttributeBuilder + + [] + + [src]

pub struct AttributeBuilder {
+    pub value_type: Option<ValueType>,
+    pub multival: Option<bool>,
+    pub unique: Option<Option<Unique>>,
+    pub index: Option<bool>,
+    pub fulltext: Option<bool>,
+    pub component: Option<bool>,
+    pub no_history: Option<bool>,
+    // some fields omitted
+}

+ Fields

+ + + + + + + + + + + + + + +

+ Methods +

+

impl AttributeBuilder
[src]

Make a new AttributeBuilder for human consumption: it will help you +by flipping relevant flags.

+

Make a new AttributeBuilder from an existing Attribute. This is important to allow +retraction. Only attributes that we allow to change are duplicated here.

+

Important traits for &'a mut R

Important traits for &'a mut R

Important traits for &'a mut R

Important traits for &'a mut R

Important traits for &'a mut R

Important traits for &'a mut R

Important traits for &'a mut R

Important traits for &'a mut R

Important traits for Vec<u8>

+

+ Trait Implementations +

+
+

impl Clone for AttributeBuilder
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for AttributeBuilder
[src]

Formats the value using the given formatter. Read more

+

impl Default for AttributeBuilder
[src]

Returns the "default value" for a type. Read more

+

impl Eq for AttributeBuilder
[src]

impl Hash for AttributeBuilder
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for AttributeBuilder
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for AttributeBuilder
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for AttributeBuilder
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/to_namespaced_keyword.v.html b/docs/apis/rust/0.7.0/mentat_db/to_namespaced_keyword.v.html new file mode 100644 index 00000000..d92d9e25 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/to_namespaced_keyword.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.to_namespaced_keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/trait.AttributeValidation.html b/docs/apis/rust/0.7.0/mentat_db/trait.AttributeValidation.html new file mode 100644 index 00000000..03f54584 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/trait.AttributeValidation.html @@ -0,0 +1,141 @@ + + + + + + + + + + mentat_db::AttributeValidation - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_db::AttributeValidation + + [] + + [src]

pub trait AttributeValidation {
+    fn validate<F>(&self, ident: F) -> Result<()>
    where
        F: Fn() -> String
; +}
+

+ Required Methods +

+
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/trait.TransactWatcher.html b/docs/apis/rust/0.7.0/mentat_db/trait.TransactWatcher.html new file mode 100644 index 00000000..8c798050 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/trait.TransactWatcher.html @@ -0,0 +1,147 @@ + + + + + + + + + + mentat_db::TransactWatcher - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_db::TransactWatcher + + [] + + [src]

pub trait TransactWatcher {
+    fn datom(&mut self, op: OpType, e: Entid, a: Entid, v: &TypedValue);
+
fn done(&mut self, t: &Entid, schema: &Schema) -> Result<()>; +}
+

+ Required Methods +

+
+

Only return an error if you want to interrupt the transact! +Called with the schema prior to the transact -- any attributes or +attribute changes transacted during this transact are not reflected in +the schema.

+
+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/transact.v.html b/docs/apis/rust/0.7.0/mentat_db/transact.v.html new file mode 100644 index 00000000..3d6a307d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/transact.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.transact.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/transact_terms.v.html b/docs/apis/rust/0.7.0/mentat_db/transact_terms.v.html new file mode 100644 index 00000000..69381d05 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/transact_terms.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.transact_terms.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/tx/fn.transact.html b/docs/apis/rust/0.7.0/mentat_db/tx/fn.transact.html new file mode 100644 index 00000000..b03d1cc4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/tx/fn.transact.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_db/fn.transact.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/tx/fn.transact_terms.html b/docs/apis/rust/0.7.0/mentat_db/tx/fn.transact_terms.html new file mode 100644 index 00000000..61176cd6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/tx/fn.transact_terms.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_db/fn.transact_terms.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/tx/transact.v.html b/docs/apis/rust/0.7.0/mentat_db/tx/transact.v.html new file mode 100644 index 00000000..3d6a307d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/tx/transact.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.transact.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/tx/transact_terms.v.html b/docs/apis/rust/0.7.0/mentat_db/tx/transact_terms.v.html new file mode 100644 index 00000000..69381d05 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/tx/transact_terms.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.transact_terms.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/tx_observer/Command.t.html b/docs/apis/rust/0.7.0/mentat_db/tx_observer/Command.t.html new file mode 100644 index 00000000..10ecb1b5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/tx_observer/Command.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.Command.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/tx_observer/InProgressObserverTransactWatcher.t.html b/docs/apis/rust/0.7.0/mentat_db/tx_observer/InProgressObserverTransactWatcher.t.html new file mode 100644 index 00000000..20abc27a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/tx_observer/InProgressObserverTransactWatcher.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.InProgressObserverTransactWatcher.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/tx_observer/TxCommand.t.html b/docs/apis/rust/0.7.0/mentat_db/tx_observer/TxCommand.t.html new file mode 100644 index 00000000..1cb0e0ad --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/tx_observer/TxCommand.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.TxCommand.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/tx_observer/TxObservationService.t.html b/docs/apis/rust/0.7.0/mentat_db/tx_observer/TxObservationService.t.html new file mode 100644 index 00000000..e27daf38 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/tx_observer/TxObservationService.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.TxObservationService.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/tx_observer/TxObserver.t.html b/docs/apis/rust/0.7.0/mentat_db/tx_observer/TxObserver.t.html new file mode 100644 index 00000000..fa2f3723 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/tx_observer/TxObserver.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.TxObserver.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/tx_observer/index.html b/docs/apis/rust/0.7.0/mentat_db/tx_observer/index.html new file mode 100644 index 00000000..7bcc900a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/tx_observer/index.html @@ -0,0 +1,163 @@ + + + + + + + + + + mentat_db::tx_observer - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_db::tx_observer + + [] + + [src]

Structs

+ + + + + + + + + + + + + + + + +
InProgressObserverTransactWatcher + +
TxCommand + +
TxObservationService + +
TxObserver + +

Traits

+ + + + +
Command + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/tx_observer/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_db/tx_observer/sidebar-items.js new file mode 100644 index 00000000..f54ece75 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/tx_observer/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["InProgressObserverTransactWatcher",""],["TxCommand",""],["TxObservationService",""],["TxObserver",""]],"trait":[["Command",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/tx_observer/struct.InProgressObserverTransactWatcher.html b/docs/apis/rust/0.7.0/mentat_db/tx_observer/struct.InProgressObserverTransactWatcher.html new file mode 100644 index 00000000..643afae7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/tx_observer/struct.InProgressObserverTransactWatcher.html @@ -0,0 +1,149 @@ + + + + + + + + + + mentat_db::tx_observer::InProgressObserverTransactWatcher - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::tx_observer::InProgressObserverTransactWatcher + + [] + + [src]

pub struct InProgressObserverTransactWatcher {
+    pub txes: IndexMap<Entid, AttributeSet>,
+    // some fields omitted
+}

+ Fields

+ + +

+ Methods +

+

impl InProgressObserverTransactWatcher
[src]

+

+ Trait Implementations +

+
+

impl TransactWatcher for InProgressObserverTransactWatcher
[src]

Only return an error if you want to interrupt the transact! Called with the schema prior to the transact -- any attributes or attribute changes transacted during this transact are not reflected in the schema. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/tx_observer/struct.TxCommand.html b/docs/apis/rust/0.7.0/mentat_db/tx_observer/struct.TxCommand.html new file mode 100644 index 00000000..b493a2ce --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/tx_observer/struct.TxCommand.html @@ -0,0 +1,136 @@ + + + + + + + + + + mentat_db::tx_observer::TxCommand - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::tx_observer::TxCommand + + [] + + [src]

pub struct TxCommand { /* fields omitted */ }
+

+ Trait Implementations +

+
+

impl Command for TxCommand
[src]

+

+ Auto Trait Implementations +

+
+

impl Send for TxCommand

impl Sync for TxCommand

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/tx_observer/struct.TxObservationService.html b/docs/apis/rust/0.7.0/mentat_db/tx_observer/struct.TxObservationService.html new file mode 100644 index 00000000..ec986f08 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/tx_observer/struct.TxObservationService.html @@ -0,0 +1,141 @@ + + + + + + + + + + mentat_db::tx_observer::TxObservationService - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::tx_observer::TxObservationService + + [] + + [src]

pub struct TxObservationService { /* fields omitted */ }
+

+ Methods +

+

impl TxObservationService
[src]

+

+ Trait Implementations +

+
+

impl Drop for TxObservationService
[src]

Executes the destructor for this type. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/tx_observer/struct.TxObserver.html b/docs/apis/rust/0.7.0/mentat_db/tx_observer/struct.TxObserver.html new file mode 100644 index 00000000..373b3976 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/tx_observer/struct.TxObserver.html @@ -0,0 +1,140 @@ + + + + + + + + + + mentat_db::tx_observer::TxObserver - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::tx_observer::TxObserver + + [] + + [src]

pub struct TxObserver { /* fields omitted */ }
+

+ Methods +

+

impl TxObserver
[src]

+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl Send for TxObserver

impl Sync for TxObserver

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/tx_observer/trait.Command.html b/docs/apis/rust/0.7.0/mentat_db/tx_observer/trait.Command.html new file mode 100644 index 00000000..47d816e4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/tx_observer/trait.Command.html @@ -0,0 +1,141 @@ + + + + + + + + + + mentat_db::tx_observer::Command - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_db::tx_observer::Command + + [] + + [src]

pub trait Command {
+    fn execute(&mut self);
+}
+

+ Required Methods +

+
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/AVMap.t.html b/docs/apis/rust/0.7.0/mentat_db/types/AVMap.t.html new file mode 100644 index 00000000..07944178 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/AVMap.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.AVMap.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/AVPair.t.html b/docs/apis/rust/0.7.0/mentat_db/types/AVPair.t.html new file mode 100644 index 00000000..f65bfd4e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/AVPair.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.AVPair.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/Attribute.t.html b/docs/apis/rust/0.7.0/mentat_db/types/Attribute.t.html new file mode 100644 index 00000000..d929c865 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/Attribute.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Attribute.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/AttributeBitFlags.t.html b/docs/apis/rust/0.7.0/mentat_db/types/AttributeBitFlags.t.html new file mode 100644 index 00000000..fe00e7a4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/AttributeBitFlags.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.AttributeBitFlags.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/AttributeSet.t.html b/docs/apis/rust/0.7.0/mentat_db/types/AttributeSet.t.html new file mode 100644 index 00000000..f738004f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/AttributeSet.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.AttributeSet.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/DB.t.html b/docs/apis/rust/0.7.0/mentat_db/types/DB.t.html new file mode 100644 index 00000000..440d07cf --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/DB.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DB.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/DateTime.t.html b/docs/apis/rust/0.7.0/mentat_db/types/DateTime.t.html new file mode 100644 index 00000000..4f28f679 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/DateTime.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DateTime.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/Entid.t.html b/docs/apis/rust/0.7.0/mentat_db/types/Entid.t.html new file mode 100644 index 00000000..a33a5c5a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/Entid.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Entid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/Partition.t.html b/docs/apis/rust/0.7.0/mentat_db/types/Partition.t.html new file mode 100644 index 00000000..3bb6e23c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/Partition.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Partition.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/PartitionMap.t.html b/docs/apis/rust/0.7.0/mentat_db/types/PartitionMap.t.html new file mode 100644 index 00000000..77da2d75 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/PartitionMap.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.PartitionMap.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/Schema.t.html b/docs/apis/rust/0.7.0/mentat_db/types/Schema.t.html new file mode 100644 index 00000000..176b0419 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/Schema.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Schema.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/TransactableValue.t.html b/docs/apis/rust/0.7.0/mentat_db/types/TransactableValue.t.html new file mode 100644 index 00000000..012c08af --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/TransactableValue.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.TransactableValue.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/TxReport.t.html b/docs/apis/rust/0.7.0/mentat_db/types/TxReport.t.html new file mode 100644 index 00000000..94bca9f7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/TxReport.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.TxReport.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/TypedValue.t.html b/docs/apis/rust/0.7.0/mentat_db/types/TypedValue.t.html new file mode 100644 index 00000000..8b0ac4a6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/TypedValue.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.TypedValue.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/Utc.t.html b/docs/apis/rust/0.7.0/mentat_db/types/Utc.t.html new file mode 100644 index 00000000..dda32b3b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/Utc.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Utc.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/ValueType.t.html b/docs/apis/rust/0.7.0/mentat_db/types/ValueType.t.html new file mode 100644 index 00000000..2809fdde --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/ValueType.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.ValueType.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/enum.AttributeBitFlags.html b/docs/apis/rust/0.7.0/mentat_db/types/enum.AttributeBitFlags.html new file mode 100644 index 00000000..730181e4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/enum.AttributeBitFlags.html @@ -0,0 +1,147 @@ + + + + + + + + + + mentat_db::types::AttributeBitFlags - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_db::types::AttributeBitFlags + + [] + + [src]

pub enum AttributeBitFlags {
+    IndexAVET,
+    IndexVAET,
+    IndexFulltext,
+    UniqueValue,
+}

Bit flags used in flags0 column in temporary tables created during search, +such as the search_results, inexact_searches and exact_searches tables. +When moving to a more concrete table, such as datoms, they are expanded out +via these flags and put into their own column rather than a bit field.

+

+ Variants

+ +

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/enum.TypedValue.html b/docs/apis/rust/0.7.0/mentat_db/types/enum.TypedValue.html new file mode 100644 index 00000000..ffc7c45c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/enum.TypedValue.html @@ -0,0 +1,206 @@ + + + + + + + + + + mentat_db::types::TypedValue - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_db::types::TypedValue + + [] + + [src]

pub enum TypedValue {
+    Ref(i64),
+    Boolean(bool),
+    Long(i64),
+    Double(OrderedFloat<f64>),
+    Instant(DateTime<Utc>),
+    String(Arc<String>),
+    Keyword(Arc<Keyword>),
+    Uuid(Uuid),
+}

Represents a value that can be stored in a Mentat store.

+

+ Variants

+ +

+ Methods +

+

impl TypedValue
[src]

Returns true if the provided type is Some and matches this value's type, or if the +provided type is None.

+

Construct a new TypedValue::Keyword instance by cloning the provided +values and wrapping them in a new ValueRc. This is expensive, so this might +be best limited to tests.

+

Construct a new TypedValue::String instance by cloning the provided +value and wrapping it in a new ValueRc. This is expensive, so this might +be best limited to tests.

+

Construct a new TypedValue::Instant instance from the provided +microsecond timestamp.

+

impl TypedValue
[src]

+

+ Trait Implementations +

+
+

impl PartialOrd<TypedValue> for TypedValue
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Clone for TypedValue
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<DateTime<Utc>> for TypedValue
[src]

Truncate the provided DateTime to microsecond precision, and return the corresponding +TypedValue::Instant.

+

Performs the conversion.

+

impl From<Uuid> for TypedValue
[src]

Performs the conversion.

+

impl From<String> for TypedValue
[src]

Performs the conversion.

+

impl From<bool> for TypedValue
[src]

Performs the conversion.

+

impl From<Box<String>> for TypedValue
[src]

Performs the conversion.

+

impl From<i32> for TypedValue
[src]

Performs the conversion.

+

impl From<Rc<Keyword>> for TypedValue
[src]

Performs the conversion.

+

impl<'a> From<&'a str> for TypedValue
[src]

Performs the conversion.

+

impl From<Keyword> for TypedValue
[src]

Performs the conversion.

+

impl From<Rc<String>> for TypedValue
[src]

Performs the conversion.

+

impl From<Arc<String>> for TypedValue
[src]

Performs the conversion.

+

impl From<Arc<Keyword>> for TypedValue
[src]

Performs the conversion.

+

impl From<u32> for TypedValue
[src]

Performs the conversion.

+

impl From<f64> for TypedValue
[src]

Performs the conversion.

+

impl From<KnownEntid> for TypedValue
[src]

Performs the conversion.

+

impl Ord for TypedValue
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<'de> Deserialize<'de> for TypedValue
[src]

Deserialize this value from the given Serde deserializer. Read more

+

impl Hash for TypedValue
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for TypedValue
[src]

impl PartialEq<TypedValue> for TypedValue
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for TypedValue
[src]

Formats the value using the given formatter. Read more

+

impl Serialize for TypedValue
[src]

Serialize this value into the given Serde serializer. Read more

+

impl TypedSQLValue for TypedValue
[src]

Given a SQLite value and a value_type_tag, return the corresponding TypedValue.

+

Given an EDN value, return a corresponding Mentat TypedValue.

+

An EDN Value does not encode a unique Mentat ValueType, so the composition +from_edn_value(first(to_edn_value_pair(...))) loses information. Additionally, there are +EDN values which are not Mentat typed values.

+

This function is deterministic.

+

Return the corresponding SQLite value and value_type_tag pair.

+

Return the corresponding EDN value and value_type pair.

+

impl TransactableValue for TypedValue
[src]

Coerce this value place into the given type. This is where we perform schema-aware coercion, for example coercing an integral value into a ref where appropriate. Read more

+

Make an entity place out of this value place. This is where we limit values in nested maps to valid entity places. Read more

+

+

+ Auto Trait Implementations +

+
+

impl Send for TypedValue

impl Sync for TypedValue

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/enum.ValueType.html b/docs/apis/rust/0.7.0/mentat_db/types/enum.ValueType.html new file mode 100644 index 00000000..615d89ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/enum.ValueType.html @@ -0,0 +1,187 @@ + + + + + + + + + + mentat_db::types::ValueType - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_db::types::ValueType + + [] + + [src]

#[repr(u32)] +
pub enum ValueType { + Ref, + Boolean, + Instant, + Long, + Double, + String, + Keyword, + Uuid, +}

The attribute of each Mentat assertion has a :db/valueType constraining the value to a +particular set. Mentat recognizes the following :db/valueType values.

+

+ Variants

+ +

+ Methods +

+

impl ValueType
[src]

impl ValueType
[src]

+

+ Trait Implementations +

+
+

impl SQLValueType for ValueType
[src]

Return a pair of the ValueTypeTag for this value type, and the SQLTypeAffinity required to distinguish it from any other types that share the same tag. Read more

+

Returns true if the provided integer is in the SQLite value space of this type. For +example, 1 is how we encode true.

+ +
+use mentat_core::{ValueType, SQLValueType};
+assert!(!ValueType::Instant.accommodates_integer(1493399581314));
+assert!(!ValueType::Instant.accommodates_integer(1493399581314000));
+assert!(ValueType::Boolean.accommodates_integer(1));
+assert!(!ValueType::Boolean.accommodates_integer(-1));
+assert!(!ValueType::Boolean.accommodates_integer(10));
+assert!(!ValueType::String.accommodates_integer(10));
+

impl PartialOrd<ValueType> for ValueType
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Copy for ValueType
[src]

impl Clone for ValueType
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<ValueType> for ValueTypeSet
[src]

Performs the conversion.

+

impl Ord for ValueType
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Extend<ValueType> for ValueTypeSet
[src]

Extends a collection with the contents of an iterator. Read more

+

impl Hash for ValueType
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for ValueType
[src]

impl PartialEq<ValueType> for ValueType
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl FromIterator<ValueType> for ValueTypeSet
[src]

Creates a value from an iterator. Read more

+

impl Display for ValueType
[src]

Formats the value using the given formatter. Read more

+

impl Debug for ValueType
[src]

Formats the value using the given formatter. Read more

+

impl CLike for ValueType
[src]

Converts a C-like enum to a u32. The value must be <= 31.

+

Converts a u32 to a C-like enum. This method only needs to be safe for possible return values of to_u32 of this trait. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for ValueType

impl Sync for ValueType

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/index.html b/docs/apis/rust/0.7.0/mentat_db/types/index.html new file mode 100644 index 00000000..3319b961 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/index.html @@ -0,0 +1,265 @@ + + + + + + + + + + mentat_db::types - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_db::types + + [] + + [src]

Structs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Attribute +

A Mentat schema attribute has a value type and several other flags determining how assertions +with the attribute are interpreted.

+ +
DB +

Represents the metadata required to query from, or apply transactions to, a Mentat store.

+ +
DateTime +

ISO 8601 combined date and time with time zone.

+ +
Partition +

Represents one partition of the entid space.

+ +
Schema +

Represents a Mentat schema.

+ +
TxReport +

A transaction report summarizes an applied transaction.

+ +
Utc +

The UTC time zone. This is the most efficient time zone when you don't need the local time. +It is also used as an offset (which is also a dummy type).

+ +

Enums

+ + + + + + + + + + + + +
AttributeBitFlags +

Bit flags used in flags0 column in temporary tables created during search, +such as the search_results, inexact_searches and exact_searches tables. +When moving to a more concrete table, such as datoms, they are expanded out +via these flags and put into their own column rather than a bit field.

+ +
TypedValue +

Represents a value that can be stored in a Mentat store.

+ +
ValueType +

The attribute of each Mentat assertion has a :db/valueType constraining the value to a +particular set. Mentat recognizes the following :db/valueType values.

+ +

Traits

+ + + + +
TransactableValue +

The transactor is tied to edn::ValueAndSpan right now, but in the future we'd like to support +TypedValue directly for programmatic use. TransactableValue encapsulates the interface +value types (i.e., values in the value place) need to support to be transacted.

+ +

Type Definitions

+ + + + + + + + + + + + + + + + + + + + +
AVMap +

Map [a v] pairs to existing entids.

+ +
AVPair +

A pair [a v] in the store.

+ +
AttributeSet + +
Entid +

Represents one entid in the entid space.

+ +
PartitionMap +

Map partition names to Partition instances.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_db/types/sidebar-items.js new file mode 100644 index 00000000..5898495a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["AttributeBitFlags","Bit flags used in `flags0` column in temporary tables created during search, such as the `search_results`, `inexact_searches` and `exact_searches` tables. When moving to a more concrete table, such as `datoms`, they are expanded out via these flags and put into their own column rather than a bit field."],["TypedValue","Represents a value that can be stored in a Mentat store."],["ValueType","The attribute of each Mentat assertion has a :db/valueType constraining the value to a particular set. Mentat recognizes the following :db/valueType values."]],"struct":[["Attribute","A Mentat schema attribute has a value type and several other flags determining how assertions with the attribute are interpreted."],["DB","Represents the metadata required to query from, or apply transactions to, a Mentat store."],["DateTime","ISO 8601 combined date and time with time zone."],["Partition","Represents one partition of the entid space."],["Schema","Represents a Mentat schema."],["TxReport","A transaction report summarizes an applied transaction."],["Utc","The UTC time zone. This is the most efficient time zone when you don't need the local time. It is also used as an offset (which is also a dummy type)."]],"trait":[["TransactableValue","The transactor is tied to `edn::ValueAndSpan` right now, but in the future we'd like to support `TypedValue` directly for programmatic use. `TransactableValue` encapsulates the interface value types (i.e., values in the value place) need to support to be transacted."]],"type":[["AVMap","Map [a v] pairs to existing entids."],["AVPair","A pair [a v] in the store."],["AttributeSet",""],["Entid","Represents one entid in the entid space."],["PartitionMap","Map partition names to `Partition` instances."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/struct.Attribute.html b/docs/apis/rust/0.7.0/mentat_db/types/struct.Attribute.html new file mode 100644 index 00000000..d5951a1a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/struct.Attribute.html @@ -0,0 +1,216 @@ + + + + + + + + + + mentat_db::types::Attribute - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::types::Attribute + + [] + + [src]

pub struct Attribute {
+    pub value_type: ValueType,
+    pub multival: bool,
+    pub unique: Option<Unique>,
+    pub index: bool,
+    pub fulltext: bool,
+    pub component: bool,
+    pub no_history: bool,
+}

A Mentat schema attribute has a value type and several other flags determining how assertions +with the attribute are interpreted.

+

TODO: consider packing this into a bitfield or similar.

+

+ Fields

+ +

The associated value type, i.e., :db/valueType?

+
+ +

true if this attribute is multi-valued, i.e., it is :db/cardinality :db.cardinality/many. false if this attribute is single-valued (the default), i.e., it +is :db/cardinality :db.cardinality/one.

+
+ +

None if this attribute is neither unique-value nor unique-identity.

+

Some(attribute::Unique::Value) if this attribute is unique-value, i.e., it is :db/unique :db.unique/value.

+

Unique-value means that there is at most one assertion with the attribute and a +particular value in the datom store. Unique-value attributes can be used in lookup-refs.

+

Some(attribute::Unique::Identity) if this attribute is unique-identity, i.e., it is :db/unique :db.unique/identity.

+

Unique-identity attributes always have value type Ref.

+

Unique-identity means that the attribute is unique-value and that they can be used in +lookup-refs and will automatically upsert where appropriate.

+
+ +

true if this attribute is automatically indexed, i.e., it is :db/indexing true.

+
+ +

true if this attribute is automatically fulltext indexed, i.e., it is :db/fulltext true.

+

Fulltext attributes always have string values.

+
+ +

true if this attribute is a component, i.e., it is :db/isComponent true.

+

Component attributes always have value type Ref.

+

They are used to compose entities from component sub-entities: they are fetched recursively +by pull expressions, and they are automatically recursively deleted where appropriate.

+
+ +

true if this attribute doesn't require history to be kept, i.e., it is :db/noHistory true.

+
+

+ Methods +

+

impl Attribute
[src]

Combine several attribute flags into a bitfield used in temporary search tables.

+

+

+ Trait Implementations +

+
+

impl PartialOrd<Attribute> for Attribute
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Clone for Attribute
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Ord for Attribute
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Hash for Attribute
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for Attribute
[src]

impl PartialEq<Attribute> for Attribute
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for Attribute
[src]

Formats the value using the given formatter. Read more

+

impl Default for Attribute
[src]

Returns the "default value" for a type. Read more

+

impl AttributeValidation for Attribute
[src]

+

+ Auto Trait Implementations +

+
+

impl Send for Attribute

impl Sync for Attribute

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/struct.DB.html b/docs/apis/rust/0.7.0/mentat_db/types/struct.DB.html new file mode 100644 index 00000000..7a7f14e8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/struct.DB.html @@ -0,0 +1,173 @@ + + + + + + + + + + mentat_db::types::DB - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::types::DB + + [] + + [src]

pub struct DB {
+    pub partition_map: PartitionMap,
+    pub schema: Schema,
+}

Represents the metadata required to query from, or apply transactions to, a Mentat store.

+

See https://github.com/mozilla/mentat/wiki/Thoughts:-modeling-db-conn-in-Rust.

+

+ Fields

+ +

Map partition name->Partition.

+

TODO: represent partitions as entids.

+
+ +

The schema of the store.

+
+

+ Methods +

+

impl DB
[src]

+

+ Trait Implementations +

+
+

impl Clone for DB
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for DB
[src]

Formats the value using the given formatter. Read more

+

impl Default for DB
[src]

Returns the "default value" for a type. Read more

+

impl Eq for DB
[src]

impl Hash for DB
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for DB
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for DB
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for DB
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for DB

impl Sync for DB

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/struct.DateTime.html b/docs/apis/rust/0.7.0/mentat_db/types/struct.DateTime.html new file mode 100644 index 00000000..3d57fd87 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/struct.DateTime.html @@ -0,0 +1,349 @@ + + + + + + + + + + mentat_db::types::DateTime - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::types::DateTime + + [] + + [src]

pub struct DateTime<Tz> where
    Tz: TimeZone
{ /* fields omitted */ }

ISO 8601 combined date and time with time zone.

+

There are some constructors implemented here (the from_* methods), but +the general-purpose constructors are all via the methods on the +TimeZone implementations.

+
+

+ Methods +

+

impl<Tz> DateTime<Tz> where
    Tz: TimeZone
[src]

Makes a new DateTime with given UTC datetime and offset. +The local datetime should be constructed via the TimeZone trait.

+

Example

+
+use chrono::{DateTime, TimeZone, NaiveDateTime, Utc};
+
+let dt = DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(61, 0), Utc);
+assert_eq!(Utc.timestamp(61, 0), dt);
+

Retrieves a date component.

+

Retrieves a time component. +Unlike date, this is not associated to the time zone.

+

Returns the number of non-leap seconds since January 1, 1970 0:00:00 UTC +(aka "UNIX timestamp").

+

Returns the number of non-leap-milliseconds since January 1, 1970 UTC

+

Note that this does reduce the number of years that can be represented +from ~584 Billion to ~584 Million. (If this is a problem, please file +an issue to let me know what domain needs millisecond precision over +billions of years, I'm curious.)

+

Example

+
+use chrono::Utc;
+use chrono::TimeZone;
+
+let dt = Utc.ymd(1970, 1, 1).and_hms_milli(0, 0, 1, 444);
+assert_eq!(dt.timestamp_millis(), 1_444);
+
+let dt = Utc.ymd(2001, 9, 9).and_hms_milli(1, 46, 40, 555);
+assert_eq!(dt.timestamp_millis(), 1_000_000_000_555);
+

Returns the number of non-leap-nanoseconds since January 1, 1970 UTC

+

Note that this does reduce the number of years that can be represented +from ~584 Billion to ~584. (If this is a problem, please file +an issue to let me know what domain needs nanosecond precision over +millenia, I'm curious.)

+

Example

+
+use chrono::Utc;
+use chrono::TimeZone;
+
+let dt = Utc.ymd(1970, 1, 1).and_hms_nano(0, 0, 1, 444);
+assert_eq!(dt.timestamp_nanos(), 1_000_000_444);
+
+let dt = Utc.ymd(2001, 9, 9).and_hms_nano(1, 46, 40, 555);
+assert_eq!(dt.timestamp_nanos(), 1_000_000_000_000_000_555);
+

Returns the number of milliseconds since the last second boundary

+

warning: in event of a leap second, this may exceed 999

+

note: this is not the number of milliseconds since January 1, 1970 0:00:00 UTC

+

Returns the number of microseconds since the last second boundary

+

warning: in event of a leap second, this may exceed 999_999

+

note: this is not the number of microseconds since January 1, 1970 0:00:00 UTC

+

Returns the number of nanoseconds since the last second boundary

+

warning: in event of a leap second, this may exceed 999_999_999

+

note: this is not the number of nanoseconds since January 1, 1970 0:00:00 UTC

+

Retrieves an associated offset from UTC.

+

Retrieves an associated time zone.

+

Changes the associated time zone. +This does not change the actual DateTime (but will change the string representation).

+

Adds given Duration to the current date and time.

+

Returns None when it will result in overflow.

+

Subtracts given Duration from the current date and time.

+

Returns None when it will result in overflow.

+

Subtracts another DateTime from the current date and time. +This does not overflow or underflow at all.

+

Returns a view to the naive UTC datetime.

+

Returns a view to the naive local datetime.

+

impl DateTime<FixedOffset>
[src]

Parses an RFC 2822 date and time string such as Tue, 1 Jul 2003 10:52:37 +0200, +then returns a new DateTime with a parsed FixedOffset.

+

Parses an RFC 3339 and ISO 8601 date and time string such as 1996-12-19T16:39:57-08:00, +then returns a new DateTime with a parsed FixedOffset.

+

Why isn't this named parse_from_iso8601? That's because ISO 8601 allows some freedom +over the syntax and RFC 3339 exercises that freedom to rigidly define a fixed format.

+

Parses a string with the specified format string and +returns a new DateTime with a parsed FixedOffset. +See the format::strftime module +on the supported escape sequences.

+

See also Offset::datetime_from_str which gives a local DateTime on specific time zone.

+

Note that this method requires a timezone in the string. See +NaiveDateTime::parse_from_str +for a version that does not require a timezone in the to-be-parsed str.

+

Example

+
+use chrono::{DateTime, FixedOffset, TimeZone};
+
+let dt = DateTime::parse_from_str(
+    "1983 Apr 13 12:09:14.274 +0000", "%Y %b %d %H:%M:%S%.3f %z");
+assert_eq!(dt, Ok(FixedOffset::east(0).ymd(1983, 4, 13).and_hms_milli(12, 9, 14, 274)));
+

impl<Tz> DateTime<Tz> where
    Tz: TimeZone,
    <Tz as TimeZone>::Offset: Display
[src]

Returns an RFC 2822 date and time string such as Tue, 1 Jul 2003 10:52:37 +0200.

+

Returns an RFC 3339 and ISO 8601 date and time string such as 1996-12-19T16:39:57-08:00.

+

Return an RFC 3339 and ISO 8601 date and time string with subseconds +formatted as per a SecondsFormat. If passed use_z true and the +timezone is UTC (offset 0), use 'Z', as per +Fixed::TimezoneOffsetColonZ. +If passed use_z false, use +Fixed::TimezoneOffsetColon.

+

Examples

+
+let dt = Utc.ymd(2018, 1, 26).and_hms_micro(18, 30, 9, 453_829);
+assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Millis, false),
+           "2018-01-26T18:30:09.453+00:00");
+assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Millis, true),
+           "2018-01-26T18:30:09.453Z");
+assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Secs, true),
+           "2018-01-26T18:30:09Z");
+
+let pst = FixedOffset::east(8 * 60 * 60);
+let dt = pst.ymd(2018, 1, 26).and_hms_micro(10, 30, 9, 453_829);
+assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Secs, true),
+           "2018-01-26T10:30:09+08:00");
+

Formats the combined date and time with the specified formatting items.

+

Formats the combined date and time with the specified format string. +See the format::strftime module +on the supported escape sequences.

+
+

+ Trait Implementations +

+
+

impl ToMicros for DateTime<Utc>
[src]

impl FromMicros for DateTime<Utc>
[src]

impl<Tz> Copy for DateTime<Tz> where
    Tz: TimeZone,
    <Tz as TimeZone>::Offset: Copy
[src]

impl<Tz> PartialOrd<DateTime<Tz>> for DateTime<Tz> where
    Tz: TimeZone
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl<Tz> Clone for DateTime<Tz> where
    Tz: TimeZone + Clone,
    <Tz as TimeZone>::Offset: Clone
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<Tz> Add<FixedOffset> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<Tz> Add<Duration> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the + operator.

+

Performs the + operation.

+

impl<Tz> From<DateTime<Tz>> for SystemTime where
    Tz: TimeZone
[src]

Performs the conversion.

+

impl From<SystemTime> for DateTime<Local>
[src]

Performs the conversion.

+

impl From<SystemTime> for DateTime<Utc>
[src]

Performs the conversion.

+

impl<Tz> Serialize for DateTime<Tz> where
    Tz: TimeZone
[src]

Serialize into a rfc3339 time string

+

See the serde module for alternate +serializations.

+

impl<Tz> Sub<Duration> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<Tz> Sub<DateTime<Tz>> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl<Tz> Sub<FixedOffset> for DateTime<Tz> where
    Tz: TimeZone
[src]

+

The resulting type after applying the - operator.

+

Performs the - operation.

+

impl FromStr for DateTime<FixedOffset>
[src]

+

The associated error which can be returned from parsing.

+

Parses a string s to return a value of this type. Read more

+

impl FromStr for DateTime<Local>
[src]

+

The associated error which can be returned from parsing.

+

Parses a string s to return a value of this type. Read more

+

impl FromStr for DateTime<Utc>
[src]

+

The associated error which can be returned from parsing.

+

Parses a string s to return a value of this type. Read more

+

impl<Tz> Ord for DateTime<Tz> where
    Tz: TimeZone
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<Tz> Hash for DateTime<Tz> where
    Tz: TimeZone
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl<Tz> Eq for DateTime<Tz> where
    Tz: TimeZone
[src]

impl<Tz, Tz2> PartialEq<DateTime<Tz2>> for DateTime<Tz> where
    Tz: TimeZone,
    Tz2: TimeZone
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl<'de> Deserialize<'de> for DateTime<FixedOffset>
[src]

Deserialize a value that optionally includes a timezone offset in its +string representation

+

The value to be deserialized must be an rfc3339 string.

+

See the serde module for alternate +deserialization formats.

+

Deserialize this value from the given Serde deserializer. Read more

+

impl<'de> Deserialize<'de> for DateTime<Utc>
[src]

Deserialize into a UTC value

+

The value to be deserialized must be an rfc3339 string.

+

See the serde module for alternate +deserialization formats.

+

Deserialize this value from the given Serde deserializer. Read more

+

impl<'de> Deserialize<'de> for DateTime<Local>
[src]

Deserialize a value that includes no timezone in its string +representation

+

The value to be deserialized must be an rfc3339 string.

+

See the serde module for alternate +serialization formats.

+

Deserialize this value from the given Serde deserializer. Read more

+

impl<Tz> Timelike for DateTime<Tz> where
    Tz: TimeZone
[src]

Returns the hour number from 0 to 23.

+

Returns the minute number from 0 to 59.

+

Returns the second number from 0 to 59.

+

Returns the number of nanoseconds since the whole non-leap second. The range from 1,000,000,000 to 1,999,999,999 represents the leap second. Read more

+

Makes a new value with the hour number changed. Read more

+

Makes a new value with the minute number changed. Read more

+

Makes a new value with the second number changed. Read more

+

Makes a new value with nanoseconds since the whole non-leap second changed. Read more

+

Returns the hour number from 1 to 12 with a boolean flag, which is false for AM and true for PM. Read more

+

Returns the number of non-leap seconds past the last midnight.

+

impl<Tz> Display for DateTime<Tz> where
    Tz: TimeZone,
    <Tz as TimeZone>::Offset: Display
[src]

Formats the value using the given formatter. Read more

+

impl<Tz> Send for DateTime<Tz> where
    Tz: TimeZone,
    <Tz as TimeZone>::Offset: Send
[src]

impl<Tz> Datelike for DateTime<Tz> where
    Tz: TimeZone
[src]

Returns the year number in the calendar date.

+

Returns the month number starting from 1. Read more

+

Returns the month number starting from 0. Read more

+

Returns the day of month starting from 1. Read more

+

Returns the day of month starting from 0. Read more

+

Returns the day of year starting from 1. Read more

+

Returns the day of year starting from 0. Read more

+

Returns the day of week.

+

Returns the ISO week.

+

Makes a new value with the year number changed. Read more

+

Makes a new value with the month number (starting from 1) changed. Read more

+

Makes a new value with the month number (starting from 0) changed. Read more

+

Makes a new value with the day of month (starting from 1) changed. Read more

+

Makes a new value with the day of month (starting from 0) changed. Read more

+

Makes a new value with the day of year (starting from 1) changed. Read more

+

Makes a new value with the day of year (starting from 0) changed. Read more

+

Returns the absolute year number starting from 1 with a boolean flag, which is false when the year predates the epoch (BCE/BC) and true otherwise (CE/AD). Read more

+

Returns the number of days since January 1, 1 (Day 1) in the proleptic Gregorian calendar.

+

impl<Tz> Debug for DateTime<Tz> where
    Tz: TimeZone
[src]

Formats the value using the given formatter. Read more

+

impl From<DateTime<Utc>> for TypedValue
[src]

Truncate the provided DateTime to microsecond precision, and return the corresponding +TypedValue::Instant.

+

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl<Tz> Sync for DateTime<Tz> where
    <Tz as TimeZone>::Offset: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/struct.Partition.html b/docs/apis/rust/0.7.0/mentat_db/types/struct.Partition.html new file mode 100644 index 00000000..4a9c6595 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/struct.Partition.html @@ -0,0 +1,170 @@ + + + + + + + + + + mentat_db::types::Partition - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::types::Partition + + [] + + [src]

pub struct Partition {
+    pub start: i64,
+    pub index: i64,
+}

Represents one partition of the entid space.

+

+ Fields

+ +

The first entid in the partition.

+
+ +

The next entid to be allocated in the partition.

+
+

+ Methods +

+

impl Partition
[src]

+

+ Trait Implementations +

+
+

impl Clone for Partition
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for Partition
[src]

Formats the value using the given formatter. Read more

+

impl Eq for Partition
[src]

impl Hash for Partition
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for Partition
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for Partition
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for Partition
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for Partition

impl Sync for Partition

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/struct.Schema.html b/docs/apis/rust/0.7.0/mentat_db/types/struct.Schema.html new file mode 100644 index 00000000..e0255d31 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/struct.Schema.html @@ -0,0 +1,195 @@ + + + + + + + + + + mentat_db::types::Schema - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::types::Schema + + [] + + [src]

pub struct Schema {
+    pub entid_map: BTreeMap<i64, Keyword>,
+    pub ident_map: BTreeMap<Keyword, i64>,
+    pub attribute_map: BTreeMap<i64, Attribute>,
+    pub component_attributes: Vec<i64>,
+}

Represents a Mentat schema.

+

Maintains the mapping between string idents and positive integer entids; and exposes the schema +flags associated to a given entid (equivalently, ident).

+

TODO: consider a single bi-directional map instead of separate ident->entid and entid->ident +maps.

+

+ Fields

+ +

Map entid->ident.

+

Invariant: is the inverse map of ident_map.

+
+ +

Map ident->entid.

+

Invariant: is the inverse map of entid_map.

+
+ +

Map entid->attribute flags.

+

Invariant: key-set is the same as the key-set of entid_map (equivalently, the value-set of +ident_map).

+
+ +

Maintain a vec of unique attribute IDs for which the corresponding attribute in attribute_map +has .component == true.

+
+

+ Methods +

+

impl Schema
[src]

Returns an symbolic representation of the schema suitable for applying across Mentat stores.

+

+

+ Trait Implementations +

+
+

impl HasSchema for Schema
[src]

Return true if the provided entid identifies an attribute in this schema.

+

Return true if the provided ident identifies an attribute in this schema.

+

Important traits for &'a [u8]

impl PartialOrd<Schema> for Schema
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Clone for Schema
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Ord for Schema
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Hash for Schema
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for Schema
[src]

impl PartialEq<Schema> for Schema
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for Schema
[src]

Formats the value using the given formatter. Read more

+

impl Default for Schema
[src]

Returns the "default value" for a type. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for Schema

impl Sync for Schema

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/struct.TxReport.html b/docs/apis/rust/0.7.0/mentat_db/types/struct.TxReport.html new file mode 100644 index 00000000..a9ca6f0d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/struct.TxReport.html @@ -0,0 +1,175 @@ + + + + + + + + + + mentat_db::types::TxReport - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::types::TxReport + + [] + + [src]

pub struct TxReport {
+    pub tx_id: Entid,
+    pub tx_instant: DateTime<Utc>,
+    pub tempids: BTreeMap<String, Entid>,
+}

A transaction report summarizes an applied transaction.

+

+ Fields

+ +

The transaction ID of the transaction.

+
+ +

The timestamp when the transaction began to be committed.

+
+ +

A map from string literal tempid to resolved or allocated entid.

+

Every string literal tempid presented to the transactor either resolves via upsert to an +existing entid, or is allocated a new entid. (It is possible for multiple distinct string +literal tempids to all unify to a single freshly allocated entid.)

+
+

+ Trait Implementations +

+
+

impl Clone for TxReport
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for TxReport
[src]

Formats the value using the given formatter. Read more

+

impl Eq for TxReport
[src]

impl Hash for TxReport
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Ord for TxReport
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialOrd for TxReport
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl PartialEq for TxReport
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for TxReport

impl Sync for TxReport

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/struct.Utc.html b/docs/apis/rust/0.7.0/mentat_db/types/struct.Utc.html new file mode 100644 index 00000000..0b4590da --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/struct.Utc.html @@ -0,0 +1,182 @@ + + + + + + + + + + mentat_db::types::Utc - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_db::types::Utc + + [] + + [src]

pub struct Utc;

The UTC time zone. This is the most efficient time zone when you don't need the local time. +It is also used as an offset (which is also a dummy type).

+

Using the TimeZone methods +on the UTC struct is the preferred way to construct DateTime<Utc> +instances.

+

Example

+
+use chrono::{DateTime, TimeZone, NaiveDateTime, Utc};
+
+let dt = DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(61, 0), Utc);
+
+assert_eq!(Utc.timestamp(61, 0), dt);
+assert_eq!(Utc.ymd(1970, 1, 1).and_hms(0, 1, 1), dt);
+
+

+ Methods +

+

impl Utc
[src]

Returns a Date which corresponds to the current date.

+

Returns a DateTime which corresponds to the current date.

+
+

+ Trait Implementations +

+
+

impl Copy for Utc
[src]

impl Clone for Utc
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Offset for Utc
[src]

Returns the fixed offset from UTC to the local time stored.

+

impl Eq for Utc
[src]

impl PartialEq<Utc> for Utc
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for Utc
[src]

Formats the value using the given formatter. Read more

+

impl Debug for Utc
[src]

Formats the value using the given formatter. Read more

+

impl TimeZone for Utc
[src]

+

An associated offset type. This type is used to store the actual offset in date and time types. The original TimeZone value can be recovered via TimeZone::from_offset. Read more

+

Reconstructs the time zone from the offset.

+

Creates the offset(s) for given local NaiveDate if possible.

+

Creates the offset(s) for given local NaiveDateTime if possible.

+

Creates the offset for given UTC NaiveDate. This cannot fail.

+

Creates the offset for given UTC NaiveDateTime. This cannot fail.

+

Makes a new Date from year, month, day and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. Read more

+

Makes a new Date from year, month, day and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. Read more

+

Makes a new Date from year, day of year (DOY or "ordinal") and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. Read more

+

Makes a new Date from year, day of year (DOY or "ordinal") and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. Read more

+

Makes a new Date from ISO week date (year and week number), day of the week (DOW) and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. The resulting Date may have a different year from the input year. Read more

+

Makes a new Date from ISO week date (year and week number), day of the week (DOW) and the current time zone. This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. The resulting Date may have a different year from the input year. Read more

+

Makes a new DateTime from the number of non-leap seconds since January 1, 1970 0:00:00 UTC (aka "UNIX timestamp") and the number of nanoseconds since the last whole non-leap second. Read more

+

Makes a new DateTime from the number of non-leap seconds since January 1, 1970 0:00:00 UTC (aka "UNIX timestamp") and the number of nanoseconds since the last whole non-leap second. Read more

+

Parses a string with the specified format string and returns a DateTime with the current offset. See the format::strftime module on the supported escape sequences. Read more

+

Converts the local NaiveDate to the timezone-aware Date if possible.

+

Converts the local NaiveDateTime to the timezone-aware DateTime if possible.

+

Converts the UTC NaiveDate to the local time. The UTC is continuous and thus this cannot fail (but can give the duplicate local time). Read more

+

Converts the UTC NaiveDateTime to the local time. The UTC is continuous and thus this cannot fail (but can give the duplicate local time). Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for Utc

impl Sync for Utc

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/trait.TransactableValue.html b/docs/apis/rust/0.7.0/mentat_db/types/trait.TransactableValue.html new file mode 100644 index 00000000..ffa11334 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/trait.TransactableValue.html @@ -0,0 +1,154 @@ + + + + + + + + + + mentat_db::types::TransactableValue - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_db::types::TransactableValue + + [] + + [src]

pub trait TransactableValue: Clone {
+    fn into_typed_value(
        self,
        schema: &Schema,
        value_type: ValueType
    ) -> Result<TypedValue>; +
fn into_entity_place(self) -> Result<EntityPlace<Self>>; +
fn as_tempid(&self) -> Option<TempId>; +}

The transactor is tied to edn::ValueAndSpan right now, but in the future we'd like to support +TypedValue directly for programmatic use. TransactableValue encapsulates the interface +value types (i.e., values in the value place) need to support to be transacted.

+
+

+ Required Methods +

+
+

Coerce this value place into the given type. This is where we perform schema-aware +coercion, for example coercing an integral value into a ref where appropriate.

+

Make an entity place out of this value place. This is where we limit values in nested maps +to valid entity places.

+

+

+ Implementations on Foreign Types +

+

impl TransactableValue for ValueAndSpan
[src]

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/type.AVMap.html b/docs/apis/rust/0.7.0/mentat_db/types/type.AVMap.html new file mode 100644 index 00000000..73c7850c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/type.AVMap.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_db::types::AVMap - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::types::AVMap + + [] + + [src]

type AVMap<'a> = HashMap<&'a AVPair, Entid>;

Map [a v] pairs to existing entids.

+

Used to resolve lookup-refs and upserts.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/type.AVPair.html b/docs/apis/rust/0.7.0/mentat_db/types/type.AVPair.html new file mode 100644 index 00000000..a5087281 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/type.AVPair.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_db::types::AVPair - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::types::AVPair + + [] + + [src]

type AVPair = (Entid, TypedValue);

A pair [a v] in the store.

+

Used to represent lookup-refs and [TEMPID a v] upserts as they are resolved.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/type.AttributeSet.html b/docs/apis/rust/0.7.0/mentat_db/types/type.AttributeSet.html new file mode 100644 index 00000000..5798e78f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/type.AttributeSet.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_db::types::AttributeSet - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::types::AttributeSet + + [] + + [src]

type AttributeSet = BTreeSet<Entid>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/type.Entid.html b/docs/apis/rust/0.7.0/mentat_db/types/type.Entid.html new file mode 100644 index 00000000..e7070cc1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/type.Entid.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_db::types::Entid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::types::Entid + + [] + + [src]

type Entid = i64;

Represents one entid in the entid space.

+

Per https://www.sqlite.org/datatype3.html (see also http://stackoverflow.com/a/8499544), SQLite +stores signed integers up to 64 bits in size. Since u32 is not appropriate for our use case, we +use i64 rather than manually truncating u64 to u63 and casting to i64 throughout the codebase.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/types/type.PartitionMap.html b/docs/apis/rust/0.7.0/mentat_db/types/type.PartitionMap.html new file mode 100644 index 00000000..2913025d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/types/type.PartitionMap.html @@ -0,0 +1,134 @@ + + + + + + + + + + mentat_db::types::PartitionMap - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_db::types::PartitionMap + + [] + + [src]

type PartitionMap = BTreeMap<String, Partition>;

Map partition names to Partition instances.

+
+

+ Trait Implementations +

+
+

impl PartitionMapping for PartitionMap
[src]

Allocate a single fresh entid in the given partition.

+

Important traits for Range<A>

Allocate n fresh entids in the given partition.

+

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/watcher/TransactWatcher.t.html b/docs/apis/rust/0.7.0/mentat_db/watcher/TransactWatcher.t.html new file mode 100644 index 00000000..169886db --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/watcher/TransactWatcher.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.TransactWatcher.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_db/watcher/trait.TransactWatcher.html b/docs/apis/rust/0.7.0/mentat_db/watcher/trait.TransactWatcher.html new file mode 100644 index 00000000..5014542b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_db/watcher/trait.TransactWatcher.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_db/trait.TransactWatcher.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/Binding.t.html b/docs/apis/rust/0.7.0/mentat_ffi/Binding.t.html new file mode 100644 index 00000000..04563187 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/Binding.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Binding.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/BindingIterator.t.html b/docs/apis/rust/0.7.0/mentat_ffi/BindingIterator.t.html new file mode 100644 index 00000000..cf762e5e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/BindingIterator.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.BindingIterator.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/BindingListIterator.t.html b/docs/apis/rust/0.7.0/mentat_ffi/BindingListIterator.t.html new file mode 100644 index 00000000..c2cb0d94 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/BindingListIterator.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.BindingListIterator.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/BuildTerms.t.html b/docs/apis/rust/0.7.0/mentat_ffi/BuildTerms.t.html new file mode 100644 index 00000000..a84b8af5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/BuildTerms.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.BuildTerms.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/CacheDirection.t.html b/docs/apis/rust/0.7.0/mentat_ffi/CacheDirection.t.html new file mode 100644 index 00000000..267c7f41 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/CacheDirection.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.CacheDirection.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/Entid.t.html b/docs/apis/rust/0.7.0/mentat_ffi/Entid.t.html new file mode 100644 index 00000000..a33a5c5a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/Entid.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Entid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/EntityBuilder.t.html b/docs/apis/rust/0.7.0/mentat_ffi/EntityBuilder.t.html new file mode 100644 index 00000000..243e8abe --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/EntityBuilder.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.EntityBuilder.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/ExternOption.t.html b/docs/apis/rust/0.7.0/mentat_ffi/ExternOption.t.html new file mode 100644 index 00000000..93121551 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/ExternOption.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ExternOption.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/ExternResult.t.html b/docs/apis/rust/0.7.0/mentat_ffi/ExternResult.t.html new file mode 100644 index 00000000..c75517fb --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/ExternResult.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ExternResult.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/FindSpec.t.html b/docs/apis/rust/0.7.0/mentat_ffi/FindSpec.t.html new file mode 100644 index 00000000..85d8eec4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/FindSpec.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.FindSpec.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/HasSchema.t.html b/docs/apis/rust/0.7.0/mentat_ffi/HasSchema.t.html new file mode 100644 index 00000000..5c26521f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/HasSchema.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.HasSchema.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/InProgress.t.html b/docs/apis/rust/0.7.0/mentat_ffi/InProgress.t.html new file mode 100644 index 00000000..4892260c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/InProgress.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.InProgress.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/InProgressBuilder.t.html b/docs/apis/rust/0.7.0/mentat_ffi/InProgressBuilder.t.html new file mode 100644 index 00000000..4fa2ef15 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/InProgressBuilder.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.InProgressBuilder.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/InProgressTransactResult.t.html b/docs/apis/rust/0.7.0/mentat_ffi/InProgressTransactResult.t.html new file mode 100644 index 00000000..fd1303ed --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/InProgressTransactResult.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.InProgressTransactResult.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/IntoThing.t.html b/docs/apis/rust/0.7.0/mentat_ffi/IntoThing.t.html new file mode 100644 index 00000000..1fbf012e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/IntoThing.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.IntoThing.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/KnownEntid.t.html b/docs/apis/rust/0.7.0/mentat_ffi/KnownEntid.t.html new file mode 100644 index 00000000..f715cf77 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/KnownEntid.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.KnownEntid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/QueryBuilder.t.html b/docs/apis/rust/0.7.0/mentat_ffi/QueryBuilder.t.html new file mode 100644 index 00000000..ce8cc39b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/QueryBuilder.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.QueryBuilder.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/QueryInputs.t.html b/docs/apis/rust/0.7.0/mentat_ffi/QueryInputs.t.html new file mode 100644 index 00000000..e805aadc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/QueryInputs.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.QueryInputs.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/QueryOutput.t.html b/docs/apis/rust/0.7.0/mentat_ffi/QueryOutput.t.html new file mode 100644 index 00000000..56ae12d8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/QueryOutput.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.QueryOutput.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/QueryResults.t.html b/docs/apis/rust/0.7.0/mentat_ffi/QueryResults.t.html new file mode 100644 index 00000000..b52d422e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/QueryResults.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.QueryResults.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/Queryable.t.html b/docs/apis/rust/0.7.0/mentat_ffi/Queryable.t.html new file mode 100644 index 00000000..6a690d5c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/Queryable.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.Queryable.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/RelResult.t.html b/docs/apis/rust/0.7.0/mentat_ffi/RelResult.t.html new file mode 100644 index 00000000..28847dea --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/RelResult.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.RelResult.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/Store.t.html b/docs/apis/rust/0.7.0/mentat_ffi/Store.t.html new file mode 100644 index 00000000..df3a3c40 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/Store.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Store.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/Syncable.t.html b/docs/apis/rust/0.7.0/mentat_ffi/Syncable.t.html new file mode 100644 index 00000000..d189cf43 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/Syncable.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.Syncable.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/TransactionChange.t.html b/docs/apis/rust/0.7.0/mentat_ffi/TransactionChange.t.html new file mode 100644 index 00000000..26f0669f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/TransactionChange.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.TransactionChange.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/TxChangeList.t.html b/docs/apis/rust/0.7.0/mentat_ffi/TxChangeList.t.html new file mode 100644 index 00000000..f8acc1a6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/TxChangeList.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.TxChangeList.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/TxObserver.t.html b/docs/apis/rust/0.7.0/mentat_ffi/TxObserver.t.html new file mode 100644 index 00000000..fa2f3723 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/TxObserver.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.TxObserver.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/TxReport.t.html b/docs/apis/rust/0.7.0/mentat_ffi/TxReport.t.html new file mode 100644 index 00000000..94bca9f7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/TxReport.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.TxReport.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/TypedValue.t.html b/docs/apis/rust/0.7.0/mentat_ffi/TypedValue.t.html new file mode 100644 index 00000000..8b0ac4a6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/TypedValue.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.TypedValue.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/Uuid.t.html b/docs/apis/rust/0.7.0/mentat_ffi/Uuid.t.html new file mode 100644 index 00000000..60b8c2f7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/Uuid.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Uuid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/ValueType.t.html b/docs/apis/rust/0.7.0/mentat_ffi/ValueType.t.html new file mode 100644 index 00000000..2809fdde --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/ValueType.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.ValueType.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/Variable.t.html b/docs/apis/rust/0.7.0/mentat_ffi/Variable.t.html new file mode 100644 index 00000000..37fb069f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/Variable.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Variable.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/android/LogLevel.t.html b/docs/apis/rust/0.7.0/mentat_ffi/android/LogLevel.t.html new file mode 100644 index 00000000..4a3c617a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/android/LogLevel.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.LogLevel.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/android/__android_log_write.v.html b/docs/apis/rust/0.7.0/mentat_ffi/android/__android_log_write.v.html new file mode 100644 index 00000000..1e83f7d4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/android/__android_log_write.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.__android_log_write.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/android/enum.LogLevel.html b/docs/apis/rust/0.7.0/mentat_ffi/android/enum.LogLevel.html new file mode 100644 index 00000000..ce4a1230 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/android/enum.LogLevel.html @@ -0,0 +1,143 @@ + + + + + + + + + + mentat_ffi::android::LogLevel - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_ffi::android::LogLevel + + [] + + [src]

pub enum LogLevel {
+    Debug,
+    Info,
+    Warn,
+    Error,
+}

+ Variants

+ +

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl Send for LogLevel

impl Sync for LogLevel

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/android/fn.__android_log_write.html b/docs/apis/rust/0.7.0/mentat_ffi/android/fn.__android_log_write.html new file mode 100644 index 00000000..587ba92a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/android/fn.__android_log_write.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_ffi::android::__android_log_write - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::android::__android_log_write + + [] + + [src]

pub unsafe extern "C" fn __android_log_write(
    prio: c_int,
    tag: *const c_char,
    text: *const c_char
) -> c_int
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/android/index.html b/docs/apis/rust/0.7.0/mentat_ffi/android/index.html new file mode 100644 index 00000000..3fb89292 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/android/index.html @@ -0,0 +1,142 @@ + + + + + + + + + + mentat_ffi::android - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_ffi::android + + [] + + [src]

Enums

+ + + + +
LogLevel + +

Functions

+ + + + +
__android_log_write + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/android/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_ffi/android/sidebar-items.js new file mode 100644 index 00000000..b4be5af1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/android/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["LogLevel",""]],"fn":[["__android_log_write",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/changelist_entry_at.v.html b/docs/apis/rust/0.7.0/mentat_ffi/changelist_entry_at.v.html new file mode 100644 index 00000000..d05d2ec7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/changelist_entry_at.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.changelist_entry_at.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/destroy.v.html b/docs/apis/rust/0.7.0/mentat_ffi/destroy.v.html new file mode 100644 index 00000000..f98deece --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/destroy.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.destroy.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_boolean.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_boolean.v.html new file mode 100644 index 00000000..bab30263 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_boolean.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_add_boolean.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_double.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_double.v.html new file mode 100644 index 00000000..c13b209d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_double.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_add_double.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_keyword.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_keyword.v.html new file mode 100644 index 00000000..93523fa0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_keyword.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_add_keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_long.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_long.v.html new file mode 100644 index 00000000..6cb9e37b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_long.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_add_long.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_ref.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_ref.v.html new file mode 100644 index 00000000..40d4fb7d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_ref.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_add_ref.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_string.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_string.v.html new file mode 100644 index 00000000..a0ee0376 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_string.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_add_string.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_timestamp.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_timestamp.v.html new file mode 100644 index 00000000..cc00760b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_timestamp.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_add_timestamp.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_uuid.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_uuid.v.html new file mode 100644 index 00000000..ed41c773 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_add_uuid.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_add_uuid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_commit.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_commit.v.html new file mode 100644 index 00000000..0b969406 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_commit.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_commit.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_destroy.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_destroy.v.html new file mode 100644 index 00000000..f7a6538d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_destroy.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_destroy.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_boolean.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_boolean.v.html new file mode 100644 index 00000000..eb205e54 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_boolean.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_retract_boolean.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_double.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_double.v.html new file mode 100644 index 00000000..e7211ec0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_double.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_retract_double.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_keyword.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_keyword.v.html new file mode 100644 index 00000000..ff4d8d9f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_keyword.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_retract_keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_long.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_long.v.html new file mode 100644 index 00000000..310feff0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_long.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_retract_long.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_ref.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_ref.v.html new file mode 100644 index 00000000..e7b3e654 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_ref.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_retract_ref.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_string.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_string.v.html new file mode 100644 index 00000000..23f9c87a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_string.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_retract_string.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_timestamp.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_timestamp.v.html new file mode 100644 index 00000000..fdcc56ef --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_timestamp.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_retract_timestamp.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_uuid.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_uuid.v.html new file mode 100644 index 00000000..3991cf07 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_retract_uuid.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_retract_uuid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_transact.v.html b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_transact.v.html new file mode 100644 index 00000000..63e3d445 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/entity_builder_transact.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.entity_builder_transact.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/enum.Binding.html b/docs/apis/rust/0.7.0/mentat_ffi/enum.Binding.html new file mode 100644 index 00000000..062d69a2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/enum.Binding.html @@ -0,0 +1,166 @@ + + + + + + + + + + mentat_ffi::Binding - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_ffi::Binding + + [] + + [src]

pub enum Binding {
+    Scalar(TypedValue),
+    Vec(Arc<Vec<Binding>>),
+    Map(Arc<StructuredMap>),
+}

The values bound in a query specification can be:

+
    +
  • Vecs of structured values, for multi-valued component attributes or nested expressions.
  • +
  • Single structured values, for single-valued component attributes or nested expressions.
  • +
  • Single typed values, for simple attributes.
  • +
+

The Binding enum defines these three options.

+

Datomic also supports structured inputs; at present Mentat does not, but this type +would also serve that purpose.

+

Note that maps are not ordered, and so Binding is neither Ord nor PartialOrd.

+

+ Variants

+ +

+ Methods +

+

impl Binding
[src]

impl Binding
[src]

Returns true if the provided type is Some and matches this value's type, or if the +provided type is None.

+

impl Binding
[src]

+

+ Trait Implementations +

+
+

impl Clone for Binding
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<StructuredMap> for Binding
[src]

Performs the conversion.

+

impl From<Vec<Binding>> for Binding
[src]

Performs the conversion.

+

impl<T> From<T> for Binding where
    T: Into<TypedValue>, 
[src]

Performs the conversion.

+

impl Eq for Binding
[src]

impl PartialEq<Binding> for Binding
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for Binding
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for Binding

impl Sync for Binding

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/enum.CacheDirection.html b/docs/apis/rust/0.7.0/mentat_ffi/enum.CacheDirection.html new file mode 100644 index 00000000..adb148ea --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/enum.CacheDirection.html @@ -0,0 +1,147 @@ + + + + + + + + + + mentat_ffi::CacheDirection - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_ffi::CacheDirection + + [] + +

pub enum CacheDirection {
+    Forward,
+    Reverse,
+    Both,
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Copy for CacheDirection

impl Clone for CacheDirection

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Eq for CacheDirection

impl PartialEq<CacheDirection> for CacheDirection

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for CacheDirection

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/enum.FindSpec.html b/docs/apis/rust/0.7.0/mentat_ffi/enum.FindSpec.html new file mode 100644 index 00000000..bed0fb10 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/enum.FindSpec.html @@ -0,0 +1,192 @@ + + + + + + + + + + mentat_ffi::FindSpec - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_ffi::FindSpec + + [] + + [src]

pub enum FindSpec {
+    FindRel(Vec<Element>),
+    FindColl(Element),
+    FindTuple(Vec<Element>),
+    FindScalar(Element),
+}

A definition of the first part of a find query: the +[:find ?foo ?bar…] bit.

+

There are four different kinds of find specs, allowing you to query for +a single value, a collection of values from different entities, a single +tuple (relation), or a collection of tuples.

+

Examples:

+ +
+
+
+  let elements = vec![
+    Element::Variable(Variable::from_valid_name("?foo")),
+    Element::Variable(Variable::from_valid_name("?bar")),
+  ];
+  let rel = FindSpec::FindRel(elements);
+
+  if let FindSpec::FindRel(elements) = rel {
+    assert_eq!(2, elements.len());
+  }
+
+

+ Variants

+

Returns an array of arrays, represented as a single array with length a multiple of width.

+

Returns an array of scalars, usually homogeneous. +This is equivalent to mapping over the results of a FindRel, +returning the first value of each.

+

Returns a single tuple: a heterogeneous array of scalars. Equivalent to +taking the first result from a FindRel.

+

Returns a single scalar value. Equivalent to taking the first result +from a FindColl.

+
+

+ Methods +

+

impl FindSpec
[src]

Returns true if the provided FindSpec returns at most one result.

+

Returns true if the provided FindSpec cares about distinct results.

+

I use the words "cares about" because find is generally defined in terms of producing distinct +results at the Datalog level.

+

Two of the find specs (scalar and tuple) produce only a single result. Those don't need to be +run with SELECT DISTINCT, because we're only consuming a single result. Those queries will be +run with LIMIT 1.

+

Additionally, some projections cannot produce duplicate results: [:find (max ?x) …], for +example.

+

This function gives us the hook to add that logic when we're ready.

+

Beyond this, DISTINCT is not always needed. For example, in some kinds of accumulation or +sampling projections we might not need to do it at the SQL level because we're consuming into +a dupe-eliminating data structure like a Set, or we know that a particular query cannot produce +duplicate results.

+

Important traits for Box<R>

+

+ Trait Implementations +

+
+

impl Eq for FindSpec
[src]

impl PartialEq<FindSpec> for FindSpec
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for FindSpec
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for FindSpec

impl !Sync for FindSpec

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/enum.QueryResults.html b/docs/apis/rust/0.7.0/mentat_ffi/enum.QueryResults.html new file mode 100644 index 00000000..c44ad895 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/enum.QueryResults.html @@ -0,0 +1,153 @@ + + + + + + + + + + mentat_ffi::QueryResults - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_ffi::QueryResults + + [] + + [src]

pub enum QueryResults {
+    Scalar(Option<Binding>),
+    Tuple(Option<Vec<Binding>>),
+    Coll(Vec<Binding>),
+    Rel(RelResult<Binding>),
+}

+ Variants

+ +

+ Methods +

+

impl QueryResults
[src]

+

+ Trait Implementations +

+
+

impl Clone for QueryResults
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<QueryOutput> for QueryResults
[src]

Performs the conversion.

+

impl Eq for QueryResults
[src]

impl PartialEq<QueryResults> for QueryResults
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for QueryResults
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for QueryResults

impl Sync for QueryResults

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/enum.TypedValue.html b/docs/apis/rust/0.7.0/mentat_ffi/enum.TypedValue.html new file mode 100644 index 00000000..49847a92 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/enum.TypedValue.html @@ -0,0 +1,206 @@ + + + + + + + + + + mentat_ffi::TypedValue - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_ffi::TypedValue + + [] + + [src]

pub enum TypedValue {
+    Ref(i64),
+    Boolean(bool),
+    Long(i64),
+    Double(OrderedFloat<f64>),
+    Instant(DateTime<Utc>),
+    String(Arc<String>),
+    Keyword(Arc<Keyword>),
+    Uuid(Uuid),
+}

Represents a value that can be stored in a Mentat store.

+

+ Variants

+ +

+ Methods +

+

impl TypedValue
[src]

Returns true if the provided type is Some and matches this value's type, or if the +provided type is None.

+

Construct a new TypedValue::Keyword instance by cloning the provided +values and wrapping them in a new ValueRc. This is expensive, so this might +be best limited to tests.

+

Construct a new TypedValue::String instance by cloning the provided +value and wrapping it in a new ValueRc. This is expensive, so this might +be best limited to tests.

+

Construct a new TypedValue::Instant instance from the provided +microsecond timestamp.

+

impl TypedValue
[src]

+

+ Trait Implementations +

+
+

impl FromThing<TypedValue> for Either<TypedValue, Rc<TempId>>

impl PartialOrd<TypedValue> for TypedValue
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Clone for TypedValue
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<DateTime<Utc>> for TypedValue
[src]

Truncate the provided DateTime to microsecond precision, and return the corresponding +TypedValue::Instant.

+

Performs the conversion.

+

impl From<Uuid> for TypedValue
[src]

Performs the conversion.

+

impl From<String> for TypedValue
[src]

Performs the conversion.

+

impl From<bool> for TypedValue
[src]

Performs the conversion.

+

impl From<Box<String>> for TypedValue
[src]

Performs the conversion.

+

impl From<i32> for TypedValue
[src]

Performs the conversion.

+

impl From<Rc<Keyword>> for TypedValue
[src]

Performs the conversion.

+

impl<'a> From<&'a str> for TypedValue
[src]

Performs the conversion.

+

impl From<Keyword> for TypedValue
[src]

Performs the conversion.

+

impl From<Rc<String>> for TypedValue
[src]

Performs the conversion.

+

impl From<Arc<String>> for TypedValue
[src]

Performs the conversion.

+

impl From<Arc<Keyword>> for TypedValue
[src]

Performs the conversion.

+

impl From<u32> for TypedValue
[src]

Performs the conversion.

+

impl From<f64> for TypedValue
[src]

Performs the conversion.

+

impl From<KnownEntid> for TypedValue
[src]

Performs the conversion.

+

impl Ord for TypedValue
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<'de> Deserialize<'de> for TypedValue
[src]

Deserialize this value from the given Serde deserializer. Read more

+

impl Hash for TypedValue
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for TypedValue
[src]

impl PartialEq<TypedValue> for TypedValue
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for TypedValue
[src]

Formats the value using the given formatter. Read more

+

impl Serialize for TypedValue
[src]

Serialize this value into the given Serde serializer. Read more

+

impl TransactableValue for TypedValue
[src]

Coerce this value place into the given type. This is where we perform schema-aware coercion, for example coercing an integral value into a ref where appropriate. Read more

+

Make an entity place out of this value place. This is where we limit values in nested maps to valid entity places. Read more

+

impl TypedSQLValue for TypedValue
[src]

Given a SQLite value and a value_type_tag, return the corresponding TypedValue.

+

Given an EDN value, return a corresponding Mentat TypedValue.

+

An EDN Value does not encode a unique Mentat ValueType, so the composition +from_edn_value(first(to_edn_value_pair(...))) loses information. Additionally, there are +EDN values which are not Mentat typed values.

+

This function is deterministic.

+

Return the corresponding SQLite value and value_type_tag pair.

+

Return the corresponding EDN value and value_type pair.

+
+

+ Auto Trait Implementations +

+
+

impl Send for TypedValue

impl Sync for TypedValue

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/enum.ValueType.html b/docs/apis/rust/0.7.0/mentat_ffi/enum.ValueType.html new file mode 100644 index 00000000..ff31ef58 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/enum.ValueType.html @@ -0,0 +1,187 @@ + + + + + + + + + + mentat_ffi::ValueType - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_ffi::ValueType + + [] + + [src]

#[repr(u32)] +
pub enum ValueType { + Ref, + Boolean, + Instant, + Long, + Double, + String, + Keyword, + Uuid, +}

The attribute of each Mentat assertion has a :db/valueType constraining the value to a +particular set. Mentat recognizes the following :db/valueType values.

+

+ Variants

+ +

+ Methods +

+

impl ValueType
[src]

impl ValueType
[src]

+

+ Trait Implementations +

+
+

impl SQLValueType for ValueType
[src]

Return a pair of the ValueTypeTag for this value type, and the SQLTypeAffinity required to distinguish it from any other types that share the same tag. Read more

+

Returns true if the provided integer is in the SQLite value space of this type. For +example, 1 is how we encode true.

+ +
+use mentat_core::{ValueType, SQLValueType};
+assert!(!ValueType::Instant.accommodates_integer(1493399581314));
+assert!(!ValueType::Instant.accommodates_integer(1493399581314000));
+assert!(ValueType::Boolean.accommodates_integer(1));
+assert!(!ValueType::Boolean.accommodates_integer(-1));
+assert!(!ValueType::Boolean.accommodates_integer(10));
+assert!(!ValueType::String.accommodates_integer(10));
+

impl PartialOrd<ValueType> for ValueType
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Copy for ValueType
[src]

impl Clone for ValueType
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<ValueType> for ValueTypeSet
[src]

Performs the conversion.

+

impl Ord for ValueType
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Extend<ValueType> for ValueTypeSet
[src]

Extends a collection with the contents of an iterator. Read more

+

impl Hash for ValueType
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for ValueType
[src]

impl PartialEq<ValueType> for ValueType
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl FromIterator<ValueType> for ValueTypeSet
[src]

Creates a value from an iterator. Read more

+

impl Display for ValueType
[src]

Formats the value using the given formatter. Read more

+

impl Debug for ValueType
[src]

Formats the value using the given formatter. Read more

+

impl CLike for ValueType
[src]

Converts a C-like enum to a u32. The value must be <= 31.

+

Converts a u32 to a C-like enum. This method only needs to be safe for possible return values of to_u32 of this trait. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for ValueType

impl Sync for ValueType

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.changelist_entry_at.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.changelist_entry_at.html new file mode 100644 index 00000000..33057f46 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.changelist_entry_at.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_ffi::changelist_entry_at - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::changelist_entry_at + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn changelist_entry_at(
    tx_report: *mut TransactionChange,
    index: c_int
) -> Entid

Returns the value at the provided index as a Entid .

+

Panics

+

If there is no value present at the index.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.destroy.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.destroy.html new file mode 100644 index 00000000..8294c54e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.destroy.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_ffi::destroy - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::destroy + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn destroy(obj: *mut c_void)
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_boolean.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_boolean.html new file mode 100644 index 00000000..1e55075a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_boolean.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_add_boolean - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_add_boolean + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_add_boolean<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>,
    kw: *const c_char,
    value: bool
) -> *mut ExternResult

Uses builder to assert value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/boolean.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_double.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_double.html new file mode 100644 index 00000000..f90cf13d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_double.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_add_double - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_add_double + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_add_double<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>,
    kw: *const c_char,
    value: f64
) -> *mut ExternResult

Uses builder to assert value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/double.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_keyword.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_keyword.html new file mode 100644 index 00000000..d949bf7f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_keyword.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_add_keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_add_keyword + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_add_keyword<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>,
    kw: *const c_char,
    value: *const c_char
) -> *mut ExternResult

Uses builder to assert value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/keyword.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_long.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_long.html new file mode 100644 index 00000000..c7c7ac6a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_long.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_add_long - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_add_long + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_add_long<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>,
    kw: *const c_char,
    value: c_longlong
) -> *mut ExternResult

Uses builder to assert value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/long.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_ref.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_ref.html new file mode 100644 index 00000000..d03df631 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_ref.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_add_ref - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_add_ref + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_add_ref<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>,
    kw: *const c_char,
    value: c_longlong
) -> *mut ExternResult

Uses builder to assert value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/ref.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_string.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_string.html new file mode 100644 index 00000000..835529d0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_string.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_add_string - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_add_string + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_add_string<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>,
    kw: *const c_char,
    value: *const c_char
) -> *mut ExternResult

Uses builder to assert value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/string.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_timestamp.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_timestamp.html new file mode 100644 index 00000000..f9d563fa --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_timestamp.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_add_timestamp - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_add_timestamp + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_add_timestamp<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>,
    kw: *const c_char,
    value: c_longlong
) -> *mut ExternResult

Uses builder to assert value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/instant.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_uuid.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_uuid.html new file mode 100644 index 00000000..8589e3e4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_add_uuid.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_add_uuid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_add_uuid + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_add_uuid<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>,
    kw: *const c_char,
    value: *mut [u8; 16]
) -> *mut ExternResult

Uses builder to assert value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/uuid.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_commit.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_commit.html new file mode 100644 index 00000000..f37f0010 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_commit.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_commit - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_commit + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_commit<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>
) -> *mut ExternResult

Transacts and commits all the assertions and retractions that have been performed +using this builder.

+

This consumes the builder and the enclosed InProgress transaction.

+

Returns a Result as an ExternResult.

+

TODO: Document the errors that can result from transact

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_destroy.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_destroy.html new file mode 100644 index 00000000..10fd0a8e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_destroy.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_ffi::entity_builder_destroy - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_destroy + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_destroy<'a, 'c>(
    obj: *mut EntityBuilder<InProgressBuilder<'a, 'c>>
)
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_boolean.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_boolean.html new file mode 100644 index 00000000..e564a949 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_boolean.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_retract_boolean - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_retract_boolean + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_retract_boolean<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>,
    kw: *const c_char,
    value: bool
) -> *mut ExternResult

Uses builder to retract value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/boolean.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_double.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_double.html new file mode 100644 index 00000000..f29fbb36 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_double.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_retract_double - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_retract_double + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_retract_double<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>,
    kw: *const c_char,
    value: f64
) -> *mut ExternResult

Uses builder to retract value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/double.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_keyword.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_keyword.html new file mode 100644 index 00000000..f4bfdabb --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_keyword.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_retract_keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_retract_keyword + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_retract_keyword<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>,
    kw: *const c_char,
    value: *const c_char
) -> *mut ExternResult

Uses builder to retract value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/keyword.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_long.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_long.html new file mode 100644 index 00000000..846b9f46 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_long.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_retract_long - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_retract_long + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_retract_long<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>,
    kw: *const c_char,
    value: c_longlong
) -> *mut ExternResult

Uses builder to retract value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/long.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_ref.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_ref.html new file mode 100644 index 00000000..633c2cd3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_ref.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_retract_ref - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_retract_ref + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_retract_ref<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>,
    kw: *const c_char,
    value: c_longlong
) -> *mut ExternResult

Uses builder to retract value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/ref.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_string.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_string.html new file mode 100644 index 00000000..a4dc41b9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_string.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_retract_string - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_retract_string + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_retract_string<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>,
    kw: *const c_char,
    value: *const c_char
) -> *mut ExternResult

Uses builder to retract value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/string.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_timestamp.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_timestamp.html new file mode 100644 index 00000000..3de7dfbc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_timestamp.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_retract_timestamp - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_retract_timestamp + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_retract_timestamp<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>,
    kw: *const c_char,
    value: c_longlong
) -> *mut ExternResult

Uses builder to retract value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/instant.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_uuid.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_uuid.html new file mode 100644 index 00000000..4f2f4249 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_retract_uuid.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::entity_builder_retract_uuid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_retract_uuid + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_retract_uuid<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>,
    kw: *const c_char,
    value: *mut [u8; 16]
) -> *mut ExternResult

Uses builder to retract value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/uuid.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_transact.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_transact.html new file mode 100644 index 00000000..021b1d40 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.entity_builder_transact.html @@ -0,0 +1,137 @@ + + + + + + + + + + mentat_ffi::entity_builder_transact - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::entity_builder_transact + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn entity_builder_transact<'a, 'c>(
    builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>
) -> *mut InProgressTransactResult<'a, 'c>

Transacts all the assertions and retractions that have been performed +using this builder.

+

This consumes the builder and returns the enclosed InProgress transaction +inside the [InProgressTransactResult][::InProgressTransactResult] alongside the TxReport generated +by the transact.

+

Safety

+

Callers are responsible for managing the memory for the return value. +The destructors in_progress_destroy and tx_report_destroy are provided for +releasing the memory for these pointer types.

+

TODO: Document the errors that can result from transact

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder.html new file mode 100644 index 00000000..8c329e53 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_ffi::in_progress_builder - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder<'m>(
    in_progress: *mut InProgress<'m, 'm>
) -> *mut InProgressBuilder

Creates a builder using the in progress transaction to allow for programmatic +assertion of values.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor in_progress_builder_destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_boolean.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_boolean.html new file mode 100644 index 00000000..028bd836 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_boolean.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_add_boolean - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_add_boolean + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_add_boolean<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>,
    entid: c_longlong,
    kw: *const c_char,
    value: bool
) -> *mut ExternResult

Uses builder to assert value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/boolean.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_double.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_double.html new file mode 100644 index 00000000..5d2085ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_double.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_add_double - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_add_double + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_add_double<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>,
    entid: c_longlong,
    kw: *const c_char,
    value: f64
) -> *mut ExternResult

Uses builder to assert value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/double.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_keyword.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_keyword.html new file mode 100644 index 00000000..103fc6e8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_keyword.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_add_keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_add_keyword + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_add_keyword<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>,
    entid: c_longlong,
    kw: *const c_char,
    value: *const c_char
) -> *mut ExternResult

Uses builder to assert value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If value is not present as an attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/keyword.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_long.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_long.html new file mode 100644 index 00000000..7173b763 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_long.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_add_long - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_add_long + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_add_long<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>,
    entid: c_longlong,
    kw: *const c_char,
    value: c_longlong
) -> *mut ExternResult

Uses builder to assert value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/long.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_ref.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_ref.html new file mode 100644 index 00000000..6fc852ce --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_ref.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_add_ref - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_add_ref + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_add_ref<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>,
    entid: c_longlong,
    kw: *const c_char,
    value: c_longlong
) -> *mut ExternResult

Uses builder to assert value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If value is not present as an Entid in the store. +If the :db/type of the attribute described by kw is not :db.type/ref.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_string.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_string.html new file mode 100644 index 00000000..870957e7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_string.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_add_string - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_add_string + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_add_string<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>,
    entid: c_longlong,
    kw: *const c_char,
    value: *const c_char
) -> *mut ExternResult

Uses builder to assert value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/string.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_timestamp.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_timestamp.html new file mode 100644 index 00000000..f76ff5c4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_timestamp.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_add_timestamp - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_add_timestamp + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_add_timestamp<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>,
    entid: c_longlong,
    kw: *const c_char,
    value: c_longlong
) -> *mut ExternResult

Uses builder to assert value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/instant.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_uuid.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_uuid.html new file mode 100644 index 00000000..928fc334 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_add_uuid.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_add_uuid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_add_uuid + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_add_uuid<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>,
    entid: c_longlong,
    kw: *const c_char,
    value: *mut [u8; 16]
) -> *mut ExternResult

Uses builder to assert value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/uuid.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_commit.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_commit.html new file mode 100644 index 00000000..0ae075a9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_commit.html @@ -0,0 +1,131 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_commit - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_commit + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_commit<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>
) -> *mut ExternResult

Transacts and commits all the assertions and retractions that have been performed +using this builder.

+

This consumes the builder and the enclosed InProgress transaction.

+

Returns a [Result<()>(std::result::Result) as an ExternResult.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_destroy.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_destroy.html new file mode 100644 index 00000000..de27ad27 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_destroy.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_destroy - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_destroy + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_destroy<'a, 'c>(
    obj: *mut InProgressBuilder<'a, 'c>
)
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_boolean.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_boolean.html new file mode 100644 index 00000000..a20daf7c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_boolean.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_retract_boolean - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_retract_boolean + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_retract_boolean<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>,
    entid: c_longlong,
    kw: *const c_char,
    value: bool
) -> *mut ExternResult

Uses builder to retract value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/boolean.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_double.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_double.html new file mode 100644 index 00000000..63d92946 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_double.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_retract_double - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_retract_double + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_retract_double<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>,
    entid: c_longlong,
    kw: *const c_char,
    value: f64
) -> *mut ExternResult

Uses builder to retract value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/double.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_keyword.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_keyword.html new file mode 100644 index 00000000..5e354f80 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_keyword.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_retract_keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_retract_keyword + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_retract_keyword<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>,
    entid: c_longlong,
    kw: *const c_char,
    value: *const c_char
) -> *mut ExternResult

Uses builder to retract value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/keyword.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_long.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_long.html new file mode 100644 index 00000000..7e3f2827 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_long.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_retract_long - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_retract_long + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_retract_long<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>,
    entid: c_longlong,
    kw: *const c_char,
    value: c_longlong
) -> *mut ExternResult

Uses builder to retract value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/long.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_ref.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_ref.html new file mode 100644 index 00000000..9e8a82d2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_ref.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_retract_ref - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_retract_ref + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_retract_ref<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>,
    entid: c_longlong,
    kw: *const c_char,
    value: c_longlong
) -> *mut ExternResult

Uses builder to retract value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/ref.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_string.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_string.html new file mode 100644 index 00000000..1b1c5561 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_string.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_retract_string - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_retract_string + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_retract_string<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>,
    entid: c_longlong,
    kw: *const c_char,
    value: *const c_char
) -> *mut ExternResult

Uses builder to retract value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/string.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_timestamp.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_timestamp.html new file mode 100644 index 00000000..32ff1de0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_timestamp.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_retract_timestamp - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_retract_timestamp + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_retract_timestamp<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>,
    entid: c_longlong,
    kw: *const c_char,
    value: c_longlong
) -> *mut ExternResult

Uses builder to retract value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/instant.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_uuid.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_uuid.html new file mode 100644 index 00000000..857cead4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_retract_uuid.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_retract_uuid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_retract_uuid + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_retract_uuid<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>,
    entid: c_longlong,
    kw: *const c_char,
    value: *mut [u8; 16]
) -> *mut ExternResult

Uses builder to retract value for kw on entity entid.

+

Errors

+

If entid is not present in the store. +If kw is not a valid attribute in the store. +If the :db/type of the attribute described by kw is not :db.type/uuid.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_transact.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_transact.html new file mode 100644 index 00000000..c37314a4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_builder_transact.html @@ -0,0 +1,136 @@ + + + + + + + + + + mentat_ffi::in_progress_builder_transact - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_builder_transact + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_builder_transact<'a, 'c>(
    builder: *mut InProgressBuilder<'a, 'c>
) -> *mut InProgressTransactResult<'a, 'c>

Transacts all the assertions and retractions that have been performed +using this builder.

+

This consumes the builder and returns the enclosed InProgress transaction +inside the InProgressTransactResult alongside the TxReport generated +by the transact.

+

Safety

+

Callers are responsible for managing the memory for the return value. +The destructors in_progress_destroy and tx_report_destroy arew provided for +releasing the memory for these pointer types.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_commit.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_commit.html new file mode 100644 index 00000000..4ae7b291 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_commit.html @@ -0,0 +1,131 @@ + + + + + + + + + + mentat_ffi::in_progress_commit - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_commit + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_commit<'m>(
    in_progress: *mut InProgress<'m, 'm>
) -> *mut ExternResult

Commit all the transacts that have been performed using this +in progress transaction.

+

Returns a Result<()> as an ExternResult.

+

TODO: Document the errors that can result from transact

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_destroy.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_destroy.html new file mode 100644 index 00000000..282b99d2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_destroy.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_ffi::in_progress_destroy - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_destroy + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_destroy(obj: *mut InProgress)
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_entity_builder_from_entid.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_entity_builder_from_entid.html new file mode 100644 index 00000000..acf30892 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_entity_builder_from_entid.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_ffi::in_progress_entity_builder_from_entid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_entity_builder_from_entid + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_entity_builder_from_entid<'m>(
    in_progress: *mut InProgress<'m, 'm>,
    entid: c_longlong
) -> *mut EntityBuilder<InProgressBuilder>

Creates a builder for an entity with entid using the in progress transaction to +allow for programmatic assertion of values for that entity.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor entity_builder_destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_entity_builder_from_temp_id.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_entity_builder_from_temp_id.html new file mode 100644 index 00000000..523e5cdd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_entity_builder_from_temp_id.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_ffi::in_progress_entity_builder_from_temp_id - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_entity_builder_from_temp_id + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_entity_builder_from_temp_id<'m>(
    in_progress: *mut InProgress<'m, 'm>,
    temp_id: *const c_char
) -> *mut EntityBuilder<InProgressBuilder>

Creates a builder for an entity with tempid using the in progress transaction to +allow for programmatic assertion of values for that entity.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor entity_builder_destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_rollback.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_rollback.html new file mode 100644 index 00000000..bbd1e8f3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_rollback.html @@ -0,0 +1,131 @@ + + + + + + + + + + mentat_ffi::in_progress_rollback - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_rollback + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_rollback<'m>(
    in_progress: *mut InProgress<'m, 'm>
) -> *mut ExternResult

Rolls back all the transacts that have been performed using this +in progress transaction.

+

Returns a Result<()> as an ExternResult.

+

TODO: Document the errors that can result from rollback

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_transact.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_transact.html new file mode 100644 index 00000000..56a78a7f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.in_progress_transact.html @@ -0,0 +1,135 @@ + + + + + + + + + + mentat_ffi::in_progress_transact - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::in_progress_transact + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn in_progress_transact<'m>(
    in_progress: *mut InProgress<'m, 'm>,
    transaction: *const c_char
) -> *mut ExternResult

Perform a single transact operation using the current in progress +transaction. Takes edn as a string to transact.

+

Returns a Result as an ExternResult.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor tx_report_destroy is provided for releasing the memory for this +pointer type.

+

TODO: Document the errors that can result from transact

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_boolean.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_boolean.html new file mode 100644 index 00000000..9669bb53 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_boolean.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_ffi::query_builder_bind_boolean - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::query_builder_bind_boolean + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn query_builder_bind_boolean(
    query_builder: *mut QueryBuilder,
    var: *const c_char,
    value: bool
)

Binds a TypedValue::Boolean to a Variable with the given name.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_double.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_double.html new file mode 100644 index 00000000..44e3aaec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_double.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_ffi::query_builder_bind_double - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::query_builder_bind_double + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn query_builder_bind_double(
    query_builder: *mut QueryBuilder,
    var: *const c_char,
    value: f64
)

Binds a TypedValue::Double to a Variable with the given name.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_kw.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_kw.html new file mode 100644 index 00000000..316c612d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_kw.html @@ -0,0 +1,129 @@ + + + + + + + + + + mentat_ffi::query_builder_bind_kw - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::query_builder_bind_kw + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn query_builder_bind_kw(
    query_builder: *mut QueryBuilder,
    var: *const c_char,
    value: *const c_char
)

Binds a TypedValue::Ref to a Variable with the given name. Takes a keyword as a c string in the format +:namespace/name and converts it into an NamespacedKeyworf.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_long.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_long.html new file mode 100644 index 00000000..a2c19150 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_long.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_ffi::query_builder_bind_long - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::query_builder_bind_long + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn query_builder_bind_long(
    query_builder: *mut QueryBuilder,
    var: *const c_char,
    value: c_longlong
)

Binds a TypedValue::Long to a Variable with the given name.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_ref.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_ref.html new file mode 100644 index 00000000..c7503afd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_ref.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_ffi::query_builder_bind_ref - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::query_builder_bind_ref + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn query_builder_bind_ref(
    query_builder: *mut QueryBuilder,
    var: *const c_char,
    value: c_longlong
)

Binds a TypedValue::Ref to a Variable with the given name.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_ref_kw.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_ref_kw.html new file mode 100644 index 00000000..6a7a0dd1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_ref_kw.html @@ -0,0 +1,131 @@ + + + + + + + + + + mentat_ffi::query_builder_bind_ref_kw - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::query_builder_bind_ref_kw + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn query_builder_bind_ref_kw(
    query_builder: *mut QueryBuilder,
    var: *const c_char,
    value: *const c_char
)

Binds a TypedValue::Ref to a Variable with the given name. Takes a keyword as a c string in the format +:namespace/name and converts it into an NamespacedKeyworf.

+

Panics

+

If the provided keyword does not map to a valid keyword in the schema.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_string.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_string.html new file mode 100644 index 00000000..8c4dc63f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_string.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_ffi::query_builder_bind_string - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::query_builder_bind_string + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn query_builder_bind_string(
    query_builder: *mut QueryBuilder,
    var: *const c_char,
    value: *const c_char
)

Binds a TypedValue::String to a Variable with the given name.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_timestamp.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_timestamp.html new file mode 100644 index 00000000..a8eab9d5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_timestamp.html @@ -0,0 +1,129 @@ + + + + + + + + + + mentat_ffi::query_builder_bind_timestamp - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::query_builder_bind_timestamp + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn query_builder_bind_timestamp(
    query_builder: *mut QueryBuilder,
    var: *const c_char,
    value: c_longlong
)

Binds a TypedValue::Instant to a Variable with the given name. +Takes a timestamp in microseconds.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_uuid.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_uuid.html new file mode 100644 index 00000000..9e791a74 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_bind_uuid.html @@ -0,0 +1,129 @@ + + + + + + + + + + mentat_ffi::query_builder_bind_uuid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::query_builder_bind_uuid + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn query_builder_bind_uuid(
    query_builder: *mut QueryBuilder,
    var: *const c_char,
    value: *mut [u8; 16]
)

Binds a TypedValue::Uuid to a Variable with the given name. +Takes a UUID as a byte slice of length 16. This maps directly to the uuid_t C type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_destroy.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_destroy.html new file mode 100644 index 00000000..91b87a8d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_destroy.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_ffi::query_builder_destroy - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::query_builder_destroy + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn query_builder_destroy(obj: *mut QueryBuilder)
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_execute.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_execute.html new file mode 100644 index 00000000..d816cc4d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_execute.html @@ -0,0 +1,134 @@ + + + + + + + + + + mentat_ffi::query_builder_execute - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::query_builder_execute + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn query_builder_execute(
    query_builder: *mut QueryBuilder
) -> *mut ExternResult

Executes a query and returns the results as a Rel.

+

Panics

+

If the find set of the query executed is not structured [:find ?foo ?bar :where ...].

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_execute_coll.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_execute_coll.html new file mode 100644 index 00000000..a2c06e12 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_execute_coll.html @@ -0,0 +1,134 @@ + + + + + + + + + + mentat_ffi::query_builder_execute_coll - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::query_builder_execute_coll + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn query_builder_execute_coll(
    query_builder: *mut QueryBuilder
) -> *mut ExternResult

Executes a query and returns the results as a Coll.

+

Panics

+

If the find set of the query executed is not structured [:find [?foo ...] :where ...].

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_execute_scalar.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_execute_scalar.html new file mode 100644 index 00000000..04b54309 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_execute_scalar.html @@ -0,0 +1,134 @@ + + + + + + + + + + mentat_ffi::query_builder_execute_scalar - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::query_builder_execute_scalar + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn query_builder_execute_scalar(
    query_builder: *mut QueryBuilder
) -> *mut ExternResult

Executes a query and returns the results as a Scalar.

+

Panics

+

If the find set of the query executed is not structured [:find ?foo . :where ...].

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_execute_tuple.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_execute_tuple.html new file mode 100644 index 00000000..5f028b09 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.query_builder_execute_tuple.html @@ -0,0 +1,134 @@ + + + + + + + + + + mentat_ffi::query_builder_execute_tuple - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::query_builder_execute_tuple + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn query_builder_execute_tuple(
    query_builder: *mut QueryBuilder
) -> *mut ExternResult

Executes a query and returns the results as a Tuple.

+

Panics

+

If the find set of the query executed is not structured [:find [?foo ?bar] :where ...].

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.row_at_index.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.row_at_index.html new file mode 100644 index 00000000..64933039 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.row_at_index.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_ffi::row_at_index - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::row_at_index + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn row_at_index(
    rows: *mut RelResult<Binding>,
    index: c_int
) -> *mut Vec<Binding>

Returns the value at the provided index as a Vec<ValueType>. +If there is no value present at the index, a null pointer is returned.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor typed_value_result_set_destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.store_begin_transaction.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_begin_transaction.html new file mode 100644 index 00000000..fae606e5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_begin_transaction.html @@ -0,0 +1,137 @@ + + + + + + + + + + mentat_ffi::store_begin_transaction - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::store_begin_transaction + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn store_begin_transaction(
    store: *mut Store
) -> *mut ExternResult

Starts a new transaction to allow multiple transacts to be +performed together. This is more efficient than performing +a large set of individual commits.

+

Returns a Result as an ExternResult.

+

Safety

+

Callers must ensure that the pointer to the Store is not dangling.

+

Callers are responsible for managing the memory for the return value. +A destructor tx_report_destroy is provided for releasing the memory for this +pointer type.

+

TODO: Document the errors that can result from begin_transaction

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.store_cache_attribute_bi_directional.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_cache_attribute_bi_directional.html new file mode 100644 index 00000000..f50523d5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_cache_attribute_bi_directional.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_ffi::store_cache_attribute_bi_directional - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::store_cache_attribute_bi_directional + + [] + + [src]

#[no_mangle] +
pub extern "C" fn store_cache_attribute_bi_directional(
    store: *mut Store,
    attribute: *const c_char
) -> *mut ExternResult

Adds an attribute to the cache. +store_cache_attribute_bi_directional caches entity in both available directions, forward and reverse.

+

Forward caches values for an attribute keyed by entity +(i.e. find values and entities that have this attribute, or find values of attribute for an entity)

+

Reverse caches entities for an attribute keyed by value. +(i.e. find entities that have a particular value for an attribute).

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.store_cache_attribute_forward.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_cache_attribute_forward.html new file mode 100644 index 00000000..9ae8516b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_cache_attribute_forward.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_ffi::store_cache_attribute_forward - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::store_cache_attribute_forward + + [] + + [src]

#[no_mangle] +
pub extern "C" fn store_cache_attribute_forward(
    store: *mut Store,
    attribute: *const c_char
) -> *mut ExternResult

Adds an attribute to the cache. +store_cache_attribute_forward caches values for an attribute keyed by entity +(i.e. find values and entities that have this attribute, or find values of attribute for an entity)

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.store_cache_attribute_reverse.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_cache_attribute_reverse.html new file mode 100644 index 00000000..a024a101 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_cache_attribute_reverse.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_ffi::store_cache_attribute_reverse - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::store_cache_attribute_reverse + + [] + + [src]

#[no_mangle] +
pub extern "C" fn store_cache_attribute_reverse(
    store: *mut Store,
    attribute: *const c_char
) -> *mut ExternResult

Adds an attribute to the cache. +store_cache_attribute_reverse caches entities for an attribute keyed by value. +(i.e. find entities that have a particular value for an attribute).

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.store_destroy.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_destroy.html new file mode 100644 index 00000000..1b1b8103 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_destroy.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_ffi::store_destroy - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::store_destroy + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn store_destroy(obj: *mut Store)
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.store_entid_for_attribute.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_entid_for_attribute.html new file mode 100644 index 00000000..81551cd1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_entid_for_attribute.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_ffi::store_entid_for_attribute - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::store_entid_for_attribute + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn store_entid_for_attribute(
    store: *mut Store,
    attr: *const c_char
) -> Entid

Returns the Entid associated with the attr as :namespace/name.

+

Panics

+

If there is no Attribute in the Schema for attr.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.store_entity_builder_from_entid.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_entity_builder_from_entid.html new file mode 100644 index 00000000..8ff2a7fe --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_entity_builder_from_entid.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_ffi::store_entity_builder_from_entid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::store_entity_builder_from_entid + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn store_entity_builder_from_entid(
    store: *mut Store,
    entid: c_longlong
) -> *mut ExternResult

Starts a new transaction and creates a builder for an entity with entid +using the transaction to allow for programmatic assertion of values for that entity.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor entity_builder_destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.store_entity_builder_from_temp_id.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_entity_builder_from_temp_id.html new file mode 100644 index 00000000..0525b82a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_entity_builder_from_temp_id.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_ffi::store_entity_builder_from_temp_id - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::store_entity_builder_from_temp_id + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn store_entity_builder_from_temp_id(
    store: *mut Store,
    temp_id: *const c_char
) -> *mut ExternResult

Starts a new transaction and creates a builder for an entity with tempid +using the transaction to allow for programmatic assertion of values for that entity.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor entity_builder_destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.store_in_progress_builder.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_in_progress_builder.html new file mode 100644 index 00000000..2f68cc9b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_in_progress_builder.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_ffi::store_in_progress_builder - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::store_in_progress_builder + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn store_in_progress_builder(
    store: *mut Store
) -> *mut ExternResult

Starts a new transaction and creates a builder using the transaction +to allow for programmatic assertion of values.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor in_progress_builder_destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.store_open.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_open.html new file mode 100644 index 00000000..77d558a9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_open.html @@ -0,0 +1,135 @@ + + + + + + + + + + mentat_ffi::store_open - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::store_open + + [] + + [src]

#[no_mangle] +
pub extern "C" fn store_open(uri: *const c_char) -> *mut Store

A store cannot be opened twice to the same location. +Once created, the reference to the store is held by the caller and not Rust, +therefore the caller is responsible for calling destroy to release the memory +used by the Store in order to avoid a memory leak.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor store_destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.store_query.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_query.html new file mode 100644 index 00000000..0ab2891a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_query.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_ffi::store_query - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::store_query + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn store_query<'a>(
    store: *mut Store,
    query: *const c_char
) -> *mut QueryBuilder<'a>

Creates a QueryBuilder from the given store to execute the provided query.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor query_builder_destroy is provided for releasing the memory for this +pointer type.

+

TODO: Update QueryBuilder so it only takes a Store pointer on execution

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.store_register_observer.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_register_observer.html new file mode 100644 index 00000000..c8059dd6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_register_observer.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::store_register_observer - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::store_register_observer + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn store_register_observer(
    store: *mut Store,
    key: *const c_char,
    attributes: *const Entid,
    attributes_len: usize,
    callback: extern "C" fn(key: *const c_char, reports: &TxChangeList)
)

Registers a TxObserver with the key to observe changes to attributes +on this store. +Calls callback is a relevant transaction occurs.

+

Panics

+

If there is no Attribute in the Schema for a given attribute.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.store_transact.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_transact.html new file mode 100644 index 00000000..be454027 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_transact.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_ffi::store_transact - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::store_transact + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn store_transact(
    store: *mut Store,
    transaction: *const c_char
) -> *mut ExternResult

Performs a single transaction against the store.

+

Returns a TxReport as an ExternResult. +TODO: Document the errors that can result from transact

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.store_unregister_observer.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_unregister_observer.html new file mode 100644 index 00000000..d99af735 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_unregister_observer.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_ffi::store_unregister_observer - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::store_unregister_observer + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn store_unregister_observer(
    store: *mut Store,
    key: *const c_char
)

Unregisters a TxObserver with the key to observe changes on this store.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.store_value_for_attribute.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_value_for_attribute.html new file mode 100644 index 00000000..cd6bec10 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.store_value_for_attribute.html @@ -0,0 +1,138 @@ + + + + + + + + + + mentat_ffi::store_value_for_attribute - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::store_value_for_attribute + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn store_value_for_attribute(
    store: *mut Store,
    entid: c_longlong,
    attribute: *const c_char
) -> *mut ExternResult

Returns an ExternResult containing the Binding associated with the attribute as :namespace/name +for the given entid. +If there is a value for that attribute on the entity with id entid then the value is returned in ok. +If there no value for that attribute on the entity with id entid but the attribute is value, +then a null pointer is returned in ok. +If there is no Attribute in the Schema for the given attribute then an error is returned in err.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor destroy is provided for releasing the memory for this +pointer type.

+

TODO: list the types of error that can be caused by this function

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.tx_change_list_entry_at.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.tx_change_list_entry_at.html new file mode 100644 index 00000000..5dfee736 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.tx_change_list_entry_at.html @@ -0,0 +1,134 @@ + + + + + + + + + + mentat_ffi::tx_change_list_entry_at - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::tx_change_list_entry_at + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn tx_change_list_entry_at(
    tx_report_list: *mut TxChangeList,
    index: c_int
) -> *const TransactionChange

Returns the value at the provided index as a TransactionChange .

+

Panics

+

If there is no value present at the index.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor typed_value_destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.tx_report_destroy.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.tx_report_destroy.html new file mode 100644 index 00000000..5cedfe6a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.tx_report_destroy.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_ffi::tx_report_destroy - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::tx_report_destroy + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn tx_report_destroy(obj: *mut TxReport)
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.tx_report_entity_for_temp_id.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.tx_report_entity_for_temp_id.html new file mode 100644 index 00000000..a31249ce --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.tx_report_entity_for_temp_id.html @@ -0,0 +1,129 @@ + + + + + + + + + + mentat_ffi::tx_report_entity_for_temp_id - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::tx_report_entity_for_temp_id + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn tx_report_entity_for_temp_id(
    tx_report: *mut TxReport,
    tempid: *const c_char
) -> *mut c_longlong

Fetches the Entid assigned to the tempid during the transaction represented +by the given TxReport.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.tx_report_get_entid.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.tx_report_get_entid.html new file mode 100644 index 00000000..94ffe029 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.tx_report_get_entid.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_ffi::tx_report_get_entid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::tx_report_get_entid + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn tx_report_get_entid(
    tx_report: *mut TxReport
) -> c_longlong

Fetches the tx_id for the given TxReport`.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.tx_report_get_tx_instant.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.tx_report_get_tx_instant.html new file mode 100644 index 00000000..5ae7303a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.tx_report_get_tx_instant.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_ffi::tx_report_get_tx_instant - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::tx_report_get_tx_instant + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn tx_report_get_tx_instant(
    tx_report: *mut TxReport
) -> c_longlong

Fetches the tx_instant for the given TxReport.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_destroy.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_destroy.html new file mode 100644 index 00000000..18380783 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_destroy.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_ffi::typed_value_destroy - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_destroy + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_destroy(obj: *mut Binding)
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_boolean.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_boolean.html new file mode 100644 index 00000000..9f4c15e8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_boolean.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::typed_value_into_boolean - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_into_boolean + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_into_boolean(
    typed_value: *mut Binding
) -> i32

Consumes a Binding and returns the value as a boolean represented as an i32. +If the value of the boolean is true the value returned is 1. +If the value of the boolean is false the value returned is 0.

+

Panics

+

If the ValueType of the Binding is not ValueType::Long.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_double.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_double.html new file mode 100644 index 00000000..990285c3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_double.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_ffi::typed_value_into_double - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_into_double + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_into_double(
    typed_value: *mut Binding
) -> f64

Consumes a Binding and returns the value as a f64.

+

Panics

+

If the ValueType of the Binding is not ValueType::Long.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_entid.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_entid.html new file mode 100644 index 00000000..bc6601bf --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_entid.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_ffi::typed_value_into_entid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_into_entid + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_into_entid(
    typed_value: *mut Binding
) -> Entid

Consumes a Binding and returns the value as an Entid.

+

Panics

+

If the ValueType of the Binding is not ValueType::Ref.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_kw.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_kw.html new file mode 100644 index 00000000..f05dd0ed --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_kw.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_ffi::typed_value_into_kw - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_into_kw + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_into_kw(
    typed_value: *mut Binding
) -> *const c_char

Consumes a Binding and returns the value as an keyword C String.

+

Panics

+

If the ValueType of the Binding is not ValueType::Ref.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_long.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_long.html new file mode 100644 index 00000000..0e2651d3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_long.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_ffi::typed_value_into_long - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_into_long + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_into_long(
    typed_value: *mut Binding
) -> c_longlong

Consumes a Binding and returns the value as a C long.

+

Panics

+

If the ValueType of the Binding is not ValueType::Long.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_string.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_string.html new file mode 100644 index 00000000..dc686207 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_string.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_ffi::typed_value_into_string - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_into_string + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_into_string(
    typed_value: *mut Binding
) -> *const c_char

Consumes a Binding and returns the value as a C String.

+

Panics

+

If the ValueType of the Binding is not ValueType::Long.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_timestamp.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_timestamp.html new file mode 100644 index 00000000..d289223e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_timestamp.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_ffi::typed_value_into_timestamp - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_into_timestamp + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_into_timestamp(
    typed_value: *mut Binding
) -> c_longlong

Consumes a Binding and returns the value as a microsecond timestamp.

+

Panics

+

If the ValueType of the Binding is not ValueType::Long.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_uuid.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_uuid.html new file mode 100644 index 00000000..46f4ab11 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_into_uuid.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_ffi::typed_value_into_uuid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_into_uuid + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_into_uuid(
    typed_value: *mut Binding
) -> *mut [u8; 16]

Consumes a Binding and returns the value as a UUID byte slice of length 16.

+

Panics

+

If the ValueType of the Binding is not ValueType::Long.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_list_destroy.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_list_destroy.html new file mode 100644 index 00000000..1f777217 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_list_destroy.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_ffi::typed_value_list_destroy - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_list_destroy + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_list_destroy(obj: *mut Vec<Binding>)
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_list_into_iter.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_list_into_iter.html new file mode 100644 index 00000000..d2bc33da --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_list_into_iter.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::typed_value_list_into_iter - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_list_into_iter + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_list_into_iter(
    values: *mut Vec<Binding>
) -> *mut BindingIterator

Consumes the Vec<Binding> and returns an iterator over the values.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor typed_value_list_iter_destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_list_iter_destroy.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_list_iter_destroy.html new file mode 100644 index 00000000..bb2f17a9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_list_iter_destroy.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_ffi::typed_value_list_iter_destroy - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_list_iter_destroy + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_list_iter_destroy(
    obj: *mut BindingIterator
)
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_list_iter_next.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_list_iter_next.html new file mode 100644 index 00000000..76cc560d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_list_iter_next.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_ffi::typed_value_list_iter_next - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_list_iter_next + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_list_iter_next(
    iter: *mut BindingIterator
) -> *mut Binding

Returns the next value in the iter as a Binding. +If there is no value next value, a null pointer is returned.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor typed_value_destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_result_set_destroy.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_result_set_destroy.html new file mode 100644 index 00000000..3e10791a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_result_set_destroy.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_ffi::typed_value_result_set_destroy - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_result_set_destroy + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_result_set_destroy(
    obj: *mut RelResult<Binding>
)
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_result_set_into_iter.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_result_set_into_iter.html new file mode 100644 index 00000000..1931e247 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_result_set_into_iter.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_ffi::typed_value_result_set_into_iter - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_result_set_into_iter + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_result_set_into_iter(
    rows: *mut RelResult<Binding>
) -> *mut BindingListIterator

Consumes the RelResult<Binding> and returns an iterator over the values.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor typed_value_result_set_iter_destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_result_set_iter_destroy.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_result_set_iter_destroy.html new file mode 100644 index 00000000..0f196ecd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_result_set_iter_destroy.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_ffi::typed_value_result_set_iter_destroy - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_result_set_iter_destroy + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_result_set_iter_destroy(
    obj: *mut BindingListIterator
)
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_result_set_iter_next.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_result_set_iter_next.html new file mode 100644 index 00000000..f6fe7c78 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_result_set_iter_next.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_ffi::typed_value_result_set_iter_next - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_result_set_iter_next + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_result_set_iter_next(
    iter: *mut BindingListIterator
) -> *mut Vec<Binding>

Returns the next value in the iter as a Vec<ValueType>. +If there is no value next value, a null pointer is returned.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor typed_value_list_destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_value_type.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_value_type.html new file mode 100644 index 00000000..37ee4bda --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.typed_value_value_type.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_ffi::typed_value_value_type - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::typed_value_value_type + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn typed_value_value_type(
    typed_value: *mut Binding
) -> ValueType

Returns the ValueType of this Binding.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index.html new file mode 100644 index 00000000..3e68ff5c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_ffi::value_at_index - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::value_at_index + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn value_at_index(
    values: *mut Vec<Binding>,
    index: c_int
) -> *const Binding

Returns the value at the provided index as a Binding. +If there is no value present at the index, a null pointer is returned.

+

Safety

+

Callers are responsible for managing the memory for the return value. +A destructor typed_value_destroy is provided for releasing the memory for this +pointer type.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_boolean.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_boolean.html new file mode 100644 index 00000000..62813a02 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_boolean.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_ffi::value_at_index_into_boolean - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::value_at_index_into_boolean + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn value_at_index_into_boolean(
    values: *mut Vec<Binding>,
    index: c_int
) -> i32

Returns the value of the Binding at index as a boolean represented by a i32. +If the value of the boolean is true then the value returned is 1. +If the value of the boolean is false then the value returned is 0.

+

Panics

+

If the ValueType of the Binding is not ValueType::Long. +If there is no value at index.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_double.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_double.html new file mode 100644 index 00000000..efdbc6fe --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_double.html @@ -0,0 +1,131 @@ + + + + + + + + + + mentat_ffi::value_at_index_into_double - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::value_at_index_into_double + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn value_at_index_into_double(
    values: *mut Vec<Binding>,
    index: c_int
) -> f64

Returns the value of the Binding at index as an f64.

+

Panics

+

If the ValueType of the Binding is not ValueType::Double. +If there is no value at index.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_entid.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_entid.html new file mode 100644 index 00000000..bb0f27a6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_entid.html @@ -0,0 +1,131 @@ + + + + + + + + + + mentat_ffi::value_at_index_into_entid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::value_at_index_into_entid + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn value_at_index_into_entid(
    values: *mut Vec<Binding>,
    index: c_int
) -> Entid

Returns the value of the Binding at index as an Entid.

+

Panics

+

If the ValueType of the Binding is not ValueType::Ref. +If there is no value at index.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_kw.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_kw.html new file mode 100644 index 00000000..7ab8bf22 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_kw.html @@ -0,0 +1,131 @@ + + + + + + + + + + mentat_ffi::value_at_index_into_kw - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::value_at_index_into_kw + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn value_at_index_into_kw(
    values: *mut Vec<Binding>,
    index: c_int
) -> *const c_char

Returns the value of the Binding at index as a keyword C String.

+

Panics

+

If the ValueType of the Binding is not ValueType::Ref. +If there is no value at index.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_long.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_long.html new file mode 100644 index 00000000..a43acb3b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_long.html @@ -0,0 +1,131 @@ + + + + + + + + + + mentat_ffi::value_at_index_into_long - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::value_at_index_into_long + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn value_at_index_into_long(
    values: *mut Vec<Binding>,
    index: c_int
) -> c_longlong

Returns the value of the Binding at index as a long.

+

Panics

+

If the ValueType of the Binding is not ValueType::Long. +If there is no value at index.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_string.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_string.html new file mode 100644 index 00000000..591b0c5b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_string.html @@ -0,0 +1,131 @@ + + + + + + + + + + mentat_ffi::value_at_index_into_string - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::value_at_index_into_string + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn value_at_index_into_string(
    values: *mut Vec<Binding>,
    index: c_int
) -> *const c_char

Returns the value of the Binding at index as a C String.

+

Panics

+

If the ValueType of the Binding is not ValueType::String. +If there is no value at index.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_timestamp.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_timestamp.html new file mode 100644 index 00000000..3f79173c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_timestamp.html @@ -0,0 +1,131 @@ + + + + + + + + + + mentat_ffi::value_at_index_into_timestamp - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::value_at_index_into_timestamp + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn value_at_index_into_timestamp(
    values: *mut Vec<Binding>,
    index: c_int
) -> c_longlong

Returns the value of the Binding at index as a microsecond timestamp.

+

Panics

+

If the ValueType of the Binding is not ValueType::Instant. +If there is no value at index.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_uuid.html b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_uuid.html new file mode 100644 index 00000000..5a932ad1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/fn.value_at_index_into_uuid.html @@ -0,0 +1,131 @@ + + + + + + + + + + mentat_ffi::value_at_index_into_uuid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::value_at_index_into_uuid + + [] + + [src]

#[no_mangle] +
pub unsafe extern "C" fn value_at_index_into_uuid(
    values: *mut Vec<Binding>,
    index: c_int
) -> *mut [u8; 16]

Returns the value of the Binding at index as a UUID byte slice of length 16.

+

Panics

+

If the ValueType of the Binding is not ValueType::Uuid. +If there is no value at index.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder.v.html new file mode 100644 index 00000000..17400ad4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_boolean.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_boolean.v.html new file mode 100644 index 00000000..5d17a573 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_boolean.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_add_boolean.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_double.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_double.v.html new file mode 100644 index 00000000..b17a65f2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_double.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_add_double.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_keyword.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_keyword.v.html new file mode 100644 index 00000000..c66777e0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_keyword.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_add_keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_long.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_long.v.html new file mode 100644 index 00000000..b6043c18 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_long.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_add_long.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_ref.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_ref.v.html new file mode 100644 index 00000000..9d3fa954 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_ref.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_add_ref.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_string.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_string.v.html new file mode 100644 index 00000000..5f2a18e3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_string.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_add_string.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_timestamp.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_timestamp.v.html new file mode 100644 index 00000000..e1d5e84c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_timestamp.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_add_timestamp.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_uuid.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_uuid.v.html new file mode 100644 index 00000000..e5085464 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_add_uuid.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_add_uuid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_commit.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_commit.v.html new file mode 100644 index 00000000..88de79ef --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_commit.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_commit.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_destroy.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_destroy.v.html new file mode 100644 index 00000000..c45767e2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_destroy.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_destroy.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_boolean.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_boolean.v.html new file mode 100644 index 00000000..60deb0ba --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_boolean.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_retract_boolean.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_double.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_double.v.html new file mode 100644 index 00000000..6f8b1a45 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_double.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_retract_double.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_keyword.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_keyword.v.html new file mode 100644 index 00000000..bbd5db49 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_keyword.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_retract_keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_long.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_long.v.html new file mode 100644 index 00000000..655f652c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_long.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_retract_long.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_ref.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_ref.v.html new file mode 100644 index 00000000..06cce0ce --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_ref.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_retract_ref.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_string.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_string.v.html new file mode 100644 index 00000000..9bda4625 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_string.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_retract_string.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_timestamp.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_timestamp.v.html new file mode 100644 index 00000000..1135dce1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_timestamp.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_retract_timestamp.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_uuid.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_uuid.v.html new file mode 100644 index 00000000..f5583075 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_retract_uuid.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_retract_uuid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_transact.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_transact.v.html new file mode 100644 index 00000000..31e0a64b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_builder_transact.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_builder_transact.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_commit.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_commit.v.html new file mode 100644 index 00000000..ce41b246 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_commit.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_commit.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_destroy.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_destroy.v.html new file mode 100644 index 00000000..0158c411 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_destroy.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_destroy.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_entity_builder_from_entid.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_entity_builder_from_entid.v.html new file mode 100644 index 00000000..27d42572 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_entity_builder_from_entid.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_entity_builder_from_entid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_entity_builder_from_temp_id.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_entity_builder_from_temp_id.v.html new file mode 100644 index 00000000..10f01d02 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_entity_builder_from_temp_id.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_entity_builder_from_temp_id.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_rollback.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_rollback.v.html new file mode 100644 index 00000000..f360d919 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_rollback.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_rollback.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/in_progress_transact.v.html b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_transact.v.html new file mode 100644 index 00000000..e7fba52c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/in_progress_transact.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.in_progress_transact.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/index.html b/docs/apis/rust/0.7.0/mentat_ffi/index.html new file mode 100644 index 00000000..dd6cbc70 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/index.html @@ -0,0 +1,1356 @@ + + + + + + + + + + mentat_ffi - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Crate mentat_ffi + + [] + + [src]

This module exposes an Foreign Function Interface (FFI) that allows Mentat to be +called from other languages.

+

Functions that are available to other languages in this module are defined as +extern "C" functions which allow them to be layed out correctly for the +platform's C ABI. They all have a #[no_mangle] decorator to ensure +Rust's name mangling is turned off, so that it is easier to link to.

+

Mentat's FFI contains unsafe code. As it is an interface between foreign code +and native Rust code, Rust cannot guarantee that the types and data that have been passed +to it from another language are present and in the format it is expecting. +This interface is designed to ensure that nothing unsafe passes through this module +and enters Mentat proper

+

Structs defined with #[repr(C)] are guaranteed to have a layout that is compatible +with the platform's representation in C.

+

This API passes pointers in two ways, depending on the lifetime of the value and +what value owns it. +Pointers to values that are guaranteed to live beyond the lifetime of the function, +are passed over the FFI as a raw pointer.

+

value as *const Binding

+

Pointers to values that cannot be guaranteed to live beyond the lifetime of the function +are first Boxed so that they live on the heap, and the raw pointer passed this way.

+

Box::into_raw(Box::new(value))

+

The memory for a value that is moved onto the heap before being passed over the FFI +is no longer managed by Rust, but Rust still owns the value. Therefore the pointer +must be returned to Rust in order to be released. To this effect a number of destructor +functions are provided for each Rust value type that is passed, as is a catch all destructor +to release memory for #[repr(C)] values. +The destructors reclaim the memory via Box and then drop the reference, causing the +memory to be released.

+

A macro has been provided to make defining destructors easier.

+

define_destructor!(query_builder_destroy, QueryBuilder);

+

Passing a pointer to memory that has already been released will cause Mentat to crash, +so callers have to be careful to ensure they manage their pointers properly. +Failure to call a destructor for a value on the heap will cause a memory leak.

+

Generally, the functions exposed in this module have a direct mapping to existing Mentat APIs, +in order to keep application logic to a minumum and provide the greatest flexibility +for callers using the interface. However, in some cases a single convenience function +has been provided in order to make the interface easier to use and reduce the number +of calls that have to be made over the FFI to perform a task. An example of this is +store_register_observer, which takes a single native callback function that is then +wrapped inside a Rust closure and added to a TxObserver struct. This is then used to +register the observer with the store.

+

Result and Option Rust types have repr(C) structs that mirror them. This is to provide a more +native access pattern to callers and to enable easier passing of optional types and error +propogation. These types have implemented From such that conversion from the Rust type +to the C type is as painless as possible.

+

Re-exports

+
pub use utils::strings::c_char_to_string;
pub use utils::strings::kw_from_string;
pub use utils::strings::string_to_c_char;
pub use utils::log;

Modules

+ + + + + + + + +
android + +
utils + +

Structs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EntityBuilder + +
ExternOption +

A C representation Rust's Option. +A value of Some results in value containing a raw pointer as a c_void. +A value of None results in value containing a null pointer.

+ +
ExternResult +

A C representation Rust's Result. +A value of Ok results in ok containing a raw pointer as a c_void +and err containing a null pointer. +A value of Err results in value containing a null pointer and err containing an error message.

+ +
InProgress +

Represents an in-progress, not yet committed, set of changes to the store. +Call commit to commit your changes, or rollback to discard them. +A transaction is held open until you do so. +Your changes will be implicitly dropped along with this struct.

+ +
InProgressBuilder + +
InProgressTransactResult + +
KnownEntid +

An entid that's either already in the store, or newly allocated to a tempid. +TODO: we'd like to link this in some way to the lifetime of a particular PartitionMap.

+ +
QueryBuilder + +
QueryInputs +

Define the inputs to a query. This is in two parts: a set of values known now, and a set of +types known now. +The separate map of types is to allow queries to be algebrized without full knowledge of +the bindings that will be used at execution time. +When built correctly, types is guaranteed to contain the types of values -- use +QueryInputs::new or QueryInputs::with_values to construct an instance.

+ +
QueryOutput + +
RelResult +

The result you get from a 'rel' query, like:

+ +
Store +

A convenience wrapper around a single SQLite connection and a Conn. This is suitable +for applications that don't require complex connection management.

+ +
TransactionChange +

A C representation of the change provided by the transaction observers +from a single transact. +Holds a transaction identifier, the changes as a set of affected attributes +and the length of the list of changes.

+ +
TxChangeList +

A C representation of the list of changes provided by the transaction observers. +Provides the list of changes as the length of the list.

+ +
TxObserver + +
TxReport +

A transaction report summarizes an applied transaction.

+ +
Uuid +

A Universally Unique Identifier (UUID).

+ +
Variable + +

Enums

+ + + + + + + + + + + + + + + + + + + + + + + + +
Binding +

The values bound in a query specification can be:

+ +
CacheDirection + +
FindSpec +

A definition of the first part of a find query: the +[:find ?foo ?bar…] bit.

+ +
QueryResults + +
TypedValue +

Represents a value that can be stored in a Mentat store.

+ +
ValueType +

The attribute of each Mentat assertion has a :db/valueType constraining the value to a +particular set. Mentat recognizes the following :db/valueType values.

+ +

Traits

+ + + + + + + + + + + + + + + + + + + + +
BuildTerms + +
HasSchema + +
IntoThing + +
Queryable + +
Syncable + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
changelist_entry_at +

Returns the value at the provided index as a Entid .

+ +
destroy + +
entity_builder_add_boolean +

Uses builder to assert value for kw on entity entid.

+ +
entity_builder_add_double +

Uses builder to assert value for kw on entity entid.

+ +
entity_builder_add_keyword +

Uses builder to assert value for kw on entity entid.

+ +
entity_builder_add_long +

Uses builder to assert value for kw on entity entid.

+ +
entity_builder_add_ref +

Uses builder to assert value for kw on entity entid.

+ +
entity_builder_add_string +

Uses builder to assert value for kw on entity entid.

+ +
entity_builder_add_timestamp +

Uses builder to assert value for kw on entity entid.

+ +
entity_builder_add_uuid +

Uses builder to assert value for kw on entity entid.

+ +
entity_builder_commit +

Transacts and commits all the assertions and retractions that have been performed +using this builder.

+ +
entity_builder_destroy + +
entity_builder_retract_boolean +

Uses builder to retract value for kw on entity entid.

+ +
entity_builder_retract_double +

Uses builder to retract value for kw on entity entid.

+ +
entity_builder_retract_keyword +

Uses builder to retract value for kw on entity entid.

+ +
entity_builder_retract_long +

Uses builder to retract value for kw on entity entid.

+ +
entity_builder_retract_ref +

Uses builder to retract value for kw on entity entid.

+ +
entity_builder_retract_string +

Uses builder to retract value for kw on entity entid.

+ +
entity_builder_retract_timestamp +

Uses builder to retract value for kw on entity entid.

+ +
entity_builder_retract_uuid +

Uses builder to retract value for kw on entity entid.

+ +
entity_builder_transact +

Transacts all the assertions and retractions that have been performed +using this builder.

+ +
in_progress_builder +

Creates a builder using the in progress transaction to allow for programmatic +assertion of values.

+ +
in_progress_builder_add_boolean +

Uses builder to assert value for kw on entity entid.

+ +
in_progress_builder_add_double +

Uses builder to assert value for kw on entity entid.

+ +
in_progress_builder_add_keyword +

Uses builder to assert value for kw on entity entid.

+ +
in_progress_builder_add_long +

Uses builder to assert value for kw on entity entid.

+ +
in_progress_builder_add_ref +

Uses builder to assert value for kw on entity entid.

+ +
in_progress_builder_add_string +

Uses builder to assert value for kw on entity entid.

+ +
in_progress_builder_add_timestamp +

Uses builder to assert value for kw on entity entid.

+ +
in_progress_builder_add_uuid +

Uses builder to assert value for kw on entity entid.

+ +
in_progress_builder_commit +

Transacts and commits all the assertions and retractions that have been performed +using this builder.

+ +
in_progress_builder_destroy + +
in_progress_builder_retract_boolean +

Uses builder to retract value for kw on entity entid.

+ +
in_progress_builder_retract_double +

Uses builder to retract value for kw on entity entid.

+ +
in_progress_builder_retract_keyword +

Uses builder to retract value for kw on entity entid.

+ +
in_progress_builder_retract_long +

Uses builder to retract value for kw on entity entid.

+ +
in_progress_builder_retract_ref +

Uses builder to retract value for kw on entity entid.

+ +
in_progress_builder_retract_string +

Uses builder to retract value for kw on entity entid.

+ +
in_progress_builder_retract_timestamp +

Uses builder to retract value for kw on entity entid.

+ +
in_progress_builder_retract_uuid +

Uses builder to retract value for kw on entity entid.

+ +
in_progress_builder_transact +

Transacts all the assertions and retractions that have been performed +using this builder.

+ +
in_progress_commit +

Commit all the transacts that have been performed using this +in progress transaction.

+ +
in_progress_destroy + +
in_progress_entity_builder_from_entid +

Creates a builder for an entity with entid using the in progress transaction to +allow for programmatic assertion of values for that entity.

+ +
in_progress_entity_builder_from_temp_id +

Creates a builder for an entity with tempid using the in progress transaction to +allow for programmatic assertion of values for that entity.

+ +
in_progress_rollback +

Rolls back all the transacts that have been performed using this +in progress transaction.

+ +
in_progress_transact +

Perform a single transact operation using the current in progress +transaction. Takes edn as a string to transact.

+ +
query_builder_bind_boolean +

Binds a TypedValue::Boolean to a Variable with the given name.

+ +
query_builder_bind_double +

Binds a TypedValue::Double to a Variable with the given name.

+ +
query_builder_bind_kw +

Binds a TypedValue::Ref to a Variable with the given name. Takes a keyword as a c string in the format +:namespace/name and converts it into an NamespacedKeyworf.

+ +
query_builder_bind_long +

Binds a TypedValue::Long to a Variable with the given name.

+ +
query_builder_bind_ref +

Binds a TypedValue::Ref to a Variable with the given name.

+ +
query_builder_bind_ref_kw +

Binds a TypedValue::Ref to a Variable with the given name. Takes a keyword as a c string in the format +:namespace/name and converts it into an NamespacedKeyworf.

+ +
query_builder_bind_string +

Binds a TypedValue::String to a Variable with the given name.

+ +
query_builder_bind_timestamp +

Binds a TypedValue::Instant to a Variable with the given name. +Takes a timestamp in microseconds.

+ +
query_builder_bind_uuid +

Binds a TypedValue::Uuid to a Variable with the given name. +Takes a UUID as a byte slice of length 16. This maps directly to the uuid_t C type.

+ +
query_builder_destroy + +
query_builder_execute +

Executes a query and returns the results as a Rel.

+ +
query_builder_execute_coll +

Executes a query and returns the results as a Coll.

+ +
query_builder_execute_scalar +

Executes a query and returns the results as a Scalar.

+ +
query_builder_execute_tuple +

Executes a query and returns the results as a Tuple.

+ +
row_at_index +

Returns the value at the provided index as a Vec<ValueType>. +If there is no value present at the index, a null pointer is returned.

+ +
store_begin_transaction +

Starts a new transaction to allow multiple transacts to be +performed together. This is more efficient than performing +a large set of individual commits.

+ +
store_cache_attribute_bi_directional +

Adds an attribute to the cache. +store_cache_attribute_bi_directional caches entity in both available directions, forward and reverse.

+ +
store_cache_attribute_forward +

Adds an attribute to the cache. +store_cache_attribute_forward caches values for an attribute keyed by entity +(i.e. find values and entities that have this attribute, or find values of attribute for an entity)

+ +
store_cache_attribute_reverse +

Adds an attribute to the cache. +store_cache_attribute_reverse caches entities for an attribute keyed by value. +(i.e. find entities that have a particular value for an attribute).

+ +
store_destroy + +
store_entid_for_attribute +

Returns the Entid associated with the attr as :namespace/name.

+ +
store_entity_builder_from_entid +

Starts a new transaction and creates a builder for an entity with entid +using the transaction to allow for programmatic assertion of values for that entity.

+ +
store_entity_builder_from_temp_id +

Starts a new transaction and creates a builder for an entity with tempid +using the transaction to allow for programmatic assertion of values for that entity.

+ +
store_in_progress_builder +

Starts a new transaction and creates a builder using the transaction +to allow for programmatic assertion of values.

+ +
store_open +

A store cannot be opened twice to the same location. +Once created, the reference to the store is held by the caller and not Rust, +therefore the caller is responsible for calling destroy to release the memory +used by the Store in order to avoid a memory leak.

+ +
store_query +

Creates a QueryBuilder from the given store to execute the provided query.

+ +
store_register_observer +

Registers a TxObserver with the key to observe changes to attributes +on this store. +Calls callback is a relevant transaction occurs.

+ +
store_transact +

Performs a single transaction against the store.

+ +
store_unregister_observer +

Unregisters a TxObserver with the key to observe changes on this store.

+ +
store_value_for_attribute +

Returns an ExternResult containing the Binding associated with the attribute as :namespace/name +for the given entid. +If there is a value for that attribute on the entity with id entid then the value is returned in ok. +If there no value for that attribute on the entity with id entid but the attribute is value, +then a null pointer is returned in ok. +If there is no Attribute in the Schema for the given attribute then an error is returned in err.

+ +
tx_change_list_entry_at +

Returns the value at the provided index as a TransactionChange .

+ +
tx_report_destroy + +
tx_report_entity_for_temp_id +

Fetches the Entid assigned to the tempid during the transaction represented +by the given TxReport.

+ +
tx_report_get_entid +

Fetches the tx_id for the given TxReport`.

+ +
tx_report_get_tx_instant +

Fetches the tx_instant for the given TxReport.

+ +
typed_value_destroy + +
typed_value_into_boolean +

Consumes a Binding and returns the value as a boolean represented as an i32. +If the value of the boolean is true the value returned is 1. +If the value of the boolean is false the value returned is 0.

+ +
typed_value_into_double +

Consumes a Binding and returns the value as a f64.

+ +
typed_value_into_entid +

Consumes a Binding and returns the value as an Entid.

+ +
typed_value_into_kw +

Consumes a Binding and returns the value as an keyword C String.

+ +
typed_value_into_long +

Consumes a Binding and returns the value as a C long.

+ +
typed_value_into_string +

Consumes a Binding and returns the value as a C String.

+ +
typed_value_into_timestamp +

Consumes a Binding and returns the value as a microsecond timestamp.

+ +
typed_value_into_uuid +

Consumes a Binding and returns the value as a UUID byte slice of length 16.

+ +
typed_value_list_destroy + +
typed_value_list_into_iter +

Consumes the Vec<Binding> and returns an iterator over the values.

+ +
typed_value_list_iter_destroy + +
typed_value_list_iter_next +

Returns the next value in the iter as a Binding. +If there is no value next value, a null pointer is returned.

+ +
typed_value_result_set_destroy + +
typed_value_result_set_into_iter +

Consumes the RelResult<Binding> and returns an iterator over the values.

+ +
typed_value_result_set_iter_destroy + +
typed_value_result_set_iter_next +

Returns the next value in the iter as a Vec<ValueType>. +If there is no value next value, a null pointer is returned.

+ +
typed_value_value_type +

Returns the ValueType of this Binding.

+ +
value_at_index +

Returns the value at the provided index as a Binding. +If there is no value present at the index, a null pointer is returned.

+ +
value_at_index_into_boolean +

Returns the value of the Binding at index as a boolean represented by a i32. +If the value of the boolean is true then the value returned is 1. +If the value of the boolean is false then the value returned is 0.

+ +
value_at_index_into_double +

Returns the value of the Binding at index as an f64.

+ +
value_at_index_into_entid +

Returns the value of the Binding at index as an Entid.

+ +
value_at_index_into_kw +

Returns the value of the Binding at index as a keyword C String.

+ +
value_at_index_into_long +

Returns the value of the Binding at index as a long.

+ +
value_at_index_into_string +

Returns the value of the Binding at index as a C String.

+ +
value_at_index_into_timestamp +

Returns the value of the Binding at index as a microsecond timestamp.

+ +
value_at_index_into_uuid +

Returns the value of the Binding at index as a UUID byte slice of length 16.

+ +

Type Definitions

+ + + + + + + + + + + + +
BindingIterator + +
BindingListIterator + +
Entid +

Represents one entid in the entid space.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_boolean.v.html b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_boolean.v.html new file mode 100644 index 00000000..fbfec78b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_boolean.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_builder_bind_boolean.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_double.v.html b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_double.v.html new file mode 100644 index 00000000..614c3953 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_double.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_builder_bind_double.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_kw.v.html b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_kw.v.html new file mode 100644 index 00000000..7efdb47e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_kw.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_builder_bind_kw.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_long.v.html b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_long.v.html new file mode 100644 index 00000000..6d2f37d2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_long.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_builder_bind_long.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_ref.v.html b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_ref.v.html new file mode 100644 index 00000000..ac738c89 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_ref.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_builder_bind_ref.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_ref_kw.v.html b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_ref_kw.v.html new file mode 100644 index 00000000..2fcb07a8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_ref_kw.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_builder_bind_ref_kw.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_string.v.html b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_string.v.html new file mode 100644 index 00000000..342a8061 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_string.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_builder_bind_string.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_timestamp.v.html b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_timestamp.v.html new file mode 100644 index 00000000..05f3e447 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_timestamp.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_builder_bind_timestamp.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_uuid.v.html b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_uuid.v.html new file mode 100644 index 00000000..fb46e3c1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_bind_uuid.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_builder_bind_uuid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/query_builder_destroy.v.html b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_destroy.v.html new file mode 100644 index 00000000..4782edc4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_destroy.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_builder_destroy.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/query_builder_execute.v.html b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_execute.v.html new file mode 100644 index 00000000..8d6fa644 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_execute.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_builder_execute.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/query_builder_execute_coll.v.html b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_execute_coll.v.html new file mode 100644 index 00000000..0baf9e9f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_execute_coll.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_builder_execute_coll.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/query_builder_execute_scalar.v.html b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_execute_scalar.v.html new file mode 100644 index 00000000..2153826a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_execute_scalar.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_builder_execute_scalar.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/query_builder_execute_tuple.v.html b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_execute_tuple.v.html new file mode 100644 index 00000000..9e21b370 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/query_builder_execute_tuple.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_builder_execute_tuple.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/row_at_index.v.html b/docs/apis/rust/0.7.0/mentat_ffi/row_at_index.v.html new file mode 100644 index 00000000..d7445bd8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/row_at_index.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.row_at_index.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_ffi/sidebar-items.js new file mode 100644 index 00000000..79f9d05d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["Binding","The values bound in a query specification can be:"],["CacheDirection",""],["FindSpec","A definition of the first part of a find query: the `[:find ?foo ?bar…]` bit."],["QueryResults",""],["TypedValue","Represents a value that can be stored in a Mentat store."],["ValueType","The attribute of each Mentat assertion has a :db/valueType constraining the value to a particular set. Mentat recognizes the following :db/valueType values."]],"fn":[["changelist_entry_at","Returns the value at the provided `index` as a Entid ."],["destroy",""],["entity_builder_add_boolean","Uses `builder` to assert `value` for `kw` on entity `entid`."],["entity_builder_add_double","Uses `builder` to assert `value` for `kw` on entity `entid`."],["entity_builder_add_keyword","Uses `builder` to assert `value` for `kw` on entity `entid`."],["entity_builder_add_long","Uses `builder` to assert `value` for `kw` on entity `entid`."],["entity_builder_add_ref","Uses `builder` to assert `value` for `kw` on entity `entid`."],["entity_builder_add_string","Uses `builder` to assert `value` for `kw` on entity `entid`."],["entity_builder_add_timestamp","Uses `builder` to assert `value` for `kw` on entity `entid`."],["entity_builder_add_uuid","Uses `builder` to assert `value` for `kw` on entity `entid`."],["entity_builder_commit","Transacts and commits all the assertions and retractions that have been performed using this builder."],["entity_builder_destroy",""],["entity_builder_retract_boolean","Uses `builder` to retract `value` for `kw` on entity `entid`."],["entity_builder_retract_double","Uses `builder` to retract `value` for `kw` on entity `entid`."],["entity_builder_retract_keyword","Uses `builder` to retract `value` for `kw` on entity `entid`."],["entity_builder_retract_long","Uses `builder` to retract `value` for `kw` on entity `entid`."],["entity_builder_retract_ref","Uses `builder` to retract `value` for `kw` on entity `entid`."],["entity_builder_retract_string","Uses `builder` to retract `value` for `kw` on entity `entid`."],["entity_builder_retract_timestamp","Uses `builder` to retract `value` for `kw` on entity `entid`."],["entity_builder_retract_uuid","Uses `builder` to retract `value` for `kw` on entity `entid`."],["entity_builder_transact","Transacts all the assertions and retractions that have been performed using this builder."],["in_progress_builder","Creates a builder using the in progress transaction to allow for programmatic assertion of values."],["in_progress_builder_add_boolean","Uses `builder` to assert `value` for `kw` on entity `entid`."],["in_progress_builder_add_double","Uses `builder` to assert `value` for `kw` on entity `entid`."],["in_progress_builder_add_keyword","Uses `builder` to assert `value` for `kw` on entity `entid`."],["in_progress_builder_add_long","Uses `builder` to assert `value` for `kw` on entity `entid`."],["in_progress_builder_add_ref","Uses `builder` to assert `value` for `kw` on entity `entid`."],["in_progress_builder_add_string","Uses `builder` to assert `value` for `kw` on entity `entid`."],["in_progress_builder_add_timestamp","Uses `builder` to assert `value` for `kw` on entity `entid`."],["in_progress_builder_add_uuid","Uses `builder` to assert `value` for `kw` on entity `entid`."],["in_progress_builder_commit","Transacts and commits all the assertions and retractions that have been performed using this builder."],["in_progress_builder_destroy",""],["in_progress_builder_retract_boolean","Uses `builder` to retract `value` for `kw` on entity `entid`."],["in_progress_builder_retract_double","Uses `builder` to retract `value` for `kw` on entity `entid`."],["in_progress_builder_retract_keyword","Uses `builder` to retract `value` for `kw` on entity `entid`."],["in_progress_builder_retract_long","Uses `builder` to retract `value` for `kw` on entity `entid`."],["in_progress_builder_retract_ref","Uses `builder` to retract `value` for `kw` on entity `entid`."],["in_progress_builder_retract_string","Uses `builder` to retract `value` for `kw` on entity `entid`."],["in_progress_builder_retract_timestamp","Uses `builder` to retract `value` for `kw` on entity `entid`."],["in_progress_builder_retract_uuid","Uses `builder` to retract `value` for `kw` on entity `entid`."],["in_progress_builder_transact","Transacts all the assertions and retractions that have been performed using this builder."],["in_progress_commit","Commit all the transacts that have been performed using this in progress transaction."],["in_progress_destroy",""],["in_progress_entity_builder_from_entid","Creates a builder for an entity with `entid` using the in progress transaction to allow for programmatic assertion of values for that entity."],["in_progress_entity_builder_from_temp_id","Creates a builder for an entity with `tempid` using the in progress transaction to allow for programmatic assertion of values for that entity."],["in_progress_rollback","Rolls back all the transacts that have been performed using this in progress transaction."],["in_progress_transact","Perform a single transact operation using the current in progress transaction. Takes edn as a string to transact."],["query_builder_bind_boolean","Binds a TypedValue::Boolean to a Variable with the given name."],["query_builder_bind_double","Binds a TypedValue::Double to a Variable with the given name."],["query_builder_bind_kw","Binds a TypedValue::Ref to a Variable with the given name. Takes a keyword as a c string in the format `:namespace/name` and converts it into an NamespacedKeyworf."],["query_builder_bind_long","Binds a TypedValue::Long to a Variable with the given name."],["query_builder_bind_ref","Binds a TypedValue::Ref to a Variable with the given name."],["query_builder_bind_ref_kw","Binds a TypedValue::Ref to a Variable with the given name. Takes a keyword as a c string in the format `:namespace/name` and converts it into an NamespacedKeyworf."],["query_builder_bind_string","Binds a TypedValue::String to a Variable with the given name."],["query_builder_bind_timestamp","Binds a TypedValue::Instant to a Variable with the given name. Takes a timestamp in microseconds."],["query_builder_bind_uuid","Binds a TypedValue::Uuid to a Variable with the given name. Takes a `UUID` as a byte slice of length 16. This maps directly to the `uuid_t` C type."],["query_builder_destroy",""],["query_builder_execute","Executes a query and returns the results as a Rel."],["query_builder_execute_coll","Executes a query and returns the results as a Coll."],["query_builder_execute_scalar","Executes a query and returns the results as a Scalar."],["query_builder_execute_tuple","Executes a query and returns the results as a Tuple."],["row_at_index","Returns the value at the provided `index` as a `Vec`. If there is no value present at the `index`, a null pointer is returned."],["store_begin_transaction","Starts a new transaction to allow multiple transacts to be performed together. This is more efficient than performing a large set of individual commits."],["store_cache_attribute_bi_directional","Adds an attribute to the cache. `store_cache_attribute_bi_directional` caches entity in both available directions, forward and reverse."],["store_cache_attribute_forward","Adds an attribute to the cache. `store_cache_attribute_forward` caches values for an attribute keyed by entity (i.e. find values and entities that have this attribute, or find values of attribute for an entity)"],["store_cache_attribute_reverse","Adds an attribute to the cache. `store_cache_attribute_reverse` caches entities for an attribute keyed by value. (i.e. find entities that have a particular value for an attribute)."],["store_destroy",""],["store_entid_for_attribute","Returns the Entid associated with the `attr` as `:namespace/name`."],["store_entity_builder_from_entid","Starts a new transaction and creates a builder for an entity with `entid` using the transaction to allow for programmatic assertion of values for that entity."],["store_entity_builder_from_temp_id","Starts a new transaction and creates a builder for an entity with `tempid` using the transaction to allow for programmatic assertion of values for that entity."],["store_in_progress_builder","Starts a new transaction and creates a builder using the transaction to allow for programmatic assertion of values."],["store_open","A store cannot be opened twice to the same location. Once created, the reference to the store is held by the caller and not Rust, therefore the caller is responsible for calling `destroy` to release the memory used by the Store in order to avoid a memory leak."],["store_query","Creates a QueryBuilder from the given store to execute the provided query."],["store_register_observer","Registers a TxObserver with the `key` to observe changes to `attributes` on this `store`. Calls `callback` is a relevant transaction occurs."],["store_transact","Performs a single transaction against the store."],["store_unregister_observer","Unregisters a TxObserver with the `key` to observe changes on this `store`."],["store_value_for_attribute","Returns an ExternResult containing the Binding associated with the `attribute` as `:namespace/name` for the given `entid`. If there is a value for that `attribute` on the entity with id `entid` then the value is returned in `ok`. If there no value for that `attribute` on the entity with id `entid` but the attribute is value, then a null pointer is returned in `ok`. If there is no Attribute in the Schema for the given `attribute` then an error is returned in `err`."],["tx_change_list_entry_at","Returns the value at the provided `index` as a TransactionChange ."],["tx_report_destroy",""],["tx_report_entity_for_temp_id","Fetches the Entid assigned to the `tempid` during the transaction represented by the given TxReport."],["tx_report_get_entid","Fetches the `tx_id` for the given TxReport`."],["tx_report_get_tx_instant","Fetches the `tx_instant` for the given TxReport."],["typed_value_destroy",""],["typed_value_into_boolean","Consumes a Binding and returns the value as a boolean represented as an `i32`. If the value of the boolean is `true` the value returned is 1. If the value of the boolean is `false` the value returned is 0."],["typed_value_into_double","Consumes a Binding and returns the value as a `f64`."],["typed_value_into_entid","Consumes a Binding and returns the value as an Entid."],["typed_value_into_kw","Consumes a Binding and returns the value as an keyword C `String`."],["typed_value_into_long","Consumes a Binding and returns the value as a C `long`."],["typed_value_into_string","Consumes a Binding and returns the value as a C `String`."],["typed_value_into_timestamp","Consumes a Binding and returns the value as a microsecond timestamp."],["typed_value_into_uuid","Consumes a Binding and returns the value as a UUID byte slice of length 16."],["typed_value_list_destroy",""],["typed_value_list_into_iter","Consumes the `Vec` and returns an iterator over the values."],["typed_value_list_iter_destroy",""],["typed_value_list_iter_next","Returns the next value in the `iter` as a Binding. If there is no value next value, a null pointer is returned."],["typed_value_result_set_destroy",""],["typed_value_result_set_into_iter","Consumes the `RelResult` and returns an iterator over the values."],["typed_value_result_set_iter_destroy",""],["typed_value_result_set_iter_next","Returns the next value in the `iter` as a `Vec`. If there is no value next value, a null pointer is returned."],["typed_value_value_type","Returns the ValueType of this Binding."],["value_at_index","Returns the value at the provided `index` as a Binding. If there is no value present at the `index`, a null pointer is returned."],["value_at_index_into_boolean","Returns the value of the Binding at `index` as a boolean represented by a `i32`. If the value of the `boolean` is `true` then the value returned is 1. If the value of the `boolean` is `false` then the value returned is 0."],["value_at_index_into_double","Returns the value of the Binding at `index` as an `f64`."],["value_at_index_into_entid","Returns the value of the Binding at `index` as an Entid."],["value_at_index_into_kw","Returns the value of the Binding at `index` as a keyword C `String`."],["value_at_index_into_long","Returns the value of the Binding at `index` as a `long`."],["value_at_index_into_string","Returns the value of the Binding at `index` as a C `String`."],["value_at_index_into_timestamp","Returns the value of the Binding at `index` as a microsecond timestamp."],["value_at_index_into_uuid","Returns the value of the Binding at `index` as a UUID byte slice of length 16."]],"mod":[["android",""],["utils",""]],"struct":[["EntityBuilder",""],["ExternOption","A C representation Rust's Option. A value of `Some` results in `value` containing a raw pointer as a `c_void`. A value of `None` results in `value` containing a null pointer."],["ExternResult","A C representation Rust's Result. A value of `Ok` results in `ok` containing a raw pointer as a `c_void` and `err` containing a null pointer. A value of `Err` results in `value` containing a null pointer and `err` containing an error message."],["InProgress","Represents an in-progress, not yet committed, set of changes to the store. Call `commit` to commit your changes, or `rollback` to discard them. A transaction is held open until you do so. Your changes will be implicitly dropped along with this struct."],["InProgressBuilder",""],["InProgressTransactResult",""],["KnownEntid","An entid that's either already in the store, or newly allocated to a tempid. TODO: we'd like to link this in some way to the lifetime of a particular PartitionMap."],["QueryBuilder",""],["QueryInputs","Define the inputs to a query. This is in two parts: a set of values known now, and a set of types known now. The separate map of types is to allow queries to be algebrized without full knowledge of the bindings that will be used at execution time. When built correctly, `types` is guaranteed to contain the types of `values` -- use `QueryInputs::new` or `QueryInputs::with_values` to construct an instance."],["QueryOutput",""],["RelResult","The result you get from a 'rel' query, like:"],["Store","A convenience wrapper around a single SQLite connection and a Conn. This is suitable for applications that don't require complex connection management."],["TransactionChange","A C representation of the change provided by the transaction observers from a single transact. Holds a transaction identifier, the changes as a set of affected attributes and the length of the list of changes."],["TxChangeList","A C representation of the list of changes provided by the transaction observers. Provides the list of changes as the length of the list."],["TxObserver",""],["TxReport","A transaction report summarizes an applied transaction."],["Uuid","A Universally Unique Identifier (UUID)."],["Variable",""]],"trait":[["BuildTerms",""],["HasSchema",""],["IntoThing",""],["Queryable",""],["Syncable",""]],"type":[["BindingIterator",""],["BindingListIterator",""],["Entid","Represents one entid in the entid space."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/store_begin_transaction.v.html b/docs/apis/rust/0.7.0/mentat_ffi/store_begin_transaction.v.html new file mode 100644 index 00000000..e3173675 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/store_begin_transaction.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.store_begin_transaction.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/store_cache_attribute_bi_directional.v.html b/docs/apis/rust/0.7.0/mentat_ffi/store_cache_attribute_bi_directional.v.html new file mode 100644 index 00000000..c6efcf47 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/store_cache_attribute_bi_directional.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.store_cache_attribute_bi_directional.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/store_cache_attribute_forward.v.html b/docs/apis/rust/0.7.0/mentat_ffi/store_cache_attribute_forward.v.html new file mode 100644 index 00000000..b5f811db --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/store_cache_attribute_forward.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.store_cache_attribute_forward.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/store_cache_attribute_reverse.v.html b/docs/apis/rust/0.7.0/mentat_ffi/store_cache_attribute_reverse.v.html new file mode 100644 index 00000000..5dfabb85 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/store_cache_attribute_reverse.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.store_cache_attribute_reverse.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/store_destroy.v.html b/docs/apis/rust/0.7.0/mentat_ffi/store_destroy.v.html new file mode 100644 index 00000000..f4d4b6ed --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/store_destroy.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.store_destroy.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/store_entid_for_attribute.v.html b/docs/apis/rust/0.7.0/mentat_ffi/store_entid_for_attribute.v.html new file mode 100644 index 00000000..392c26be --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/store_entid_for_attribute.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.store_entid_for_attribute.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/store_entity_builder_from_entid.v.html b/docs/apis/rust/0.7.0/mentat_ffi/store_entity_builder_from_entid.v.html new file mode 100644 index 00000000..b068872b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/store_entity_builder_from_entid.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.store_entity_builder_from_entid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/store_entity_builder_from_temp_id.v.html b/docs/apis/rust/0.7.0/mentat_ffi/store_entity_builder_from_temp_id.v.html new file mode 100644 index 00000000..e5d25689 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/store_entity_builder_from_temp_id.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.store_entity_builder_from_temp_id.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/store_in_progress_builder.v.html b/docs/apis/rust/0.7.0/mentat_ffi/store_in_progress_builder.v.html new file mode 100644 index 00000000..793bb08a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/store_in_progress_builder.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.store_in_progress_builder.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/store_open.v.html b/docs/apis/rust/0.7.0/mentat_ffi/store_open.v.html new file mode 100644 index 00000000..11e8bfec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/store_open.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.store_open.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/store_query.v.html b/docs/apis/rust/0.7.0/mentat_ffi/store_query.v.html new file mode 100644 index 00000000..a7497d58 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/store_query.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.store_query.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/store_register_observer.v.html b/docs/apis/rust/0.7.0/mentat_ffi/store_register_observer.v.html new file mode 100644 index 00000000..00cd822c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/store_register_observer.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.store_register_observer.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/store_transact.v.html b/docs/apis/rust/0.7.0/mentat_ffi/store_transact.v.html new file mode 100644 index 00000000..2b582933 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/store_transact.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.store_transact.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/store_unregister_observer.v.html b/docs/apis/rust/0.7.0/mentat_ffi/store_unregister_observer.v.html new file mode 100644 index 00000000..b3329178 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/store_unregister_observer.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.store_unregister_observer.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/store_value_for_attribute.v.html b/docs/apis/rust/0.7.0/mentat_ffi/store_value_for_attribute.v.html new file mode 100644 index 00000000..42e078f0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/store_value_for_attribute.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.store_value_for_attribute.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.EntityBuilder.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.EntityBuilder.html new file mode 100644 index 00000000..aae60a11 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.EntityBuilder.html @@ -0,0 +1,145 @@ + + + + + + + + + + mentat_ffi::EntityBuilder - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::EntityBuilder + + [] + +

pub struct EntityBuilder<T> where
    T: BuildTerms
{ /* fields omitted */ }
+

+ Methods +

+

impl<T> EntityBuilder<T> where
    T: BuildTerms

impl<'a, 'c> EntityBuilder<InProgressBuilder<'a, 'c>>

Build the terms from this builder and transact them against the current +InProgress. This method always returns the InProgress -- failure doesn't +imply an automatic rollback.

+

Transact the contents of the builder and commit the InProgress. If any +step fails, roll back. Return the TxReport.

+
+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl<T> !Send for EntityBuilder<T>

impl<T> !Sync for EntityBuilder<T>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.ExternOption.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.ExternOption.html new file mode 100644 index 00000000..888032bd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.ExternOption.html @@ -0,0 +1,153 @@ + + + + + + + + + + mentat_ffi::ExternOption - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::ExternOption + + [] + + [src]

#[repr(C)] +
pub struct ExternOption { + pub value: *mut c_void, +}

A C representation Rust's Option. +A value of Some results in value containing a raw pointer as a c_void. +A value of None results in value containing a null pointer.

+

#Safety

+

Callers are responsible for managing the memory for the return value. +A destructor destroy is provided for releasing the memory for this +pointer type.

+

+ Fields

+ + +

+ Trait Implementations +

+
+

impl Debug for ExternOption
[src]

Formats the value using the given formatter. Read more

+

impl<T> From<Option<T>> for ExternOption
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl !Send for ExternOption

impl !Sync for ExternOption

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.ExternResult.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.ExternResult.html new file mode 100644 index 00000000..72f4c458 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.ExternResult.html @@ -0,0 +1,159 @@ + + + + + + + + + + mentat_ffi::ExternResult - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::ExternResult + + [] + + [src]

#[repr(C)] +
pub struct ExternResult { + pub ok: *const c_void, + pub err: *const c_char, +}

A C representation Rust's Result. +A value of Ok results in ok containing a raw pointer as a c_void +and err containing a null pointer. +A value of Err results in value containing a null pointer and err containing an error message.

+

#Safety

+

Callers are responsible for managing the memory for the return value. +A destructor destroy is provided for releasing the memory for this +pointer type.

+

+ Fields

+ + + + +

+ Trait Implementations +

+
+

impl Debug for ExternResult
[src]

Formats the value using the given formatter. Read more

+

impl<T, E> From<Result<T, E>> for ExternResult where
    E: Display
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl !Send for ExternResult

impl !Sync for ExternResult

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.InProgress.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.InProgress.html new file mode 100644 index 00000000..f87feb39 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.InProgress.html @@ -0,0 +1,153 @@ + + + + + + + + + + mentat_ffi::InProgress - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::InProgress + + [] + +

pub struct InProgress<'a, 'c> { /* fields omitted */ }

Represents an in-progress, not yet committed, set of changes to the store. +Call commit to commit your changes, or rollback to discard them. +A transaction is held open until you do so. +Your changes will be implicitly dropped along with this struct.

+
+

+ Methods +

+

impl<'a, 'c> InProgress<'a, 'c>

Choose whether to use in-memory caches for running queries.

+

If you only have a reference to an InProgress, you can't use the easy builder. +This exists so you can make your own.

+

+

+ Trait Implementations +

+
+

impl<'a, 'c> Pullable for InProgress<'a, 'c>

impl<'a, 'c> VersionedStore for InProgress<'a, 'c>

Check whether the provided vocabulary is present in the store. If it isn't, make it so.

+

Check whether the provided vocabularies are present in the store at the correct version and with all defined attributes. If any are not, invoke the pre function on the provided VocabularySource, install or upgrade the necessary vocabularies, then invoke post. Returns Ok if all of these steps succeed. Read more

+

Check whether the vocabulary described by the provided metadata is present in the store.

+

Make sure that our expectations of the core vocabulary — basic types and attributes — are met.

+

impl<'a, 'c> Queryable for InProgress<'a, 'c>

impl<'a, 'c> HasSchema for InProgress<'a, 'c>

Return true if the provided entid identifies an attribute in this schema.

+

Return true if the provided ident identifies an attribute in this schema.

+

Important traits for &'a [u8]

+

+ Auto Trait Implementations +

+
+

impl<'a, 'c> !Send for InProgress<'a, 'c>

impl<'a, 'c> !Sync for InProgress<'a, 'c>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.InProgressBuilder.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.InProgressBuilder.html new file mode 100644 index 00000000..b8df3b34 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.InProgressBuilder.html @@ -0,0 +1,145 @@ + + + + + + + + + + mentat_ffi::InProgressBuilder - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::InProgressBuilder + + [] + +

pub struct InProgressBuilder<'a, 'c> { /* fields omitted */ }
+

+ Methods +

+

impl<'a, 'c> InProgressBuilder<'a, 'c>

Build the terms from this builder and transact them against the current +InProgress. This method always returns the InProgress -- failure doesn't +imply an automatic rollback.

+

Transact the contents of the builder and commit the InProgress. If any +step fails, roll back. Return the TxReport.

+

impl<'a, 'c> InProgressBuilder<'a, 'c>

+

+ Trait Implementations +

+
+

impl<'a, 'c> BuildTerms for InProgressBuilder<'a, 'c>

+

+ Auto Trait Implementations +

+
+

impl<'a, 'c> !Send for InProgressBuilder<'a, 'c>

impl<'a, 'c> !Sync for InProgressBuilder<'a, 'c>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.InProgressTransactResult.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.InProgressTransactResult.html new file mode 100644 index 00000000..43320116 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.InProgressTransactResult.html @@ -0,0 +1,150 @@ + + + + + + + + + + mentat_ffi::InProgressTransactResult - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::InProgressTransactResult + + [] + + [src]

#[repr(C)] +
pub struct InProgressTransactResult<'a, 'c> { + pub in_progress: *mut InProgress<'a, 'c>, + pub result: *mut ExternResult, +}

+ Fields

+ + + + +

+ Trait Implementations +

+
+

impl<'a, 'c> Debug for InProgressTransactResult<'a, 'c>
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl<'a, 'c> !Send for InProgressTransactResult<'a, 'c>

impl<'a, 'c> !Sync for InProgressTransactResult<'a, 'c>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.KnownEntid.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.KnownEntid.html new file mode 100644 index 00000000..3816ba4e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.KnownEntid.html @@ -0,0 +1,155 @@ + + + + + + + + + + mentat_ffi::KnownEntid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::KnownEntid + + [] + + [src]

pub struct KnownEntid(pub i64);

An entid that's either already in the store, or newly allocated to a tempid. +TODO: we'd like to link this in some way to the lifetime of a particular PartitionMap.

+
+

+ Trait Implementations +

+
+

impl FromThing<KnownEntid> for Either<KnownEntid, Rc<TempId>>

impl FromThing<KnownEntid> for Either<TypedValue, Rc<TempId>>

impl<'a> FromThing<&'a KnownEntid> for Either<KnownEntid, Rc<TempId>>

impl PartialOrd<KnownEntid> for KnownEntid
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Copy for KnownEntid
[src]

impl Clone for KnownEntid
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<KnownEntid> for i64
[src]

Performs the conversion.

+

impl From<KnownEntid> for TypedValue
[src]

Performs the conversion.

+

impl Ord for KnownEntid
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Hash for KnownEntid
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for KnownEntid
[src]

impl PartialEq<KnownEntid> for KnownEntid
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for KnownEntid
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for KnownEntid

impl Sync for KnownEntid

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.QueryBuilder.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.QueryBuilder.html new file mode 100644 index 00000000..a7d01750 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.QueryBuilder.html @@ -0,0 +1,140 @@ + + + + + + + + + + mentat_ffi::QueryBuilder - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::QueryBuilder + + [] + +

pub struct QueryBuilder<'a> { /* fields omitted */ }
+

+ Methods +

+

impl<'a> QueryBuilder<'a>

+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl<'a> !Send for QueryBuilder<'a>

impl<'a> !Sync for QueryBuilder<'a>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.QueryInputs.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.QueryInputs.html new file mode 100644 index 00000000..d6dfba35 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.QueryInputs.html @@ -0,0 +1,147 @@ + + + + + + + + + + mentat_ffi::QueryInputs - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::QueryInputs + + [] + + [src]

pub struct QueryInputs { /* fields omitted */ }

Define the inputs to a query. This is in two parts: a set of values known now, and a set of +types known now. +The separate map of types is to allow queries to be algebrized without full knowledge of +the bindings that will be used at execution time. +When built correctly, types is guaranteed to contain the types of values -- use +QueryInputs::new or QueryInputs::with_values to construct an instance.

+
+

+ Methods +

+

impl QueryInputs
[src]

+

+ Trait Implementations +

+
+

impl Default for QueryInputs
[src]

Returns the "default value" for a type. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for QueryInputs

impl !Sync for QueryInputs

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.QueryOutput.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.QueryOutput.html new file mode 100644 index 00000000..f9fee3da --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.QueryOutput.html @@ -0,0 +1,156 @@ + + + + + + + + + + mentat_ffi::QueryOutput - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::QueryOutput + + [] + + [src]

pub struct QueryOutput {
+    pub spec: Rc<FindSpec>,
+    pub results: QueryResults,
+}

+ Fields

+ + + + +

+ Methods +

+

impl QueryOutput
[src]

Important traits for Box<R>

+

+ Trait Implementations +

+
+

impl From<QueryOutput> for QueryResults
[src]

Performs the conversion.

+

impl Eq for QueryOutput
[src]

impl PartialEq<QueryOutput> for QueryOutput
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for QueryOutput
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for QueryOutput

impl !Sync for QueryOutput

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.RelResult.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.RelResult.html new file mode 100644 index 00000000..7cc78452 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.RelResult.html @@ -0,0 +1,183 @@ + + + + + + + + + + mentat_ffi::RelResult - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::RelResult + + [] + + [src]

pub struct RelResult<T> {
+    pub width: usize,
+    pub values: Vec<T>,
+}

The result you get from a 'rel' query, like:

+
[:find ?person ?name
+ :where [?person :person/name ?name]]
+
+

There are three ways to get data out of a RelResult:

+
    +
  • By iterating over rows as slices. Use result.rows(). This is efficient and is +recommended in two cases: +
      +
    1. If you don't need to take ownership of the resulting values (e.g., you're comparing +or making a modified clone).
    2. +
    3. When the data you're retrieving is cheap to clone. All scalar values are relatively +cheap: they're either small values or Rc.
    4. +
    +
  • +
  • By direct reference to a row by index, using result.row(i). This also returns +a reference.
  • +
  • By consuming the results using into_iter. This allocates short-lived vectors, +but gives you ownership of the enclosed TypedValues.
  • +
+

+ Fields

+ + + + +

+ Methods +

+

impl<T> RelResult<T>
[src]

Important traits for Chunks<'a, T>

+

+ Trait Implementations +

+
+

impl<T> IntoIterator for RelResult<T>
[src]

+

The type of the elements being iterated over.

+

+

Which kind of iterator are we turning this into?

+

Creates an iterator from a value. Read more

+

impl<T> Clone for RelResult<T> where
    T: Clone
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<Vec<Vec<TypedValue>>> for RelResult<Binding>
[src]

Performs the conversion.

+

impl<T> Eq for RelResult<T> where
    T: Eq
[src]

impl<T> PartialEq<RelResult<T>> for RelResult<T> where
    T: PartialEq<T>, 
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl<T> Debug for RelResult<T> where
    T: Debug
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl<T> Send for RelResult<T> where
    T: Send

impl<T> Sync for RelResult<T> where
    T: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.Store.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.Store.html new file mode 100644 index 00000000..7caa56d0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.Store.html @@ -0,0 +1,145 @@ + + + + + + + + + + mentat_ffi::Store - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::Store + + [] + +

pub struct Store { /* fields omitted */ }

A convenience wrapper around a single SQLite connection and a Conn. This is suitable +for applications that don't require complex connection management.

+
+

+ Methods +

+

impl Store

Open a store at the supplied path, ensuring that it includes the bootstrap schema.

+

Returns a totally blank store with no bootstrap schema. Use open instead.

+

impl Store

Intended for use from tests.

+

impl Store

+

+ Trait Implementations +

+
+

impl Syncable for Store

impl Pullable for Store

impl Queryable for Store

+

+ Auto Trait Implementations +

+
+

impl Send for Store

impl !Sync for Store

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.TransactionChange.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.TransactionChange.html new file mode 100644 index 00000000..813a7659 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.TransactionChange.html @@ -0,0 +1,165 @@ + + + + + + + + + + mentat_ffi::TransactionChange - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::TransactionChange + + [] + + [src]

#[repr(C)] +
pub struct TransactionChange { + pub txid: Entid, + pub changes_len: usize, + pub changes: Box<[Entid]>, +}

A C representation of the change provided by the transaction observers +from a single transact. +Holds a transaction identifier, the changes as a set of affected attributes +and the length of the list of changes.

+

#Safety

+

Callers are responsible for managing the memory for the return value. +A destructor destroy is provided for releasing the memory for this +pointer type.

+

+ Fields

+ + + + + + +

+ Trait Implementations +

+
+

impl Debug for TransactionChange
[src]

Formats the value using the given formatter. Read more

+

impl Clone for TransactionChange
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.TxChangeList.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.TxChangeList.html new file mode 100644 index 00000000..bda23faa --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.TxChangeList.html @@ -0,0 +1,156 @@ + + + + + + + + + + mentat_ffi::TxChangeList - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::TxChangeList + + [] + + [src]

#[repr(C)] +
pub struct TxChangeList { + pub reports: Box<[TransactionChange]>, + pub len: usize, +}

A C representation of the list of changes provided by the transaction observers. +Provides the list of changes as the length of the list.

+

#Safety

+

Callers are responsible for managing the memory for the return value. +A destructor destroy is provided for releasing the memory for this +pointer type.

+

+ Fields

+ + + + +

+ Trait Implementations +

+
+

impl Debug for TxChangeList
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for TxChangeList

impl Sync for TxChangeList

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.TxObserver.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.TxObserver.html new file mode 100644 index 00000000..0f30a4bf --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.TxObserver.html @@ -0,0 +1,140 @@ + + + + + + + + + + mentat_ffi::TxObserver - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::TxObserver + + [] + + [src]

pub struct TxObserver { /* fields omitted */ }
+

+ Methods +

+

impl TxObserver
[src]

+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl Send for TxObserver

impl Sync for TxObserver

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.TxReport.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.TxReport.html new file mode 100644 index 00000000..69e2d8dc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.TxReport.html @@ -0,0 +1,175 @@ + + + + + + + + + + mentat_ffi::TxReport - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::TxReport + + [] + + [src]

pub struct TxReport {
+    pub tx_id: i64,
+    pub tx_instant: DateTime<Utc>,
+    pub tempids: BTreeMap<String, i64>,
+}

A transaction report summarizes an applied transaction.

+

+ Fields

+ +

The transaction ID of the transaction.

+
+ +

The timestamp when the transaction began to be committed.

+
+ +

A map from string literal tempid to resolved or allocated entid.

+

Every string literal tempid presented to the transactor either resolves via upsert to an +existing entid, or is allocated a new entid. (It is possible for multiple distinct string +literal tempids to all unify to a single freshly allocated entid.)

+
+

+ Trait Implementations +

+
+

impl Clone for TxReport
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Hash for TxReport
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for TxReport
[src]

impl Debug for TxReport
[src]

Formats the value using the given formatter. Read more

+

impl PartialOrd<TxReport> for TxReport
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Ord for TxReport
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl PartialEq<TxReport> for TxReport
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for TxReport

impl Sync for TxReport

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.Uuid.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.Uuid.html new file mode 100644 index 00000000..564cc41d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.Uuid.html @@ -0,0 +1,323 @@ + + + + + + + + + + mentat_ffi::Uuid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::Uuid + + [] + + [src]

pub struct Uuid { /* fields omitted */ }

A Universally Unique Identifier (UUID).

+
+

+ Methods +

+

impl Uuid
[src]

The 'nil UUID'.

+

The nil UUID is special form of UUID that is specified to have all +128 bits set to zero, as defined in IETF RFC 4122 Section 4.1.7.

+

Examples

+

Basic usage:

+ +
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+
+assert_eq!(uuid.hyphenated().to_string(),
+           "00000000-0000-0000-0000-000000000000");
+

Creates a new Uuid.

+

Note that not all versions can be generated currently and None will be +returned if the specified version cannot be generated.

+

To generate a random UUID (UuidVersion::Random), then the v4 +feature must be enabled for this crate.

+

Creates a random Uuid.

+

This uses the rand crate's default task RNG as the source of random numbers. +If you'd like to use a custom generator, don't use this method: use the +rand::Rand trait's rand() method instead.

+

Note that usage of this method requires the v4 feature of this crate +to be enabled.

+

Examples

+

Basic usage:

+ +
+use uuid::Uuid;
+
+let uuid = Uuid::new_v4();
+

Creates a Uuid from four field values.

+

Errors

+

This function will return an error if d4's length is not 8 bytes.

+

Examples

+

Basic usage:

+ +
+use uuid::Uuid;
+
+let d4 = [12, 3, 9, 56, 54, 43, 8, 9];
+
+let uuid = Uuid::from_fields(42, 12, 5, &d4);
+let uuid = uuid.map(|uuid| uuid.hyphenated().to_string());
+
+let expected_uuid = Ok(String::from("0000002a-000c-0005-0c03-0938362b0809"));
+
+assert_eq!(expected_uuid, uuid);
+

An invalid length:

+ +
+use uuid::Uuid;
+use uuid::ParseError;
+
+let d4 = [12];
+
+let uuid = Uuid::from_fields(42, 12, 5, &d4);
+
+let expected_uuid = Err(ParseError::InvalidLength(1));
+
+assert_eq!(expected_uuid, uuid);
+

Creates a Uuid using the supplied bytes.

+

Errors

+

This function will return an error if b has any length other than 16.

+

Examples

+

Basic usage:

+ +
+use uuid::Uuid;
+
+let bytes = [4, 54, 67, 12, 43, 2, 98, 76,
+             32, 50, 87, 5, 1, 33, 43, 87];
+
+let uuid = Uuid::from_bytes(&bytes);
+let uuid = uuid.map(|uuid| uuid.hyphenated().to_string());
+
+let expected_uuid = Ok(String::from("0436430c-2b02-624c-2032-570501212b57"));
+
+assert_eq!(expected_uuid, uuid);
+

An incorrect number of bytes:

+ +
+use uuid::Uuid;
+use uuid::ParseError;
+
+let bytes = [4, 54, 67, 12, 43, 2, 98, 76];
+
+let uuid = Uuid::from_bytes(&bytes);
+
+let expected_uuid = Err(ParseError::InvalidLength(8));
+
+assert_eq!(expected_uuid, uuid);
+

Returns the variant of the Uuid structure.

+

This determines the interpretation of the structure of the UUID. +Currently only the RFC4122 variant is generated by this module.

+ +

Returns the version number of the Uuid.

+

This represents the algorithm used to generate the contents.

+

Currently only the Random (V4) algorithm is supported by this +module. There are security and privacy implications for using +older versions - see Wikipedia: Universally Unique Identifier for +details.

+ +

Returns the version of the Uuid.

+

This represents the algorithm used to generate the contents

+

Return an array of 16 octets containing the UUID data

+

Examples

+
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+assert_eq!(uuid.as_bytes(), &[0; 16]);
+
+let uuid = Uuid::parse_str("936DA01F9ABD4d9d80C702AF85C822A8").unwrap();
+assert_eq!(uuid.as_bytes(),
+           &[147, 109, 160, 31, 154, 189, 77, 157,
+             128, 199, 2, 175, 133, 200, 34, 168]);
+

Returns a wrapper which when formatted via fmt::Display will format a +string of 32 hexadecimal digits.

+

Examples

+
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+assert_eq!(uuid.simple().to_string(),
+           "00000000000000000000000000000000");
+

Returns a wrapper which when formatted via fmt::Display will format a +string of hexadecimal digits separated into groups with a hyphen.

+

Examples

+
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+assert_eq!(uuid.hyphenated().to_string(),
+           "00000000-0000-0000-0000-000000000000");
+

Returns a wrapper which when formatted via fmt::Display will format a +string of the UUID as a full URN string.

+

Examples

+
+use uuid::Uuid;
+
+let uuid = Uuid::nil();
+assert_eq!(uuid.urn().to_string(),
+           "urn:uuid:00000000-0000-0000-0000-000000000000");
+

Returns an Optional Tuple of (u64, u16) representing the timestamp and +counter portion of a V1 UUID. If the supplied UUID is not V1, this +will return None

+

Parses a Uuid from a string of hexadecimal digits with optional hyphens.

+

Any of the formats generated by this module (simple, hyphenated, urn) are +supported by this parsing function.

+

Tests if the UUID is nil

+
+

+ Trait Implementations +

+
+

impl Debug for Uuid
[src]

Formats the value using the given formatter. Read more

+

impl Display for Uuid
[src]

Formats the value using the given formatter. Read more

+

impl PartialEq<Uuid> for Uuid
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Hash for Uuid
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for Uuid
[src]

impl FromStr for Uuid
[src]

+

The associated error which can be returned from parsing.

+

Parse a hex string and interpret as a Uuid.

+

Accepted formats are a sequence of 32 hexadecimal characters, +with or without hyphens (grouped as 8, 4, 4, 4, 12).

+

impl Ord for Uuid
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl<'de> Deserialize<'de> for Uuid
[src]

Deserialize this value from the given Serde deserializer. Read more

+

impl Rand for Uuid
[src]

Generates a random Uuid (V4 conformant).

+

Generates a random instance of this type using the specified source of randomness. Read more

+

impl Clone for Uuid
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for Uuid
[src]

impl PartialOrd<Uuid> for Uuid
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Serialize for Uuid
[src]

Serialize this value into the given Serde serializer. Read more

+

impl Default for Uuid
[src]

Returns the nil UUID, which is all zeroes

+

impl From<Uuid> for TypedValue
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl Send for Uuid

impl Sync for Uuid

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/struct.Variable.html b/docs/apis/rust/0.7.0/mentat_ffi/struct.Variable.html new file mode 100644 index 00000000..fd885ef4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/struct.Variable.html @@ -0,0 +1,162 @@ + + + + + + + + + + mentat_ffi::Variable - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_ffi::Variable + + [] + + [src]

pub struct Variable(pub Rc<PlainSymbol>);
+

+ Methods +

+

impl Variable
[src]

Return a new Variable, assuming that the provided string is a valid name.

+

impl Variable
[src]

TODO: intern strings. #398.

+
+

+ Trait Implementations +

+
+

impl PartialOrd<Variable> for Variable
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Clone for Variable
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<Variable> for Element
[src]

Performs the conversion.

+

impl Ord for Variable
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

impl Hash for Variable
[src]

Feeds this value into the given [Hasher]. Read more

+

Feeds a slice of this type into the given [Hasher]. Read more

+

impl Eq for Variable
[src]

impl PartialEq<Variable> for Variable
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Display for Variable
[src]

Formats the value using the given formatter. Read more

+

impl Debug for Variable
[src]

Formats the value using the given formatter. Read more

+

impl FromValue<Variable> for Variable
[src]

If the provided EDN value is a PlainSymbol beginning with '?', return +it wrapped in a Variable. If not, return None. +TODO: intern strings. #398.

+
+

+ Auto Trait Implementations +

+
+

impl !Send for Variable

impl !Sync for Variable

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/trait.BuildTerms.html b/docs/apis/rust/0.7.0/mentat_ffi/trait.BuildTerms.html new file mode 100644 index 00000000..f6d14362 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/trait.BuildTerms.html @@ -0,0 +1,149 @@ + + + + + + + + + + mentat_ffi::BuildTerms - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_ffi::BuildTerms + + [] + +

pub trait BuildTerms {
+    fn named_tempid(&mut self, name: String) -> Rc<TempId>;
+
fn describe_tempid(self, name: &str) -> EntityBuilder<Self>; +
fn describe<E>(self, entity: E) -> EntityBuilder<Self>
    where
        E: IntoThing<Either<KnownEntid, Rc<TempId>>>
; +
fn add<E, V>(&mut self, e: E, a: KnownEntid, v: V) -> Result<(), Error>
    where
        E: IntoThing<Either<KnownEntid, Rc<TempId>>>,
        V: IntoThing<Either<TypedValue, Rc<TempId>>>
; +
fn retract<E, V>(&mut self, e: E, a: KnownEntid, v: V) -> Result<(), Error>
    where
        E: IntoThing<Either<KnownEntid, Rc<TempId>>>,
        V: IntoThing<Either<TypedValue, Rc<TempId>>>
; +}
+

+ Required Methods +

+
+

+

+ Implementations on Foreign Types +

+

impl BuildTerms for TermBuilder

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/trait.HasSchema.html b/docs/apis/rust/0.7.0/mentat_ffi/trait.HasSchema.html new file mode 100644 index 00000000..b343bfbd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/trait.HasSchema.html @@ -0,0 +1,158 @@ + + + + + + + + + + mentat_ffi::HasSchema - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_ffi::HasSchema + + [] + + [src]

pub trait HasSchema {
+    fn entid_for_type(&self, t: ValueType) -> Option<KnownEntid>;
+
fn get_ident<T>(&self, x: T) -> Option<&Keyword>
    where
        T: Into<i64>
; +
fn get_entid(&self, x: &Keyword) -> Option<KnownEntid>; +
fn attribute_for_entid<T>(&self, x: T) -> Option<&Attribute>
    where
        T: Into<i64>
; +
fn attribute_for_ident(
        &self,
        ident: &Keyword
    ) -> Option<(&Attribute, KnownEntid)>; +
fn is_attribute<T>(&self, x: T) -> bool
    where
        T: Into<i64>
; +
fn identifies_attribute(&self, x: &Keyword) -> bool; +
fn component_attributes(&self) -> &[i64]; +}
+

+ Required Methods +

+
+

Return true if the provided entid identifies an attribute in this schema.

+

Return true if the provided ident identifies an attribute in this schema.

+
Important traits for &'a [u8]

+

+ Implementations on Foreign Types +

+

impl<'a, 'c> HasSchema for InProgressRead<'a, 'c>

Return true if the provided entid identifies an attribute in this schema.

+

Return true if the provided ident identifies an attribute in this schema.

+

Important traits for &'a [u8]

impl HasSchema for Schema
[src]

Return true if the provided entid identifies an attribute in this schema.

+

Return true if the provided ident identifies an attribute in this schema.

+

Important traits for &'a [u8]

+

+ Implementors +

+
    +
  • impl<'a, 'c> HasSchema for InProgress<'a, 'c>
  • +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/trait.IntoThing.html b/docs/apis/rust/0.7.0/mentat_ffi/trait.IntoThing.html new file mode 100644 index 00000000..45dbbe0a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/trait.IntoThing.html @@ -0,0 +1,141 @@ + + + + + + + + + + mentat_ffi::IntoThing - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_ffi::IntoThing + + [] + +

pub trait IntoThing<T> {
+    fn into_thing(self) -> T;
+}
+

+ Required Methods +

+
+

+

+ Implementors +

+
    +
  • impl<I, F> IntoThing<I> for F where
        I: FromThing<F>, 
  • +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/trait.Queryable.html b/docs/apis/rust/0.7.0/mentat_ffi/trait.Queryable.html new file mode 100644 index 00000000..d1f461e7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/trait.Queryable.html @@ -0,0 +1,150 @@ + + + + + + + + + + mentat_ffi::Queryable - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_ffi::Queryable + + [] + +

pub trait Queryable {
+    fn q_explain<T>(
        &self,
        query: &str,
        inputs: T
    ) -> Result<QueryExplanation, Error>
    where
        T: Into<Option<QueryInputs>>
; +
fn q_once<T>(&self, query: &str, inputs: T) -> Result<QueryOutput, Error>
    where
        T: Into<Option<QueryInputs>>
; +
fn q_prepare<T>(
        &self,
        query: &str,
        inputs: T
    ) -> Result<PreparedQuery, Error>
    where
        T: Into<Option<QueryInputs>>
; +
fn lookup_values_for_attribute<E>(
        &self,
        entity: E,
        attribute: &Keyword
    ) -> Result<Vec<TypedValue>, Error>
    where
        E: Into<i64>
; +
fn lookup_value_for_attribute<E>(
        &self,
        entity: E,
        attribute: &Keyword
    ) -> Result<Option<TypedValue>, Error>
    where
        E: Into<i64>
; +}
+

+ Required Methods +

+
+

+

+ Implementations on Foreign Types +

+

impl<'a, 'c> Queryable for InProgressRead<'a, 'c>

+

+ Implementors +

+
    +
  • impl<'a, 'c> Queryable for InProgress<'a, 'c>
  • +
  • impl Queryable for Store
  • +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/trait.Syncable.html b/docs/apis/rust/0.7.0/mentat_ffi/trait.Syncable.html new file mode 100644 index 00000000..da46f3d5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/trait.Syncable.html @@ -0,0 +1,141 @@ + + + + + + + + + + mentat_ffi::Syncable - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_ffi::Syncable + + [] + +

pub trait Syncable {
+    fn sync(
        &mut self,
        server_uri: &String,
        user_uuid: &String
    ) -> Result<(), Error>; +}
+

+ Required Methods +

+
+

+

+ Implementors +

+
    +
  • impl Syncable for Store
  • +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/tx_change_list_entry_at.v.html b/docs/apis/rust/0.7.0/mentat_ffi/tx_change_list_entry_at.v.html new file mode 100644 index 00000000..c66961fb --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/tx_change_list_entry_at.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.tx_change_list_entry_at.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/tx_report_destroy.v.html b/docs/apis/rust/0.7.0/mentat_ffi/tx_report_destroy.v.html new file mode 100644 index 00000000..a0c8140f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/tx_report_destroy.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.tx_report_destroy.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/tx_report_entity_for_temp_id.v.html b/docs/apis/rust/0.7.0/mentat_ffi/tx_report_entity_for_temp_id.v.html new file mode 100644 index 00000000..c6fe7ee8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/tx_report_entity_for_temp_id.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.tx_report_entity_for_temp_id.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/tx_report_get_entid.v.html b/docs/apis/rust/0.7.0/mentat_ffi/tx_report_get_entid.v.html new file mode 100644 index 00000000..875df398 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/tx_report_get_entid.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.tx_report_get_entid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/tx_report_get_tx_instant.v.html b/docs/apis/rust/0.7.0/mentat_ffi/tx_report_get_tx_instant.v.html new file mode 100644 index 00000000..1c6d142d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/tx_report_get_tx_instant.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.tx_report_get_tx_instant.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/type.BindingIterator.html b/docs/apis/rust/0.7.0/mentat_ffi/type.BindingIterator.html new file mode 100644 index 00000000..56a6f9ff --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/type.BindingIterator.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_ffi::BindingIterator - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_ffi::BindingIterator + + [] + + [src]

type BindingIterator = IntoIter<Binding>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/type.BindingListIterator.html b/docs/apis/rust/0.7.0/mentat_ffi/type.BindingListIterator.html new file mode 100644 index 00000000..336c8053 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/type.BindingListIterator.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_ffi::BindingListIterator - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_ffi::BindingListIterator + + [] + + [src]

type BindingListIterator = Chunks<'static, Binding>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/type.Entid.html b/docs/apis/rust/0.7.0/mentat_ffi/type.Entid.html new file mode 100644 index 00000000..68b0531d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/type.Entid.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_ffi::Entid - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_ffi::Entid + + [] + + [src]

type Entid = i64;

Represents one entid in the entid space.

+

Per https://www.sqlite.org/datatype3.html (see also http://stackoverflow.com/a/8499544), SQLite +stores signed integers up to 64 bits in size. Since u32 is not appropriate for our use case, we +use i64 rather than manually truncating u64 to u63 and casting to i64 throughout the codebase.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_destroy.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_destroy.v.html new file mode 100644 index 00000000..2bc3a75a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_destroy.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_destroy.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_boolean.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_boolean.v.html new file mode 100644 index 00000000..30efdb82 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_boolean.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_into_boolean.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_double.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_double.v.html new file mode 100644 index 00000000..0eb54d08 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_double.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_into_double.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_entid.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_entid.v.html new file mode 100644 index 00000000..bba3ea62 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_entid.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_into_entid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_kw.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_kw.v.html new file mode 100644 index 00000000..d3559f5a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_kw.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_into_kw.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_long.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_long.v.html new file mode 100644 index 00000000..6a2e5c6d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_long.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_into_long.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_string.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_string.v.html new file mode 100644 index 00000000..5567c26b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_string.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_into_string.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_timestamp.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_timestamp.v.html new file mode 100644 index 00000000..90af5af2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_timestamp.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_into_timestamp.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_uuid.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_uuid.v.html new file mode 100644 index 00000000..505ee08f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_into_uuid.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_into_uuid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_list_destroy.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_list_destroy.v.html new file mode 100644 index 00000000..426631ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_list_destroy.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_list_destroy.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_list_into_iter.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_list_into_iter.v.html new file mode 100644 index 00000000..abe5188f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_list_into_iter.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_list_into_iter.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_list_iter_destroy.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_list_iter_destroy.v.html new file mode 100644 index 00000000..fd4c9abd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_list_iter_destroy.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_list_iter_destroy.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_list_iter_next.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_list_iter_next.v.html new file mode 100644 index 00000000..de4d7d13 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_list_iter_next.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_list_iter_next.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_result_set_destroy.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_result_set_destroy.v.html new file mode 100644 index 00000000..5d4fad56 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_result_set_destroy.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_result_set_destroy.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_result_set_into_iter.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_result_set_into_iter.v.html new file mode 100644 index 00000000..5e100cf9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_result_set_into_iter.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_result_set_into_iter.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_result_set_iter_destroy.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_result_set_iter_destroy.v.html new file mode 100644 index 00000000..4c83289f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_result_set_iter_destroy.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_result_set_iter_destroy.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_result_set_iter_next.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_result_set_iter_next.v.html new file mode 100644 index 00000000..5804dd71 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_result_set_iter_next.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_result_set_iter_next.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/typed_value_value_type.v.html b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_value_type.v.html new file mode 100644 index 00000000..a7331351 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/typed_value_value_type.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.typed_value_value_type.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/utils/index.html b/docs/apis/rust/0.7.0/mentat_ffi/utils/index.html new file mode 100644 index 00000000..ea2b7215 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/utils/index.html @@ -0,0 +1,141 @@ + + + + + + + + + + mentat_ffi::utils - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_ffi::utils + + [] + + [src]

Modules

+ + + + + + + + +
log + +
strings + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/utils/log/d.v.html b/docs/apis/rust/0.7.0/mentat_ffi/utils/log/d.v.html new file mode 100644 index 00000000..3cef54d0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/utils/log/d.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.d.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/utils/log/fn.d.html b/docs/apis/rust/0.7.0/mentat_ffi/utils/log/fn.d.html new file mode 100644 index 00000000..054be56a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/utils/log/fn.d.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_ffi::utils::log::d - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::utils::log::d + + [] + + [src]

pub fn d(_: &str)
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/utils/log/index.html b/docs/apis/rust/0.7.0/mentat_ffi/utils/log/index.html new file mode 100644 index 00000000..72f83f60 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/utils/log/index.html @@ -0,0 +1,134 @@ + + + + + + + + + + mentat_ffi::utils::log - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_ffi::utils::log + + [] + + [src]

Functions

+ + + + +
d + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/utils/log/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_ffi/utils/log/sidebar-items.js new file mode 100644 index 00000000..8d35eace --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/utils/log/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"fn":[["d",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/utils/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_ffi/utils/sidebar-items.js new file mode 100644 index 00000000..8620f1a4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/utils/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"mod":[["log",""],["strings",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/c_char_to_string.v.html b/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/c_char_to_string.v.html new file mode 100644 index 00000000..875d96d3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/c_char_to_string.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.c_char_to_string.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/fn.c_char_to_string.html b/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/fn.c_char_to_string.html new file mode 100644 index 00000000..226797b6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/fn.c_char_to_string.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_ffi::utils::strings::c_char_to_string - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::utils::strings::c_char_to_string + + [] + + [src]

pub fn c_char_to_string(cchar: *const c_char) -> &'static str
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/fn.kw_from_string.html b/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/fn.kw_from_string.html new file mode 100644 index 00000000..09d6d3a0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/fn.kw_from_string.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_ffi::utils::strings::kw_from_string - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::utils::strings::kw_from_string + + [] + + [src]

pub fn kw_from_string(keyword_string: &'static str) -> Keyword
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/fn.string_to_c_char.html b/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/fn.string_to_c_char.html new file mode 100644 index 00000000..0424ab95 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/fn.string_to_c_char.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_ffi::utils::strings::string_to_c_char - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_ffi::utils::strings::string_to_c_char + + [] + + [src]

pub fn string_to_c_char<T>(r_string: T) -> *mut c_char where
    T: Into<String>, 
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/index.html b/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/index.html new file mode 100644 index 00000000..22c15280 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/index.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_ffi::utils::strings - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_ffi::utils::strings + + [] + + [src]

Functions

+ + + + + + + + + + + + +
c_char_to_string + +
kw_from_string + +
string_to_c_char + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/kw_from_string.v.html b/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/kw_from_string.v.html new file mode 100644 index 00000000..3dba45d8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/kw_from_string.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.kw_from_string.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/sidebar-items.js new file mode 100644 index 00000000..0239ee73 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"fn":[["c_char_to_string",""],["kw_from_string",""],["string_to_c_char",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/string_to_c_char.v.html b/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/string_to_c_char.v.html new file mode 100644 index 00000000..f3c79572 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/utils/strings/string_to_c_char.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.string_to_c_char.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/value_at_index.v.html b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index.v.html new file mode 100644 index 00000000..1829d84a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.value_at_index.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_boolean.v.html b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_boolean.v.html new file mode 100644 index 00000000..8340aff3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_boolean.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.value_at_index_into_boolean.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_double.v.html b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_double.v.html new file mode 100644 index 00000000..2a05f304 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_double.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.value_at_index_into_double.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_entid.v.html b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_entid.v.html new file mode 100644 index 00000000..9edddd04 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_entid.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.value_at_index_into_entid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_kw.v.html b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_kw.v.html new file mode 100644 index 00000000..3edb107f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_kw.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.value_at_index_into_kw.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_long.v.html b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_long.v.html new file mode 100644 index 00000000..ffc287fa --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_long.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.value_at_index_into_long.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_string.v.html b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_string.v.html new file mode 100644 index 00000000..7b0aef06 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_string.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.value_at_index_into_string.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_timestamp.v.html b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_timestamp.v.html new file mode 100644 index 00000000..29a1283f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_timestamp.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.value_at_index_into_timestamp.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_uuid.v.html b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_uuid.v.html new file mode 100644 index 00000000..3a537624 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_ffi/value_at_index_into_uuid.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.value_at_index_into_uuid.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/ValueParseError.t.html b/docs/apis/rust/0.7.0/mentat_parser_utils/ValueParseError.t.html new file mode 100644 index 00000000..47986d7e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/ValueParseError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ValueParseError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/assert_edn_parses_to.m.html b/docs/apis/rust/0.7.0/mentat_parser_utils/assert_edn_parses_to.m.html new file mode 100644 index 00000000..b837c828 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/assert_edn_parses_to.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.assert_edn_parses_to.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/assert_parse_failure_contains.m.html b/docs/apis/rust/0.7.0/mentat_parser_utils/assert_parse_failure_contains.m.html new file mode 100644 index 00000000..dbde7444 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/assert_parse_failure_contains.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.assert_parse_failure_contains.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/assert_parses_to.m.html b/docs/apis/rust/0.7.0/mentat_parser_utils/assert_parses_to.m.html new file mode 100644 index 00000000..bbdb7a01 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/assert_parses_to.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.assert_parses_to.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/def_matches_keyword.m.html b/docs/apis/rust/0.7.0/mentat_parser_utils/def_matches_keyword.m.html new file mode 100644 index 00000000..befa71b8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/def_matches_keyword.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.def_matches_keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/def_matches_namespaced_keyword.m.html b/docs/apis/rust/0.7.0/mentat_parser_utils/def_matches_namespaced_keyword.m.html new file mode 100644 index 00000000..8341da9e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/def_matches_namespaced_keyword.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.def_matches_namespaced_keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/def_matches_plain_symbol.m.html b/docs/apis/rust/0.7.0/mentat_parser_utils/def_matches_plain_symbol.m.html new file mode 100644 index 00000000..e30397bc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/def_matches_plain_symbol.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.def_matches_plain_symbol.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/def_parser.m.html b/docs/apis/rust/0.7.0/mentat_parser_utils/def_parser.m.html new file mode 100644 index 00000000..7550d6cc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/def_parser.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.def_parser.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/index.html b/docs/apis/rust/0.7.0/mentat_parser_utils/index.html new file mode 100644 index 00000000..779490ff --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/index.html @@ -0,0 +1,245 @@ + + + + + + + + + + mentat_parser_utils - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Crate mentat_parser_utils + + [] + + [src]

Re-exports

+
pub use macros::KeywordMapParser;
pub use macros::ResultParser;
pub use value_and_span::Stream;

Modules

+ + + + + + + + + + + + +
log + +
macros + +
value_and_span + +

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
assert_edn_parses_to +

assert_edn_parses_to! simplifies some of the boilerplate around running a parser function +against string input and expecting a certain result.

+ +
assert_parse_failure_contains +

assert_parse_failure_contains! simplifies running a parser function against string input and +expecting a certain failure. This is working around the complexity of pattern matching parse +errors that contain spans.

+ +
assert_parses_to +

assert_parses_to! simplifies some of the boilerplate around running a +parser function against input and expecting a certain result.

+ +
def_matches_keyword +

Generate a satisfy expression that matches a Keyword value with the given name.

+ +
def_matches_namespaced_keyword +

Generate a satisfy expression that matches a Keyword value with the given +namespace and name.

+ +
def_matches_plain_symbol +

Generate a satisfy expression that matches a PlainSymbol value with the given name.

+ +
def_parser + +
keyword_map_of + +
matches_plain_symbol +

Generate a satisfy_map expression that matches a PlainSymbol +value with the given name.

+ +
satisfy_unwrap +

satisfy_unwrap! makes it a little easier to implement a satisfy_map +body that matches a particular Value enum case, otherwise returning None.

+ +

Structs

+ + + + +
ValueParseError +

A ValueParseError is a combine::primitives::ParseError-alike that implements the Debug, +Display, and std::error::Error traits. In addition, it doesn't capture references.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/keyword_map_of.m.html b/docs/apis/rust/0.7.0/mentat_parser_utils/keyword_map_of.m.html new file mode 100644 index 00000000..4ec169b3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/keyword_map_of.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.keyword_map_of.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/log/index.html b/docs/apis/rust/0.7.0/mentat_parser_utils/log/index.html new file mode 100644 index 00000000..cd26f384 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/log/index.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::log - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_parser_utils::log + + [] + + [src]

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/log/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_parser_utils/log/sidebar-items.js new file mode 100644 index 00000000..48333d31 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/log/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_edn_parses_to!.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_edn_parses_to!.html new file mode 100644 index 00000000..b837c828 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_edn_parses_to!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.assert_edn_parses_to.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_edn_parses_to.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_edn_parses_to.html new file mode 100644 index 00000000..92ea92a0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_edn_parses_to.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_parser_utils::assert_edn_parses_to - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_parser_utils::assert_edn_parses_to + + [] + + [src]

+macro_rules! assert_edn_parses_to {
+    ( $parser: expr, $input: expr, $expected: expr ) => { ... };
+}
+

assert_edn_parses_to! simplifies some of the boilerplate around running a parser function +against string input and expecting a certain result.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_parse_failure_contains!.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_parse_failure_contains!.html new file mode 100644 index 00000000..dbde7444 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_parse_failure_contains!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.assert_parse_failure_contains.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_parse_failure_contains.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_parse_failure_contains.html new file mode 100644 index 00000000..6c671b25 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_parse_failure_contains.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_parser_utils::assert_parse_failure_contains - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_parser_utils::assert_parse_failure_contains + + [] + + [src]

+macro_rules! assert_parse_failure_contains {
+    ( $parser: expr, $input: expr, $expected: expr ) => { ... };
+}
+

assert_parse_failure_contains! simplifies running a parser function against string input and +expecting a certain failure. This is working around the complexity of pattern matching parse +errors that contain spans.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_parses_to!.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_parses_to!.html new file mode 100644 index 00000000..bbdb7a01 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_parses_to!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.assert_parses_to.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_parses_to.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_parses_to.html new file mode 100644 index 00000000..57665ca6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.assert_parses_to.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_parser_utils::assert_parses_to - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_parser_utils::assert_parses_to + + [] + + [src]

+macro_rules! assert_parses_to {
+    ( $parser: expr, $input: expr, $expected: expr ) => { ... };
+}
+

assert_parses_to! simplifies some of the boilerplate around running a +parser function against input and expecting a certain result.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_keyword!.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_keyword!.html new file mode 100644 index 00000000..befa71b8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_keyword!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.def_matches_keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_keyword.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_keyword.html new file mode 100644 index 00000000..82cd3333 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_keyword.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_parser_utils::def_matches_keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_parser_utils::def_matches_keyword + + [] + + [src]

+macro_rules! def_matches_keyword {
+    ( $parser: ident, $name: ident, $input: expr ) => { ... };
+}
+

Generate a satisfy expression that matches a Keyword value with the given name.

+

We do this rather than using combine::token to save allocations.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_namespaced_keyword!.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_namespaced_keyword!.html new file mode 100644 index 00000000..8341da9e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_namespaced_keyword!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.def_matches_namespaced_keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_namespaced_keyword.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_namespaced_keyword.html new file mode 100644 index 00000000..61a8f926 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_namespaced_keyword.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_parser_utils::def_matches_namespaced_keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_parser_utils::def_matches_namespaced_keyword + + [] + + [src]

+macro_rules! def_matches_namespaced_keyword {
+    ( $parser: ident, $name: ident, $input_namespace: expr, $input_name: expr ) => { ... };
+}
+

Generate a satisfy expression that matches a Keyword value with the given +namespace and name.

+

We do this rather than using combine::token to save allocations.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_plain_symbol!.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_plain_symbol!.html new file mode 100644 index 00000000..e30397bc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_plain_symbol!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.def_matches_plain_symbol.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_plain_symbol.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_plain_symbol.html new file mode 100644 index 00000000..245acf4d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_matches_plain_symbol.html @@ -0,0 +1,133 @@ + + + + + + + + + + mentat_parser_utils::def_matches_plain_symbol - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_parser_utils::def_matches_plain_symbol + + [] + + [src]

+macro_rules! def_matches_plain_symbol {
+    ( $parser: ident, $name: ident, $input: expr ) => { ... };
+}
+

Generate a satisfy expression that matches a PlainSymbol value with the given name.

+

We do this rather than using combine::token so that we don't need to allocate a new String +inside a PlainSymbol inside a SpannedValue inside a ValueAndSpan just to match input.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_parser!.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_parser!.html new file mode 100644 index 00000000..7550d6cc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_parser!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.def_parser.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_parser.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_parser.html new file mode 100644 index 00000000..429b3b30 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.def_parser.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_parser_utils::def_parser - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_parser_utils::def_parser + + [] + + [src]

+macro_rules! def_parser {
+    ( $parser: ident, $name: ident, $result_type: ty, $body: block ) => { ... };
+}
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.keyword_map_of!.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.keyword_map_of!.html new file mode 100644 index 00000000..4ec169b3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.keyword_map_of!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.keyword_map_of.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.keyword_map_of.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.keyword_map_of.html new file mode 100644 index 00000000..8fa8d31c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.keyword_map_of.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_parser_utils::keyword_map_of - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_parser_utils::keyword_map_of + + [] + + [src]

+macro_rules! keyword_map_of {
+    ($(($keyword:expr, $value:expr)),+) => { ... };
+}
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.matches_plain_symbol!.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.matches_plain_symbol!.html new file mode 100644 index 00000000..0327ac8e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.matches_plain_symbol!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.matches_plain_symbol.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.matches_plain_symbol.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.matches_plain_symbol.html new file mode 100644 index 00000000..cc837ade --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.matches_plain_symbol.html @@ -0,0 +1,135 @@ + + + + + + + + + + mentat_parser_utils::matches_plain_symbol - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_parser_utils::matches_plain_symbol + + [] + + [src]

+macro_rules! matches_plain_symbol {
+    ($name: expr, $input: ident) => { ... };
+}
+

Generate a satisfy_map expression that matches a PlainSymbol +value with the given name.

+

We do this rather than using combine::token so that we don't +need to allocate a new String inside a PlainSymbol inside a Value +just to match input.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.satisfy_unwrap!.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.satisfy_unwrap!.html new file mode 100644 index 00000000..35e3595c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.satisfy_unwrap!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.satisfy_unwrap.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macro.satisfy_unwrap.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.satisfy_unwrap.html new file mode 100644 index 00000000..b2a44901 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macro.satisfy_unwrap.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_parser_utils::satisfy_unwrap - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_parser_utils::satisfy_unwrap + + [] + + [src]

+macro_rules! satisfy_unwrap {
+    ( $cas: path, $var: ident, $body: block ) => { ... };
+}
+

satisfy_unwrap! makes it a little easier to implement a satisfy_map +body that matches a particular Value enum case, otherwise returning None.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macros/KeywordMapParser.t.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macros/KeywordMapParser.t.html new file mode 100644 index 00000000..76f1f63e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macros/KeywordMapParser.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.KeywordMapParser.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macros/ResultParser.t.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macros/ResultParser.t.html new file mode 100644 index 00000000..f00a954f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macros/ResultParser.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.ResultParser.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macros/index.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macros/index.html new file mode 100644 index 00000000..746ca799 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macros/index.html @@ -0,0 +1,147 @@ + + + + + + + + + + mentat_parser_utils::macros - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_parser_utils::macros + + [] + + [src]

Structs

+ + + + +
KeywordMapParser + +

Type Definitions

+ + + + +
ResultParser +

A type definition for a function parser that either parses an O from an input stream of type +I, or fails with an "expected" failure. +See https://docs.rs/combine/2.2.1/combine/trait.Parser.html#method.expected for more +illumination. +Nothing about this is specific to the result type of the parser.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macros/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_parser_utils/macros/sidebar-items.js new file mode 100644 index 00000000..f15afefd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macros/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["KeywordMapParser",""]],"type":[["ResultParser","A type definition for a function parser that either parses an `O` from an input stream of type `I`, or fails with an \"expected\" failure. See https://docs.rs/combine/2.2.1/combine/trait.Parser.html#method.expected for more illumination. Nothing about this is specific to the result type of the parser."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macros/struct.KeywordMapParser.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macros/struct.KeywordMapParser.html new file mode 100644 index 00000000..10c13779 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macros/struct.KeywordMapParser.html @@ -0,0 +1,268 @@ + + + + + + + + + + mentat_parser_utils::macros::KeywordMapParser - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_parser_utils::macros::KeywordMapParser + + [] + + [src]

pub struct KeywordMapParser<T>(pub T);
+

+ Trait Implementations +

+
+

impl<'a, Av, Bv> Parser for KeywordMapParser<((&'static str, Av), (&'static str, Bv))> where
    Av: Parser<Input = Stream<'a>>,
    Bv: Parser<Input = Stream<'a>>, 
[src]

+

The type which is taken as input for the parser. The type must implement the Stream trait which allows the parser to read items from the type. Read more

+

+

The type which is returned if the parser is successful.

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Entry point of the parser. Takes some input and tries to parse it. Read more

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Adds the first error that would normally be returned by this parser if it failed with an EmptyErr result. Read more

+

Borrows a parser instead of consuming it. Read more

+

Discards the value of the self parser and returns the value of p. Fails if any of the parsers fails. Read more

+

Discards the value of the p parser and returns the value of self. Fails if any of the parsers fails. Read more

+

Parses with self followed by p. Succeeds if both parsers succeed, otherwise fails. Returns a tuple with both values on success. Read more

+

Returns a parser which attempts to parse using self. If self fails without consuming any input it tries to consume the same input using p. Read more

+

Parses using self and then passes the value to f which returns a parser used to parse the rest of the input. Read more

+

Uses f to map over the parsed value. Read more

+

Uses f to map over the output of self. If f returns an error the parser fails. Read more

+

Parses with self and if it fails, adds the message msg to the error. Read more

+

Parses with self and if it fails without consuming any input any expected errors are replaced by msg. msg is then used in error messages as "Expected msg". Read more

+

Parses with self and applies f on the result if self parses successfully. f may optionally fail with an error which is automatically converted to a ParseError. Read more

+

Creates an iterator from a parser and a state. Can be used as an alternative to [many] when collecting directly into a FromIterator type is not desirable. Read more

+

Turns the parser into a trait object by putting it in a Box. Can be used to easily return parsers from functions without naming the type. Read more

+

impl<'a, Av, Bv, Cv> Parser for KeywordMapParser<((&'static str, Av), (&'static str, Bv), (&'static str, Cv))> where
    Av: Parser<Input = Stream<'a>>,
    Bv: Parser<Input = Stream<'a>>,
    Cv: Parser<Input = Stream<'a>>, 
[src]

+

The type which is taken as input for the parser. The type must implement the Stream trait which allows the parser to read items from the type. Read more

+

+

The type which is returned if the parser is successful.

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Entry point of the parser. Takes some input and tries to parse it. Read more

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Adds the first error that would normally be returned by this parser if it failed with an EmptyErr result. Read more

+

Borrows a parser instead of consuming it. Read more

+

Discards the value of the self parser and returns the value of p. Fails if any of the parsers fails. Read more

+

Discards the value of the p parser and returns the value of self. Fails if any of the parsers fails. Read more

+

Parses with self followed by p. Succeeds if both parsers succeed, otherwise fails. Returns a tuple with both values on success. Read more

+

Returns a parser which attempts to parse using self. If self fails without consuming any input it tries to consume the same input using p. Read more

+

Parses using self and then passes the value to f which returns a parser used to parse the rest of the input. Read more

+

Uses f to map over the parsed value. Read more

+

Uses f to map over the output of self. If f returns an error the parser fails. Read more

+

Parses with self and if it fails, adds the message msg to the error. Read more

+

Parses with self and if it fails without consuming any input any expected errors are replaced by msg. msg is then used in error messages as "Expected msg". Read more

+

Parses with self and applies f on the result if self parses successfully. f may optionally fail with an error which is automatically converted to a ParseError. Read more

+

Creates an iterator from a parser and a state. Can be used as an alternative to [many] when collecting directly into a FromIterator type is not desirable. Read more

+

Turns the parser into a trait object by putting it in a Box. Can be used to easily return parsers from functions without naming the type. Read more

+

impl<'a, Av, Bv, Cv, Dv> Parser for KeywordMapParser<((&'static str, Av), (&'static str, Bv), (&'static str, Cv), (&'static str, Dv))> where
    Av: Parser<Input = Stream<'a>>,
    Bv: Parser<Input = Stream<'a>>,
    Cv: Parser<Input = Stream<'a>>,
    Dv: Parser<Input = Stream<'a>>, 
[src]

+

The type which is taken as input for the parser. The type must implement the Stream trait which allows the parser to read items from the type. Read more

+

+

The type which is returned if the parser is successful.

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Entry point of the parser. Takes some input and tries to parse it. Read more

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Adds the first error that would normally be returned by this parser if it failed with an EmptyErr result. Read more

+

Borrows a parser instead of consuming it. Read more

+

Discards the value of the self parser and returns the value of p. Fails if any of the parsers fails. Read more

+

Discards the value of the p parser and returns the value of self. Fails if any of the parsers fails. Read more

+

Parses with self followed by p. Succeeds if both parsers succeed, otherwise fails. Returns a tuple with both values on success. Read more

+

Returns a parser which attempts to parse using self. If self fails without consuming any input it tries to consume the same input using p. Read more

+

Parses using self and then passes the value to f which returns a parser used to parse the rest of the input. Read more

+

Uses f to map over the parsed value. Read more

+

Uses f to map over the output of self. If f returns an error the parser fails. Read more

+

Parses with self and if it fails, adds the message msg to the error. Read more

+

Parses with self and if it fails without consuming any input any expected errors are replaced by msg. msg is then used in error messages as "Expected msg". Read more

+

Parses with self and applies f on the result if self parses successfully. f may optionally fail with an error which is automatically converted to a ParseError. Read more

+

Creates an iterator from a parser and a state. Can be used as an alternative to [many] when collecting directly into a FromIterator type is not desirable. Read more

+

Turns the parser into a trait object by putting it in a Box. Can be used to easily return parsers from functions without naming the type. Read more

+

impl<'a, Av, Bv, Cv, Dv, Ev> Parser for KeywordMapParser<((&'static str, Av), (&'static str, Bv), (&'static str, Cv), (&'static str, Dv), (&'static str, Ev))> where
    Av: Parser<Input = Stream<'a>>,
    Bv: Parser<Input = Stream<'a>>,
    Cv: Parser<Input = Stream<'a>>,
    Dv: Parser<Input = Stream<'a>>,
    Ev: Parser<Input = Stream<'a>>, 
[src]

+

The type which is taken as input for the parser. The type must implement the Stream trait which allows the parser to read items from the type. Read more

+

+

The type which is returned if the parser is successful.

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Entry point of the parser. Takes some input and tries to parse it. Read more

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Adds the first error that would normally be returned by this parser if it failed with an EmptyErr result. Read more

+

Borrows a parser instead of consuming it. Read more

+

Discards the value of the self parser and returns the value of p. Fails if any of the parsers fails. Read more

+

Discards the value of the p parser and returns the value of self. Fails if any of the parsers fails. Read more

+

Parses with self followed by p. Succeeds if both parsers succeed, otherwise fails. Returns a tuple with both values on success. Read more

+

Returns a parser which attempts to parse using self. If self fails without consuming any input it tries to consume the same input using p. Read more

+

Parses using self and then passes the value to f which returns a parser used to parse the rest of the input. Read more

+

Uses f to map over the parsed value. Read more

+

Uses f to map over the output of self. If f returns an error the parser fails. Read more

+

Parses with self and if it fails, adds the message msg to the error. Read more

+

Parses with self and if it fails without consuming any input any expected errors are replaced by msg. msg is then used in error messages as "Expected msg". Read more

+

Parses with self and applies f on the result if self parses successfully. f may optionally fail with an error which is automatically converted to a ParseError. Read more

+

Creates an iterator from a parser and a state. Can be used as an alternative to [many] when collecting directly into a FromIterator type is not desirable. Read more

+

Turns the parser into a trait object by putting it in a Box. Can be used to easily return parsers from functions without naming the type. Read more

+

impl<'a, Av, Bv, Cv, Dv, Ev, Fv> Parser for KeywordMapParser<((&'static str, Av), (&'static str, Bv), (&'static str, Cv), (&'static str, Dv), (&'static str, Ev), (&'static str, Fv))> where
    Av: Parser<Input = Stream<'a>>,
    Bv: Parser<Input = Stream<'a>>,
    Cv: Parser<Input = Stream<'a>>,
    Dv: Parser<Input = Stream<'a>>,
    Ev: Parser<Input = Stream<'a>>,
    Fv: Parser<Input = Stream<'a>>, 
[src]

+

The type which is taken as input for the parser. The type must implement the Stream trait which allows the parser to read items from the type. Read more

+

+

The type which is returned if the parser is successful.

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Entry point of the parser. Takes some input and tries to parse it. Read more

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Adds the first error that would normally be returned by this parser if it failed with an EmptyErr result. Read more

+

Borrows a parser instead of consuming it. Read more

+

Discards the value of the self parser and returns the value of p. Fails if any of the parsers fails. Read more

+

Discards the value of the p parser and returns the value of self. Fails if any of the parsers fails. Read more

+

Parses with self followed by p. Succeeds if both parsers succeed, otherwise fails. Returns a tuple with both values on success. Read more

+

Returns a parser which attempts to parse using self. If self fails without consuming any input it tries to consume the same input using p. Read more

+

Parses using self and then passes the value to f which returns a parser used to parse the rest of the input. Read more

+

Uses f to map over the parsed value. Read more

+

Uses f to map over the output of self. If f returns an error the parser fails. Read more

+

Parses with self and if it fails, adds the message msg to the error. Read more

+

Parses with self and if it fails without consuming any input any expected errors are replaced by msg. msg is then used in error messages as "Expected msg". Read more

+

Parses with self and applies f on the result if self parses successfully. f may optionally fail with an error which is automatically converted to a ParseError. Read more

+

Creates an iterator from a parser and a state. Can be used as an alternative to [many] when collecting directly into a FromIterator type is not desirable. Read more

+

Turns the parser into a trait object by putting it in a Box. Can be used to easily return parsers from functions without naming the type. Read more

+

impl<'a, Av, Bv, Cv, Dv, Ev, Fv, Gv> Parser for KeywordMapParser<((&'static str, Av), (&'static str, Bv), (&'static str, Cv), (&'static str, Dv), (&'static str, Ev), (&'static str, Fv), (&'static str, Gv))> where
    Av: Parser<Input = Stream<'a>>,
    Bv: Parser<Input = Stream<'a>>,
    Cv: Parser<Input = Stream<'a>>,
    Dv: Parser<Input = Stream<'a>>,
    Ev: Parser<Input = Stream<'a>>,
    Fv: Parser<Input = Stream<'a>>,
    Gv: Parser<Input = Stream<'a>>, 
[src]

+

The type which is taken as input for the parser. The type must implement the Stream trait which allows the parser to read items from the type. Read more

+

+

The type which is returned if the parser is successful.

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Entry point of the parser. Takes some input and tries to parse it. Read more

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Adds the first error that would normally be returned by this parser if it failed with an EmptyErr result. Read more

+

Borrows a parser instead of consuming it. Read more

+

Discards the value of the self parser and returns the value of p. Fails if any of the parsers fails. Read more

+

Discards the value of the p parser and returns the value of self. Fails if any of the parsers fails. Read more

+

Parses with self followed by p. Succeeds if both parsers succeed, otherwise fails. Returns a tuple with both values on success. Read more

+

Returns a parser which attempts to parse using self. If self fails without consuming any input it tries to consume the same input using p. Read more

+

Parses using self and then passes the value to f which returns a parser used to parse the rest of the input. Read more

+

Uses f to map over the parsed value. Read more

+

Uses f to map over the output of self. If f returns an error the parser fails. Read more

+

Parses with self and if it fails, adds the message msg to the error. Read more

+

Parses with self and if it fails without consuming any input any expected errors are replaced by msg. msg is then used in error messages as "Expected msg". Read more

+

Parses with self and applies f on the result if self parses successfully. f may optionally fail with an error which is automatically converted to a ParseError. Read more

+

Creates an iterator from a parser and a state. Can be used as an alternative to [many] when collecting directly into a FromIterator type is not desirable. Read more

+

Turns the parser into a trait object by putting it in a Box. Can be used to easily return parsers from functions without naming the type. Read more

+
+

+ Auto Trait Implementations +

+
+

impl<T> Send for KeywordMapParser<T> where
    T: Send

impl<T> Sync for KeywordMapParser<T> where
    T: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/macros/type.ResultParser.html b/docs/apis/rust/0.7.0/mentat_parser_utils/macros/type.ResultParser.html new file mode 100644 index 00000000..71c87f74 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/macros/type.ResultParser.html @@ -0,0 +1,131 @@ + + + + + + + + + + mentat_parser_utils::macros::ResultParser - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_parser_utils::macros::ResultParser + + [] + + [src]

type ResultParser<O, I> = Expected<FnParser<I, fn(_: I) -> ParseResult<O, I>>>;

A type definition for a function parser that either parses an O from an input stream of type +I, or fails with an "expected" failure. +See https://docs.rs/combine/2.2.1/combine/trait.Parser.html#method.expected for more +illumination. +Nothing about this is specific to the result type of the parser.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/matches_plain_symbol.m.html b/docs/apis/rust/0.7.0/mentat_parser_utils/matches_plain_symbol.m.html new file mode 100644 index 00000000..0327ac8e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/matches_plain_symbol.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.matches_plain_symbol.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/satisfy_unwrap.m.html b/docs/apis/rust/0.7.0/mentat_parser_utils/satisfy_unwrap.m.html new file mode 100644 index 00000000..35e3595c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/satisfy_unwrap.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.satisfy_unwrap.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_parser_utils/sidebar-items.js new file mode 100644 index 00000000..d161888c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"macro":[["assert_edn_parses_to","`assert_edn_parses_to!` simplifies some of the boilerplate around running a parser function against string input and expecting a certain result."],["assert_parse_failure_contains","`assert_parse_failure_contains!` simplifies running a parser function against string input and expecting a certain failure. This is working around the complexity of pattern matching parse errors that contain spans."],["assert_parses_to","`assert_parses_to!` simplifies some of the boilerplate around running a parser function against input and expecting a certain result."],["def_matches_keyword","Generate a `satisfy` expression that matches a `Keyword` value with the given name."],["def_matches_namespaced_keyword","Generate a `satisfy` expression that matches a `Keyword` value with the given namespace and name."],["def_matches_plain_symbol","Generate a `satisfy` expression that matches a `PlainSymbol` value with the given name."],["def_parser",""],["keyword_map_of",""],["matches_plain_symbol","Generate a `satisfy_map` expression that matches a `PlainSymbol` value with the given name."],["satisfy_unwrap","`satisfy_unwrap!` makes it a little easier to implement a `satisfy_map` body that matches a particular `Value` enum case, otherwise returning `None`."]],"mod":[["log",""],["macros",""],["value_and_span",""]],"struct":[["ValueParseError","A `ValueParseError` is a `combine::primitives::ParseError`-alike that implements the `Debug`, `Display`, and `std::error::Error` traits. In addition, it doesn't capture references."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/struct.ValueParseError.html b/docs/apis/rust/0.7.0/mentat_parser_utils/struct.ValueParseError.html new file mode 100644 index 00000000..1c0b7e7d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/struct.ValueParseError.html @@ -0,0 +1,159 @@ + + + + + + + + + + mentat_parser_utils::ValueParseError - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_parser_utils::ValueParseError + + [] + + [src]

pub struct ValueParseError {
+    pub position: Span,
+    pub errors: Vec<Error<ValueAndSpan, ValueAndSpan>>,
+}

A ValueParseError is a combine::primitives::ParseError-alike that implements the Debug, +Display, and std::error::Error traits. In addition, it doesn't capture references.

+

This is achieved by wrapping slices of type &'a [edn::Value] in an owning type that implements +Display; rather than introducing a newtype like DisplayVec, we re-use edn::Value::Vector.

+

+ Fields

+ + + + +

+ Trait Implementations +

+
+

impl PartialEq for ValueParseError
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Debug for ValueParseError
[src]

Formats the value using the given formatter. Read more

+

impl Display for ValueParseError
[src]

Formats the value using the given formatter. Read more

+

impl Error for ValueParseError
[src]

A short description of the error. Read more

+

The lower-level cause of this error, if any. Read more

+

impl<'a> From<ParseError<Stream<'a>>> for ValueParseError
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/Item.t.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/Item.t.html new file mode 100644 index 00000000..a639326c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/Item.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.Item.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/Iter.t.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/Iter.t.html new file mode 100644 index 00000000..48da6f5a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/Iter.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Iter.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/OfExactly.t.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/OfExactly.t.html new file mode 100644 index 00000000..dd56ef3c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/OfExactly.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.OfExactly.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/OfExactlyParsing.t.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/OfExactlyParsing.t.html new file mode 100644 index 00000000..55a61299 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/OfExactlyParsing.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.OfExactlyParsing.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/SpanPosition.t.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/SpanPosition.t.html new file mode 100644 index 00000000..4d0ffe02 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/SpanPosition.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.SpanPosition.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/Stream.t.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/Stream.t.html new file mode 100644 index 00000000..b75df8bc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/Stream.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Stream.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/Streaming.t.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/Streaming.t.html new file mode 100644 index 00000000..92a0b708 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/Streaming.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.Streaming.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/any_keyword.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/any_keyword.v.html new file mode 100644 index 00000000..793a74e9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/any_keyword.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.any_keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/any_keyword_.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/any_keyword_.v.html new file mode 100644 index 00000000..64ec6cbc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/any_keyword_.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.any_keyword_.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/backward_namespaced_keyword.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/backward_namespaced_keyword.v.html new file mode 100644 index 00000000..82890234 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/backward_namespaced_keyword.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.backward_namespaced_keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/backward_namespaced_keyword_.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/backward_namespaced_keyword_.v.html new file mode 100644 index 00000000..c11b886d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/backward_namespaced_keyword_.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.backward_namespaced_keyword_.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/enum.Iter.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/enum.Iter.html new file mode 100644 index 00000000..c06a5a77 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/enum.Iter.html @@ -0,0 +1,211 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::Iter - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_parser_utils::value_and_span::Iter + + [] + + [src]

pub enum Iter<'a> {
+    Empty,
+    Atom(Once<&'a ValueAndSpan>),
+    Vector(Iter<'a, ValueAndSpan>),
+    List(Iter<'a, ValueAndSpan>),
+    Map(FlatMap<Iter<'a, ValueAndSpan, ValueAndSpan>, Chain<Once<&'a ValueAndSpan>, Once<&'a ValueAndSpan>>, fn(_: (&'a ValueAndSpan, &'a ValueAndSpan)) -> Chain<Once<&'a ValueAndSpan>, Once<&'a ValueAndSpan>>>),
+    KeywordMap(FlatMap<Iter<'a, ValueAndSpan, ValueAndSpan>, Chain<Once<&'a ValueAndSpan>, Box<Iter<'a>>>, fn(_: (&'a ValueAndSpan, &'a ValueAndSpan)) -> Chain<Once<&'a ValueAndSpan>, Box<Iter<'a>>>>),
+}

An iterator specifically for iterating edn::ValueAndSpan instances in various ways.

+

Enumerating each iteration type allows us to have a single combine::Stream implementation +yielding ValueAndSpan items, which allows us to yield uniform combine::ParseError types from +disparate parsers.

+

+ Variants

+

Iterates a map {:k1 v1, :k2 v2, ...} as a single flat_map slice [k1, v1, k2, v2, ...].

+

Iterates a map with vector values {:k1 [v11 v12 ...], :k2 [v21 v22 ...], ...} as a single +flattened map [k1, v11, v12, ..., k2, v21, v22, ...].

+
+

+ Trait Implementations +

+
+

impl<'a> Clone for Iter<'a>
[src]

Important traits for Iter<'a>

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<'a> Iterator for Iter<'a>
[src]

+

The type of the elements being iterated over.

+

Advances the iterator and returns the next value. Read more

+

Returns the bounds on the remaining length of the iterator. Read more

+

Consumes the iterator, counting the number of iterations and returning it. Read more

+

Consumes the iterator, returning the last element. Read more

+

Returns the nth element of the iterator. Read more

+

🔬 This is a nightly-only experimental API. (iterator_step_by)

unstable replacement of Range::step_by

+

Creates an iterator starting at the same point, but stepping by the given amount at each iteration. Read more

+

Takes two iterators and creates a new iterator over both in sequence. Read more

+

'Zips up' two iterators into a single iterator of pairs. Read more

+

Takes a closure and creates an iterator which calls that closure on each element. Read more

+

Calls a closure on each element of an iterator. Read more

+

Creates an iterator which uses a closure to determine if an element should be yielded. Read more

+

Creates an iterator that both filters and maps. Read more

+

Creates an iterator which gives the current iteration count as well as the next value. Read more

+

Creates an iterator which can use peek to look at the next element of the iterator without consuming it. Read more

+

Creates an iterator that [skip]s elements based on a predicate. Read more

+

Creates an iterator that yields elements based on a predicate. Read more

+

Creates an iterator that skips the first n elements. Read more

+

Creates an iterator that yields its first n elements. Read more

+

An iterator adaptor similar to [fold] that holds internal state and produces a new iterator. Read more

+

Creates an iterator that works like map, but flattens nested structure. Read more

+

🔬 This is a nightly-only experimental API. (iterator_flatten)

Creates an iterator that flattens nested structure. Read more

+

Creates an iterator which ends after the first [None]. Read more

+

Do something with each element of an iterator, passing the value on. Read more

+

Borrows an iterator, rather than consuming it. Read more

+

Transforms an iterator into a collection. Read more

+

Consumes an iterator, creating two collections from it. Read more

+

🔬 This is a nightly-only experimental API. (iterator_try_fold)

An iterator method that applies a function as long as it returns successfully, producing a single, final value. Read more

+

🔬 This is a nightly-only experimental API. (iterator_try_fold)

An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. Read more

+

An iterator method that applies a function, producing a single, final value. Read more

+

Tests if every element of the iterator matches a predicate. Read more

+

Tests if any element of the iterator matches a predicate. Read more

+

Searches for an element of an iterator that satisfies a predicate. Read more

+

Searches for an element in an iterator, returning its index. Read more

+

Searches for an element in an iterator from the right, returning its index. Read more

+

Returns the maximum element of an iterator. Read more

+

Returns the minimum element of an iterator. Read more

+

Returns the element that gives the maximum value from the specified function. Read more

+

Returns the element that gives the maximum value with respect to the specified comparison function. Read more

+

Returns the element that gives the minimum value from the specified function. Read more

+

Returns the element that gives the minimum value with respect to the specified comparison function. Read more

+

Reverses an iterator's direction. Read more

+

Converts an iterator of pairs into a pair of containers. Read more

+

Creates an iterator which [clone]s all of its elements. Read more

+

Repeats an iterator endlessly. Read more

+

Sums the elements of an iterator. Read more

+

Iterates over the entire iterator, multiplying all the elements Read more

+

Lexicographically compares the elements of this Iterator with those of another. Read more

+

Lexicographically compares the elements of this Iterator with those of another. Read more

+

Determines if the elements of this Iterator are equal to those of another. Read more

+

Determines if the elements of this Iterator are unequal to those of another. Read more

+

Determines if the elements of this Iterator are lexicographically less than those of another. Read more

+

Determines if the elements of this Iterator are lexicographically less or equal to those of another. Read more

+

Determines if the elements of this Iterator are lexicographically greater than those of another. Read more

+

Determines if the elements of this Iterator are lexicographically greater than or equal to those of another. Read more

+
+

+ Auto Trait Implementations +

+
+

impl<'a> Send for Iter<'a>

impl<'a> Sync for Iter<'a>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.any_keyword.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.any_keyword.html new file mode 100644 index 00000000..9562b62f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.any_keyword.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::any_keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::any_keyword + + [] + + [src]

pub fn any_keyword<'a>(
) -> Expected<FnParser<Stream<'a>, fn(_: Stream<'a>) -> ParseResult<&'a Keyword, Stream<'a>>>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.any_keyword_.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.any_keyword_.html new file mode 100644 index 00000000..f0b76842 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.any_keyword_.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::any_keyword_ - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::any_keyword_ + + [] + + [src]

pub fn any_keyword_<'a>(
    input: Stream<'a>
) -> ParseResult<&'a Keyword, Stream<'a>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.backward_namespaced_keyword.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.backward_namespaced_keyword.html new file mode 100644 index 00000000..b59215ea --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.backward_namespaced_keyword.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::backward_namespaced_keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::backward_namespaced_keyword + + [] + + [src]

pub fn backward_namespaced_keyword<'a>(
) -> Expected<FnParser<Stream<'a>, fn(_: Stream<'a>) -> ParseResult<&'a Keyword, Stream<'a>>>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.backward_namespaced_keyword_.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.backward_namespaced_keyword_.html new file mode 100644 index 00000000..0d939789 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.backward_namespaced_keyword_.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::backward_namespaced_keyword_ - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::backward_namespaced_keyword_ + + [] + + [src]

pub fn backward_namespaced_keyword_<'a>(
    input: Stream<'a>
) -> ParseResult<&'a Keyword, Stream<'a>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.forward_any_keyword.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.forward_any_keyword.html new file mode 100644 index 00000000..830e653e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.forward_any_keyword.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::forward_any_keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::forward_any_keyword + + [] + + [src]

pub fn forward_any_keyword<'a>(
) -> Expected<FnParser<Stream<'a>, fn(_: Stream<'a>) -> ParseResult<&'a Keyword, Stream<'a>>>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.forward_any_keyword_.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.forward_any_keyword_.html new file mode 100644 index 00000000..0d4bd296 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.forward_any_keyword_.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::forward_any_keyword_ - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::forward_any_keyword_ + + [] + + [src]

pub fn forward_any_keyword_<'a>(
    input: Stream<'a>
) -> ParseResult<&'a Keyword, Stream<'a>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.forward_namespaced_keyword.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.forward_namespaced_keyword.html new file mode 100644 index 00000000..15133a46 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.forward_namespaced_keyword.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::forward_namespaced_keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::forward_namespaced_keyword + + [] + + [src]

pub fn forward_namespaced_keyword<'a>(
) -> Expected<FnParser<Stream<'a>, fn(_: Stream<'a>) -> ParseResult<&'a Keyword, Stream<'a>>>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.forward_namespaced_keyword_.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.forward_namespaced_keyword_.html new file mode 100644 index 00000000..abc3f867 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.forward_namespaced_keyword_.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::forward_namespaced_keyword_ - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::forward_namespaced_keyword_ + + [] + + [src]

pub fn forward_namespaced_keyword_<'a>(
    input: Stream<'a>
) -> ParseResult<&'a Keyword, Stream<'a>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.integer.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.integer.html new file mode 100644 index 00000000..6dd1b460 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.integer.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::integer - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::integer + + [] + + [src]

pub fn integer<'a>(
) -> Expected<FnParser<Stream<'a>, fn(_: Stream<'a>) -> ParseResult<i64, Stream<'a>>>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.integer_.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.integer_.html new file mode 100644 index 00000000..abb2bfa6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.integer_.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::integer_ - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::integer_ + + [] + + [src]

pub fn integer_<'a>(input: Stream<'a>) -> ParseResult<i64, Stream<'a>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.is_valid_keyword_map_k_v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.is_valid_keyword_map_k_v.html new file mode 100644 index 00000000..87384ec2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.is_valid_keyword_map_k_v.html @@ -0,0 +1,132 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::is_valid_keyword_map_k_v - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::is_valid_keyword_map_k_v + + [] + + [src]

pub fn is_valid_keyword_map_k_v<'a>(
    (k, v): (&'a ValueAndSpan, &'a ValueAndSpan)
) -> bool

A [k v] pair in the map form of a keyword map must have the shape [:k, [v1, v2, ...]], with +none of v1, v2, ... a keyword: without loss of generality, we cannot represent the case +where vn is a keyword :l, since [:k v1 v2 ... :l], isn't a valid keyword map in vector +form. This function tests that a [k v] pair obeys these constraints.

+

If we didn't test this, then we might flatten a map [:k [:l]] to[:k :l]`, which isn't a valid +keyword map in vector form.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.keyword_map.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.keyword_map.html new file mode 100644 index 00000000..b7b4f1d2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.keyword_map.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::keyword_map - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::keyword_map + + [] + + [src]

pub fn keyword_map<'a>(
) -> Expected<FnParser<Stream<'a>, fn(_: Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.keyword_map_.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.keyword_map_.html new file mode 100644 index 00000000..515f0078 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.keyword_map_.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::keyword_map_ - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::keyword_map_ + + [] + + [src]

pub fn keyword_map_<'a>(
    input: Stream<'a>
) -> ParseResult<Stream<'a>, Stream<'a>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.list.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.list.html new file mode 100644 index 00000000..54f06930 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.list.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::list - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::list + + [] + + [src]

pub fn list<'a>(
) -> Expected<FnParser<Stream<'a>, fn(_: Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.list_.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.list_.html new file mode 100644 index 00000000..607191d3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.list_.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::list_ - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::list_ + + [] + + [src]

pub fn list_<'a>(input: Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.map.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.map.html new file mode 100644 index 00000000..c98d87ce --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.map.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::map - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::map + + [] + + [src]

pub fn map<'a>(
) -> Expected<FnParser<Stream<'a>, fn(_: Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.map_.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.map_.html new file mode 100644 index 00000000..753369d2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.map_.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::map_ - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::map_ + + [] + + [src]

pub fn map_<'a>(input: Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.namespaced_keyword.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.namespaced_keyword.html new file mode 100644 index 00000000..75501685 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.namespaced_keyword.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::namespaced_keyword - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::namespaced_keyword + + [] + + [src]

pub fn namespaced_keyword<'a>(
) -> Expected<FnParser<Stream<'a>, fn(_: Stream<'a>) -> ParseResult<&'a Keyword, Stream<'a>>>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.namespaced_keyword_.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.namespaced_keyword_.html new file mode 100644 index 00000000..abd21a42 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.namespaced_keyword_.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::namespaced_keyword_ - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::namespaced_keyword_ + + [] + + [src]

pub fn namespaced_keyword_<'a>(
    input: Stream<'a>
) -> ParseResult<&'a Keyword, Stream<'a>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.of_exactly.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.of_exactly.html new file mode 100644 index 00000000..71dfc406 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.of_exactly.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::of_exactly - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::of_exactly + + [] + + [src]

pub fn of_exactly<'a, P, N, M, O>(p: P, n: N) -> OfExactly<P, N> where
    P: Parser<Input = Stream<'a>, Output = M>,
    N: Parser<Input = Stream<'a>, Output = O>,
    M: 'a + Streaming<'a>, 
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.seq.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.seq.html new file mode 100644 index 00000000..e786e434 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.seq.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::seq - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::seq + + [] + + [src]

pub fn seq<'a>(
) -> Expected<FnParser<Stream<'a>, fn(_: Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.seq_.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.seq_.html new file mode 100644 index 00000000..beda520d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.seq_.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::seq_ - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::seq_ + + [] + + [src]

pub fn seq_<'a>(input: Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.vector.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.vector.html new file mode 100644 index 00000000..8de3b803 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.vector.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::vector - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::vector + + [] + + [src]

pub fn vector<'a>(
) -> Expected<FnParser<Stream<'a>, fn(_: Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>>>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.vector_.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.vector_.html new file mode 100644 index 00000000..14942832 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/fn.vector_.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::vector_ - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_parser_utils::value_and_span::vector_ + + [] + + [src]

pub fn vector_<'a>(input: Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>

Shorthands, just enough to convert the mentat_db crate for now. Written using Box for now: +it's simple and we can address allocation issues if and when they surface.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/forward_any_keyword.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/forward_any_keyword.v.html new file mode 100644 index 00000000..ba733147 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/forward_any_keyword.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.forward_any_keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/forward_any_keyword_.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/forward_any_keyword_.v.html new file mode 100644 index 00000000..973b9e12 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/forward_any_keyword_.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.forward_any_keyword_.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/forward_namespaced_keyword.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/forward_namespaced_keyword.v.html new file mode 100644 index 00000000..763a9591 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/forward_namespaced_keyword.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.forward_namespaced_keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/forward_namespaced_keyword_.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/forward_namespaced_keyword_.v.html new file mode 100644 index 00000000..2127941d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/forward_namespaced_keyword_.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.forward_namespaced_keyword_.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/index.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/index.html new file mode 100644 index 00000000..06eca9d3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/index.html @@ -0,0 +1,362 @@ + + + + + + + + + + mentat_parser_utils::value_and_span - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_parser_utils::value_and_span + + [] + + [src]

Structs

+ + + + + + + + + + + + +
OfExactly +

OfExactly and of_exactly allow us to express nested parsers naturally.

+ +
SpanPosition +

A wrapper to let us order edn::Span in whatever way is appropriate for parsing with combine.

+ +
Stream +

A single combine::Stream implementation iterating edn::ValueAndSpan instances. Equivalent +to combine::IteratorStream as produced by combine::from_iter, but specialized to +edn::ValueAndSpan.

+ +

Enums

+ + + + +
Iter +

An iterator specifically for iterating edn::ValueAndSpan instances in various ways.

+ +

Traits

+ + + + + + + + + + + + +
Item +

Things specific to parsing with combine and our Stream that need a trait to live outside of +the edn crate.

+ +
OfExactlyParsing +

We need a trait to define Parser.of and have it live outside of the combine crate.

+ +
Streaming + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
any_keyword + +
any_keyword_ + +
backward_namespaced_keyword + +
backward_namespaced_keyword_ + +
forward_any_keyword + +
forward_any_keyword_ + +
forward_namespaced_keyword + +
forward_namespaced_keyword_ + +
integer + +
integer_ + +
is_valid_keyword_map_k_v +

A [k v] pair in the map form of a keyword map must have the shape [:k, [v1, v2, ...]], with +none of v1, v2, ... a keyword: without loss of generality, we cannot represent the case +where vn is a keyword :l, since [:k v1 v2 ... :l], isn't a valid keyword map in vector +form. This function tests that a [k v] pair obeys these constraints.

+ +
keyword_map + +
keyword_map_ + +
list + +
list_ + +
map + +
map_ + +
namespaced_keyword + +
namespaced_keyword_ + +
of_exactly + +
seq + +
seq_ + +
vector + +
vector_ +

Shorthands, just enough to convert the mentat_db crate for now. Written using Box for now: +it's simple and we can address allocation issues if and when they surface.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/integer.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/integer.v.html new file mode 100644 index 00000000..1f80a598 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/integer.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.integer.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/integer_.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/integer_.v.html new file mode 100644 index 00000000..5947c68f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/integer_.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.integer_.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/is_valid_keyword_map_k_v.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/is_valid_keyword_map_k_v.v.html new file mode 100644 index 00000000..934658d4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/is_valid_keyword_map_k_v.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.is_valid_keyword_map_k_v.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/keyword_map.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/keyword_map.v.html new file mode 100644 index 00000000..d7871af7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/keyword_map.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.keyword_map.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/keyword_map_.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/keyword_map_.v.html new file mode 100644 index 00000000..634dbde0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/keyword_map_.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.keyword_map_.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/list.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/list.v.html new file mode 100644 index 00000000..6763be69 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/list.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.list.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/list_.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/list_.v.html new file mode 100644 index 00000000..0e6116ac --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/list_.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.list_.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/map.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/map.v.html new file mode 100644 index 00000000..66016236 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/map.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.map.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/map_.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/map_.v.html new file mode 100644 index 00000000..f51ece0e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/map_.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.map_.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/namespaced_keyword.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/namespaced_keyword.v.html new file mode 100644 index 00000000..885efc51 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/namespaced_keyword.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.namespaced_keyword.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/namespaced_keyword_.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/namespaced_keyword_.v.html new file mode 100644 index 00000000..7392d68f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/namespaced_keyword_.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.namespaced_keyword_.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/of_exactly.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/of_exactly.v.html new file mode 100644 index 00000000..e7feb396 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/of_exactly.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.of_exactly.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/seq.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/seq.v.html new file mode 100644 index 00000000..55a79e48 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/seq.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.seq.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/seq_.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/seq_.v.html new file mode 100644 index 00000000..2c55918c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/seq_.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.seq_.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/sidebar-items.js new file mode 100644 index 00000000..ec65c51d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["Iter","An iterator specifically for iterating `edn::ValueAndSpan` instances in various ways."]],"fn":[["any_keyword",""],["any_keyword_",""],["backward_namespaced_keyword",""],["backward_namespaced_keyword_",""],["forward_any_keyword",""],["forward_any_keyword_",""],["forward_namespaced_keyword",""],["forward_namespaced_keyword_",""],["integer",""],["integer_",""],["is_valid_keyword_map_k_v","A `[k v]` pair in the map form of a keyword map must have the shape `[:k, [v1, v2, ...]]`, with none of `v1`, `v2`, ... a keyword: without loss of generality, we cannot represent the case where `vn` is a keyword `:l`, since `[:k v1 v2 ... :l]`, isn't a valid keyword map in vector form. This function tests that a `[k v]` pair obeys these constraints."],["keyword_map",""],["keyword_map_",""],["list",""],["list_",""],["map",""],["map_",""],["namespaced_keyword",""],["namespaced_keyword_",""],["of_exactly",""],["seq",""],["seq_",""],["vector",""],["vector_","Shorthands, just enough to convert the `mentat_db` crate for now. Written using `Box` for now: it's simple and we can address allocation issues if and when they surface."]],"struct":[["OfExactly","`OfExactly` and `of_exactly` allow us to express nested parsers naturally."],["SpanPosition","A wrapper to let us order `edn::Span` in whatever way is appropriate for parsing with `combine`."],["Stream","A single `combine::Stream` implementation iterating `edn::ValueAndSpan` instances. Equivalent to `combine::IteratorStream` as produced by `combine::from_iter`, but specialized to `edn::ValueAndSpan`."]],"trait":[["Item","Things specific to parsing with `combine` and our `Stream` that need a trait to live outside of the `edn` crate."],["OfExactlyParsing","We need a trait to define `Parser.of` and have it live outside of the `combine` crate."],["Streaming",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/struct.OfExactly.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/struct.OfExactly.html new file mode 100644 index 00000000..ebef6248 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/struct.OfExactly.html @@ -0,0 +1,167 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::OfExactly - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_parser_utils::value_and_span::OfExactly + + [] + + [src]

pub struct OfExactly<P, N>(_, _);

OfExactly and of_exactly allow us to express nested parsers naturally.

+

For example, vector().of_exactly(many(list())) parses a vector-of-lists, like [(1 2) (:a :b) ("test") ()].

+

The "outer" parser P and the "nested" parser N must be compatible: P must produce an +output edn::ValueAndSpan which can itself be turned into a stream of child elements; and N +must accept the resulting input Stream. This compatibility allows us to lift errors from the +nested parser to the outer parser, which is part of what has made parsing &'a [edn::Value] +difficult.

+
+

+ Trait Implementations +

+
+

impl<P: Clone, N: Clone> Clone for OfExactly<P, N>
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<'a, P, N, M, O> Parser for OfExactly<P, N> where
    P: Parser<Input = Stream<'a>, Output = M>,
    N: Parser<Input = Stream<'a>, Output = O>,
    M: 'a + Streaming<'a>, 
[src]

+

The type which is taken as input for the parser. The type must implement the Stream trait which allows the parser to read items from the type. Read more

+

+

The type which is returned if the parser is successful.

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Adds the first error that would normally be returned by this parser if it failed with an EmptyErr result. Read more

+

Entry point of the parser. Takes some input and tries to parse it. Read more

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Parses using the stream input by calling [Stream::uncons] one or more times. Read more

+

Borrows a parser instead of consuming it. Read more

+

Discards the value of the self parser and returns the value of p. Fails if any of the parsers fails. Read more

+

Discards the value of the p parser and returns the value of self. Fails if any of the parsers fails. Read more

+

Parses with self followed by p. Succeeds if both parsers succeed, otherwise fails. Returns a tuple with both values on success. Read more

+

Returns a parser which attempts to parse using self. If self fails without consuming any input it tries to consume the same input using p. Read more

+

Parses using self and then passes the value to f which returns a parser used to parse the rest of the input. Read more

+

Uses f to map over the parsed value. Read more

+

Uses f to map over the output of self. If f returns an error the parser fails. Read more

+

Parses with self and if it fails, adds the message msg to the error. Read more

+

Parses with self and if it fails without consuming any input any expected errors are replaced by msg. msg is then used in error messages as "Expected msg". Read more

+

Parses with self and applies f on the result if self parses successfully. f may optionally fail with an error which is automatically converted to a ParseError. Read more

+

Creates an iterator from a parser and a state. Can be used as an alternative to [many] when collecting directly into a FromIterator type is not desirable. Read more

+

Turns the parser into a trait object by putting it in a Box. Can be used to easily return parsers from functions without naming the type. Read more

+
+

+ Auto Trait Implementations +

+
+

impl<P, N> Send for OfExactly<P, N> where
    N: Send,
    P: Send

impl<P, N> Sync for OfExactly<P, N> where
    N: Sync,
    P: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/struct.SpanPosition.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/struct.SpanPosition.html new file mode 100644 index 00000000..8ac95049 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/struct.SpanPosition.html @@ -0,0 +1,151 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::SpanPosition - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_parser_utils::value_and_span::SpanPosition + + [] + + [src]

pub struct SpanPosition(pub Span);

A wrapper to let us order edn::Span in whatever way is appropriate for parsing with combine.

+
+

+ Trait Implementations +

+
+

impl Clone for SpanPosition
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for SpanPosition
[src]

impl Debug for SpanPosition
[src]

Formats the value using the given formatter. Read more

+

impl Display for SpanPosition
[src]

Formats the value using the given formatter. Read more

+

impl PartialEq for SpanPosition
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for SpanPosition
[src]

impl PartialOrd for SpanPosition
[src]

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

+

impl Ord for SpanPosition
[src]

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for SpanPosition

impl Sync for SpanPosition

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/struct.Stream.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/struct.Stream.html new file mode 100644 index 00000000..3453fda0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/struct.Stream.html @@ -0,0 +1,150 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::Stream - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_parser_utils::value_and_span::Stream + + [] + + [src]

pub struct Stream<'a>(_, _);

A single combine::Stream implementation iterating edn::ValueAndSpan instances. Equivalent +to combine::IteratorStream as produced by combine::from_iter, but specialized to +edn::ValueAndSpan.

+
+

+ Trait Implementations +

+
+

impl<'a> Clone for Stream<'a>
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<'a> Streaming<'a> for Stream<'a>
[src]

impl<'a> StreamOnce for Stream<'a>
[src]

Equivalent to combine::IteratorStream.

+

+

The type of items which is yielded from this stream.

+

+

The type of a range of items yielded from this stream. Types which do not a have a way of yielding ranges of items should just use the Self::Item for this type. Read more

+

+

Type which represents the position in a stream. Ord is required to allow parsers to determine which of two positions are further ahead. Read more

+

Takes a stream and removes its first item, yielding the item and the rest of the elements. Returns Err if no element could be retrieved. Read more

+

Returns the current position of the stream.

+
+

+ Auto Trait Implementations +

+
+

impl<'a> Send for Stream<'a>

impl<'a> Sync for Stream<'a>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/trait.Item.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/trait.Item.html new file mode 100644 index 00000000..4720a485 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/trait.Item.html @@ -0,0 +1,163 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::Item - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_parser_utils::value_and_span::Item + + [] + + [src]

pub trait Item<'a>: Clone + PartialEq + Sized {
+    type Position: Clone + Ord + Display;
+    fn start(&self) -> Self::Position;
+
fn update_position(&self, _: &mut Self::Position); +
fn child_iter(&'a self) -> Iter<'a>; +
fn child_stream(&'a self) -> Stream<'a>; +
fn atom_iter(&'a self) -> Iter<'a>; +
fn atom_stream(&'a self) -> Stream<'a>; +
fn keyword_map_iter(&'a self) -> Iter<'a>; +
fn keyword_map_stream(&'a self) -> Stream<'a>; +}

Things specific to parsing with combine and our Stream that need a trait to live outside of +the edn crate.

+
+

+ Associated Types +

+
+

Position could be specialized to SpanPosition.

+
+

+ Required Methods +

+
+

A slight generalization of combine::Positioner that allows to set the position based on +the edn::ValueAndSpan being iterated.

+

Important traits for Iter<'a>

Important traits for Iter<'a>

Important traits for Iter<'a>

+

+ Implementations on Foreign Types +

+

impl<'a> Item<'a> for ValueAndSpan
[src]

+

Important traits for Iter<'a>

Important traits for Iter<'a>

Important traits for Iter<'a>

+

+ Implementors +

+
    +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/trait.OfExactlyParsing.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/trait.OfExactlyParsing.html new file mode 100644 index 00000000..82c6426c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/trait.OfExactlyParsing.html @@ -0,0 +1,142 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::OfExactlyParsing - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_parser_utils::value_and_span::OfExactlyParsing + + [] + + [src]

pub trait OfExactlyParsing: Parser + Sized {
+    fn of_exactly<N, O>(self, n: N) -> OfExactly<Self, N>
    where
        Self: Sized,
        N: Parser<Input = Self::Input, Output = O>
; +}

We need a trait to define Parser.of and have it live outside of the combine crate.

+
+

+ Required Methods +

+
+

+

+ Implementors +

+
    +
  • impl<'a, P, M> OfExactlyParsing for P where
        P: Parser<Input = Stream<'a>, Output = M>,
        M: 'a + Streaming<'a>, 
  • +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/trait.Streaming.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/trait.Streaming.html new file mode 100644 index 00000000..88a16a78 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/trait.Streaming.html @@ -0,0 +1,145 @@ + + + + + + + + + + mentat_parser_utils::value_and_span::Streaming - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_parser_utils::value_and_span::Streaming + + [] + + [src]

pub trait Streaming<'a> {
+    fn as_stream(self) -> Stream<'a>;
+}
+

+ Required Methods +

+
+

+

+ Implementations on Foreign Types +

+

impl<'a> Streaming<'a> for &'a ValueAndSpan
[src]

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/vector.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/vector.v.html new file mode 100644 index 00000000..75aff001 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/vector.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.vector.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/vector_.v.html b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/vector_.v.html new file mode 100644 index 00000000..7caa06b2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_parser_utils/value_and_span/vector_.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.vector_.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query/index.html b/docs/apis/rust/0.7.0/mentat_query/index.html new file mode 100644 index 00000000..38d3bfe1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query/index.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_query - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Crate mentat_query + + [] + + [src]

Re-exports

+
pub use edn::query::*;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_query/sidebar-items.js new file mode 100644 index 00000000..48333d31 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/AlgebraicQuery.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/AlgebraicQuery.t.html new file mode 100644 index 00000000..ae37d14d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/AlgebraicQuery.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.AlgebraicQuery.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/AlgebrizerError.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/AlgebrizerError.t.html new file mode 100644 index 00000000..12c88614 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/AlgebrizerError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.AlgebrizerError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/BindingError.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/BindingError.t.html new file mode 100644 index 00000000..f1ccb220 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/BindingError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.BindingError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/Column.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/Column.t.html new file mode 100644 index 00000000..d3e7ed4a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/Column.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Column.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/ColumnAlternation.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/ColumnAlternation.t.html new file mode 100644 index 00000000..b7c400e5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/ColumnAlternation.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ColumnAlternation.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/ColumnConstraint.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/ColumnConstraint.t.html new file mode 100644 index 00000000..72aa5cc6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/ColumnConstraint.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.ColumnConstraint.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/ColumnConstraintOrAlternation.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/ColumnConstraintOrAlternation.t.html new file mode 100644 index 00000000..46872e34 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/ColumnConstraintOrAlternation.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.ColumnConstraintOrAlternation.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/ColumnIntersection.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/ColumnIntersection.t.html new file mode 100644 index 00000000..a685ce60 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/ColumnIntersection.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ColumnIntersection.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/ColumnName.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/ColumnName.t.html new file mode 100644 index 00000000..80430f2d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/ColumnName.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.ColumnName.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/ComputedTable.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/ComputedTable.t.html new file mode 100644 index 00000000..324adaad --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/ComputedTable.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.ComputedTable.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/ConjoiningClauses.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/ConjoiningClauses.t.html new file mode 100644 index 00000000..0e2bd74e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/ConjoiningClauses.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ConjoiningClauses.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/DatomsColumn.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/DatomsColumn.t.html new file mode 100644 index 00000000..58577102 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/DatomsColumn.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.DatomsColumn.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/DatomsTable.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/DatomsTable.t.html new file mode 100644 index 00000000..4abab688 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/DatomsTable.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.DatomsTable.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/EmptyBecause.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/EmptyBecause.t.html new file mode 100644 index 00000000..475184c1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/EmptyBecause.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.EmptyBecause.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/FindQuery.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/FindQuery.t.html new file mode 100644 index 00000000..5be30a20 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/FindQuery.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.FindQuery.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/FulltextColumn.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/FulltextColumn.t.html new file mode 100644 index 00000000..f504246f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/FulltextColumn.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.FulltextColumn.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/InvalidBinding.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/InvalidBinding.t.html new file mode 100644 index 00000000..075f03f1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/InvalidBinding.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.InvalidBinding.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/Known.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/Known.t.html new file mode 100644 index 00000000..723467bb --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/Known.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Known.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/OrderBy.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/OrderBy.t.html new file mode 100644 index 00000000..d0803807 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/OrderBy.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.OrderBy.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/QualifiedAlias.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/QualifiedAlias.t.html new file mode 100644 index 00000000..27e0f7cd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/QualifiedAlias.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.QualifiedAlias.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/QueryInputs.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/QueryInputs.t.html new file mode 100644 index 00000000..e805aadc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/QueryInputs.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.QueryInputs.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/QueryValue.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/QueryValue.t.html new file mode 100644 index 00000000..7bc1f2b5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/QueryValue.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.QueryValue.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/Result.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/Result.t.html new file mode 100644 index 00000000..865910f9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/Result.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Result.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/SourceAlias.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/SourceAlias.t.html new file mode 100644 index 00000000..ad7b5cee --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/SourceAlias.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.SourceAlias.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/TableAlias.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/TableAlias.t.html new file mode 100644 index 00000000..43f3749a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/TableAlias.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.TableAlias.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/VariableBindings.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/VariableBindings.t.html new file mode 100644 index 00000000..47d23b75 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/VariableBindings.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.VariableBindings.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/VariableColumn.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/VariableColumn.t.html new file mode 100644 index 00000000..d48706e8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/VariableColumn.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.VariableColumn.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/algebrize.v.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/algebrize.v.html new file mode 100644 index 00000000..f54f6a03 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/algebrize.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.algebrize.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/algebrize_with_counter.v.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/algebrize_with_counter.v.html new file mode 100644 index 00000000..7c2b8072 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/algebrize_with_counter.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.algebrize_with_counter.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/algebrize_with_inputs.v.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/algebrize_with_inputs.v.html new file mode 100644 index 00000000..15936b50 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/algebrize_with_inputs.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.algebrize_with_inputs.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/bail.m.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/bail.m.html new file mode 100644 index 00000000..6a9910ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/bail.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.bail.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/ConjoiningClauses.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/ConjoiningClauses.t.html new file mode 100644 index 00000000..0e2bd74e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/ConjoiningClauses.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ConjoiningClauses.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/VariableBindings.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/VariableBindings.t.html new file mode 100644 index 00000000..47d23b75 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/VariableBindings.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.VariableBindings.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/inputs/QueryInputs.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/inputs/QueryInputs.t.html new file mode 100644 index 00000000..e805aadc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/inputs/QueryInputs.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.QueryInputs.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/inputs/struct.QueryInputs.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/inputs/struct.QueryInputs.html new file mode 100644 index 00000000..8640fb5a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/inputs/struct.QueryInputs.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../mentat_query_algebrizer/struct.QueryInputs.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/struct.ConjoiningClauses.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/struct.ConjoiningClauses.html new file mode 100644 index 00000000..3a40084d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/struct.ConjoiningClauses.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/struct.ConjoiningClauses.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/type.VariableBindings.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/type.VariableBindings.html new file mode 100644 index 00000000..d6e995de --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/clauses/type.VariableBindings.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/type.VariableBindings.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.AlgebrizerError.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.AlgebrizerError.html new file mode 100644 index 00000000..26659d96 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.AlgebrizerError.html @@ -0,0 +1,162 @@ + + + + + + + + + + mentat_query_algebrizer::AlgebrizerError - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_algebrizer::AlgebrizerError + + [] + + [src]

pub enum AlgebrizerError {
+    DuplicateVariableError(PlainSymbol, &'static str),
+    UnsupportedArgument,
+    InputTypeDisagreement(PlainSymbol, ValueType, ValueType),
+    InvalidNumberOfArguments(PlainSymbol, usizeusize),
+    InvalidArgument(PlainSymbol, &'static strusize),
+    InvalidArgumentType(PlainSymbol, ValueTypeSet, usize),
+    InvalidGroundConstant,
+    InvalidLimit(String, ValueType),
+    GroundBindingsMismatch,
+    UnrecognizedIdent(String),
+    UnknownFunction(PlainSymbol),
+    UnknownLimitVar(PlainSymbol),
+    UnboundVariable(PlainSymbol),
+    NonMatchingVariablesInOrClause,
+    NonMatchingVariablesInNotClause,
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Debug for AlgebrizerError
[src]

Formats the value using the given formatter. Read more

+

impl Fail for AlgebrizerError
[src]

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

+

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

+

Provides context for this failure. Read more

+

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

+

Returns a iterator over the causes of this Fail with itself as the first item and the root_cause as the final item. Read more

+

Returns the "root cause" of this Fail - the last value in the cause chain which does not return an underlying cause. Read more

+

impl Display for AlgebrizerError
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.BindingError.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.BindingError.html new file mode 100644 index 00000000..522589cd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.BindingError.html @@ -0,0 +1,169 @@ + + + + + + + + + + mentat_query_algebrizer::BindingError - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_algebrizer::BindingError + + [] + + [src]

pub enum BindingError {
+    NoBoundVariable,
+    UnexpectedBinding,
+    RepeatedBoundVariable,
+    ExpectedBindRel,
+    ExpectedBindRelOrBindColl,
+    InvalidNumberOfBindings {
+        number: usize,
+        expected: usize,
+    },
+}

+ Variants

+

Expected [[?x ?y]] but got some other type of binding. Mentat is deliberately more strict +than Datomic: we won't try to make sense of non-obvious (and potentially erroneous) bindings.

+

Expected [[?x ?y]] or [?x ...] but got some other type of binding. Mentat is +deliberately more strict than Datomic: we won't try to make sense of non-obvious (and +potentially erroneous) bindings.

+

Expected [?x1 … ?xN] or [[?x1 … ?xN]] but got some other number of bindings. Mentat is +deliberately more strict than Datomic: we prefer placeholders to omission.

+

Fields of InvalidNumberOfBindings

+ +
+

+ Trait Implementations +

+
+

impl Display for BindingError
[src]

Formats the value using the given formatter. Read more

+

impl Clone for BindingError
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for BindingError
[src]

Formats the value using the given formatter. Read more

+

impl Eq for BindingError
[src]

impl PartialEq for BindingError
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Fail for BindingError
[src]

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

+

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

+

Provides context for this failure. Read more

+

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

+

Returns a iterator over the causes of this Fail with itself as the first item and the root_cause as the final item. Read more

+

Returns the "root cause" of this Fail - the last value in the cause chain which does not return an underlying cause. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for BindingError

impl Sync for BindingError

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.Column.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.Column.html new file mode 100644 index 00000000..a53bd71d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.Column.html @@ -0,0 +1,150 @@ + + + + + + + + + + mentat_query_algebrizer::Column - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_algebrizer::Column + + [] + + [src]

pub enum Column {
+    Fixed(DatomsColumn),
+    Fulltext(FulltextColumn),
+    Variable(VariableColumn),
+    Transactions(TransactionsColumn),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl PartialEq for Column
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for Column
[src]

impl Clone for Column
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<DatomsColumn> for Column
[src]

Performs the conversion.

+

impl From<VariableColumn> for Column
[src]

Performs the conversion.

+

impl Debug for Column
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for Column

impl !Sync for Column

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.ColumnConstraint.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.ColumnConstraint.html new file mode 100644 index 00000000..f78a07c8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.ColumnConstraint.html @@ -0,0 +1,164 @@ + + + + + + + + + + mentat_query_algebrizer::ColumnConstraint - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_algebrizer::ColumnConstraint + + [] + + [src]

pub enum ColumnConstraint {
+    Equals(QualifiedAliasQueryValue),
+    Inequality {
+        operator: Inequality,
+        left: QueryValue,
+        right: QueryValue,
+    },
+    HasTypes {
+        value: TableAlias,
+        value_types: ValueTypeSet,
+        check_value: bool,
+    },
+    NotExists(ComputedTable),
+    Matches(QualifiedAliasQueryValue),
+}

+ Variants

+

Fields of Inequality

+ +

Fields of HasTypes

+ +
+

+ Methods +

+

impl ColumnConstraint
[src]

+

+ Trait Implementations +

+
+

impl PartialEq for ColumnConstraint
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for ColumnConstraint
[src]

impl From<ColumnConstraint> for ColumnConstraintOrAlternation
[src]

Performs the conversion.

+

impl Debug for ColumnConstraint
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.ColumnConstraintOrAlternation.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.ColumnConstraintOrAlternation.html new file mode 100644 index 00000000..dfb7d901 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.ColumnConstraintOrAlternation.html @@ -0,0 +1,145 @@ + + + + + + + + + + mentat_query_algebrizer::ColumnConstraintOrAlternation - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_algebrizer::ColumnConstraintOrAlternation + + [] + + [src]

pub enum ColumnConstraintOrAlternation {
+    Constraint(ColumnConstraint),
+    Alternation(ColumnAlternation),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl PartialEq for ColumnConstraintOrAlternation
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for ColumnConstraintOrAlternation
[src]

impl Debug for ColumnConstraintOrAlternation
[src]

Formats the value using the given formatter. Read more

+

impl From<ColumnConstraint> for ColumnConstraintOrAlternation
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.ComputedTable.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.ComputedTable.html new file mode 100644 index 00000000..80984e06 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.ComputedTable.html @@ -0,0 +1,157 @@ + + + + + + + + + + mentat_query_algebrizer::ComputedTable - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_algebrizer::ComputedTable + + [] + + [src]

pub enum ComputedTable {
+    Subquery(ConjoiningClauses),
+    Union {
+        projection: BTreeSet<Variable>,
+        type_extraction: BTreeSet<Variable>,
+        arms: Vec<ConjoiningClauses>,
+    },
+    NamedValues {
+        names: Vec<Variable>,
+        values: Vec<TypedValue>,
+    },
+}

A source of rows that isn't a named table -- typically a subquery or union.

+

+ Variants

+

Fields of Union

+ +

Fields of NamedValues

+ +
+

+ Trait Implementations +

+
+

impl PartialEq for ComputedTable
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for ComputedTable
[src]

impl Debug for ComputedTable
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for ComputedTable

impl !Sync for ComputedTable

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.DatomsColumn.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.DatomsColumn.html new file mode 100644 index 00000000..9be816da --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.DatomsColumn.html @@ -0,0 +1,157 @@ + + + + + + + + + + mentat_query_algebrizer::DatomsColumn - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_algebrizer::DatomsColumn + + [] + + [src]

pub enum DatomsColumn {
+    Entity,
+    Attribute,
+    Value,
+    Tx,
+    ValueTypeTag,
+}

One of the named columns of our tables.

+

+ Variants

+ +

+ Methods +

+

impl DatomsColumn
[src]

The type of the v column is determined by the value_type_tag column. Return the +associated column determining the type of this column, if there is one.

+
+

+ Trait Implementations +

+
+

impl PartialEq for DatomsColumn
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for DatomsColumn
[src]

impl Clone for DatomsColumn
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<DatomsColumn> for Column
[src]

Performs the conversion.

+

impl ColumnName for DatomsColumn
[src]

impl Debug for DatomsColumn
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for DatomsColumn

impl Sync for DatomsColumn

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.DatomsTable.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.DatomsTable.html new file mode 100644 index 00000000..c408f0d6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.DatomsTable.html @@ -0,0 +1,156 @@ + + + + + + + + + + mentat_query_algebrizer::DatomsTable - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_algebrizer::DatomsTable + + [] + + [src]

pub enum DatomsTable {
+    Datoms,
+    FulltextValues,
+    FulltextDatoms,
+    AllDatoms,
+    Computed(usize),
+    Transactions,
+}

This enum models the fixed set of default tables we have -- two +tables and two views -- and computed tables defined in the enclosing CC.

+

+ Variants

+ +

+ Methods +

+

impl DatomsTable
[src]

+

+ Trait Implementations +

+
+

impl PartialEq for DatomsTable
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for DatomsTable
[src]

impl Clone for DatomsTable
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for DatomsTable
[src]

impl Debug for DatomsTable
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for DatomsTable

impl Sync for DatomsTable

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.EmptyBecause.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.EmptyBecause.html new file mode 100644 index 00000000..efe7671f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.EmptyBecause.html @@ -0,0 +1,189 @@ + + + + + + + + + + mentat_query_algebrizer::EmptyBecause - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_algebrizer::EmptyBecause + + [] + + [src]

pub enum EmptyBecause {
+    CachedAttributeHasNoValues {
+        entity: Entid,
+        attr: Entid,
+    },
+    CachedAttributeHasNoEntity {
+        value: TypedValue,
+        attr: Entid,
+    },
+    ConflictingBindings {
+        var: Variable,
+        existing: TypedValue,
+        desired: TypedValue,
+    },
+    TypeMismatch {
+        var: Variable,
+        existing: ValueTypeSet,
+        desired: ValueTypeSet,
+    },
+    KnownTypeMismatch {
+        left: ValueTypeSet,
+        right: ValueTypeSet,
+    },
+    NoValidTypes(Variable),
+    NonAttributeArgument,
+    NonInstantArgument,
+    NonNumericArgument,
+    NonEntityArgument,
+    NonStringFulltextValue,
+    NonFulltextAttribute(Entid),
+    UnresolvedIdent(Keyword),
+    InvalidAttributeIdent(Keyword),
+    InvalidAttributeEntid(Entid),
+    InvalidBinding(Column, TypedValue),
+    ValueTypeMismatch(ValueType, TypedValue),
+    AttributeLookupFailed,
+}

+ Variants

+

Fields of CachedAttributeHasNoValues

+ +

Fields of CachedAttributeHasNoEntity

+ +

Fields of ConflictingBindings

+ +

Fields of TypeMismatch

+ +

Fields of KnownTypeMismatch

+ +
+

+ Trait Implementations +

+
+

impl PartialEq for EmptyBecause
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Clone for EmptyBecause
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for EmptyBecause
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for EmptyBecause

impl !Sync for EmptyBecause

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.FulltextColumn.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.FulltextColumn.html new file mode 100644 index 00000000..7d2c1415 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.FulltextColumn.html @@ -0,0 +1,151 @@ + + + + + + + + + + mentat_query_algebrizer::FulltextColumn - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_algebrizer::FulltextColumn + + [] + + [src]

pub enum FulltextColumn {
+    Rowid,
+    Text,
+}

One of the named columns of our fulltext values table.

+

+ Variants

+ +

+ Methods +

+

impl FulltextColumn
[src]

+

+ Trait Implementations +

+
+

impl PartialEq for FulltextColumn
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for FulltextColumn
[src]

impl Clone for FulltextColumn
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl ColumnName for FulltextColumn
[src]

impl Debug for FulltextColumn
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.QueryValue.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.QueryValue.html new file mode 100644 index 00000000..ac4b46e2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.QueryValue.html @@ -0,0 +1,148 @@ + + + + + + + + + + mentat_query_algebrizer::QueryValue - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_algebrizer::QueryValue + + [] + + [src]

pub enum QueryValue {
+    Column(QualifiedAlias),
+    Entid(Entid),
+    TypedValue(TypedValue),
+    PrimitiveLong(i64),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl PartialEq for QueryValue
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for QueryValue
[src]

impl Clone for QueryValue
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for QueryValue
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for QueryValue

impl !Sync for QueryValue

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.VariableColumn.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.VariableColumn.html new file mode 100644 index 00000000..d75f76d7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/enum.VariableColumn.html @@ -0,0 +1,147 @@ + + + + + + + + + + mentat_query_algebrizer::VariableColumn - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_algebrizer::VariableColumn + + [] + + [src]

pub enum VariableColumn {
+    Variable(Variable),
+    VariableTypeTag(Variable),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl PartialEq for VariableColumn
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for VariableColumn
[src]

impl Clone for VariableColumn
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl From<VariableColumn> for Column
[src]

Performs the conversion.

+

impl ColumnName for VariableColumn
[src]

impl Debug for VariableColumn
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for VariableColumn

impl !Sync for VariableColumn

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/AlgebrizerError.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/AlgebrizerError.t.html new file mode 100644 index 00000000..12c88614 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/AlgebrizerError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.AlgebrizerError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/BindingError.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/BindingError.t.html new file mode 100644 index 00000000..f1ccb220 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/BindingError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.BindingError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/InvalidBinding.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/InvalidBinding.t.html new file mode 100644 index 00000000..075f03f1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/InvalidBinding.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.InvalidBinding.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/Result.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/Result.t.html new file mode 100644 index 00000000..865910f9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/Result.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Result.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/enum.AlgebrizerError.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/enum.AlgebrizerError.html new file mode 100644 index 00000000..2a3357c2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/enum.AlgebrizerError.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/enum.AlgebrizerError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/enum.BindingError.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/enum.BindingError.html new file mode 100644 index 00000000..9eb85dc6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/enum.BindingError.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/enum.BindingError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/struct.InvalidBinding.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/struct.InvalidBinding.html new file mode 100644 index 00000000..051ee405 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/struct.InvalidBinding.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/struct.InvalidBinding.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/type.Result.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/type.Result.html new file mode 100644 index 00000000..dad8ba01 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/errors/type.Result.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/type.Result.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/fn.algebrize.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/fn.algebrize.html new file mode 100644 index 00000000..808358dd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/fn.algebrize.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_query_algebrizer::algebrize - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_query_algebrizer::algebrize + + [] + + [src]

pub fn algebrize(known: Known, parsed: FindQuery) -> Result<AlgebraicQuery>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/fn.algebrize_with_counter.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/fn.algebrize_with_counter.html new file mode 100644 index 00000000..b8a5086b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/fn.algebrize_with_counter.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_query_algebrizer::algebrize_with_counter - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_query_algebrizer::algebrize_with_counter + + [] + + [src]

pub fn algebrize_with_counter(
    known: Known,
    parsed: FindQuery,
    counter: usize
) -> Result<AlgebraicQuery>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/fn.algebrize_with_inputs.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/fn.algebrize_with_inputs.html new file mode 100644 index 00000000..043eb69d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/fn.algebrize_with_inputs.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_query_algebrizer::algebrize_with_inputs - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_query_algebrizer::algebrize_with_inputs + + [] + + [src]

pub fn algebrize_with_inputs(
    known: Known,
    parsed: FindQuery,
    counter: usize,
    inputs: QueryInputs
) -> Result<AlgebraicQuery>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/fn.parse_find_string.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/fn.parse_find_string.html new file mode 100644 index 00000000..9f4b564c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/fn.parse_find_string.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_query_algebrizer::parse_find_string - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_query_algebrizer::parse_find_string + + [] + + [src]

pub fn parse_find_string(string: &str) -> Result<FindQuery>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/index.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/index.html new file mode 100644 index 00000000..f87dbc6d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/index.html @@ -0,0 +1,383 @@ + + + + + + + + + + mentat_query_algebrizer - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Crate mentat_query_algebrizer + + [] + + [src]

Macros

+ + + + +
bail + +

Structs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AlgebraicQuery + +
ColumnAlternation +

A ColumnAlternation constraint is satisfied if at least one of its inner constraints is +satisfied. An empty ColumnAlternation is never satisfied.

+ +
ColumnIntersection +

A ColumnIntersection constraint is satisfied if all of its inner constraints are satisfied. +An empty intersection is always satisfied.

+ +
ConjoiningClauses +

A ConjoiningClauses (CC) is a collection of clauses that are combined with JOIN. +The topmost form in a query is a ConjoiningClauses.

+ +
FindQuery +

A FindQuery represents a valid query to the query algebrizer.

+ +
InvalidBinding + +
Known +

A convenience wrapper around things known in memory: the schema and caches. +We use a trait object here to avoid making dozens of functions generic over the type +of the cache. If performance becomes a concern, we should hard-code specific kinds of +cache right here, and/or eliminate the Option.

+ +
OrderBy +

Represents an entry in the ORDER BY list: a variable or a variable's type tag. +(We require order vars to be projected, so we can simply use a variable here.)

+ +
QualifiedAlias +

A particular column of a particular aliased table. E.g., "datoms123", Attribute.

+ +
QueryInputs +

Define the inputs to a query. This is in two parts: a set of values known now, and a set of +types known now. +The separate map of types is to allow queries to be algebrized without full knowledge of +the bindings that will be used at execution time. +When built correctly, types is guaranteed to contain the types of values -- use +QueryInputs::new or QueryInputs::with_values to construct an instance.

+ +
SourceAlias +

The association between a table and its alias. E.g., AllDatoms, "all_datoms123".

+ +

Enums

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AlgebrizerError + +
BindingError + +
Column + +
ColumnConstraint + +
ColumnConstraintOrAlternation + +
ComputedTable +

A source of rows that isn't a named table -- typically a subquery or union.

+ +
DatomsColumn +

One of the named columns of our tables.

+ +
DatomsTable +

This enum models the fixed set of default tables we have -- two +tables and two views -- and computed tables defined in the enclosing CC.

+ +
EmptyBecause + +
FulltextColumn +

One of the named columns of our fulltext values table.

+ +
QueryValue + +
VariableColumn + +

Traits

+ + + + +
ColumnName + +

Functions

+ + + + + + + + + + + + + + + + +
algebrize + +
algebrize_with_counter + +
algebrize_with_inputs + +
parse_find_string + +

Type Definitions

+ + + + + + + + + + + + +
Result + +
TableAlias +

A specific instance of a table within a query. E.g., "datoms123".

+ +
VariableBindings + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/macro.bail!.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/macro.bail!.html new file mode 100644 index 00000000..6a9910ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/macro.bail!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.bail.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/macro.bail.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/macro.bail.html new file mode 100644 index 00000000..25efe15b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/macro.bail.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_query_algebrizer::bail - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_query_algebrizer::bail + + [] + + [src]

+macro_rules! bail {
+    ($e:expr) => { ... };
+}
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/parse_find_string.v.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/parse_find_string.v.html new file mode 100644 index 00000000..82239a1e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/parse_find_string.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.parse_find_string.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_query_algebrizer/sidebar-items.js new file mode 100644 index 00000000..e20c5f42 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["AlgebrizerError",""],["BindingError",""],["Column",""],["ColumnConstraint",""],["ColumnConstraintOrAlternation",""],["ComputedTable","A source of rows that isn't a named table -- typically a subquery or union."],["DatomsColumn","One of the named columns of our tables."],["DatomsTable","This enum models the fixed set of default tables we have -- two tables and two views -- and computed tables defined in the enclosing CC."],["EmptyBecause",""],["FulltextColumn","One of the named columns of our fulltext values table."],["QueryValue",""],["VariableColumn",""]],"fn":[["algebrize",""],["algebrize_with_counter",""],["algebrize_with_inputs",""],["parse_find_string",""]],"macro":[["bail",""]],"struct":[["AlgebraicQuery",""],["ColumnAlternation","A `ColumnAlternation` constraint is satisfied if at least one of its inner constraints is satisfied. An empty `ColumnAlternation` is never satisfied."],["ColumnIntersection","A `ColumnIntersection` constraint is satisfied if all of its inner constraints are satisfied. An empty intersection is always satisfied."],["ConjoiningClauses","A `ConjoiningClauses` (CC) is a collection of clauses that are combined with `JOIN`. The topmost form in a query is a `ConjoiningClauses`."],["FindQuery","A `FindQuery` represents a valid query to the query algebrizer."],["InvalidBinding",""],["Known","A convenience wrapper around things known in memory: the schema and caches. We use a trait object here to avoid making dozens of functions generic over the type of the cache. If performance becomes a concern, we should hard-code specific kinds of cache right here, and/or eliminate the Option."],["OrderBy","Represents an entry in the ORDER BY list: a variable or a variable's type tag. (We require order vars to be projected, so we can simply use a variable here.)"],["QualifiedAlias","A particular column of a particular aliased table. E.g., \"datoms123\", Attribute."],["QueryInputs","Define the inputs to a query. This is in two parts: a set of values known now, and a set of types known now. The separate map of types is to allow queries to be algebrized without full knowledge of the bindings that will be used at execution time. When built correctly, `types` is guaranteed to contain the types of `values` -- use `QueryInputs::new` or `QueryInputs::with_values` to construct an instance."],["SourceAlias","The association between a table and its alias. E.g., AllDatoms, \"all_datoms123\"."]],"trait":[["ColumnName",""]],"type":[["Result",""],["TableAlias","A specific instance of a table within a query. E.g., \"datoms123\"."],["VariableBindings",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.AlgebraicQuery.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.AlgebraicQuery.html new file mode 100644 index 00000000..0798e469 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.AlgebraicQuery.html @@ -0,0 +1,188 @@ + + + + + + + + + + mentat_query_algebrizer::AlgebraicQuery - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_algebrizer::AlgebraicQuery + + [] + + [src]

pub struct AlgebraicQuery {
+    pub find_spec: Rc<FindSpec>,
+    pub with: BTreeSet<Variable>,
+    pub named_projection: BTreeSet<Variable>,
+    pub order: Option<Vec<OrderBy>>,
+    pub limit: Limit,
+    pub cc: ConjoiningClauses,
+    // some fields omitted
+}

+ Fields

+ + + +

The set of variables that the caller wishes to be used for grouping when aggregating. +These are specified in the query input, as :with, and are then chewed up during projection. +If no variables are supplied, then no additional grouping is necessary beyond the +non-aggregated projection list.

+
+ +

Some query features, such as ordering, are implemented by implicit reference to SQL columns. +In order for these references to be 'live', those columns must be projected. +This is the set of variables that must be so projected. +This is not necessarily every variable that will be so required -- some variables +will already be in the projection list.

+
+ + + + + + +

+ Methods +

+

impl AlgebraicQuery
[src]

Return true if every variable in the find spec is fully bound to a single value.

+

Return true if every variable in the find spec is fully bound to a single value, +and evaluating the query doesn't require running SQL.

+

Return a set of the input variables mentioned in the :in clause that have not yet been +bound. We do this by looking at the CC.

+
+

+ Trait Implementations +

+
+

impl Debug for AlgebraicQuery
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for AlgebraicQuery

impl !Sync for AlgebraicQuery

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.ColumnAlternation.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.ColumnAlternation.html new file mode 100644 index 00000000..39bf142d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.ColumnAlternation.html @@ -0,0 +1,151 @@ + + + + + + + + + + mentat_query_algebrizer::ColumnAlternation - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_algebrizer::ColumnAlternation + + [] + + [src]

pub struct ColumnAlternation(pub Vec<ColumnIntersection>);

A ColumnAlternation constraint is satisfied if at least one of its inner constraints is +satisfied. An empty ColumnAlternation is never satisfied.

+
+

+ Methods +

+

impl ColumnAlternation
[src]

+

+ Trait Implementations +

+
+

impl PartialEq for ColumnAlternation
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for ColumnAlternation
[src]

impl Debug for ColumnAlternation
[src]

Formats the value using the given formatter. Read more

+

impl Default for ColumnAlternation
[src]

Returns the "default value" for a type. Read more

+

impl IntoIterator for ColumnAlternation
[src]

+

The type of the elements being iterated over.

+

+

Which kind of iterator are we turning this into?

+

Creates an iterator from a value. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.ColumnIntersection.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.ColumnIntersection.html new file mode 100644 index 00000000..a6f6b807 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.ColumnIntersection.html @@ -0,0 +1,152 @@ + + + + + + + + + + mentat_query_algebrizer::ColumnIntersection - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_algebrizer::ColumnIntersection + + [] + + [src]

pub struct ColumnIntersection(pub Vec<ColumnConstraintOrAlternation>);

A ColumnIntersection constraint is satisfied if all of its inner constraints are satisfied. +An empty intersection is always satisfied.

+
+

+ Methods +

+

impl ColumnIntersection
[src]

+

+ Trait Implementations +

+
+

impl PartialEq for ColumnIntersection
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for ColumnIntersection
[src]

impl From<Vec<ColumnConstraint>> for ColumnIntersection
[src]

Performs the conversion.

+

impl Default for ColumnIntersection
[src]

Returns the "default value" for a type. Read more

+

impl IntoIterator for ColumnIntersection
[src]

+

The type of the elements being iterated over.

+

+

Which kind of iterator are we turning this into?

+

Creates an iterator from a value. Read more

+

impl Debug for ColumnIntersection
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.ConjoiningClauses.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.ConjoiningClauses.html new file mode 100644 index 00000000..964d33fb --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.ConjoiningClauses.html @@ -0,0 +1,238 @@ + + + + + + + + + + mentat_query_algebrizer::ConjoiningClauses - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_algebrizer::ConjoiningClauses + + [] + + [src]

pub struct ConjoiningClauses {
+    pub empty_because: Option<EmptyBecause>,
+    pub from: Vec<SourceAlias>,
+    pub computed_tables: Vec<ComputedTable>,
+    pub wheres: ColumnIntersection,
+    pub column_bindings: BTreeMap<Variable, Vec<QualifiedAlias>>,
+    pub input_variables: BTreeSet<Variable>,
+    pub known_types: BTreeMap<Variable, ValueTypeSet>,
+    pub extracted_types: BTreeMap<Variable, QualifiedAlias>,
+    // some fields omitted
+}

A ConjoiningClauses (CC) is a collection of clauses that are combined with JOIN. +The topmost form in a query is a ConjoiningClauses.

+
    +
  • Ordinary pattern clauses turn into FROM parts and WHERE parts using =.
  • +
  • Predicate clauses turn into the same, but with other functions.
  • +
  • Function clauses turn into WHERE parts using function-specific comparisons.
  • +
  • not turns into NOT EXISTS with WHERE clauses inside the subquery to +bind it to the outer variables, or adds simple WHERE clauses to the outer +clause.
  • +
  • not-join is similar, but with explicit binding.
  • +
  • or turns into a collection of UNIONs inside a subquery, or a simple +alternation. +or's documentation states that all clauses must include the same vars, +but that's an over-simplification: all clauses must refer to the external +unification vars. +The entire UNION-set is JOINed to any surrounding expressions per the rule-vars +clause, or the intersection of the vars in the two sides of the JOIN.
  • +
+

Not yet done:

+
    +
  • Function clauses with bindings turn into: +
      +
    • Subqueries. Perhaps less efficient? Certainly clearer.
    • +
    • Projection expressions, if only used for output.
    • +
    • Inline expressions?
    • +
    +
  • +
+
+

+ Fields

+ +

Some if this set of clauses cannot yield results in the context of the current schema.

+
+ +

A vector of source/alias pairs used to construct a SQL FROM list.

+
+ +

A vector of computed tables (typically subqueries). The index into this vector is used as +an identifier in a DatomsTable::Computed(c) table reference.

+
+ +

A list of fragments that can be joined by AND.

+
+ +

A map from var to qualified columns. Used to project.

+
+ +

A list of variables mentioned in the enclosing query's :in clause. These must all be bound +before the query can be executed. TODO: clarify what this means for nested CCs.

+
+ +

A map from var to type. Whenever a var maps unambiguously to two different types, it cannot +yield results, so we don't represent that case here. If a var isn't present in the map, it +means that its type is not known in advance. +Usually that state should be represented by ValueTypeSet::Any.

+
+ +

A mapping, similar to column_bindings, but used to pull type tags out of the store at runtime. +If a var isn't unit in known_types, it should be present here.

+
+

+ Methods +

+

impl ConjoiningClauses
[src]

Be careful with this. It'll overwrite existing bindings.

+

Return an iterator over the variables externally bound to values.

+

Return a set of the variables externally bound to values.

+

Return a single ValueType if the given variable is known to have a precise type. +Returns None if the type of the variable is unknown. +Returns None if the type of the variable is known but not precise -- "double +or integer" isn't good enough.

+

+

+ Trait Implementations +

+
+

impl PartialEq for ConjoiningClauses
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for ConjoiningClauses
[src]

impl Debug for ConjoiningClauses
[src]

Formats the value using the given formatter. Read more

+

impl Default for ConjoiningClauses
[src]

Basics.

+

Returns the "default value" for a type. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.FindQuery.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.FindQuery.html new file mode 100644 index 00000000..9e49a6ef --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.FindQuery.html @@ -0,0 +1,188 @@ + + + + + + + + + + mentat_query_algebrizer::FindQuery - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_algebrizer::FindQuery + + [] + + [src]

pub struct FindQuery {
+    pub find_spec: FindSpec,
+    pub default_source: SrcVar,
+    pub with: BTreeSet<Variable>,
+    pub in_vars: BTreeSet<Variable>,
+    pub in_sources: BTreeSet<SrcVar>,
+    pub limit: Limit,
+    pub where_clauses: Vec<WhereClause>,
+    pub order: Option<Vec<Order>>,
+}

A FindQuery represents a valid query to the query algebrizer.

+

We split FindQuery from ParsedQuery because it's not easy to generalize over containers +(here, Vec and BTreeSet) in Rust.

+

+ Fields

+ + + + + + + + + + + + + + + + +

+ Methods +

+

impl FindQuery
[src]

+

+ Trait Implementations +

+
+

impl Debug for FindQuery
[src]

Formats the value using the given formatter. Read more

+

impl Eq for FindQuery
[src]

impl PartialEq for FindQuery
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl !Send for FindQuery

impl !Sync for FindQuery

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.InvalidBinding.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.InvalidBinding.html new file mode 100644 index 00000000..ac6048cd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.InvalidBinding.html @@ -0,0 +1,160 @@ + + + + + + + + + + mentat_query_algebrizer::InvalidBinding - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_algebrizer::InvalidBinding + + [] + + [src]

pub struct InvalidBinding {
+    pub function: PlainSymbol,
+    pub inner: Context<BindingError>,
+}

+ Fields

+ + + + +

+ Methods +

+

impl InvalidBinding
[src]

+

+ Trait Implementations +

+
+

impl Debug for InvalidBinding
[src]

Formats the value using the given formatter. Read more

+

impl Fail for InvalidBinding
[src]

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

+

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

+

Provides context for this failure. Read more

+

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

+

Returns a iterator over the causes of this Fail with itself as the first item and the root_cause as the final item. Read more

+

Returns the "root cause" of this Fail - the last value in the cause chain which does not return an underlying cause. Read more

+

impl Display for InvalidBinding
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.Known.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.Known.html new file mode 100644 index 00000000..86ae89ad --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.Known.html @@ -0,0 +1,160 @@ + + + + + + + + + + mentat_query_algebrizer::Known - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_algebrizer::Known + + [] + + [src]

pub struct Known<'s, 'c> {
+    pub schema: &'s Schema,
+    pub cache: Option<&'c CachedAttributes>,
+}

A convenience wrapper around things known in memory: the schema and caches. +We use a trait object here to avoid making dozens of functions generic over the type +of the cache. If performance becomes a concern, we should hard-code specific kinds of +cache right here, and/or eliminate the Option.

+

+ Fields

+ + + + +

+ Methods +

+

impl<'s, 'c> Known<'s, 'c>
[src]

impl<'s, 'c> Known<'s, 'c>
[src]

This is CachedAttributes, but with handy generic parameters. +Why not make the trait generic? Because then we can't use it as a trait object in Known.

+

+

+ Trait Implementations +

+
+

impl<'s, 'c> Clone for Known<'s, 'c>
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<'s, 'c> Copy for Known<'s, 'c>
[src]

+

+ Auto Trait Implementations +

+
+

impl<'s, 'c> !Send for Known<'s, 'c>

impl<'s, 'c> !Sync for Known<'s, 'c>

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.OrderBy.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.OrderBy.html new file mode 100644 index 00000000..bf3fc01c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.OrderBy.html @@ -0,0 +1,144 @@ + + + + + + + + + + mentat_query_algebrizer::OrderBy - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_algebrizer::OrderBy + + [] + + [src]

pub struct OrderBy(pub Direction, pub VariableColumn);

Represents an entry in the ORDER BY list: a variable or a variable's type tag. +(We require order vars to be projected, so we can simply use a variable here.)

+
+

+ Trait Implementations +

+
+

impl Clone for OrderBy
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for OrderBy
[src]

Formats the value using the given formatter. Read more

+

impl Eq for OrderBy
[src]

impl PartialEq for OrderBy
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl From<Order> for OrderBy
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl !Send for OrderBy

impl !Sync for OrderBy

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.QualifiedAlias.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.QualifiedAlias.html new file mode 100644 index 00000000..52c368ca --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.QualifiedAlias.html @@ -0,0 +1,146 @@ + + + + + + + + + + mentat_query_algebrizer::QualifiedAlias - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_algebrizer::QualifiedAlias + + [] + + [src]

pub struct QualifiedAlias(pub TableAlias, pub Column);

A particular column of a particular aliased table. E.g., "datoms123", Attribute.

+
+

+ Methods +

+

impl QualifiedAlias
[src]

+

+ Trait Implementations +

+
+

impl PartialEq for QualifiedAlias
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for QualifiedAlias
[src]

impl Clone for QualifiedAlias
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for QualifiedAlias
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for QualifiedAlias

impl !Sync for QualifiedAlias

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.QueryInputs.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.QueryInputs.html new file mode 100644 index 00000000..858da1c7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.QueryInputs.html @@ -0,0 +1,147 @@ + + + + + + + + + + mentat_query_algebrizer::QueryInputs - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_algebrizer::QueryInputs + + [] + + [src]

pub struct QueryInputs { /* fields omitted */ }

Define the inputs to a query. This is in two parts: a set of values known now, and a set of +types known now. +The separate map of types is to allow queries to be algebrized without full knowledge of +the bindings that will be used at execution time. +When built correctly, types is guaranteed to contain the types of values -- use +QueryInputs::new or QueryInputs::with_values to construct an instance.

+
+

+ Methods +

+

impl QueryInputs
[src]

+

+ Trait Implementations +

+
+

impl Default for QueryInputs
[src]

Returns the "default value" for a type. Read more

+
+

+ Auto Trait Implementations +

+
+

impl !Send for QueryInputs

impl !Sync for QueryInputs

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.SourceAlias.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.SourceAlias.html new file mode 100644 index 00000000..cf517812 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/struct.SourceAlias.html @@ -0,0 +1,142 @@ + + + + + + + + + + mentat_query_algebrizer::SourceAlias - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_algebrizer::SourceAlias + + [] + + [src]

pub struct SourceAlias(pub DatomsTable, pub TableAlias);

The association between a table and its alias. E.g., AllDatoms, "all_datoms123".

+
+

+ Trait Implementations +

+
+

impl PartialEq for SourceAlias
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for SourceAlias
[src]

impl Clone for SourceAlias
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for SourceAlias
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for SourceAlias

impl Sync for SourceAlias

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/trait.ColumnName.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/trait.ColumnName.html new file mode 100644 index 00000000..afa1fe51 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/trait.ColumnName.html @@ -0,0 +1,143 @@ + + + + + + + + + + mentat_query_algebrizer::ColumnName - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_query_algebrizer::ColumnName + + [] + + [src]

pub trait ColumnName {
+    fn column_name(&self) -> String;
+}
+

+ Required Methods +

+
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/type.Result.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/type.Result.html new file mode 100644 index 00000000..72f6ae4d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/type.Result.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_query_algebrizer::Result - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_query_algebrizer::Result + + [] + + [src]

type Result<T> = Result<T, Error>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/type.TableAlias.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/type.TableAlias.html new file mode 100644 index 00000000..1b70e873 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/type.TableAlias.html @@ -0,0 +1,127 @@ + + + + + + + + + + mentat_query_algebrizer::TableAlias - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_query_algebrizer::TableAlias + + [] + + [src]

type TableAlias = String;

A specific instance of a table within a query. E.g., "datoms123".

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/type.VariableBindings.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/type.VariableBindings.html new file mode 100644 index 00000000..ced0cc54 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/type.VariableBindings.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_query_algebrizer::VariableBindings - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_query_algebrizer::VariableBindings + + [] + + [src]

type VariableBindings = BTreeMap<Variable, TypedValue>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/Column.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/Column.t.html new file mode 100644 index 00000000..d3e7ed4a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/Column.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Column.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ColumnAlternation.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ColumnAlternation.t.html new file mode 100644 index 00000000..b7c400e5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ColumnAlternation.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ColumnAlternation.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ColumnConstraint.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ColumnConstraint.t.html new file mode 100644 index 00000000..72aa5cc6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ColumnConstraint.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.ColumnConstraint.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ColumnConstraintOrAlternation.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ColumnConstraintOrAlternation.t.html new file mode 100644 index 00000000..46872e34 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ColumnConstraintOrAlternation.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.ColumnConstraintOrAlternation.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ColumnIntersection.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ColumnIntersection.t.html new file mode 100644 index 00000000..a685ce60 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ColumnIntersection.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ColumnIntersection.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ColumnName.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ColumnName.t.html new file mode 100644 index 00000000..80430f2d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ColumnName.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.ColumnName.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ComputedTable.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ComputedTable.t.html new file mode 100644 index 00000000..324adaad --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/ComputedTable.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.ComputedTable.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/DatomsColumn.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/DatomsColumn.t.html new file mode 100644 index 00000000..58577102 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/DatomsColumn.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.DatomsColumn.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/DatomsTable.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/DatomsTable.t.html new file mode 100644 index 00000000..4abab688 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/DatomsTable.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.DatomsTable.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/EmptyBecause.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/EmptyBecause.t.html new file mode 100644 index 00000000..475184c1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/EmptyBecause.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.EmptyBecause.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/FindQuery.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/FindQuery.t.html new file mode 100644 index 00000000..5be30a20 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/FindQuery.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.FindQuery.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/FulltextColumn.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/FulltextColumn.t.html new file mode 100644 index 00000000..f504246f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/FulltextColumn.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.FulltextColumn.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/OrderBy.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/OrderBy.t.html new file mode 100644 index 00000000..d0803807 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/OrderBy.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.OrderBy.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/QualifiedAlias.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/QualifiedAlias.t.html new file mode 100644 index 00000000..27e0f7cd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/QualifiedAlias.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.QualifiedAlias.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/QueryValue.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/QueryValue.t.html new file mode 100644 index 00000000..7bc1f2b5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/QueryValue.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.QueryValue.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/SourceAlias.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/SourceAlias.t.html new file mode 100644 index 00000000..ad7b5cee --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/SourceAlias.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.SourceAlias.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/TableAlias.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/TableAlias.t.html new file mode 100644 index 00000000..43f3749a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/TableAlias.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.TableAlias.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/VariableColumn.t.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/VariableColumn.t.html new file mode 100644 index 00000000..d48706e8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/VariableColumn.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.VariableColumn.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.Column.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.Column.html new file mode 100644 index 00000000..71c8d6a1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.Column.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/enum.Column.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.ColumnConstraint.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.ColumnConstraint.html new file mode 100644 index 00000000..962877fa --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.ColumnConstraint.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/enum.ColumnConstraint.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.ColumnConstraintOrAlternation.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.ColumnConstraintOrAlternation.html new file mode 100644 index 00000000..159a70fa --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.ColumnConstraintOrAlternation.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/enum.ColumnConstraintOrAlternation.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.ComputedTable.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.ComputedTable.html new file mode 100644 index 00000000..f97d8737 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.ComputedTable.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/enum.ComputedTable.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.DatomsColumn.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.DatomsColumn.html new file mode 100644 index 00000000..0ce9b62a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.DatomsColumn.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/enum.DatomsColumn.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.DatomsTable.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.DatomsTable.html new file mode 100644 index 00000000..4cf306da --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.DatomsTable.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/enum.DatomsTable.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.EmptyBecause.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.EmptyBecause.html new file mode 100644 index 00000000..1adf53f3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.EmptyBecause.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/enum.EmptyBecause.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.FulltextColumn.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.FulltextColumn.html new file mode 100644 index 00000000..80fc3e00 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.FulltextColumn.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/enum.FulltextColumn.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.QueryValue.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.QueryValue.html new file mode 100644 index 00000000..e2a81b9f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.QueryValue.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/enum.QueryValue.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.VariableColumn.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.VariableColumn.html new file mode 100644 index 00000000..e76e81ab --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/enum.VariableColumn.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/enum.VariableColumn.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.ColumnAlternation.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.ColumnAlternation.html new file mode 100644 index 00000000..2078350a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.ColumnAlternation.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/struct.ColumnAlternation.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.ColumnIntersection.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.ColumnIntersection.html new file mode 100644 index 00000000..57dad5d6 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.ColumnIntersection.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/struct.ColumnIntersection.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.FindQuery.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.FindQuery.html new file mode 100644 index 00000000..a5094b72 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.FindQuery.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/struct.FindQuery.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.OrderBy.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.OrderBy.html new file mode 100644 index 00000000..5ccf2a74 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.OrderBy.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/struct.OrderBy.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.QualifiedAlias.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.QualifiedAlias.html new file mode 100644 index 00000000..bba47f84 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.QualifiedAlias.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/struct.QualifiedAlias.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.SourceAlias.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.SourceAlias.html new file mode 100644 index 00000000..80550f2a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/struct.SourceAlias.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/struct.SourceAlias.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/trait.ColumnName.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/trait.ColumnName.html new file mode 100644 index 00000000..049379db --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/trait.ColumnName.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/trait.ColumnName.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/type.TableAlias.html b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/type.TableAlias.html new file mode 100644 index 00000000..589a4a04 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_algebrizer/types/type.TableAlias.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_algebrizer/type.TableAlias.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/CombinedProjection.t.html b/docs/apis/rust/0.7.0/mentat_query_projector/CombinedProjection.t.html new file mode 100644 index 00000000..9e4618ac --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/CombinedProjection.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.CombinedProjection.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/ConstantProjector.t.html b/docs/apis/rust/0.7.0/mentat_query_projector/ConstantProjector.t.html new file mode 100644 index 00000000..1a64ab86 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/ConstantProjector.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ConstantProjector.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/Projector.t.html b/docs/apis/rust/0.7.0/mentat_query_projector/Projector.t.html new file mode 100644 index 00000000..af8ffa93 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/Projector.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.Projector.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/QueryOutput.t.html b/docs/apis/rust/0.7.0/mentat_query_projector/QueryOutput.t.html new file mode 100644 index 00000000..56ae12d8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/QueryOutput.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.QueryOutput.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/QueryResults.t.html b/docs/apis/rust/0.7.0/mentat_query_projector/QueryResults.t.html new file mode 100644 index 00000000..b52d422e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/QueryResults.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.QueryResults.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/RelResult.t.html b/docs/apis/rust/0.7.0/mentat_query_projector/RelResult.t.html new file mode 100644 index 00000000..28847dea --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/RelResult.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.RelResult.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/SimpleAggregationOp.t.html b/docs/apis/rust/0.7.0/mentat_query_projector/SimpleAggregationOp.t.html new file mode 100644 index 00000000..2c057d98 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/SimpleAggregationOp.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.SimpleAggregationOp.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/StructuredRelResult.t.html b/docs/apis/rust/0.7.0/mentat_query_projector/StructuredRelResult.t.html new file mode 100644 index 00000000..ad1b7708 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/StructuredRelResult.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.StructuredRelResult.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/aggregates/SimpleAggregationOp.t.html b/docs/apis/rust/0.7.0/mentat_query_projector/aggregates/SimpleAggregationOp.t.html new file mode 100644 index 00000000..2c057d98 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/aggregates/SimpleAggregationOp.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.SimpleAggregationOp.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/aggregates/enum.SimpleAggregationOp.html b/docs/apis/rust/0.7.0/mentat_query_projector/aggregates/enum.SimpleAggregationOp.html new file mode 100644 index 00000000..47a2db05 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/aggregates/enum.SimpleAggregationOp.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_projector/enum.SimpleAggregationOp.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/bail.m.html b/docs/apis/rust/0.7.0/mentat_query_projector/bail.m.html new file mode 100644 index 00000000..6a9910ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/bail.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.bail.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/enum.QueryResults.html b/docs/apis/rust/0.7.0/mentat_query_projector/enum.QueryResults.html new file mode 100644 index 00000000..0b961a3b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/enum.QueryResults.html @@ -0,0 +1,153 @@ + + + + + + + + + + mentat_query_projector::QueryResults - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_projector::QueryResults + + [] + + [src]

pub enum QueryResults {
+    Scalar(Option<Binding>),
+    Tuple(Option<Vec<Binding>>),
+    Coll(Vec<Binding>),
+    Rel(RelResult<Binding>),
+}

+ Variants

+ +

+ Methods +

+

impl QueryResults
[src]

+

+ Trait Implementations +

+
+

impl Clone for QueryResults
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for QueryResults
[src]

Formats the value using the given formatter. Read more

+

impl PartialEq for QueryResults
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for QueryResults
[src]

impl From<QueryOutput> for QueryResults
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl Send for QueryResults

impl Sync for QueryResults

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/enum.SimpleAggregationOp.html b/docs/apis/rust/0.7.0/mentat_query_projector/enum.SimpleAggregationOp.html new file mode 100644 index 00000000..81776f95 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/enum.SimpleAggregationOp.html @@ -0,0 +1,149 @@ + + + + + + + + + + mentat_query_projector::SimpleAggregationOp - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_projector::SimpleAggregationOp + + [] + + [src]

pub enum SimpleAggregationOp {
+    Avg,
+    Count,
+    Max,
+    Min,
+    Sum,
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Clone for SimpleAggregationOp
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Copy for SimpleAggregationOp
[src]

impl Debug for SimpleAggregationOp
[src]

Formats the value using the given formatter. Read more

+

impl Eq for SimpleAggregationOp
[src]

impl PartialEq for SimpleAggregationOp
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/errors/ProjectorError.t.html b/docs/apis/rust/0.7.0/mentat_query_projector/errors/ProjectorError.t.html new file mode 100644 index 00000000..7f986c6e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/errors/ProjectorError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.ProjectorError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/errors/Result.t.html b/docs/apis/rust/0.7.0/mentat_query_projector/errors/Result.t.html new file mode 100644 index 00000000..865910f9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/errors/Result.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Result.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/errors/enum.ProjectorError.html b/docs/apis/rust/0.7.0/mentat_query_projector/errors/enum.ProjectorError.html new file mode 100644 index 00000000..7d04dbe7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/errors/enum.ProjectorError.html @@ -0,0 +1,157 @@ + + + + + + + + + + mentat_query_projector::errors::ProjectorError - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_projector::errors::ProjectorError + + [] + + [src]

pub enum ProjectorError {
+    NotYetImplemented(String),
+    CannotProjectImpossibleBinding(SimpleAggregationOp),
+    CannotApplyAggregateOperationToTypes(SimpleAggregationOpValueTypeSet),
+    InvalidProjection(String),
+    UnboundVariable(PlainSymbol),
+    NoTypeAvailableForVariable(PlainSymbol),
+    UnexpectedResultsType(&'static str, &'static str),
+    AmbiguousAggregates(usizeusize),
+}

+ Variants

+

We're just not done yet. Message that the feature is recognized but not yet +implemented.

+
+

+ Trait Implementations +

+
+

impl Debug for ProjectorError
[src]

Formats the value using the given formatter. Read more

+

impl Fail for ProjectorError
[src]

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

+

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

+

Provides context for this failure. Read more

+

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

+

Returns a iterator over the causes of this Fail with itself as the first item and the root_cause as the final item. Read more

+

Returns the "root cause" of this Fail - the last value in the cause chain which does not return an underlying cause. Read more

+

impl Display for ProjectorError
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/errors/index.html b/docs/apis/rust/0.7.0/mentat_query_projector/errors/index.html new file mode 100644 index 00000000..b73d3754 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/errors/index.html @@ -0,0 +1,142 @@ + + + + + + + + + + mentat_query_projector::errors - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_query_projector::errors + + [] + + [src]

Enums

+ + + + +
ProjectorError + +

Type Definitions

+ + + + +
Result + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/errors/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_query_projector/errors/sidebar-items.js new file mode 100644 index 00000000..add0aa11 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/errors/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["ProjectorError",""]],"type":[["Result",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/errors/type.Result.html b/docs/apis/rust/0.7.0/mentat_query_projector/errors/type.Result.html new file mode 100644 index 00000000..1a81c4bd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/errors/type.Result.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_query_projector::errors::Result - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_query_projector::errors::Result + + [] + + [src]

type Result<T> = Result<T, Error>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/fn.projected_column_for_var.html b/docs/apis/rust/0.7.0/mentat_query_projector/fn.projected_column_for_var.html new file mode 100644 index 00000000..b153f545 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/fn.projected_column_for_var.html @@ -0,0 +1,129 @@ + + + + + + + + + + mentat_query_projector::projected_column_for_var - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_query_projector::projected_column_for_var + + [] + + [src]

pub fn projected_column_for_var(
    var: &Variable,
    cc: &ConjoiningClauses
) -> Result<(ProjectedColumn, ValueTypeSet)>

Return the projected column -- that is, a value or SQL column and an associated name -- for a +given variable. Also return the type. +Callers are expected to determine whether to project a type tag as an additional SQL column.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/fn.query_projection.html b/docs/apis/rust/0.7.0/mentat_query_projector/fn.query_projection.html new file mode 100644 index 00000000..cd373ed8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/fn.query_projection.html @@ -0,0 +1,136 @@ + + + + + + + + + + mentat_query_projector::query_projection - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_query_projector::query_projection + + [] + + [src]

pub fn query_projection(
    schema: &Schema,
    query: &AlgebraicQuery
) -> Result<Either<ConstantProjector, CombinedProjection>>

Compute a suitable SQL projection for an algebrized query. +This takes into account a number of things:

+
    +
  • The variable list in the find spec.
  • +
  • The presence of any aggregate operations in the find spec. TODO: for now we only handle +simple variables
  • +
  • The bindings established by the topmost CC.
  • +
  • The types known at algebrizing time.
  • +
  • The types extracted from the store for unknown attributes.
  • +
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/index.html b/docs/apis/rust/0.7.0/mentat_query_projector/index.html new file mode 100644 index 00000000..9f33f242 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/index.html @@ -0,0 +1,228 @@ + + + + + + + + + + mentat_query_projector - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Crate mentat_query_projector + + [] + + [src]

Modules

+ + + + +
errors + +

Macros

+ + + + +
bail + +

Structs

+ + + + + + + + + + + + + + + + +
CombinedProjection +

Combines the things you need to turn a query into SQL and turn its results into +QueryResults: SQL-related projection information (DISTINCT, columns, etc.) and +a Datalog projector that turns SQL into structures.

+ +
ConstantProjector +

A projector that produces a QueryResult containing fixed data. +Takes a boxed function that should return an empty result set of the desired type.

+ +
QueryOutput + +
RelResult +

The result you get from a 'rel' query, like:

+ +

Enums

+ + + + + + + + +
QueryResults + +
SimpleAggregationOp + +

Traits

+ + + + +
Projector + +

Functions

+ + + + + + + + +
projected_column_for_var +

Return the projected column -- that is, a value or SQL column and an associated name -- for a +given variable. Also return the type. +Callers are expected to determine whether to project a type tag as an additional SQL column.

+ +
query_projection +

Compute a suitable SQL projection for an algebrized query. +This takes into account a number of things:

+ +

Type Definitions

+ + + + +
StructuredRelResult + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/macro.bail!.html b/docs/apis/rust/0.7.0/mentat_query_projector/macro.bail!.html new file mode 100644 index 00000000..6a9910ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/macro.bail!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.bail.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/macro.bail.html b/docs/apis/rust/0.7.0/mentat_query_projector/macro.bail.html new file mode 100644 index 00000000..e30c9ced --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/macro.bail.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_query_projector::bail - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_query_projector::bail + + [] + + [src]

+macro_rules! bail {
+    ($e:expr) => { ... };
+}
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/project/fn.projected_column_for_var.html b/docs/apis/rust/0.7.0/mentat_query_projector/project/fn.projected_column_for_var.html new file mode 100644 index 00000000..3082dfa7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/project/fn.projected_column_for_var.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_projector/fn.projected_column_for_var.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/project/projected_column_for_var.v.html b/docs/apis/rust/0.7.0/mentat_query_projector/project/projected_column_for_var.v.html new file mode 100644 index 00000000..4f148419 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/project/projected_column_for_var.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.projected_column_for_var.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/projected_column_for_var.v.html b/docs/apis/rust/0.7.0/mentat_query_projector/projected_column_for_var.v.html new file mode 100644 index 00000000..4f148419 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/projected_column_for_var.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.projected_column_for_var.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/projectors/Projector.t.html b/docs/apis/rust/0.7.0/mentat_query_projector/projectors/Projector.t.html new file mode 100644 index 00000000..af8ffa93 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/projectors/Projector.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.Projector.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/projectors/constant/ConstantProjector.t.html b/docs/apis/rust/0.7.0/mentat_query_projector/projectors/constant/ConstantProjector.t.html new file mode 100644 index 00000000..1a64ab86 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/projectors/constant/ConstantProjector.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ConstantProjector.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/projectors/constant/struct.ConstantProjector.html b/docs/apis/rust/0.7.0/mentat_query_projector/projectors/constant/struct.ConstantProjector.html new file mode 100644 index 00000000..71a7f78c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/projectors/constant/struct.ConstantProjector.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../mentat_query_projector/struct.ConstantProjector.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/projectors/trait.Projector.html b/docs/apis/rust/0.7.0/mentat_query_projector/projectors/trait.Projector.html new file mode 100644 index 00000000..325ff69c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/projectors/trait.Projector.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_projector/trait.Projector.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/query_projection.v.html b/docs/apis/rust/0.7.0/mentat_query_projector/query_projection.v.html new file mode 100644 index 00000000..f65b797e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/query_projection.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_projection.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/relresult/RelResult.t.html b/docs/apis/rust/0.7.0/mentat_query_projector/relresult/RelResult.t.html new file mode 100644 index 00000000..28847dea --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/relresult/RelResult.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.RelResult.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/relresult/StructuredRelResult.t.html b/docs/apis/rust/0.7.0/mentat_query_projector/relresult/StructuredRelResult.t.html new file mode 100644 index 00000000..ad1b7708 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/relresult/StructuredRelResult.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.StructuredRelResult.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/relresult/struct.RelResult.html b/docs/apis/rust/0.7.0/mentat_query_projector/relresult/struct.RelResult.html new file mode 100644 index 00000000..42bf6dcf --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/relresult/struct.RelResult.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_projector/struct.RelResult.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/relresult/type.StructuredRelResult.html b/docs/apis/rust/0.7.0/mentat_query_projector/relresult/type.StructuredRelResult.html new file mode 100644 index 00000000..be827e11 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/relresult/type.StructuredRelResult.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_projector/type.StructuredRelResult.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_query_projector/sidebar-items.js new file mode 100644 index 00000000..e75c8dee --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["QueryResults",""],["SimpleAggregationOp",""]],"fn":[["projected_column_for_var","Return the projected column -- that is, a value or SQL column and an associated name -- for a given variable. Also return the type. Callers are expected to determine whether to project a type tag as an additional SQL column."],["query_projection","Compute a suitable SQL projection for an algebrized query. This takes into account a number of things: - The variable list in the find spec. - The presence of any aggregate operations in the find spec. TODO: for now we only handle simple variables - The bindings established by the topmost CC. - The types known at algebrizing time. - The types extracted from the store for unknown attributes."]],"macro":[["bail",""]],"mod":[["errors",""]],"struct":[["CombinedProjection","Combines the things you need to turn a query into SQL and turn its results into `QueryResults`: SQL-related projection information (`DISTINCT`, columns, etc.) and a Datalog projector that turns SQL into structures."],["ConstantProjector","A projector that produces a `QueryResult` containing fixed data. Takes a boxed function that should return an empty result set of the desired type."],["QueryOutput",""],["RelResult","The result you get from a 'rel' query, like:"]],"trait":[["Projector",""]],"type":[["StructuredRelResult",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/struct.CombinedProjection.html b/docs/apis/rust/0.7.0/mentat_query_projector/struct.CombinedProjection.html new file mode 100644 index 00000000..30b5f8c8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/struct.CombinedProjection.html @@ -0,0 +1,179 @@ + + + + + + + + + + mentat_query_projector::CombinedProjection - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_projector::CombinedProjection + + [] + + [src]

pub struct CombinedProjection {
+    pub sql_projection: Projection,
+    pub pre_aggregate_projection: Option<Projection>,
+    pub datalog_projector: Box<Projector>,
+    pub distinct: bool,
+    pub group_by_cols: Vec<GroupBy>,
+}

Combines the things you need to turn a query into SQL and turn its results into +QueryResults: SQL-related projection information (DISTINCT, columns, etc.) and +a Datalog projector that turns SQL into structures.

+

+ Fields

+ +

A SQL projection, mapping columns mentioned in the body of the query to columns in the +output.

+
+ +

If a query contains aggregates, we need to generate a nested subquery: an inner query +that returns our distinct variable bindings (and any :with vars), and an outer query +that applies aggregation. That's so we can put DISTINCT in the inner query and apply +aggregation afterwards -- SELECT DISTINCT count(foo) counts then uniques, and we need +the opposite to implement Datalog distinct semantics. +If this is the case, sql_projection will be the outer query's projection list, and +pre_aggregate_projection will be the inner. +If the query doesn't use aggregation, this field will be None.

+
+ +

A Datalog projection. This consumes rows of the appropriate shape (as defined by +the SQL projection) to yield one of the four kinds of Datalog query result.

+
+ +

True if this query requires the SQL query to include DISTINCT.

+
+ + +

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/struct.ConstantProjector.html b/docs/apis/rust/0.7.0/mentat_query_projector/struct.ConstantProjector.html new file mode 100644 index 00000000..90e15cf7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/struct.ConstantProjector.html @@ -0,0 +1,142 @@ + + + + + + + + + + mentat_query_projector::ConstantProjector - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_projector::ConstantProjector + + [] + + [src]

pub struct ConstantProjector { /* fields omitted */ }

A projector that produces a QueryResult containing fixed data. +Takes a boxed function that should return an empty result set of the desired type.

+
+

+ Methods +

+

impl ConstantProjector
[src]

+

+ Trait Implementations +

+
+

impl Projector for ConstantProjector
[src]

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/struct.QueryOutput.html b/docs/apis/rust/0.7.0/mentat_query_projector/struct.QueryOutput.html new file mode 100644 index 00000000..fea7bf20 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/struct.QueryOutput.html @@ -0,0 +1,156 @@ + + + + + + + + + + mentat_query_projector::QueryOutput - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_projector::QueryOutput + + [] + + [src]

pub struct QueryOutput {
+    pub spec: Rc<FindSpec>,
+    pub results: QueryResults,
+}

+ Fields

+ + + + +

+ Methods +

+

impl QueryOutput
[src]

+

+ Trait Implementations +

+
+

impl Debug for QueryOutput
[src]

Formats the value using the given formatter. Read more

+

impl PartialEq for QueryOutput
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for QueryOutput
[src]

impl From<QueryOutput> for QueryResults
[src]

Performs the conversion.

+
+

+ Auto Trait Implementations +

+
+

impl !Send for QueryOutput

impl !Sync for QueryOutput

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/struct.RelResult.html b/docs/apis/rust/0.7.0/mentat_query_projector/struct.RelResult.html new file mode 100644 index 00000000..c661dcee --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/struct.RelResult.html @@ -0,0 +1,183 @@ + + + + + + + + + + mentat_query_projector::RelResult - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_projector::RelResult + + [] + + [src]

pub struct RelResult<T> {
+    pub width: usize,
+    pub values: Vec<T>,
+}

The result you get from a 'rel' query, like:

+
[:find ?person ?name
+ :where [?person :person/name ?name]]
+
+

There are three ways to get data out of a RelResult:

+
    +
  • By iterating over rows as slices. Use result.rows(). This is efficient and is +recommended in two cases: +
      +
    1. If you don't need to take ownership of the resulting values (e.g., you're comparing +or making a modified clone).
    2. +
    3. When the data you're retrieving is cheap to clone. All scalar values are relatively +cheap: they're either small values or Rc.
    4. +
    +
  • +
  • By direct reference to a row by index, using result.row(i). This also returns +a reference.
  • +
  • By consuming the results using into_iter. This allocates short-lived vectors, +but gives you ownership of the enclosed TypedValues.
  • +
+

+ Fields

+ + + + +

+ Methods +

+

impl<T> RelResult<T>
[src]

+

+ Trait Implementations +

+
+

impl<T: Clone> Clone for RelResult<T>
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl<T: Debug> Debug for RelResult<T>
[src]

Formats the value using the given formatter. Read more

+

impl<T: PartialEq> PartialEq for RelResult<T>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl<T: Eq> Eq for RelResult<T>
[src]

impl From<Vec<Vec<TypedValue>>> for RelResult<Binding>
[src]

Performs the conversion.

+

impl<T> IntoIterator for RelResult<T>
[src]

+

The type of the elements being iterated over.

+

+

Which kind of iterator are we turning this into?

+

Creates an iterator from a value. Read more

+
+

+ Auto Trait Implementations +

+
+

impl<T> Send for RelResult<T> where
    T: Send

impl<T> Sync for RelResult<T> where
    T: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/trait.Projector.html b/docs/apis/rust/0.7.0/mentat_query_projector/trait.Projector.html new file mode 100644 index 00000000..04a78844 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/trait.Projector.html @@ -0,0 +1,142 @@ + + + + + + + + + + mentat_query_projector::Projector - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_query_projector::Projector + + [] + + [src]

pub trait Projector {
+    fn project<'stmt, 's>(
        &self,
        schema: &Schema,
        sqlite: &'s Connection,
        rows: Rows<'stmt>
    ) -> Result<QueryOutput>; +
fn columns<'s>(&'s self) -> Box<Iterator<Item = &Element> + 's>; +}
+

+ Required Methods +

+
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_projector/type.StructuredRelResult.html b/docs/apis/rust/0.7.0/mentat_query_projector/type.StructuredRelResult.html new file mode 100644 index 00000000..8e2ca03b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_projector/type.StructuredRelResult.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_query_projector::StructuredRelResult - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_query_projector::StructuredRelResult + + [] + + [src]

type StructuredRelResult = RelResult<Binding>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_pull/Puller.t.html b/docs/apis/rust/0.7.0/mentat_query_pull/Puller.t.html new file mode 100644 index 00000000..4d5fd810 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_pull/Puller.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Puller.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_pull/errors/PullError.t.html b/docs/apis/rust/0.7.0/mentat_query_pull/errors/PullError.t.html new file mode 100644 index 00000000..d8aaffbc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_pull/errors/PullError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.PullError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_pull/errors/Result.t.html b/docs/apis/rust/0.7.0/mentat_query_pull/errors/Result.t.html new file mode 100644 index 00000000..865910f9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_pull/errors/Result.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Result.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_pull/errors/enum.PullError.html b/docs/apis/rust/0.7.0/mentat_query_pull/errors/enum.PullError.html new file mode 100644 index 00000000..130b7e65 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_pull/errors/enum.PullError.html @@ -0,0 +1,149 @@ + + + + + + + + + + mentat_query_pull::errors::PullError - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_pull::errors::PullError + + [] + + [src]

pub enum PullError {
+    UnnamedAttribute(Entid),
+    RepeatedDbId,
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Debug for PullError
[src]

Formats the value using the given formatter. Read more

+

impl Fail for PullError
[src]

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

+

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

+

Provides context for this failure. Read more

+

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

+

Returns a iterator over the causes of this Fail with itself as the first item and the root_cause as the final item. Read more

+

Returns the "root cause" of this Fail - the last value in the cause chain which does not return an underlying cause. Read more

+

impl Display for PullError
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for PullError

impl Sync for PullError

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_pull/errors/index.html b/docs/apis/rust/0.7.0/mentat_query_pull/errors/index.html new file mode 100644 index 00000000..349b800e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_pull/errors/index.html @@ -0,0 +1,142 @@ + + + + + + + + + + mentat_query_pull::errors - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_query_pull::errors + + [] + + [src]

Enums

+ + + + +
PullError + +

Type Definitions

+ + + + +
Result + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_pull/errors/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_query_pull/errors/sidebar-items.js new file mode 100644 index 00000000..2bf00c85 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_pull/errors/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["PullError",""]],"type":[["Result",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_pull/errors/type.Result.html b/docs/apis/rust/0.7.0/mentat_query_pull/errors/type.Result.html new file mode 100644 index 00000000..bc352b17 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_pull/errors/type.Result.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_query_pull::errors::Result - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_query_pull::errors::Result + + [] + + [src]

type Result<T> = Result<T, Error>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_pull/fn.pull_attributes_for_entities.html b/docs/apis/rust/0.7.0/mentat_query_pull/fn.pull_attributes_for_entities.html new file mode 100644 index 00000000..c8cb69be --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_pull/fn.pull_attributes_for_entities.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_query_pull::pull_attributes_for_entities - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_query_pull::pull_attributes_for_entities + + [] + + [src]

pub fn pull_attributes_for_entities<E, A>(
    schema: &Schema,
    db: &Connection,
    entities: E,
    attributes: A
) -> Result<BTreeMap<Entid, ValueRc<StructuredMap>>> where
    E: IntoIterator<Item = Entid>,
    A: IntoIterator<Item = Entid>, 
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_pull/fn.pull_attributes_for_entity.html b/docs/apis/rust/0.7.0/mentat_query_pull/fn.pull_attributes_for_entity.html new file mode 100644 index 00000000..1b7615b5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_pull/fn.pull_attributes_for_entity.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_query_pull::pull_attributes_for_entity - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_query_pull::pull_attributes_for_entity + + [] + + [src]

pub fn pull_attributes_for_entity<A>(
    schema: &Schema,
    db: &Connection,
    entity: Entid,
    attributes: A
) -> Result<StructuredMap> where
    A: IntoIterator<Item = Entid>, 
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_pull/index.html b/docs/apis/rust/0.7.0/mentat_query_pull/index.html new file mode 100644 index 00000000..78e6ca3b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_pull/index.html @@ -0,0 +1,158 @@ + + + + + + + + + + mentat_query_pull - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Crate mentat_query_pull + + [] + + [src]

Modules

+ + + + +
errors + +

Structs

+ + + + +
Puller +

A Puller constructs on demand a map from a provided set of entity IDs to a set of structured maps.

+ +

Functions

+ + + + + + + + +
pull_attributes_for_entities + +
pull_attributes_for_entity + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_pull/pull_attributes_for_entities.v.html b/docs/apis/rust/0.7.0/mentat_query_pull/pull_attributes_for_entities.v.html new file mode 100644 index 00000000..f54abbc2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_pull/pull_attributes_for_entities.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.pull_attributes_for_entities.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_pull/pull_attributes_for_entity.v.html b/docs/apis/rust/0.7.0/mentat_query_pull/pull_attributes_for_entity.v.html new file mode 100644 index 00000000..7bbeaaf8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_pull/pull_attributes_for_entity.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.pull_attributes_for_entity.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_pull/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_query_pull/sidebar-items.js new file mode 100644 index 00000000..530a5a08 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_pull/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"fn":[["pull_attributes_for_entities",""],["pull_attributes_for_entity",""]],"mod":[["errors",""]],"struct":[["Puller","A `Puller` constructs on demand a map from a provided set of entity IDs to a set of structured maps."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_pull/struct.Puller.html b/docs/apis/rust/0.7.0/mentat_query_pull/struct.Puller.html new file mode 100644 index 00000000..033a391f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_pull/struct.Puller.html @@ -0,0 +1,141 @@ + + + + + + + + + + mentat_query_pull::Puller - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_pull::Puller + + [] + + [src]

pub struct Puller { /* fields omitted */ }

A Puller constructs on demand a map from a provided set of entity IDs to a set of structured maps.

+
+

+ Methods +

+

impl Puller
[src]

+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl Send for Puller

impl Sync for Puller

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/ColumnOrExpression.t.html b/docs/apis/rust/0.7.0/mentat_query_sql/ColumnOrExpression.t.html new file mode 100644 index 00000000..64f8c8fa --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/ColumnOrExpression.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.ColumnOrExpression.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/Constraint.t.html b/docs/apis/rust/0.7.0/mentat_query_sql/Constraint.t.html new file mode 100644 index 00000000..ca86f443 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/Constraint.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Constraint.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/Expression.t.html b/docs/apis/rust/0.7.0/mentat_query_sql/Expression.t.html new file mode 100644 index 00000000..bc50d850 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/Expression.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Expression.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/FromClause.t.html b/docs/apis/rust/0.7.0/mentat_query_sql/FromClause.t.html new file mode 100644 index 00000000..b1b00498 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/FromClause.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.FromClause.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/GroupBy.t.html b/docs/apis/rust/0.7.0/mentat_query_sql/GroupBy.t.html new file mode 100644 index 00000000..2fbf0bd5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/GroupBy.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.GroupBy.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/Join.t.html b/docs/apis/rust/0.7.0/mentat_query_sql/Join.t.html new file mode 100644 index 00000000..57c8be49 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/Join.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Join.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/Name.t.html b/docs/apis/rust/0.7.0/mentat_query_sql/Name.t.html new file mode 100644 index 00000000..b14bdfe2 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/Name.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Name.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/Op.t.html b/docs/apis/rust/0.7.0/mentat_query_sql/Op.t.html new file mode 100644 index 00000000..b788c57f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/Op.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Op.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/ProjectedColumn.t.html b/docs/apis/rust/0.7.0/mentat_query_sql/ProjectedColumn.t.html new file mode 100644 index 00000000..f167cbce --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/ProjectedColumn.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.ProjectedColumn.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/Projection.t.html b/docs/apis/rust/0.7.0/mentat_query_sql/Projection.t.html new file mode 100644 index 00000000..6249b5ea --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/Projection.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Projection.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/SelectQuery.t.html b/docs/apis/rust/0.7.0/mentat_query_sql/SelectQuery.t.html new file mode 100644 index 00000000..f4d96905 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/SelectQuery.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.SelectQuery.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/TableList.t.html b/docs/apis/rust/0.7.0/mentat_query_sql/TableList.t.html new file mode 100644 index 00000000..0a7067b4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/TableList.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.TableList.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/TableOrSubquery.t.html b/docs/apis/rust/0.7.0/mentat_query_sql/TableOrSubquery.t.html new file mode 100644 index 00000000..99e424d0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/TableOrSubquery.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.TableOrSubquery.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/Values.t.html b/docs/apis/rust/0.7.0/mentat_query_sql/Values.t.html new file mode 100644 index 00000000..5d853a27 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/Values.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Values.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/enum.ColumnOrExpression.html b/docs/apis/rust/0.7.0/mentat_query_sql/enum.ColumnOrExpression.html new file mode 100644 index 00000000..945891b5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/enum.ColumnOrExpression.html @@ -0,0 +1,154 @@ + + + + + + + + + + mentat_query_sql::ColumnOrExpression - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_sql::ColumnOrExpression + + [] + + [src]

pub enum ColumnOrExpression {
+    Column(QualifiedAlias),
+    ExistingColumn(Name),
+    Entid(Entid),
+    Integer(i32),
+    Long(i64),
+    Value(TypedValue),
+    NullableAggregate(Box<Expression>, ValueType),
+    Expression(Box<Expression>, ValueType),
+}

One of the things that can appear in a projection or a constraint. Note that we use +TypedValue here; it's not pure SQL, but it avoids us having to concern ourselves at this +point with the translation between a TypedValue and the storage-layer representation.

+

Eventually we might allow different translations by providing a different QueryBuilder +implementation for each storage backend. Passing TypedValues here allows for that.

+

+ Variants

+ +

+ Trait Implementations +

+
+

impl From<QueryValue> for ColumnOrExpression
[src]

QueryValue and ColumnOrExpression are almost identical… merge somehow?

+

Performs the conversion.

+

impl QueryFragment for ColumnOrExpression
[src]

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/enum.Constraint.html b/docs/apis/rust/0.7.0/mentat_query_sql/enum.Constraint.html new file mode 100644 index 00000000..6a8d01d1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/enum.Constraint.html @@ -0,0 +1,187 @@ + + + + + + + + + + mentat_query_sql::Constraint - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_sql::Constraint + + [] + + [src]

pub enum Constraint {
+    Infix {
+        op: Op,
+        left: ColumnOrExpression,
+        right: ColumnOrExpression,
+    },
+    Or {
+        constraints: Vec<Constraint>,
+    },
+    And {
+        constraints: Vec<Constraint>,
+    },
+    In {
+        left: ColumnOrExpression,
+        list: Vec<ColumnOrExpression>,
+    },
+    IsNull {
+        value: ColumnOrExpression,
+    },
+    IsNotNull {
+        value: ColumnOrExpression,
+    },
+    NotExists {
+        subquery: TableOrSubquery,
+    },
+    TypeCheck {
+        value: ColumnOrExpression,
+        affinity: SQLTypeAffinity,
+    },
+}

+ Variants

+

Fields of Infix

+ +

Fields of Or

+ +

Fields of And

+ +

Fields of In

+ +

Fields of IsNull

+ +

Fields of IsNotNull

+ +

Fields of NotExists

+ +

Fields of TypeCheck

+ +
+

+ Methods +

+

impl Constraint
[src]

+

+ Trait Implementations +

+
+

impl QueryFragment for Constraint
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for Constraint

impl !Sync for Constraint

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/enum.Expression.html b/docs/apis/rust/0.7.0/mentat_query_sql/enum.Expression.html new file mode 100644 index 00000000..a8f6594d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/enum.Expression.html @@ -0,0 +1,145 @@ + + + + + + + + + + mentat_query_sql::Expression - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_sql::Expression + + [] + + [src]

pub enum Expression {
+    Unary {
+        sql_op: &'static str,
+        arg: ColumnOrExpression,
+    },
+}

+ Variants

+

Fields of Unary

+ +
+

+ Trait Implementations +

+
+

impl QueryFragment for Expression
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for Expression

impl !Sync for Expression

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/enum.FromClause.html b/docs/apis/rust/0.7.0/mentat_query_sql/enum.FromClause.html new file mode 100644 index 00000000..f8174bc9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/enum.FromClause.html @@ -0,0 +1,142 @@ + + + + + + + + + + mentat_query_sql::FromClause - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_sql::FromClause + + [] + + [src]

pub enum FromClause {
+    TableList(TableList),
+    Join(Join),
+    Nothing,
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl QueryFragment for FromClause
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for FromClause

impl !Sync for FromClause

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/enum.GroupBy.html b/docs/apis/rust/0.7.0/mentat_query_sql/enum.GroupBy.html new file mode 100644 index 00000000..23979076 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/enum.GroupBy.html @@ -0,0 +1,144 @@ + + + + + + + + + + mentat_query_sql::GroupBy - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_sql::GroupBy + + [] + + [src]

pub enum GroupBy {
+    ProjectedColumn(Name),
+    QueryColumn(QualifiedAlias),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Debug for GroupBy
[src]

Formats the value using the given formatter. Read more

+

impl PartialEq for GroupBy
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+

impl Eq for GroupBy
[src]

impl QueryFragment for GroupBy
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for GroupBy

impl !Sync for GroupBy

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/enum.Projection.html b/docs/apis/rust/0.7.0/mentat_query_sql/enum.Projection.html new file mode 100644 index 00000000..62a89af4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/enum.Projection.html @@ -0,0 +1,142 @@ + + + + + + + + + + mentat_query_sql::Projection - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_sql::Projection + + [] + + [src]

pub enum Projection {
+    Columns(Vec<ProjectedColumn>),
+    Star,
+    One,
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl QueryFragment for Projection
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for Projection

impl !Sync for Projection

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/enum.TableOrSubquery.html b/docs/apis/rust/0.7.0/mentat_query_sql/enum.TableOrSubquery.html new file mode 100644 index 00000000..e5748e1f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/enum.TableOrSubquery.html @@ -0,0 +1,143 @@ + + + + + + + + + + mentat_query_sql::TableOrSubquery - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_sql::TableOrSubquery + + [] + + [src]

pub enum TableOrSubquery {
+    Table(SourceAlias),
+    Union(Vec<SelectQuery>, TableAlias),
+    Subquery(Box<SelectQuery>),
+    Values(ValuesTableAlias),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl QueryFragment for TableOrSubquery
[src]

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/enum.Values.html b/docs/apis/rust/0.7.0/mentat_query_sql/enum.Values.html new file mode 100644 index 00000000..fb46e395 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/enum.Values.html @@ -0,0 +1,146 @@ + + + + + + + + + + mentat_query_sql::Values - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_sql::Values + + [] + + [src]

pub enum Values {
+    Unnamed(usizeVec<TypedValue>),
+    Named(Vec<Variable>, Vec<TypedValue>),
+}

+ Variants

+

Like "VALUES (0, 1), (2, 3), ...". +The vector must be of a length that is a multiple of the given size.

+

Like "SELECT 0 AS x, SELECT 0 AS y WHERE 0 UNION ALL VALUES (0, 1), (2, 3), ...". +The vector of values must be of a length that is a multiple of the length +of the vector of names.

+
+

+ Trait Implementations +

+
+

impl QueryFragment for Values
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for Values

impl !Sync for Values

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/index.html b/docs/apis/rust/0.7.0/mentat_query_sql/index.html new file mode 100644 index 00000000..4886d167 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/index.html @@ -0,0 +1,230 @@ + + + + + + + + + + mentat_query_sql - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Crate mentat_query_sql + + [] + + [src]

Structs

+ + + + + + + + + + + + + + + + + + + + +
Join + +
Op + +
ProjectedColumn + +
SelectQuery + +
TableList + +

Enums

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ColumnOrExpression +

One of the things that can appear in a projection or a constraint. Note that we use +TypedValue here; it's not pure SQL, but it avoids us having to concern ourselves at this +point with the translation between a TypedValue and the storage-layer representation.

+ +
Constraint + +
Expression + +
FromClause + +
GroupBy + +
Projection + +
TableOrSubquery + +
Values + +

Type Definitions

+ + + + +
Name + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_query_sql/sidebar-items.js new file mode 100644 index 00000000..0425ea54 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["ColumnOrExpression","One of the things that can appear in a projection or a constraint. Note that we use `TypedValue` here; it's not pure SQL, but it avoids us having to concern ourselves at this point with the translation between a `TypedValue` and the storage-layer representation."],["Constraint",""],["Expression",""],["FromClause",""],["GroupBy",""],["Projection",""],["TableOrSubquery",""],["Values",""]],"struct":[["Join",""],["Op",""],["ProjectedColumn",""],["SelectQuery",""],["TableList",""]],"type":[["Name",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/struct.Join.html b/docs/apis/rust/0.7.0/mentat_query_sql/struct.Join.html new file mode 100644 index 00000000..8a41d85c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/struct.Join.html @@ -0,0 +1,136 @@ + + + + + + + + + + mentat_query_sql::Join - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_sql::Join + + [] + + [src]

pub struct Join { /* fields omitted */ }
+

+ Trait Implementations +

+
+

impl QueryFragment for Join
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for Join

impl !Sync for Join

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/struct.Op.html b/docs/apis/rust/0.7.0/mentat_query_sql/struct.Op.html new file mode 100644 index 00000000..bade17af --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/struct.Op.html @@ -0,0 +1,138 @@ + + + + + + + + + + mentat_query_sql::Op - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_sql::Op + + [] + + [src]

pub struct Op(pub &'static str);
+

+ Trait Implementations +

+
+

impl Copy for Op
[src]

impl Clone for Op
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl QueryFragment for Op
[src]

+

+ Auto Trait Implementations +

+
+

impl Send for Op

impl Sync for Op

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/struct.ProjectedColumn.html b/docs/apis/rust/0.7.0/mentat_query_sql/struct.ProjectedColumn.html new file mode 100644 index 00000000..7db6d350 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/struct.ProjectedColumn.html @@ -0,0 +1,136 @@ + + + + + + + + + + mentat_query_sql::ProjectedColumn - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_sql::ProjectedColumn + + [] + + [src]

pub struct ProjectedColumn(pub ColumnOrExpression, pub Name);
+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/struct.SelectQuery.html b/docs/apis/rust/0.7.0/mentat_query_sql/struct.SelectQuery.html new file mode 100644 index 00000000..18cc7493 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/struct.SelectQuery.html @@ -0,0 +1,177 @@ + + + + + + + + + + mentat_query_sql::SelectQuery - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_sql::SelectQuery + + [] + + [src]

pub struct SelectQuery {
+    pub distinct: bool,
+    pub projection: Projection,
+    pub from: FromClause,
+    pub constraints: Vec<Constraint>,
+    pub group_by: Vec<GroupBy>,
+    pub order: Vec<OrderBy>,
+    pub limit: Limit,
+}

+ Fields

+ + + + + + + + + + + + + + +

+ Methods +

+

impl SelectQuery
[src]

+

+ Trait Implementations +

+
+

impl QueryFragment for SelectQuery
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for SelectQuery

impl !Sync for SelectQuery

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/struct.TableList.html b/docs/apis/rust/0.7.0/mentat_query_sql/struct.TableList.html new file mode 100644 index 00000000..1d72af7d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/struct.TableList.html @@ -0,0 +1,136 @@ + + + + + + + + + + mentat_query_sql::TableList - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_query_sql::TableList + + [] + + [src]

pub struct TableList(pub Vec<TableOrSubquery>);
+

+ Trait Implementations +

+
+

impl QueryFragment for TableList
[src]

+

+ Auto Trait Implementations +

+
+

impl !Send for TableList

impl !Sync for TableList

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_sql/type.Name.html b/docs/apis/rust/0.7.0/mentat_query_sql/type.Name.html new file mode 100644 index 00000000..030495bc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_sql/type.Name.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_query_sql::Name - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_query_sql::Name + + [] + + [src]

type Name = String;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_translator/ProjectedSelect.t.html b/docs/apis/rust/0.7.0/mentat_query_translator/ProjectedSelect.t.html new file mode 100644 index 00000000..3bbaf692 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_translator/ProjectedSelect.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.ProjectedSelect.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_translator/Projection.t.html b/docs/apis/rust/0.7.0/mentat_query_translator/Projection.t.html new file mode 100644 index 00000000..6249b5ea --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_translator/Projection.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Projection.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_translator/cc_to_exists.v.html b/docs/apis/rust/0.7.0/mentat_query_translator/cc_to_exists.v.html new file mode 100644 index 00000000..9abe4f27 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_translator/cc_to_exists.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.cc_to_exists.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_translator/enum.ProjectedSelect.html b/docs/apis/rust/0.7.0/mentat_query_translator/enum.ProjectedSelect.html new file mode 100644 index 00000000..dd391b9e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_translator/enum.ProjectedSelect.html @@ -0,0 +1,146 @@ + + + + + + + + + + mentat_query_translator::ProjectedSelect - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_translator::ProjectedSelect + + [] + + [src]

pub enum ProjectedSelect {
+    Constant(ConstantProjector),
+    Query {
+        query: SelectQuery,
+        projector: Box<Projector>,
+    },
+}

+ Variants

+

Fields of Query

+ +
+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_translator/enum.Projection.html b/docs/apis/rust/0.7.0/mentat_query_translator/enum.Projection.html new file mode 100644 index 00000000..91ec6d50 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_translator/enum.Projection.html @@ -0,0 +1,142 @@ + + + + + + + + + + mentat_query_translator::Projection - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_query_translator::Projection + + [] + + [src]

pub enum Projection {
+    Columns(Vec<ProjectedColumn>),
+    Star,
+    One,
+}

+ Variants

+ +

+ Trait Implementations +

+ +

+ Auto Trait Implementations +

+
+

impl !Send for Projection

impl !Sync for Projection

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_translator/fn.cc_to_exists.html b/docs/apis/rust/0.7.0/mentat_query_translator/fn.cc_to_exists.html new file mode 100644 index 00000000..4adaaada --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_translator/fn.cc_to_exists.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_query_translator::cc_to_exists - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_query_translator::cc_to_exists + + [] + + [src]

pub fn cc_to_exists(cc: ConjoiningClauses) -> SelectQuery

Return a query that projects 1 if the cc matches the store, and returns no results +if it doesn't.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_translator/fn.query_to_select.html b/docs/apis/rust/0.7.0/mentat_query_translator/fn.query_to_select.html new file mode 100644 index 00000000..f1d0e601 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_translator/fn.query_to_select.html @@ -0,0 +1,128 @@ + + + + + + + + + + mentat_query_translator::query_to_select - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_query_translator::query_to_select + + [] + + [src]

pub fn query_to_select(
    schema: &Schema,
    query: AlgebraicQuery
) -> Result<ProjectedSelect, Error>

Consume a provided AlgebraicQuery to yield a new +ProjectedSelect.

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_translator/index.html b/docs/apis/rust/0.7.0/mentat_query_translator/index.html new file mode 100644 index 00000000..40e3418d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_translator/index.html @@ -0,0 +1,160 @@ + + + + + + + + + + mentat_query_translator - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Crate mentat_query_translator + + [] + + [src]

Enums

+ + + + + + + + +
ProjectedSelect + +
Projection + +

Functions

+ + + + + + + + +
cc_to_exists +

Return a query that projects 1 if the cc matches the store, and returns no results +if it doesn't.

+ +
query_to_select +

Consume a provided AlgebraicQuery to yield a new +ProjectedSelect.

+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_translator/query_to_select.v.html b/docs/apis/rust/0.7.0/mentat_query_translator/query_to_select.v.html new file mode 100644 index 00000000..0da6b551 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_translator/query_to_select.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_to_select.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_translator/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_query_translator/sidebar-items.js new file mode 100644 index 00000000..228cdcc9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_translator/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["ProjectedSelect",""],["Projection",""]],"fn":[["cc_to_exists","Return a query that projects `1` if the `cc` matches the store, and returns no results if it doesn't."],["query_to_select","Consume a provided `AlgebraicQuery` to yield a new `ProjectedSelect`."]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_translator/translate/ProjectedSelect.t.html b/docs/apis/rust/0.7.0/mentat_query_translator/translate/ProjectedSelect.t.html new file mode 100644 index 00000000..3bbaf692 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_translator/translate/ProjectedSelect.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.ProjectedSelect.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_translator/translate/cc_to_exists.v.html b/docs/apis/rust/0.7.0/mentat_query_translator/translate/cc_to_exists.v.html new file mode 100644 index 00000000..9abe4f27 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_translator/translate/cc_to_exists.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.cc_to_exists.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_translator/translate/enum.ProjectedSelect.html b/docs/apis/rust/0.7.0/mentat_query_translator/translate/enum.ProjectedSelect.html new file mode 100644 index 00000000..a56cfc98 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_translator/translate/enum.ProjectedSelect.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_translator/enum.ProjectedSelect.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_translator/translate/fn.cc_to_exists.html b/docs/apis/rust/0.7.0/mentat_query_translator/translate/fn.cc_to_exists.html new file mode 100644 index 00000000..cb3e1a70 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_translator/translate/fn.cc_to_exists.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_translator/fn.cc_to_exists.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_translator/translate/fn.query_to_select.html b/docs/apis/rust/0.7.0/mentat_query_translator/translate/fn.query_to_select.html new file mode 100644 index 00000000..3e8435b9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_translator/translate/fn.query_to_select.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../mentat_query_translator/fn.query_to_select.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_query_translator/translate/query_to_select.v.html b/docs/apis/rust/0.7.0/mentat_query_translator/translate/query_to_select.v.html new file mode 100644 index 00000000..0da6b551 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_query_translator/translate/query_to_select.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.query_to_select.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_sql/BuildQueryResult.t.html b/docs/apis/rust/0.7.0/mentat_sql/BuildQueryResult.t.html new file mode 100644 index 00000000..a19369bc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_sql/BuildQueryResult.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.BuildQueryResult.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_sql/QueryBuilder.t.html b/docs/apis/rust/0.7.0/mentat_sql/QueryBuilder.t.html new file mode 100644 index 00000000..a2cc2d32 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_sql/QueryBuilder.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.QueryBuilder.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_sql/QueryFragment.t.html b/docs/apis/rust/0.7.0/mentat_sql/QueryFragment.t.html new file mode 100644 index 00000000..f4ee374a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_sql/QueryFragment.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.QueryFragment.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_sql/SQLError.t.html b/docs/apis/rust/0.7.0/mentat_sql/SQLError.t.html new file mode 100644 index 00000000..408ef955 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_sql/SQLError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.SQLError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_sql/SQLQuery.t.html b/docs/apis/rust/0.7.0/mentat_sql/SQLQuery.t.html new file mode 100644 index 00000000..8e72ae9c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_sql/SQLQuery.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.SQLQuery.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_sql/SQLiteQueryBuilder.t.html b/docs/apis/rust/0.7.0/mentat_sql/SQLiteQueryBuilder.t.html new file mode 100644 index 00000000..178c8ec1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_sql/SQLiteQueryBuilder.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.SQLiteQueryBuilder.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_sql/Value.t.html b/docs/apis/rust/0.7.0/mentat_sql/Value.t.html new file mode 100644 index 00000000..9d922157 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_sql/Value.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.Value.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_sql/enum.SQLError.html b/docs/apis/rust/0.7.0/mentat_sql/enum.SQLError.html new file mode 100644 index 00000000..16bc0b12 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_sql/enum.SQLError.html @@ -0,0 +1,149 @@ + + + + + + + + + + mentat_sql::SQLError - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_sql::SQLError + + [] + + [src]

pub enum SQLError {
+    InvalidParameterName(String),
+    BindParamCouldBeGenerated(String),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Debug for SQLError
[src]

Formats the value using the given formatter. Read more

+

impl Fail for SQLError
[src]

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

+

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

+

Provides context for this failure. Read more

+

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

+

Important traits for Causes<'f>

Returns a iterator over the causes of this Fail with itself as the first item and the root_cause as the final item. Read more

+

Returns the "root cause" of this Fail - the last value in the cause chain which does not return an underlying cause. Read more

+

impl Display for SQLError
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for SQLError

impl Sync for SQLError

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_sql/enum.Value.html b/docs/apis/rust/0.7.0/mentat_sql/enum.Value.html new file mode 100644 index 00000000..fcf1ba96 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_sql/enum.Value.html @@ -0,0 +1,176 @@ + + + + + + + + + + mentat_sql::Value - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_sql::Value + + [] + +

pub enum Value {
+    Null,
+    Integer(i64),
+    Real(f64),
+    Text(String),
+    Blob(Vec<u8>),
+}

Owning dynamic type value. Value's type is typically +dictated by SQLite (not by the caller).

+

See ValueRef for a non-owning dynamic type value.

+

+ Variants

+

The value is a NULL value.

+

The value is a signed integer.

+

The value is a floating point number.

+

The value is a text string.

+

The value is a blob of data

+
+

+ Methods +

+

impl Value

+

+ Trait Implementations +

+
+

impl Clone for Value

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

impl Debug for Value

Formats the value using the given formatter. Read more

+

impl FromSql for Value

impl ToSql for Value

impl From<i16> for Value

Performs the conversion.

+

impl From<isize> for Value

Performs the conversion.

+

impl From<bool> for Value

Performs the conversion.

+

impl<'a> From<&'a Value> for ValueRef<'a>

Performs the conversion.

+

impl From<i32> for Value

Performs the conversion.

+

impl From<Null> for Value

Performs the conversion.

+

impl From<i8> for Value

Performs the conversion.

+

impl From<u8> for Value

Performs the conversion.

+

impl From<Vec<u8>> for Value

Performs the conversion.

+

impl From<u16> for Value

Performs the conversion.

+

impl From<u32> for Value

Performs the conversion.

+

impl From<String> for Value

Performs the conversion.

+

impl From<i64> for Value

Performs the conversion.

+

impl<'a> From<ValueRef<'a>> for Value

Performs the conversion.

+

impl From<f64> for Value

Performs the conversion.

+

impl PartialEq<Value> for Value

This method tests for self and other values to be equal, and is used by ==. Read more

+

This method tests for !=.

+
+

+ Auto Trait Implementations +

+
+

impl Send for Value

impl Sync for Value

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_sql/index.html b/docs/apis/rust/0.7.0/mentat_sql/index.html new file mode 100644 index 00000000..c1b1dbf1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_sql/index.html @@ -0,0 +1,188 @@ + + + + + + + + + + mentat_sql - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Crate mentat_sql + + [] + + [src]

Structs

+ + + + + + + + +
SQLQuery +

We want to accumulate values that will later be substituted into a SQL statement execution. +This struct encapsulates the generated string and the initial argument list. +Additional user-supplied argument bindings, with their placeholders accumulated via +push_bind_param, will be appended to this argument list.

+ +
SQLiteQueryBuilder +

A QueryBuilder that implements SQLite's specific escaping rules.

+ +

Enums

+ + + + + + + + +
SQLError + +
Value +

Owning dynamic type value. Value's type is typically +dictated by SQLite (not by the caller).

+ +

Traits

+ + + + + + + + +
QueryBuilder +

Gratefully based on Diesel's QueryBuilder trait: +https://github.com/diesel-rs/diesel/blob/4885f61b8205f7f3c2cfa03837ed6714831abe6b/diesel/src/query_builder/mod.rs#L56

+ +
QueryFragment + +

Type Definitions

+ + + + +
BuildQueryResult + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_sql/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_sql/sidebar-items.js new file mode 100644 index 00000000..2ee2c3cd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_sql/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["SQLError",""],["Value","Owning dynamic type value. Value's type is typically dictated by SQLite (not by the caller)."]],"struct":[["SQLQuery","We want to accumulate values that will later be substituted into a SQL statement execution. This struct encapsulates the generated string and the initial argument list. Additional user-supplied argument bindings, with their placeholders accumulated via `push_bind_param`, will be appended to this argument list."],["SQLiteQueryBuilder","A QueryBuilder that implements SQLite's specific escaping rules."]],"trait":[["QueryBuilder","Gratefully based on Diesel's QueryBuilder trait: https://github.com/diesel-rs/diesel/blob/4885f61b8205f7f3c2cfa03837ed6714831abe6b/diesel/src/query_builder/mod.rs#L56"],["QueryFragment",""]],"type":[["BuildQueryResult",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_sql/struct.SQLQuery.html b/docs/apis/rust/0.7.0/mentat_sql/struct.SQLQuery.html new file mode 100644 index 00000000..81cc5a4f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_sql/struct.SQLQuery.html @@ -0,0 +1,153 @@ + + + + + + + + + + mentat_sql::SQLQuery - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_sql::SQLQuery + + [] + + [src]

pub struct SQLQuery {
+    pub sql: String,
+    pub args: Vec<(String, Rc<Value>)>,
+}

We want to accumulate values that will later be substituted into a SQL statement execution. +This struct encapsulates the generated string and the initial argument list. +Additional user-supplied argument bindings, with their placeholders accumulated via +push_bind_param, will be appended to this argument list.

+

+ Fields

+ + + +

These will eventually perhaps be rusqlite ToSql instances.

+
+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl !Send for SQLQuery

impl !Sync for SQLQuery

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_sql/struct.SQLiteQueryBuilder.html b/docs/apis/rust/0.7.0/mentat_sql/struct.SQLiteQueryBuilder.html new file mode 100644 index 00000000..4802d845 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_sql/struct.SQLiteQueryBuilder.html @@ -0,0 +1,155 @@ + + + + + + + + + + mentat_sql::SQLiteQueryBuilder - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_sql::SQLiteQueryBuilder + + [] + + [src]

pub struct SQLiteQueryBuilder {
+    pub sql: String,
+    // some fields omitted
+}

A QueryBuilder that implements SQLite's specific escaping rules.

+

+ Fields

+ + +

+ Methods +

+

impl SQLiteQueryBuilder
[src]

+

+ Trait Implementations +

+
+

impl QueryBuilder for SQLiteQueryBuilder
[src]

Our bind parameters will be interleaved with pushed TypedValue instances. That means we +need to use named parameters, not positional parameters. +The name argument to this method is expected to be alphanumeric. If not, this method +returns an InvalidParameterName error result. +Callers should make sure that the name doesn't overlap with generated parameter names. If +it does, BindParamCouldBeGenerated is the error.

+

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_sql/trait.QueryBuilder.html b/docs/apis/rust/0.7.0/mentat_sql/trait.QueryBuilder.html new file mode 100644 index 00000000..83f58ffc --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_sql/trait.QueryBuilder.html @@ -0,0 +1,147 @@ + + + + + + + + + + mentat_sql::QueryBuilder - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_sql::QueryBuilder + + [] + + [src]

pub trait QueryBuilder {
+    fn push_sql(&mut self, sql: &str);
+
fn push_identifier(&mut self, identifier: &str) -> BuildQueryResult; +
fn push_typed_value(&mut self, value: &TypedValue) -> BuildQueryResult; +
fn push_bind_param(&mut self, name: &str) -> BuildQueryResult; +
fn finish(self) -> SQLQuery; +}

Gratefully based on Diesel's QueryBuilder trait: +https://github.com/diesel-rs/diesel/blob/4885f61b8205f7f3c2cfa03837ed6714831abe6b/diesel/src/query_builder/mod.rs#L56

+
+

+ Required Methods +

+
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_sql/trait.QueryFragment.html b/docs/apis/rust/0.7.0/mentat_sql/trait.QueryFragment.html new file mode 100644 index 00000000..97491a1f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_sql/trait.QueryFragment.html @@ -0,0 +1,150 @@ + + + + + + + + + + mentat_sql::QueryFragment - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_sql::QueryFragment + + [] + + [src]

pub trait QueryFragment {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult;
+}
+

+ Required Methods +

+
+

+

+ Trait Implementations +

+ +

+ Implementations on Foreign Types +

+

impl QueryFragment for Box<QueryFragment>
[src]

impl QueryFragment for ()
[src]

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_sql/type.BuildQueryResult.html b/docs/apis/rust/0.7.0/mentat_sql/type.BuildQueryResult.html new file mode 100644 index 00000000..53f55784 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_sql/type.BuildQueryResult.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_sql::BuildQueryResult - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_sql::BuildQueryResult + + [] + + [src]

type BuildQueryResult = Result<(), SQLError>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/bail.m.html b/docs/apis/rust/0.7.0/mentat_tolstoy/bail.m.html new file mode 100644 index 00000000..6a9910ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/bail.m.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.bail.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/errors/Result.t.html b/docs/apis/rust/0.7.0/mentat_tolstoy/errors/Result.t.html new file mode 100644 index 00000000..865910f9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/errors/Result.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to type.Result.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/errors/TolstoyError.t.html b/docs/apis/rust/0.7.0/mentat_tolstoy/errors/TolstoyError.t.html new file mode 100644 index 00000000..e8173181 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/errors/TolstoyError.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to enum.TolstoyError.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/errors/enum.TolstoyError.html b/docs/apis/rust/0.7.0/mentat_tolstoy/errors/enum.TolstoyError.html new file mode 100644 index 00000000..6fd5e06f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/errors/enum.TolstoyError.html @@ -0,0 +1,153 @@ + + + + + + + + + + mentat_tolstoy::errors::TolstoyError - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Enum mentat_tolstoy::errors::TolstoyError + + [] + + [src]

pub enum TolstoyError {
+    BadServerResponse(String),
+    DuplicateMetadata(String),
+    TxProcessorUnfinished,
+    TxIncorrectlyMapped(usize),
+    UnexpectedState(String),
+    NotYetImplemented(String),
+}

+ Variants

+ +

+ Trait Implementations +

+
+

impl Debug for TolstoyError
[src]

Formats the value using the given formatter. Read more

+

impl Fail for TolstoyError
[src]

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

+

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

+

Provides context for this failure. Read more

+

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

+

Important traits for Causes<'f>

Returns a iterator over the causes of this Fail with itself as the first item and the root_cause as the final item. Read more

+

Returns the "root cause" of this Fail - the last value in the cause chain which does not return an underlying cause. Read more

+

impl Display for TolstoyError
[src]

Formats the value using the given formatter. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for TolstoyError

impl Sync for TolstoyError

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/errors/index.html b/docs/apis/rust/0.7.0/mentat_tolstoy/errors/index.html new file mode 100644 index 00000000..dcc73908 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/errors/index.html @@ -0,0 +1,142 @@ + + + + + + + + + + mentat_tolstoy::errors - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_tolstoy::errors + + [] + + [src]

Enums

+ + + + +
TolstoyError + +

Type Definitions

+ + + + +
Result + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/errors/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_tolstoy/errors/sidebar-items.js new file mode 100644 index 00000000..b0bff301 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/errors/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["TolstoyError",""]],"type":[["Result",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/errors/type.Result.html b/docs/apis/rust/0.7.0/mentat_tolstoy/errors/type.Result.html new file mode 100644 index 00000000..cdec06e7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/errors/type.Result.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_tolstoy::errors::Result - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Type Definition mentat_tolstoy::errors::Result + + [] + + [src]

type Result<T> = Result<T, Error>;
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/index.html b/docs/apis/rust/0.7.0/mentat_tolstoy/index.html new file mode 100644 index 00000000..10d8d097 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/index.html @@ -0,0 +1,178 @@ + + + + + + + + + + mentat_tolstoy - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Crate mentat_tolstoy + + [] + + [src]

Re-exports

+
pub use syncer::Syncer;
pub use errors::TolstoyError;
pub use errors::Result;

Modules

+ + + + + + + + + + + + + + + + + + + + + + + + +
errors + +
metadata + +
schema + +
syncer + +
tx_mapper + +
tx_processor + +

Macros

+ + + + +
bail + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/macro.bail!.html b/docs/apis/rust/0.7.0/mentat_tolstoy/macro.bail!.html new file mode 100644 index 00000000..6a9910ec --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/macro.bail!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.bail.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/macro.bail.html b/docs/apis/rust/0.7.0/mentat_tolstoy/macro.bail.html new file mode 100644 index 00000000..36cead9b --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/macro.bail.html @@ -0,0 +1,130 @@ + + + + + + + + + + mentat_tolstoy::bail - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Macro mentat_tolstoy::bail + + [] + + [src]

+macro_rules! bail {
+    ($e:expr) => { ... };
+}
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/HeadTrackable.t.html b/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/HeadTrackable.t.html new file mode 100644 index 00000000..e34ceb8c --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/HeadTrackable.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.HeadTrackable.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/SyncMetadataClient.t.html b/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/SyncMetadataClient.t.html new file mode 100644 index 00000000..63df0c20 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/SyncMetadataClient.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.SyncMetadataClient.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/index.html b/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/index.html new file mode 100644 index 00000000..03faa58e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/index.html @@ -0,0 +1,142 @@ + + + + + + + + + + mentat_tolstoy::metadata - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_tolstoy::metadata + + [] + + [src]

Structs

+ + + + +
SyncMetadataClient + +

Traits

+ + + + +
HeadTrackable + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/sidebar-items.js new file mode 100644 index 00000000..c22188c3 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["SyncMetadataClient",""]],"trait":[["HeadTrackable",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/struct.SyncMetadataClient.html b/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/struct.SyncMetadataClient.html new file mode 100644 index 00000000..cd3130e8 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/struct.SyncMetadataClient.html @@ -0,0 +1,136 @@ + + + + + + + + + + mentat_tolstoy::metadata::SyncMetadataClient - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_tolstoy::metadata::SyncMetadataClient + + [] + + [src]

pub struct SyncMetadataClient {}
+

+ Trait Implementations +

+
+

impl HeadTrackable for SyncMetadataClient
[src]

+

+ Auto Trait Implementations +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/trait.HeadTrackable.html b/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/trait.HeadTrackable.html new file mode 100644 index 00000000..c7a2e7c4 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/metadata/trait.HeadTrackable.html @@ -0,0 +1,142 @@ + + + + + + + + + + mentat_tolstoy::metadata::HeadTrackable - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_tolstoy::metadata::HeadTrackable + + [] + + [src]

pub trait HeadTrackable {
+    fn remote_head(tx: &Transaction) -> Result<Uuid>;
+
fn set_remote_head(tx: &Transaction, uuid: &Uuid) -> Result<()>; +}
+

+ Required Methods +

+
+

+

+ Implementors +

+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/schema/REMOTE_HEAD_KEY.v.html b/docs/apis/rust/0.7.0/mentat_tolstoy/schema/REMOTE_HEAD_KEY.v.html new file mode 100644 index 00000000..d7e30efe --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/schema/REMOTE_HEAD_KEY.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to static.REMOTE_HEAD_KEY.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/schema/ensure_current_version.v.html b/docs/apis/rust/0.7.0/mentat_tolstoy/schema/ensure_current_version.v.html new file mode 100644 index 00000000..055267f7 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/schema/ensure_current_version.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.ensure_current_version.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/schema/fn.ensure_current_version.html b/docs/apis/rust/0.7.0/mentat_tolstoy/schema/fn.ensure_current_version.html new file mode 100644 index 00000000..362c47bd --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/schema/fn.ensure_current_version.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_tolstoy::schema::ensure_current_version - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_tolstoy::schema::ensure_current_version + + [] + + [src]

pub fn ensure_current_version(conn: &mut Connection) -> Result<()>
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/schema/index.html b/docs/apis/rust/0.7.0/mentat_tolstoy/schema/index.html new file mode 100644 index 00000000..681ef854 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/schema/index.html @@ -0,0 +1,142 @@ + + + + + + + + + + mentat_tolstoy::schema - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_tolstoy::schema + + [] + + [src]

Statics

+ + + + +
REMOTE_HEAD_KEY + +

Functions

+ + + + +
ensure_current_version + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/schema/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_tolstoy/schema/sidebar-items.js new file mode 100644 index 00000000..87939f1e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/schema/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"fn":[["ensure_current_version",""]],"static":[["REMOTE_HEAD_KEY",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/schema/static.REMOTE_HEAD_KEY.html b/docs/apis/rust/0.7.0/mentat_tolstoy/schema/static.REMOTE_HEAD_KEY.html new file mode 100644 index 00000000..864368d5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/schema/static.REMOTE_HEAD_KEY.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_tolstoy::schema::REMOTE_HEAD_KEY - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Static mentat_tolstoy::schema::REMOTE_HEAD_KEY + + [] + + [src]

pub static REMOTE_HEAD_KEY: &str = r#"remote_head"#
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_tolstoy/sidebar-items.js new file mode 100644 index 00000000..993dd476 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"macro":[["bail",""]],"mod":[["errors",""],["metadata",""],["schema",""],["syncer",""],["tx_mapper",""],["tx_processor",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/Syncer.t.html b/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/Syncer.t.html new file mode 100644 index 00000000..eff49802 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/Syncer.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Syncer.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/d.v.html b/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/d.v.html new file mode 100644 index 00000000..3cef54d0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/d.v.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to fn.d.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/fn.d.html b/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/fn.d.html new file mode 100644 index 00000000..d3a5141d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/fn.d.html @@ -0,0 +1,126 @@ + + + + + + + + + + mentat_tolstoy::syncer::d - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Function mentat_tolstoy::syncer::d + + [] + + [src]

pub fn d(message: &str)
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/index.html b/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/index.html new file mode 100644 index 00000000..5b19b03e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/index.html @@ -0,0 +1,142 @@ + + + + + + + + + + mentat_tolstoy::syncer - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_tolstoy::syncer + + [] + + [src]

Structs

+ + + + +
Syncer + +

Functions

+ + + + +
d + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/sidebar-items.js new file mode 100644 index 00000000..f01fd3f0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"fn":[["d",""]],"struct":[["Syncer",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/struct.Syncer.html b/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/struct.Syncer.html new file mode 100644 index 00000000..50039ee9 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/syncer/struct.Syncer.html @@ -0,0 +1,140 @@ + + + + + + + + + + mentat_tolstoy::syncer::Syncer - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_tolstoy::syncer::Syncer + + [] + + [src]

pub struct Syncer {}
+

+ Methods +

+

impl Syncer
[src]

+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl Send for Syncer

impl Sync for Syncer

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/tx_mapper/TxMapper.t.html b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_mapper/TxMapper.t.html new file mode 100644 index 00000000..ca5f895d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_mapper/TxMapper.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.TxMapper.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/tx_mapper/index.html b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_mapper/index.html new file mode 100644 index 00000000..6ab1dc8e --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_mapper/index.html @@ -0,0 +1,134 @@ + + + + + + + + + + mentat_tolstoy::tx_mapper - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_tolstoy::tx_mapper + + [] + + [src]

Structs

+ + + + +
TxMapper + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/tx_mapper/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_mapper/sidebar-items.js new file mode 100644 index 00000000..c2cfddb5 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_mapper/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["TxMapper",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/tx_mapper/struct.TxMapper.html b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_mapper/struct.TxMapper.html new file mode 100644 index 00000000..c167f69a --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_mapper/struct.TxMapper.html @@ -0,0 +1,140 @@ + + + + + + + + + + mentat_tolstoy::tx_mapper::TxMapper - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_tolstoy::tx_mapper::TxMapper + + [] + + [src]

pub struct TxMapper {}
+

+ Methods +

+

impl TxMapper
[src]

+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl Send for TxMapper

impl Sync for TxMapper

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/DatomsIterator.t.html b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/DatomsIterator.t.html new file mode 100644 index 00000000..1026e31d --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/DatomsIterator.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.DatomsIterator.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/Processor.t.html b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/Processor.t.html new file mode 100644 index 00000000..74b7353f --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/Processor.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.Processor.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/TxPart.t.html b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/TxPart.t.html new file mode 100644 index 00000000..d5170ac1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/TxPart.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to struct.TxPart.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/TxReceiver.t.html b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/TxReceiver.t.html new file mode 100644 index 00000000..6996fc78 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/TxReceiver.t.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to trait.TxReceiver.html...

+ + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/index.html b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/index.html new file mode 100644 index 00000000..7401dc15 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/index.html @@ -0,0 +1,156 @@ + + + + + + + + + + mentat_tolstoy::tx_processor - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Module mentat_tolstoy::tx_processor + + [] + + [src]

Structs

+ + + + + + + + + + + + +
DatomsIterator + +
Processor + +
TxPart + +

Traits

+ + + + +
TxReceiver + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/sidebar-items.js b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/sidebar-items.js new file mode 100644 index 00000000..bb631b00 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["DatomsIterator",""],["Processor",""],["TxPart",""]],"trait":[["TxReceiver",""]]}); \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/struct.DatomsIterator.html b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/struct.DatomsIterator.html new file mode 100644 index 00000000..8fe6f335 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/struct.DatomsIterator.html @@ -0,0 +1,193 @@ + + + + + + + + + + mentat_tolstoy::tx_processor::DatomsIterator - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_tolstoy::tx_processor::DatomsIterator + + [] + + [src]

pub struct DatomsIterator<'dbtx, 't, T> where
    T: Sized + Iterator<Item = Result<TxPart>> + 't, 
{ /* fields omitted */ }
+

+ Trait Implementations +

+
+

impl<'dbtx, 't, T> Iterator for DatomsIterator<'dbtx, 't, T> where
    T: Sized + Iterator<Item = Result<TxPart>> + 't, 
[src]

+

The type of the elements being iterated over.

+

Advances the iterator and returns the next value. Read more

+

Returns the bounds on the remaining length of the iterator. Read more

+

Consumes the iterator, counting the number of iterations and returning it. Read more

+

Consumes the iterator, returning the last element. Read more

+

Returns the nth element of the iterator. Read more

+

Important traits for StepBy<I>

🔬 This is a nightly-only experimental API. (iterator_step_by)

unstable replacement of Range::step_by

+

Creates an iterator starting at the same point, but stepping by the given amount at each iteration. Read more

+

Important traits for Chain<A, B>

Takes two iterators and creates a new iterator over both in sequence. Read more

+

Important traits for Zip<A, B>

'Zips up' two iterators into a single iterator of pairs. Read more

+

Important traits for Map<I, F>

Takes a closure and creates an iterator which calls that closure on each element. Read more

+

Calls a closure on each element of an iterator. Read more

+

Important traits for Filter<I, P>

Creates an iterator which uses a closure to determine if an element should be yielded. Read more

+

Important traits for FilterMap<I, F>

Creates an iterator that both filters and maps. Read more

+

Important traits for Enumerate<I>

Creates an iterator which gives the current iteration count as well as the next value. Read more

+

Important traits for Peekable<I>

Creates an iterator which can use peek to look at the next element of the iterator without consuming it. Read more

+

Important traits for SkipWhile<I, P>

Creates an iterator that [skip]s elements based on a predicate. Read more

+

Important traits for TakeWhile<I, P>

Creates an iterator that yields elements based on a predicate. Read more

+

Important traits for Skip<I>

Creates an iterator that skips the first n elements. Read more

+

Important traits for Take<I>

Creates an iterator that yields its first n elements. Read more

+

Important traits for Scan<I, St, F>

An iterator adaptor similar to [fold] that holds internal state and produces a new iterator. Read more

+

Important traits for FlatMap<I, U, F>

Creates an iterator that works like map, but flattens nested structure. Read more

+

Important traits for Flatten<I>

🔬 This is a nightly-only experimental API. (iterator_flatten)

Creates an iterator that flattens nested structure. Read more

+

Important traits for Fuse<I>

Creates an iterator which ends after the first [None]. Read more

+

Important traits for Inspect<I, F>

Do something with each element of an iterator, passing the value on. Read more

+

Important traits for &'a mut R

Borrows an iterator, rather than consuming it. Read more

+

Transforms an iterator into a collection. Read more

+

Consumes an iterator, creating two collections from it. Read more

+

🔬 This is a nightly-only experimental API. (iterator_try_fold)

An iterator method that applies a function as long as it returns successfully, producing a single, final value. Read more

+

🔬 This is a nightly-only experimental API. (iterator_try_fold)

An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. Read more

+

An iterator method that applies a function, producing a single, final value. Read more

+

Tests if every element of the iterator matches a predicate. Read more

+

Tests if any element of the iterator matches a predicate. Read more

+

Searches for an element of an iterator that satisfies a predicate. Read more

+

Searches for an element in an iterator, returning its index. Read more

+

Searches for an element in an iterator from the right, returning its index. Read more

+

Returns the maximum element of an iterator. Read more

+

Returns the minimum element of an iterator. Read more

+

Returns the element that gives the maximum value from the specified function. Read more

+

Returns the element that gives the maximum value with respect to the specified comparison function. Read more

+

Returns the element that gives the minimum value from the specified function. Read more

+

Returns the element that gives the minimum value with respect to the specified comparison function. Read more

+

Important traits for Rev<I>

Reverses an iterator's direction. Read more

+

Converts an iterator of pairs into a pair of containers. Read more

+

Important traits for Cloned<I>

Creates an iterator which [clone]s all of its elements. Read more

+

Important traits for Cycle<I>

Repeats an iterator endlessly. Read more

+

Sums the elements of an iterator. Read more

+

Iterates over the entire iterator, multiplying all the elements Read more

+

Lexicographically compares the elements of this Iterator with those of another. Read more

+

Lexicographically compares the elements of this Iterator with those of another. Read more

+

Determines if the elements of this Iterator are equal to those of another. Read more

+

Determines if the elements of this Iterator are unequal to those of another. Read more

+

Determines if the elements of this Iterator are lexicographically less than those of another. Read more

+

Determines if the elements of this Iterator are lexicographically less or equal to those of another. Read more

+

Determines if the elements of this Iterator are lexicographically greater than those of another. Read more

+

Determines if the elements of this Iterator are lexicographically greater than or equal to those of another. Read more

+
+

+ Auto Trait Implementations +

+
+

impl<'dbtx, 't, T> Send for DatomsIterator<'dbtx, 't, T> where
    T: Send

impl<'dbtx, 't, T> Sync for DatomsIterator<'dbtx, 't, T> where
    T: Sync

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/struct.Processor.html b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/struct.Processor.html new file mode 100644 index 00000000..7504f3c1 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/struct.Processor.html @@ -0,0 +1,140 @@ + + + + + + + + + + mentat_tolstoy::tx_processor::Processor - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_tolstoy::tx_processor::Processor + + [] + + [src]

pub struct Processor {}
+

+ Methods +

+

impl Processor
[src]

+

+ Trait Implementations +

+
+
+

+ Auto Trait Implementations +

+
+

impl Send for Processor

impl Sync for Processor

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/struct.TxPart.html b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/struct.TxPart.html new file mode 100644 index 00000000..7fb02024 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/struct.TxPart.html @@ -0,0 +1,166 @@ + + + + + + + + + + mentat_tolstoy::tx_processor::TxPart - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Struct mentat_tolstoy::tx_processor::TxPart + + [] + + [src]

pub struct TxPart {
+    pub e: Entid,
+    pub a: Entid,
+    pub v: TypedValue,
+    pub tx: Entid,
+    pub added: bool,
+}

+ Fields

+ + + + + + + + + + +

+ Trait Implementations +

+
+

impl Debug for TxPart
[src]

Formats the value using the given formatter. Read more

+

impl Clone for TxPart
[src]

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+
+

+ Auto Trait Implementations +

+
+

impl Send for TxPart

impl Sync for TxPart

+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/trait.TxReceiver.html b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/trait.TxReceiver.html new file mode 100644 index 00000000..87bccfe0 --- /dev/null +++ b/docs/apis/rust/0.7.0/mentat_tolstoy/tx_processor/trait.TxReceiver.html @@ -0,0 +1,141 @@ + + + + + + + + + + mentat_tolstoy::tx_processor::TxReceiver - Rust + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +

Trait mentat_tolstoy::tx_processor::TxReceiver + + [] + + [src]

pub trait TxReceiver {
+    fn tx<T>(&mut self, tx_id: Entid, d: &mut T) -> Result<()>
    where
        T: Iterator<Item = TxPart>
; +
fn done(&mut self) -> Result<()>; +}
+

+ Required Methods +

+
+

+

+ Implementors +

+
    +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/normalize.css b/docs/apis/rust/0.7.0/normalize.css new file mode 100644 index 00000000..2804c26a --- /dev/null +++ b/docs/apis/rust/0.7.0/normalize.css @@ -0,0 +1 @@ +/*! normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0} diff --git a/docs/apis/rust/0.7.0/rustdoc.css b/docs/apis/rust/0.7.0/rustdoc.css new file mode 100644 index 00000000..31a501d2 --- /dev/null +++ b/docs/apis/rust/0.7.0/rustdoc.css @@ -0,0 +1,1293 @@ +/** + * Copyright 2013 The Rust Project Developers. See the COPYRIGHT + * file at the top-level directory of this distribution and at + * http://rust-lang.org/COPYRIGHT. + * + * Licensed under the Apache License, Version 2.0 or the MIT license + * , at your + * option. This file may not be copied, modified, or distributed + * except according to those terms. + */ + +/* See FiraSans-LICENSE.txt for the Fira Sans license. */ +@font-face { + font-family: 'Fira Sans'; + font-style: normal; + font-weight: 400; + src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff'); +} +@font-face { + font-family: 'Fira Sans'; + font-style: normal; + font-weight: 500; + src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff'); +} + +/* See SourceSerifPro-LICENSE.txt for the Source Serif Pro license and + * Heuristica-LICENSE.txt for the Heuristica license. */ +@font-face { + font-family: 'Source Serif Pro'; + font-style: normal; + font-weight: 400; + src: local('Source Serif Pro'), url("SourceSerifPro-Regular.woff") format('woff'); +} +@font-face { + font-family: 'Source Serif Pro'; + font-style: italic; + font-weight: 400; + src: url("Heuristica-Italic.woff") format('woff'); +} +@font-face { + font-family: 'Source Serif Pro'; + font-style: normal; + font-weight: 700; + src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.woff") format('woff'); +} + +/* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */ +@font-face { + font-family: 'Source Code Pro'; + font-style: normal; + font-weight: 400; + /* Avoid using locally installed font because bad versions are in circulation: + * see https://github.com/rust-lang/rust/issues/24355 */ + src: url("SourceCodePro-Regular.woff") format('woff'); +} +@font-face { + font-family: 'Source Code Pro'; + font-style: normal; + font-weight: 600; + src: url("SourceCodePro-Semibold.woff") format('woff'); +} + +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +/* General structure and fonts */ + +body { + font: 16px/1.4 "Source Serif Pro", Georgia, Times, "Times New Roman", serif; + margin: 0; + position: relative; + padding: 10px 15px 20px 15px; + + -webkit-font-feature-settings: "kern", "liga"; + -moz-font-feature-settings: "kern", "liga"; + font-feature-settings: "kern", "liga"; +} + +h1 { + font-size: 1.5em; +} +h2 { + font-size: 1.4em; +} +h3 { + font-size: 1.3em; +} +h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.important), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) { + font-weight: 500; + margin: 20px 0 15px 0; + padding-bottom: 6px; +} +h1.fqn { + border-bottom: 1px dashed; + margin-top: 0; + position: relative; +} +h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) { + border-bottom: 1px solid; +} +h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant { + font-weight: 600; + margin-top: 10px; + margin-bottom: 10px; + position: relative; +} +h3.impl, h3.method, h3.type { + padding-left: 15px; +} + +h1, h2, h3, h4, +.sidebar, a.source, .search-input, .content table :not(code)>a, +.collapse-toggle, ul.item-list > li > .out-of-band { + font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +ol, ul { + padding-left: 25px; +} +ul ul, ol ul, ul ol, ol ol { + margin-bottom: 0; +} + +p { + margin: 0 0 .6em 0; +} + +summary { + outline: none; +} + +code, pre { + font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace; + white-space: pre-wrap; +} +.docblock code, .docblock-short code { + border-radius: 3px; + padding: 0 0.2em; +} +.docblock pre code, .docblock-short pre code, .docblock code.spotlight { + padding: 0; +} +.docblock code.spotlight :last-child { + padding-bottom: 0.6em; +} +pre { + padding: 14px; +} + +.source .content pre { + padding: 20px; +} + +img { + max-width: 100%; +} + +.source .content { + margin-top: 50px; + max-width: none; + overflow: visible; + margin-left: 0px; + min-width: 70em; +} + +nav.sub { + font-size: 16px; + text-transform: uppercase; +} + +.sidebar { + width: 200px; + position: fixed; + left: 0; + top: 0; + height: 100vh; + overflow: auto; +} + +.sidebar .block > ul > li { + margin-right: -10px; +} + +.content, nav { + max-width: 960px; +} + +/* Everything else */ + +.js-only, .hidden { + display: none !important; +} + +.sidebar img { + margin: 20px auto; + display: block; + margin-top: 10px; +} + +.sidebar .location { + border: 1px solid; + font-size: 17px; + margin: 30px 10px 20px 10px; + text-align: center; + word-wrap: break-word; +} + +.sidebar .version { + font-size: 15px; + text-align: center; + border-bottom: 1px solid; + overflow-wrap: break-word; + word-wrap: break-word; /* deprecated */ + word-break: break-word; /* Chrome, non-standard */ +} + +.location:empty { + border: none; +} + +.location a:first-child { + font-weight: 500; +} + +.block { + padding: 0; + margin-bottom: 14px; +} +.block h2, .block h3 { + margin-top: 0; + margin-bottom: 8px; + text-align: center; +} +.block ul, .block li { + margin: 0 10px; + padding: 0; + list-style: none; +} + +.block a { + display: block; + text-overflow: ellipsis; + overflow: hidden; + line-height: 15px; + padding: 7px 5px; + font-size: 14px; + font-weight: 300; + transition: border 500ms ease-out; +} + +.sidebar-title { + border-top: 1px solid; + border-bottom: 1px solid; + text-align: center; + font-size: 17px; + margin-bottom: 5px; +} + +.sidebar-links { + margin-bottom: 15px; +} + +.sidebar-links > a { + padding-left: 10px; + width: 100%; +} + +.sidebar-menu { + display: none; +} + +.content { + padding: 15px 0; +} + +.source .content pre.rust { + white-space: pre; + overflow: auto; + padding-left: 0; +} + +#search { + margin-left: 230px; + position: relative; +} + +#results { + position: absolute; + right: 0; + left: 0; + overflow: auto; +} + +#results > table { + width: 100%; + table-layout: fixed; +} + +.content pre.line-numbers { + float: left; + border: none; + position: relative; + + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.line-numbers span { + cursor: pointer; +} + +.docblock-short p { + display: inline; +} + +.docblock-short.nowrap { + display: block; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.docblock-short p { + overflow: hidden; + text-overflow: ellipsis; + margin: 0; +} +.docblock-short code { + white-space: nowrap; +} + +.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 { + border-bottom: 1px solid; +} + +#main > .docblock h1 { font-size: 1.3em; } +#main > .docblock h2 { font-size: 1.15em; } +#main > .docblock h3, #main > .docblock h4, #main > .docblock h5 { font-size: 1em; } + +.docblock h1 { font-size: 1em; } +.docblock h2 { font-size: 0.95em; } +.docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; } + +.docblock { + margin-left: 24px; + position: relative; +} + +.content .out-of-band { + font-size: 23px; + margin: 0px; + padding: 0px; + text-align: right; + display: inline-block; + font-weight: normal; + position: absolute; + right: 0; +} + +h3.impl > .out-of-band { + font-size: 21px; +} + +h4.method > .out-of-band { + font-size: 19px; +} + +ul.item-list > li > .out-of-band { + font-size: 19px; +} + +h4 > code, h3 > code, .invisible > code { + max-width: calc(100% - 41px); + display: block; +} + +.in-band, code { + z-index: 5; +} + +.invisible { + width: 100%; + display: inline-block; +} + +.content .in-band { + margin: 0px; + padding: 0px; +} + +.in-band > code { + display: inline-block; +} + +#main { + position: relative; +} +#main > .since { + top: inherit; + font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +.content table:not(.table-display) { + border-spacing: 0 5px; + border-collapse: separate; +} +.content td { vertical-align: top; } +.content td:first-child { padding-right: 20px; } +.content td p:first-child { margin-top: 0; } +.content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; } + +.docblock table { + border: 1px solid; + margin: .5em 0; + border-collapse: collapse; + width: 100%; +} + +.docblock table td { + padding: .5em; + border-top: 1px dashed; + border-bottom: 1px dashed; +} + +.docblock table th { + padding: .5em; + text-align: left; + border-top: 1px solid; + border-bottom: 1px solid; +} + +.fields + table { + margin-bottom: 1em; +} + +.content .item-list { + list-style-type: none; + padding: 0; +} + +.content .item-list li { + margin-bottom: 1em; +} + +.content .multi-column { + -moz-column-count: 5; + -moz-column-gap: 2.5em; + -webkit-column-count: 5; + -webkit-column-gap: 2.5em; + column-count: 5; + column-gap: 2.5em; +} +.content .multi-column li { width: 100%; display: inline-block; } + +.content .method { + font-size: 1em; + position: relative; +} +/* Shift "where ..." part of method or fn definition down a line */ +.content .method .where, +.content .fn .where, +.content .where.fmt-newline { + display: block; + font-size: 0.8em; +} + +.content .methods > div:not(.important-traits) { + margin-left: 40px; + margin-bottom: 15px; +} + +.content .impl-items .docblock, .content .impl-items .stability { + margin-bottom: .6em; +} +.content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant { + margin-left: 20px; +} + +.content .stability code { + font-size: 90%; +} + +nav { + border-bottom: 1px solid; + padding-bottom: 10px; + margin-bottom: 10px; +} +nav.main { + padding: 20px 0; + text-align: center; +} +nav.main .current { + border-top: 1px solid; + border-bottom: 1px solid; +} +nav.main .separator { + border: 1px solid; + display: inline-block; + height: 23px; + margin: 0 20px; +} +nav.sum { text-align: right; } +nav.sub form { display: inline; } + +nav.sub, .content { + margin-left: 230px; +} + +a { + text-decoration: none; + background: transparent; +} + +.small-section-header:hover > .anchor { + display: initial; +} + +.in-band:hover > .anchor { + display: inline-block; + position: absolute; +} +.anchor { + display: none; + position: absolute; + left: -7px; +} +.anchor.field { + left: -5px; +} +.small-section-header > .anchor { + left: -28px; +} +.anchor:before { + content: '\2002\00a7\2002'; +} + +.docblock a:hover, .docblock-short a:hover, .stability a { + text-decoration: underline; +} + +.block a.current.crate { font-weight: 500; } + +.search-input { + width: 100%; + /* Override Normalize.css: we have margins and do + not want to overflow - the `moz` attribute is necessary + until Firefox 29, too early to drop at this point */ + -moz-box-sizing: border-box !important; + box-sizing: border-box !important; + outline: none; + border: none; + border-radius: 1px; + margin-top: 5px; + padding: 10px 16px; + font-size: 17px; + transition: border-color 300ms ease; + transition: border-radius 300ms ease-in-out; + transition: box-shadow 300ms ease-in-out; +} + +.search-input:focus { + border-radius: 2px; + border: 0; + outline: 0; + box-shadow: 0 0 8px #078dd8; +} + +.search-results .desc { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + display: block; +} + +.search-results a { + display: block; +} + +.content .search-results td:first-child { + padding-right: 0; + width: 75%; +} +.content .search-results td:first-child a { + padding-right: 10px; +} +.content .search-results td:first-child a span { + float: left; +} + +tr.result span.primitive::after { + content: ' (primitive type)'; + font-style: italic; +} + +body.blur > :not(#help) { + filter: blur(8px); + -webkit-filter: blur(8px); + opacity: .7; +} + +#help { + width: 100%; + height: 100vh; + position: fixed; + top: 0; + left: 0; + display: flex; + justify-content: center; + align-items: center; +} +#help > div { + flex: 0 0 auto; + box-shadow: 0 0 6px rgba(0,0,0,.2); + width: 550px; + height: auto; + border: 1px solid; +} +#help dt { + float: left; + clear: left; + display: block; +} +#help dd { margin: 5px 35px; } +#help .infos { padding-left: 0; } +#help h1, #help h2 { margin-top: 0; } +#help > div div { + width: 50%; + float: left; + padding: 20px; + padding-left: 17px; +} + +.stab { + display: table; + border-width: 1px; + border-style: solid; + padding: 3px; + margin-bottom: 5px; + font-size: 90%; +} +.stab p { + display: inline; +} + +.stab summary { + display: list-item; +} + +.stab .microscope { + font-size: 1.5em; +} + +.module-item .stab { + display: inline; + border-width: 0; + padding: 0; + margin: 0; + background: inherit !important; +} + +.module-item.unstable { + opacity: 0.65; +} + +.since { + font-weight: normal; + font-size: initial; + position: absolute; + right: 0; + top: 0; +} + +.variants_table { + width: 100%; +} + +.variants_table tbody tr td:first-child { + width: 1%; /* make the variant name as small as possible */ +} + +td.summary-column { + width: 100%; +} + +.summary { + padding-right: 0px; +} + +pre.rust .question-mark { + font-weight: bold; +} + +a.test-arrow { + display: inline-block; + position: absolute; + padding: 5px 10px 5px 10px; + border-radius: 5px; + font-size: 130%; + top: 5px; + right: 5px; +} +a.test-arrow:hover{ + text-decoration: none; +} + +.section-header:hover a:before { + position: absolute; + left: -25px; + content: '\2002\00a7\2002'; +} + +.section-header:hover a { + text-decoration: none; +} + +.section-header a { + color: inherit; +} + +.collapse-toggle { + font-weight: 300; + position: absolute; + left: -23px; + top: 0; +} + +h3 > .collapse-toggle, h4 > .collapse-toggle { + font-size: 0.8em; + top: 5px; +} + +.toggle-wrapper > .collapse-toggle { + left: -24px; + margin-top: 0px; +} + +.toggle-wrapper { + position: relative; + margin-top: 5px; +} + +.toggle-wrapper.collapsed { + height: 25px; + transition: height .2s; + margin-bottom: .6em; +} + +.collapse-toggle > .inner { + display: inline-block; + width: 1.2ch; + text-align: center; +} + +.ghost { + display: none; +} + +.ghost + .since { + position: initial; + display: table-cell; +} + +.since + .srclink { + display: table-cell; + padding-left: 10px; +} + +.item-spacer { + width: 100%; + height: 12px; +} + +span.since { + position: initial; + font-size: 20px; + margin-right: 5px; +} + +.toggle-wrapper > .collapse-toggle { + left: 0; +} + +.variant + .toggle-wrapper + .docblock > p { + margin-top: 5px; +} + +.sub-variant, .sub-variant > h3 { + margin-top: 0 !important; +} + +.toggle-label { + display: inline-block; + margin-left: 4px; + margin-top: 3px; +} + +.enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock { + margin-left: 30px; + margin-bottom: 20px; + margin-top: 5px; +} + +.docblock > .section-header:first-child { + margin-left: 15px; + margin-top: 0; +} + +.docblock > .section-header:first-child:hover > a:before { + left: -10px; +} + +.enum > .collapsed, .struct > .collapsed { + margin-bottom: 25px; +} + +#main > .variant, #main > .structfield { + display: block; +} + +.attributes { + display: block; + margin: 0px 0px 0px 30px !important; +} +.toggle-attributes.collapsed { + margin-bottom: 5px; +} + +:target > code { + opacity: 1; +} + +/* Media Queries */ + +@media (max-width: 700px) { + body { + padding-top: 0px; + } + + .sidebar { + height: 45px; + min-height: 40px; + width: calc(100% + 30px); + margin: 0; + margin-left: -15px; + padding: 0 15px; + position: static; + z-index: 1; + } + + .sidebar > .location { + float: right; + margin: 0px; + margin-top: 2px; + padding: 3px 10px 1px 10px; + min-height: 39px; + background: inherit; + text-align: left; + font-size: 24px; + } + + .sidebar .location:empty { + padding: 0; + } + + .sidebar img { + width: 35px; + margin-top: 5px; + margin-bottom: 5px; + float: left; + margin-left: 50px; + } + + .sidebar-menu { + position: fixed; + z-index: 10; + font-size: 2rem; + cursor: pointer; + width: 45px; + left: 0; + text-align: center; + display: block; + border-bottom: 1px solid; + border-right: 1px solid; + height: 45px; + } + + .sidebar-elems { + position: fixed; + z-index: 1; + left: 0; + top: 45px; + bottom: 0; + overflow-y: auto; + border-right: 1px solid; + display: none; + } + + .sidebar > .block.version { + border-bottom: none; + margin-top: 12px; + } + + nav.sub { + width: calc(100% - 32px); + float: right; + } + + .content { + margin-left: 0px; + } + + #main { + margin-top: 45px; + padding: 0; + } + + .content .in-band { + width: 100%; + } + + .content h4 > .out-of-band { + position: inherit; + } + + .toggle-wrapper > .collapse-toggle { + left: 0px; + } + + .toggle-wrapper { + height: 1.5em; + } + + #search { + margin-left: 0; + } + + .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant { + display: flex; + } + + .anchor { + display: none !important; + } +} + +@media print { + nav.sub, .content .out-of-band, .collapse-toggle { + display: none; + } +} + +.information { + position: absolute; + left: -20px; + margin-top: 7px; + z-index: 1; +} + +.tooltip { + position: relative; + display: inline-block; + cursor: pointer; +} + +.tooltip .tooltiptext { + width: 120px; + display: none; + text-align: center; + padding: 5px 3px; + border-radius: 6px; + margin-left: 5px; + top: -5px; + left: 105%; + z-index: 1; +} + +.tooltip:hover .tooltiptext { + display: inline; +} + +.tooltip .tooltiptext::after { + content: " "; + position: absolute; + top: 50%; + left: 11px; + margin-top: -5px; + border-width: 5px; + border-style: solid; +} + +.important-traits .tooltip .tooltiptext { + border: 1px solid; +} + +pre.rust { + position: relative; +} + +.search-failed { + text-align: center; + margin-top: 20px; +} + +#titles { + height: 35px; +} + +#titles > div { + float: left; + width: 33.3%; + text-align: center; + border-bottom: 1px solid; + font-size: 18px; + cursor: pointer; +} + +#titles > div.selected { + border-bottom: 3px solid; +} + +#titles > div:hover { + border-bottom: 3px solid; +} + +#titles > div > div.count { + display: inline-block; + font-size: 16px; +} + +.important-traits { + cursor: pointer; + z-index: 2; +} + +h4 > .important-traits { + position: absolute; + left: -44px; + top: 2px; +} + +@media (max-width: 700px) { + h4 > .important-traits { + position: absolute; + left: -22px; + top: 24px; + } + + #titles > div > div.count { + float: left; + width: 100%; + } + + #titles { + height: 50px; + } + + .sidebar.mobile { + position: fixed; + width: 100%; + margin-left: 0; + background-color: rgba(0,0,0,0); + height: 100%; + } + + .show-it { + display: block; + width: 246px; + } + + .show-it > .block.items { + margin: 8px 0; + } + + .show-it > .block.items > ul { + margin: 0; + } + + .show-it > .block.items > ul > li { + text-align: center; + margin: 2px 0; + } + + .show-it > .block.items > ul > li > a { + font-size: 21px; + } + + /* Because of ios, we need to actually have a full height sidebar title so the + * actual sidebar can show up. But then we need to make it transparent so we don't + * hide content. The filler just allows to create the background for the sidebar + * title. But because of the absolute position, I had to lower the z-index. + */ + #sidebar-filler { + position: fixed; + left: 45px; + width: calc(100% - 45px); + top: 0; + height: 45px; + z-index: -1; + border-bottom: 1px solid; + } + + .collapse-toggle { + left: -20px; + } + + .impl > .collapse-toggle { + left: -10px; + } +} + + +@media (max-width: 416px) { + #titles { + height: 73px; + } + + #titles > div { + height: 73px; + } +} + +.modal { + position: fixed; + width: 100vw; + height: 100vh; + z-index: 10000; + top: 0; + left: 0; +} + +.modal-content { + display: block; + max-width: 60%; + min-width: 200px; + padding: 8px; + top: 40%; + position: absolute; + left: 50%; + transform: translate(-50%, -40%); + border: 1px solid; + border-radius: 4px; + border-top-right-radius: 0; +} + +.modal-content > .docblock { + margin: 0; +} + +h3.important { + margin: 0; + margin-bottom: 13px; + font-size: 19px; +} + +.modal-content > .docblock > code.content { + margin: 0; + padding: 0; + font-size: 20px; +} + +.modal-content > .close { + position: absolute; + font-weight: 900; + right: -25px; + top: -1px; + font-size: 18px; + width: 25px; + padding-right: 2px; + border-top-right-radius: 5px; + border-bottom-right-radius: 5px; + text-align: center; + border: 1px solid; + border-right: 0; + cursor: pointer; +} + +.modal-content > .whiter { + height: 25px; + position: absolute; + width: 3px; + right: -2px; + top: 0px; +} + +#main > div.important-traits { + position: absolute; + left: -24px; + margin-top: 16px; +} + +.content > .methods > div.important-traits { + position: absolute; + left: -42px; + margin-top: 2px; +} + +kbd { + display: inline-block; + padding: 3px 5px; + font: 15px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; + line-height: 10px; + vertical-align: middle; + border: solid 1px; + border-radius: 3px; + box-shadow: inset 0 -1px 0; + cursor: default; +} + +.theme-picker { + position: absolute; + left: 211px; + top: 19px; +} + +.theme-picker button { + outline: none; +} + +#theme-picker { + padding: 4px; + width: 27px; + height: 29px; + border: 1px solid; + border-radius: 3px; + cursor: pointer; +} + +#theme-choices { + display: none; + position: absolute; + left: 0; + top: 28px; + border: 1px solid; + border-radius: 3px; + z-index: 1; + cursor: pointer; +} + +#theme-choices > button { + border: none; + width: 100%; + padding: 4px; + text-align: center; + background: rgba(0,0,0,0); +} + +#theme-choices > button:not(:first-child) { + border-top: 1px solid; +} + +@media (max-width: 700px) { + .theme-picker { + left: 10px; + top: 54px; + z-index: 1; + } +} + +.hidden-by-impl-hider, +.hidden-by-usual-hider { + /* important because of conflicting rule for small screens */ + display: none !important; +} + +#implementations-list > h3 > span.in-band { + width: 100%; +} + +.table-display { + width: 100%; + border: 0; + border-collapse: collapse; + border-spacing: 0; + font-size: 16px; +} + +.table-display tr td:first-child { + padding-right: 0; +} + +.table-display tr td:last-child { + float: right; +} +.table-display .out-of-band { + position: relative; + font-size: 19px; + display: block; +} diff --git a/docs/apis/rust/0.7.0/search-index.js b/docs/apis/rust/0.7.0/search-index.js new file mode 100644 index 00000000..3fac09b5 --- /dev/null +++ b/docs/apis/rust/0.7.0/search-index.js @@ -0,0 +1,17 @@ +var searchIndex = {}; +searchIndex["edn"] = {"doc":"","items":[[3,"DateTime","edn","ISO 8601 combined date and time with time zone.",null,null],[3,"Utc","","The UTC time zone. This is the most efficient time zone when you don't need the local time. It is also used as an offset (which is also a dummy type).",null,null],[3,"BigInt","","A big signed integer type.",null,null],[3,"OrderedFloat","","A wrapper around Floats providing an implementation of Ord and Hash.",null,null],[12,"0","","",0,null],[3,"Uuid","","A Universally Unique Identifier (UUID).",null,null],[4,"UuidParseError","","Error details for string parsing failures.",null,null],[13,"InvalidLength","","",1,null],[13,"InvalidCharacter","","",1,null],[13,"InvalidGroups","","",1,null],[13,"InvalidGroupLength","","",1,null],[0,"entities","","This module defines core types that support the transaction processor.",null,null],[3,"LookupRef","edn::entities","",null,null],[12,"a","","",2,null],[12,"v","","",2,null],[3,"TxFunction","","A \"transaction function\" that exposes some value determined by the current transaction. The prototypical example is the current transaction ID, `(transaction-tx)`.",null,null],[12,"op","","",3,null],[4,"TempId","","A tempid, either an external tempid given in a transaction (usually as an `Value::Text`), or an internal tempid allocated by Mentat itself.",null,null],[13,"External","","",4,null],[13,"Internal","","",4,null],[4,"Entid","","",null,null],[13,"Entid","","",5,null],[13,"Ident","","",5,null],[4,"ValuePlace","","",null,null],[13,"Entid","","",6,null],[13,"TempId","","",6,null],[13,"LookupRef","","",6,null],[13,"TxFunction","","",6,null],[13,"Vector","","",6,null],[13,"Atom","","",6,null],[13,"MapNotation","","",6,null],[4,"EntityPlace","","",null,null],[13,"Entid","","",7,null],[13,"TempId","","",7,null],[13,"LookupRef","","",7,null],[13,"TxFunction","","",7,null],[4,"AttributePlace","","",null,null],[13,"Entid","","",8,null],[4,"OpType","","",null,null],[13,"Add","","",9,null],[13,"Retract","","",9,null],[4,"Entity","","",null,null],[13,"AddOrRetract","","",10,null],[12,"op","edn::entities::Entity","",10,null],[12,"e","","",10,null],[12,"a","","",10,null],[12,"v","","",10,null],[13,"MapNotation","edn::entities","",10,null],[6,"MapNotation","","",null,null],[11,"clone","","",4,{"inputs":[{"name":"self"}],"output":{"name":"tempid"}}],[11,"fmt","","",4,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",4,null],[11,"cmp","","",4,{"inputs":[{"name":"self"},{"name":"tempid"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",4,{"inputs":[{"name":"self"},{"name":"tempid"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",4,{"inputs":[{"name":"self"},{"name":"tempid"}],"output":{"name":"bool"}}],[11,"le","","",4,{"inputs":[{"name":"self"},{"name":"tempid"}],"output":{"name":"bool"}}],[11,"gt","","",4,{"inputs":[{"name":"self"},{"name":"tempid"}],"output":{"name":"bool"}}],[11,"ge","","",4,{"inputs":[{"name":"self"},{"name":"tempid"}],"output":{"name":"bool"}}],[11,"eq","","",4,{"inputs":[{"name":"self"},{"name":"tempid"}],"output":{"name":"bool"}}],[11,"ne","","",4,{"inputs":[{"name":"self"},{"name":"tempid"}],"output":{"name":"bool"}}],[11,"into_external","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["string"],"name":"option"}}],[11,"fmt","","",4,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"clone","","",5,{"inputs":[{"name":"self"}],"output":{"name":"entid"}}],[11,"fmt","","",5,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",5,null],[11,"cmp","","",5,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",5,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",5,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[11,"le","","",5,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[11,"gt","","",5,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[11,"ge","","",5,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[11,"eq","","",5,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[11,"ne","","",5,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[11,"unreversed","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["entid"],"name":"option"}}],[11,"clone","","",2,{"inputs":[{"name":"self"}],"output":{"name":"lookupref"}}],[11,"fmt","","",2,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",2,null],[11,"cmp","","",2,{"inputs":[{"name":"self"},{"name":"lookupref"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",2,{"inputs":[{"name":"self"},{"name":"lookupref"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",2,{"inputs":[{"name":"self"},{"name":"lookupref"}],"output":{"name":"bool"}}],[11,"le","","",2,{"inputs":[{"name":"self"},{"name":"lookupref"}],"output":{"name":"bool"}}],[11,"gt","","",2,{"inputs":[{"name":"self"},{"name":"lookupref"}],"output":{"name":"bool"}}],[11,"ge","","",2,{"inputs":[{"name":"self"},{"name":"lookupref"}],"output":{"name":"bool"}}],[11,"eq","","",2,{"inputs":[{"name":"self"},{"name":"lookupref"}],"output":{"name":"bool"}}],[11,"ne","","",2,{"inputs":[{"name":"self"},{"name":"lookupref"}],"output":{"name":"bool"}}],[11,"clone","","",3,{"inputs":[{"name":"self"}],"output":{"name":"txfunction"}}],[11,"fmt","","",3,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",3,null],[11,"cmp","","",3,{"inputs":[{"name":"self"},{"name":"txfunction"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",3,{"inputs":[{"name":"self"},{"name":"txfunction"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",3,{"inputs":[{"name":"self"},{"name":"txfunction"}],"output":{"name":"bool"}}],[11,"le","","",3,{"inputs":[{"name":"self"},{"name":"txfunction"}],"output":{"name":"bool"}}],[11,"gt","","",3,{"inputs":[{"name":"self"},{"name":"txfunction"}],"output":{"name":"bool"}}],[11,"ge","","",3,{"inputs":[{"name":"self"},{"name":"txfunction"}],"output":{"name":"bool"}}],[11,"eq","","",3,{"inputs":[{"name":"self"},{"name":"txfunction"}],"output":{"name":"bool"}}],[11,"ne","","",3,{"inputs":[{"name":"self"},{"name":"txfunction"}],"output":{"name":"bool"}}],[11,"clone","","",6,{"inputs":[{"name":"self"}],"output":{"name":"valueplace"}}],[11,"fmt","","",6,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",6,null],[11,"cmp","","",6,{"inputs":[{"name":"self"},{"name":"valueplace"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",6,{"inputs":[{"name":"self"},{"name":"valueplace"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",6,{"inputs":[{"name":"self"},{"name":"valueplace"}],"output":{"name":"bool"}}],[11,"le","","",6,{"inputs":[{"name":"self"},{"name":"valueplace"}],"output":{"name":"bool"}}],[11,"gt","","",6,{"inputs":[{"name":"self"},{"name":"valueplace"}],"output":{"name":"bool"}}],[11,"ge","","",6,{"inputs":[{"name":"self"},{"name":"valueplace"}],"output":{"name":"bool"}}],[11,"eq","","",6,{"inputs":[{"name":"self"},{"name":"valueplace"}],"output":{"name":"bool"}}],[11,"ne","","",6,{"inputs":[{"name":"self"},{"name":"valueplace"}],"output":{"name":"bool"}}],[11,"clone","","",7,{"inputs":[{"name":"self"}],"output":{"name":"entityplace"}}],[11,"fmt","","",7,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",7,null],[11,"cmp","","",7,{"inputs":[{"name":"self"},{"name":"entityplace"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",7,{"inputs":[{"name":"self"},{"name":"entityplace"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",7,{"inputs":[{"name":"self"},{"name":"entityplace"}],"output":{"name":"bool"}}],[11,"le","","",7,{"inputs":[{"name":"self"},{"name":"entityplace"}],"output":{"name":"bool"}}],[11,"gt","","",7,{"inputs":[{"name":"self"},{"name":"entityplace"}],"output":{"name":"bool"}}],[11,"ge","","",7,{"inputs":[{"name":"self"},{"name":"entityplace"}],"output":{"name":"bool"}}],[11,"eq","","",7,{"inputs":[{"name":"self"},{"name":"entityplace"}],"output":{"name":"bool"}}],[11,"ne","","",7,{"inputs":[{"name":"self"},{"name":"entityplace"}],"output":{"name":"bool"}}],[11,"clone","","",8,{"inputs":[{"name":"self"}],"output":{"name":"attributeplace"}}],[11,"fmt","","",8,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",8,null],[11,"cmp","","",8,{"inputs":[{"name":"self"},{"name":"attributeplace"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",8,{"inputs":[{"name":"self"},{"name":"attributeplace"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",8,{"inputs":[{"name":"self"},{"name":"attributeplace"}],"output":{"name":"bool"}}],[11,"le","","",8,{"inputs":[{"name":"self"},{"name":"attributeplace"}],"output":{"name":"bool"}}],[11,"gt","","",8,{"inputs":[{"name":"self"},{"name":"attributeplace"}],"output":{"name":"bool"}}],[11,"ge","","",8,{"inputs":[{"name":"self"},{"name":"attributeplace"}],"output":{"name":"bool"}}],[11,"eq","","",8,{"inputs":[{"name":"self"},{"name":"attributeplace"}],"output":{"name":"bool"}}],[11,"ne","","",8,{"inputs":[{"name":"self"},{"name":"attributeplace"}],"output":{"name":"bool"}}],[11,"clone","","",9,{"inputs":[{"name":"self"}],"output":{"name":"optype"}}],[11,"fmt","","",9,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",9,null],[11,"cmp","","",9,{"inputs":[{"name":"self"},{"name":"optype"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",9,{"inputs":[{"name":"self"},{"name":"optype"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"eq","","",9,{"inputs":[{"name":"self"},{"name":"optype"}],"output":{"name":"bool"}}],[11,"clone","","",10,{"inputs":[{"name":"self"}],"output":{"name":"entity"}}],[11,"fmt","","",10,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",10,null],[11,"cmp","","",10,{"inputs":[{"name":"self"},{"name":"entity"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",10,{"inputs":[{"name":"self"},{"name":"entity"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",10,{"inputs":[{"name":"self"},{"name":"entity"}],"output":{"name":"bool"}}],[11,"le","","",10,{"inputs":[{"name":"self"},{"name":"entity"}],"output":{"name":"bool"}}],[11,"gt","","",10,{"inputs":[{"name":"self"},{"name":"entity"}],"output":{"name":"bool"}}],[11,"ge","","",10,{"inputs":[{"name":"self"},{"name":"entity"}],"output":{"name":"bool"}}],[11,"eq","","",10,{"inputs":[{"name":"self"},{"name":"entity"}],"output":{"name":"bool"}}],[11,"ne","","",10,{"inputs":[{"name":"self"},{"name":"entity"}],"output":{"name":"bool"}}],[0,"query","edn","",null,null],[3,"Variable","edn::query","",null,null],[12,"0","","",11,null],[3,"QueryFunction","","",null,null],[12,"0","","",12,null],[3,"Order","","An abstract declaration of ordering: direction and variable.",null,null],[12,"0","","",13,null],[12,"1","","",13,null],[3,"NamedPullAttribute","","",null,null],[12,"attribute","","",14,null],[12,"alias","","",14,null],[3,"Pull","","",null,null],[12,"var","","",15,null],[12,"patterns","","",15,null],[3,"Aggregate","","",null,null],[12,"func","","",16,null],[12,"args","","",16,null],[3,"Pattern","","",null,null],[12,"source","","",17,null],[12,"entity","","",17,null],[12,"attribute","","",17,null],[12,"value","","",17,null],[12,"tx","","",17,null],[3,"Predicate","","",null,null],[12,"operator","","",18,null],[12,"args","","",18,null],[3,"WhereFn","","",null,null],[12,"operator","","",19,null],[12,"args","","",19,null],[12,"binding","","",19,null],[3,"OrJoin","","",null,null],[12,"unify_vars","","",20,null],[12,"clauses","","",20,null],[3,"NotJoin","","",null,null],[12,"unify_vars","","",21,null],[12,"clauses","","",21,null],[3,"TypeAnnotation","","",null,null],[12,"value_type","","",22,null],[12,"variable","","",22,null],[3,"ParsedQuery","","",null,null],[12,"find_spec","","",23,null],[12,"default_source","","",23,null],[12,"with","","",23,null],[12,"in_vars","","",23,null],[12,"in_sources","","",23,null],[12,"limit","","",23,null],[12,"where_clauses","","",23,null],[12,"order","","",23,null],[4,"Direction","","",null,null],[13,"Ascending","","",24,null],[13,"Descending","","",24,null],[4,"SrcVar","","",null,null],[13,"DefaultSrc","","",25,null],[13,"NamedSrc","","",25,null],[4,"NonIntegerConstant","","These are the scalar values representable in EDN.",null,null],[13,"Boolean","","",26,null],[13,"BigInteger","","",26,null],[13,"Float","","",26,null],[13,"Text","","",26,null],[13,"Instant","","",26,null],[13,"Uuid","","",26,null],[4,"FnArg","","",null,null],[13,"Variable","","",27,null],[13,"SrcVar","","",27,null],[13,"EntidOrInteger","","",27,null],[13,"IdentOrKeyword","","",27,null],[13,"Constant","","",27,null],[13,"Vector","","",27,null],[4,"PatternNonValuePlace","","e, a, tx can't be values -- no strings, no floats -- and so they can only be variables, entity IDs, ident keywords, or placeholders. This encoding allows us to represent integers that aren't entity IDs. That'll get filtered out in the context of the database.",null,null],[13,"Placeholder","","",28,null],[13,"Variable","","",28,null],[13,"Entid","","",28,null],[13,"Ident","","",28,null],[4,"IdentOrEntid","","",null,null],[13,"Ident","","",29,null],[13,"Entid","","",29,null],[4,"PatternValuePlace","","The `v` part of a pattern can be much broader: it can represent integers that aren't entity IDs (particularly negative integers), strings, and all the rest. We group those under `Constant`.",null,null],[13,"Placeholder","","",30,null],[13,"Variable","","",30,null],[13,"EntidOrInteger","","",30,null],[13,"IdentOrKeyword","","",30,null],[13,"Constant","","",30,null],[4,"PullConcreteAttribute","","",null,null],[13,"Ident","","",31,null],[13,"Entid","","",31,null],[4,"PullAttributeSpec","","",null,null],[13,"Wildcard","","",32,null],[13,"Attribute","","",32,null],[4,"Element","","",null,null],[13,"Variable","","",33,null],[13,"Aggregate","","",33,null],[13,"Corresponding","","In a query with a `max` or `min` aggregate, a corresponding variable (indicated in the query with `(the ?var)`, is guaranteed to come from the row that provided the max or min value. Queries with more than one `max` or `min` cannot yield predictable behavior, and will err during algebrizing.",33,null],[13,"Pull","","",33,null],[4,"Limit","","",null,null],[13,"None","","",34,null],[13,"Fixed","","",34,null],[13,"Variable","","",34,null],[4,"FindSpec","","A definition of the first part of a find query: the `[:find ?foo ?bar…]` bit.",null,null],[13,"FindRel","","Returns an array of arrays, represented as a single array with length a multiple of width.",35,null],[13,"FindColl","","Returns an array of scalars, usually homogeneous. This is equivalent to mapping over the results of a `FindRel`, returning the first value of each.",35,null],[13,"FindTuple","","Returns a single tuple: a heterogeneous array of scalars. Equivalent to taking the first result from a `FindRel`.",35,null],[13,"FindScalar","","Returns a single scalar value. Equivalent to taking the first result from a `FindColl`.",35,null],[4,"VariableOrPlaceholder","","",null,null],[13,"Placeholder","","",36,null],[13,"Variable","","",36,null],[4,"Binding","","",null,null],[13,"BindScalar","","",37,null],[13,"BindColl","","",37,null],[13,"BindRel","","",37,null],[13,"BindTuple","","",37,null],[4,"UnifyVars","","",null,null],[13,"Implicit","","`Implicit` means the variables in an `or` or `not` are derived from the enclosed pattern. DataScript regards these vars as 'free': these variables don't need to be bound by the enclosing environment.",38,null],[13,"Explicit","","`Explicit` means the variables in an `or-join` or `not-join` are explicitly listed, specified with `required-vars` syntax.",38,null],[4,"OrWhereClause","","",null,null],[13,"Clause","","",39,null],[13,"And","","",39,null],[4,"WhereClause","","",null,null],[13,"NotJoin","","",40,null],[13,"OrJoin","","",40,null],[13,"Pred","","",40,null],[13,"WhereFn","","",40,null],[13,"RuleExpr","","",40,null],[13,"Pattern","","",40,null],[13,"TypeAnnotation","","",40,null],[6,"SrcVarName","","",null,null],[8,"FromValue","","",null,null],[10,"from_value","","",41,{"inputs":[{"name":"valueandspan"}],"output":{"name":"option"}}],[8,"ContainsVariables","","",null,null],[10,"accumulate_mentioned_variables","","",42,{"inputs":[{"name":"self"},{"name":"btreeset"}],"output":null}],[11,"collect_mentioned_variables","","",42,{"inputs":[{"name":"self"}],"output":{"generics":["variable"],"name":"btreeset"}}],[11,"clone","","",11,{"inputs":[{"name":"self"}],"output":{"name":"variable"}}],[11,"eq","","",11,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"ne","","",11,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"hash","","",11,null],[11,"partial_cmp","","",11,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",11,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"le","","",11,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"gt","","",11,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"ge","","",11,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"cmp","","",11,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"ordering"}}],[11,"as_str","","",11,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"to_string","","",11,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"name","","",11,{"inputs":[{"name":"self"}],"output":{"name":"plainsymbol"}}],[11,"from_valid_name","","Return a new `Variable`, assuming that the provided string is a valid name.",11,{"inputs":[{"name":"str"}],"output":{"name":"variable"}}],[11,"from_value","","",11,{"inputs":[{"name":"valueandspan"}],"output":{"generics":["variable"],"name":"option"}}],[11,"from_rc","","",11,{"inputs":[{"generics":["plainsymbol"],"name":"rc"}],"output":{"generics":["variable"],"name":"option"}}],[11,"from_symbol","","TODO: intern strings. #398.",11,{"inputs":[{"name":"plainsymbol"}],"output":{"generics":["variable"],"name":"option"}}],[11,"fmt","","",11,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",11,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"clone","","",12,{"inputs":[{"name":"self"}],"output":{"name":"queryfunction"}}],[11,"fmt","","",12,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",12,{"inputs":[{"name":"self"},{"name":"queryfunction"}],"output":{"name":"bool"}}],[11,"ne","","",12,{"inputs":[{"name":"self"},{"name":"queryfunction"}],"output":{"name":"bool"}}],[11,"partial_cmp","","",12,{"inputs":[{"name":"self"},{"name":"queryfunction"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",12,{"inputs":[{"name":"self"},{"name":"queryfunction"}],"output":{"name":"bool"}}],[11,"le","","",12,{"inputs":[{"name":"self"},{"name":"queryfunction"}],"output":{"name":"bool"}}],[11,"gt","","",12,{"inputs":[{"name":"self"},{"name":"queryfunction"}],"output":{"name":"bool"}}],[11,"ge","","",12,{"inputs":[{"name":"self"},{"name":"queryfunction"}],"output":{"name":"bool"}}],[11,"cmp","","",12,{"inputs":[{"name":"self"},{"name":"queryfunction"}],"output":{"name":"ordering"}}],[11,"from_value","","",12,{"inputs":[{"name":"valueandspan"}],"output":{"generics":["queryfunction"],"name":"option"}}],[11,"from_symbol","","",12,{"inputs":[{"name":"plainsymbol"}],"output":{"generics":["queryfunction"],"name":"option"}}],[11,"fmt","","",12,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"clone","","",24,{"inputs":[{"name":"self"}],"output":{"name":"direction"}}],[11,"fmt","","",24,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",24,{"inputs":[{"name":"self"},{"name":"direction"}],"output":{"name":"bool"}}],[11,"clone","","",13,{"inputs":[{"name":"self"}],"output":{"name":"order"}}],[11,"fmt","","",13,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",13,{"inputs":[{"name":"self"},{"name":"order"}],"output":{"name":"bool"}}],[11,"ne","","",13,{"inputs":[{"name":"self"},{"name":"order"}],"output":{"name":"bool"}}],[11,"clone","","",25,{"inputs":[{"name":"self"}],"output":{"name":"srcvar"}}],[11,"fmt","","",25,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",25,{"inputs":[{"name":"self"},{"name":"srcvar"}],"output":{"name":"bool"}}],[11,"ne","","",25,{"inputs":[{"name":"self"},{"name":"srcvar"}],"output":{"name":"bool"}}],[11,"partial_cmp","","",25,{"inputs":[{"name":"self"},{"name":"srcvar"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",25,{"inputs":[{"name":"self"},{"name":"srcvar"}],"output":{"name":"bool"}}],[11,"le","","",25,{"inputs":[{"name":"self"},{"name":"srcvar"}],"output":{"name":"bool"}}],[11,"gt","","",25,{"inputs":[{"name":"self"},{"name":"srcvar"}],"output":{"name":"bool"}}],[11,"ge","","",25,{"inputs":[{"name":"self"},{"name":"srcvar"}],"output":{"name":"bool"}}],[11,"cmp","","",25,{"inputs":[{"name":"self"},{"name":"srcvar"}],"output":{"name":"ordering"}}],[11,"from_value","","",25,{"inputs":[{"name":"valueandspan"}],"output":{"generics":["srcvar"],"name":"option"}}],[11,"from_symbol","","",25,{"inputs":[{"name":"plainsymbol"}],"output":{"generics":["srcvar"],"name":"option"}}],[11,"clone","","",26,{"inputs":[{"name":"self"}],"output":{"name":"nonintegerconstant"}}],[11,"fmt","","",26,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",26,{"inputs":[{"name":"self"},{"name":"nonintegerconstant"}],"output":{"name":"bool"}}],[11,"ne","","",26,{"inputs":[{"name":"self"},{"name":"nonintegerconstant"}],"output":{"name":"bool"}}],[11,"from","","",26,{"inputs":[{"name":"str"}],"output":{"name":"nonintegerconstant"}}],[11,"from","","",26,{"inputs":[{"name":"string"}],"output":{"name":"nonintegerconstant"}}],[11,"clone","","",27,{"inputs":[{"name":"self"}],"output":{"name":"fnarg"}}],[11,"fmt","","",27,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",27,{"inputs":[{"name":"self"},{"name":"fnarg"}],"output":{"name":"bool"}}],[11,"ne","","",27,{"inputs":[{"name":"self"},{"name":"fnarg"}],"output":{"name":"bool"}}],[11,"from_value","","",27,{"inputs":[{"name":"valueandspan"}],"output":{"generics":["fnarg"],"name":"option"}}],[11,"fmt","","",27,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"as_variable","","",27,{"inputs":[{"name":"self"}],"output":{"generics":["variable"],"name":"option"}}],[11,"clone","","",28,{"inputs":[{"name":"self"}],"output":{"name":"patternnonvalueplace"}}],[11,"fmt","","",28,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",28,{"inputs":[{"name":"self"},{"name":"patternnonvalueplace"}],"output":{"name":"bool"}}],[11,"ne","","",28,{"inputs":[{"name":"self"},{"name":"patternnonvalueplace"}],"output":{"name":"bool"}}],[11,"from","","",28,{"inputs":[{"generics":["keyword"],"name":"rc"}],"output":{"name":"self"}}],[11,"from","","",28,{"inputs":[{"name":"keyword"}],"output":{"name":"self"}}],[11,"from_value","","",28,{"inputs":[{"name":"valueandspan"}],"output":{"generics":["patternnonvalueplace"],"name":"option"}}],[11,"clone","","",29,{"inputs":[{"name":"self"}],"output":{"name":"identorentid"}}],[11,"fmt","","",29,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",29,{"inputs":[{"name":"self"},{"name":"identorentid"}],"output":{"name":"bool"}}],[11,"ne","","",29,{"inputs":[{"name":"self"},{"name":"identorentid"}],"output":{"name":"bool"}}],[11,"clone","","",30,{"inputs":[{"name":"self"}],"output":{"name":"patternvalueplace"}}],[11,"fmt","","",30,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",30,{"inputs":[{"name":"self"},{"name":"patternvalueplace"}],"output":{"name":"bool"}}],[11,"ne","","",30,{"inputs":[{"name":"self"},{"name":"patternvalueplace"}],"output":{"name":"bool"}}],[11,"from","","",30,{"inputs":[{"generics":["keyword"],"name":"rc"}],"output":{"name":"self"}}],[11,"from","","",30,{"inputs":[{"name":"keyword"}],"output":{"name":"self"}}],[11,"from_value","","",30,{"inputs":[{"name":"valueandspan"}],"output":{"generics":["patternvalueplace"],"name":"option"}}],[11,"clone","","",31,{"inputs":[{"name":"self"}],"output":{"name":"pullconcreteattribute"}}],[11,"fmt","","",31,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",31,{"inputs":[{"name":"self"},{"name":"pullconcreteattribute"}],"output":{"name":"bool"}}],[11,"ne","","",31,{"inputs":[{"name":"self"},{"name":"pullconcreteattribute"}],"output":{"name":"bool"}}],[11,"clone","","",14,{"inputs":[{"name":"self"}],"output":{"name":"namedpullattribute"}}],[11,"fmt","","",14,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",14,{"inputs":[{"name":"self"},{"name":"namedpullattribute"}],"output":{"name":"bool"}}],[11,"ne","","",14,{"inputs":[{"name":"self"},{"name":"namedpullattribute"}],"output":{"name":"bool"}}],[11,"from","","",14,{"inputs":[{"name":"pullconcreteattribute"}],"output":{"name":"self"}}],[11,"clone","","",32,{"inputs":[{"name":"self"}],"output":{"name":"pullattributespec"}}],[11,"fmt","","",32,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",32,{"inputs":[{"name":"self"},{"name":"pullattributespec"}],"output":{"name":"bool"}}],[11,"ne","","",32,{"inputs":[{"name":"self"},{"name":"pullattributespec"}],"output":{"name":"bool"}}],[11,"fmt","","",31,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",14,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",32,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",15,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",15,{"inputs":[{"name":"self"},{"name":"pull"}],"output":{"name":"bool"}}],[11,"ne","","",15,{"inputs":[{"name":"self"},{"name":"pull"}],"output":{"name":"bool"}}],[11,"fmt","","",16,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",16,{"inputs":[{"name":"self"},{"name":"aggregate"}],"output":{"name":"bool"}}],[11,"ne","","",16,{"inputs":[{"name":"self"},{"name":"aggregate"}],"output":{"name":"bool"}}],[11,"fmt","","",33,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",33,{"inputs":[{"name":"self"},{"name":"element"}],"output":{"name":"bool"}}],[11,"ne","","",33,{"inputs":[{"name":"self"},{"name":"element"}],"output":{"name":"bool"}}],[11,"is_unit","","Returns true if the element must yield only one value.",33,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"from","","",33,{"inputs":[{"name":"variable"}],"output":{"name":"element"}}],[11,"fmt","","",33,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"clone","","",34,{"inputs":[{"name":"self"}],"output":{"name":"limit"}}],[11,"fmt","","",34,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",34,{"inputs":[{"name":"self"},{"name":"limit"}],"output":{"name":"bool"}}],[11,"ne","","",34,{"inputs":[{"name":"self"},{"name":"limit"}],"output":{"name":"bool"}}],[11,"fmt","","",35,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",35,{"inputs":[{"name":"self"},{"name":"findspec"}],"output":{"name":"bool"}}],[11,"ne","","",35,{"inputs":[{"name":"self"},{"name":"findspec"}],"output":{"name":"bool"}}],[11,"is_unit_limited","","",35,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"expected_column_count","","",35,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"requires_distinct","","Returns true if the provided `FindSpec` cares about distinct results.",35,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"columns","","",35,{"inputs":[{"name":"self"}],"output":{"generics":["iterator"],"name":"box"}}],[11,"clone","","",36,{"inputs":[{"name":"self"}],"output":{"name":"variableorplaceholder"}}],[11,"fmt","","",36,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",36,null],[11,"eq","","",36,{"inputs":[{"name":"self"},{"name":"variableorplaceholder"}],"output":{"name":"bool"}}],[11,"ne","","",36,{"inputs":[{"name":"self"},{"name":"variableorplaceholder"}],"output":{"name":"bool"}}],[11,"into_var","","",36,{"inputs":[{"name":"self"}],"output":{"generics":["variable"],"name":"option"}}],[11,"var","","",36,{"inputs":[{"name":"self"}],"output":{"generics":["variable"],"name":"option"}}],[11,"clone","","",37,{"inputs":[{"name":"self"}],"output":{"name":"binding"}}],[11,"fmt","","",37,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",37,{"inputs":[{"name":"self"},{"name":"binding"}],"output":{"name":"bool"}}],[11,"ne","","",37,{"inputs":[{"name":"self"},{"name":"binding"}],"output":{"name":"bool"}}],[11,"variables","","Return each variable or `None`, in order.",37,{"inputs":[{"name":"self"}],"output":{"generics":["option"],"name":"vec"}}],[11,"is_empty","","Return `true` if no variables are bound, i.e., all binding entries are placeholders.",37,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_valid","","Return `true` if no variable is bound twice, i.e., each binding entry is either a placeholder or unique.",37,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"clone","","",17,{"inputs":[{"name":"self"}],"output":{"name":"pattern"}}],[11,"fmt","","",17,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",17,{"inputs":[{"name":"self"},{"name":"pattern"}],"output":{"name":"bool"}}],[11,"ne","","",17,{"inputs":[{"name":"self"},{"name":"pattern"}],"output":{"name":"bool"}}],[11,"simple","","",17,{"inputs":[{"name":"patternnonvalueplace"},{"name":"patternnonvalueplace"},{"name":"patternvalueplace"}],"output":{"generics":["pattern"],"name":"option"}}],[11,"new","","",17,{"inputs":[{"generics":["srcvar"],"name":"option"},{"name":"patternnonvalueplace"},{"name":"patternnonvalueplace"},{"name":"patternvalueplace"},{"name":"patternnonvalueplace"}],"output":{"generics":["pattern"],"name":"option"}}],[11,"clone","","",18,{"inputs":[{"name":"self"}],"output":{"name":"predicate"}}],[11,"fmt","","",18,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",18,{"inputs":[{"name":"self"},{"name":"predicate"}],"output":{"name":"bool"}}],[11,"ne","","",18,{"inputs":[{"name":"self"},{"name":"predicate"}],"output":{"name":"bool"}}],[11,"clone","","",19,{"inputs":[{"name":"self"}],"output":{"name":"wherefn"}}],[11,"fmt","","",19,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",19,{"inputs":[{"name":"self"},{"name":"wherefn"}],"output":{"name":"bool"}}],[11,"ne","","",19,{"inputs":[{"name":"self"},{"name":"wherefn"}],"output":{"name":"bool"}}],[11,"clone","","",38,{"inputs":[{"name":"self"}],"output":{"name":"unifyvars"}}],[11,"fmt","","",38,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",38,{"inputs":[{"name":"self"},{"name":"unifyvars"}],"output":{"name":"bool"}}],[11,"ne","","",38,{"inputs":[{"name":"self"},{"name":"unifyvars"}],"output":{"name":"bool"}}],[11,"is_pattern","","",40,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"clone","","",39,{"inputs":[{"name":"self"}],"output":{"name":"orwhereclause"}}],[11,"fmt","","",39,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",39,{"inputs":[{"name":"self"},{"name":"orwhereclause"}],"output":{"name":"bool"}}],[11,"ne","","",39,{"inputs":[{"name":"self"},{"name":"orwhereclause"}],"output":{"name":"bool"}}],[11,"is_pattern_or_patterns","","",39,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"clone","","",20,{"inputs":[{"name":"self"}],"output":{"name":"orjoin"}}],[11,"fmt","","",20,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",20,{"inputs":[{"name":"self"},{"name":"orjoin"}],"output":{"name":"bool"}}],[11,"ne","","",20,{"inputs":[{"name":"self"},{"name":"orjoin"}],"output":{"name":"bool"}}],[11,"clone","","",21,{"inputs":[{"name":"self"}],"output":{"name":"notjoin"}}],[11,"fmt","","",21,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",21,{"inputs":[{"name":"self"},{"name":"notjoin"}],"output":{"name":"bool"}}],[11,"ne","","",21,{"inputs":[{"name":"self"},{"name":"notjoin"}],"output":{"name":"bool"}}],[11,"new","","",21,{"inputs":[{"name":"unifyvars"},{"generics":["whereclause"],"name":"vec"}],"output":{"name":"notjoin"}}],[11,"clone","","",22,{"inputs":[{"name":"self"}],"output":{"name":"typeannotation"}}],[11,"fmt","","",22,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",22,{"inputs":[{"name":"self"},{"name":"typeannotation"}],"output":{"name":"bool"}}],[11,"ne","","",22,{"inputs":[{"name":"self"},{"name":"typeannotation"}],"output":{"name":"bool"}}],[11,"clone","","",40,{"inputs":[{"name":"self"}],"output":{"name":"whereclause"}}],[11,"fmt","","",40,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",40,{"inputs":[{"name":"self"},{"name":"whereclause"}],"output":{"name":"bool"}}],[11,"ne","","",40,{"inputs":[{"name":"self"},{"name":"whereclause"}],"output":{"name":"bool"}}],[11,"fmt","","",23,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",23,{"inputs":[{"name":"self"},{"name":"parsedquery"}],"output":{"name":"bool"}}],[11,"ne","","",23,{"inputs":[{"name":"self"},{"name":"parsedquery"}],"output":{"name":"bool"}}],[11,"new","","",20,{"inputs":[{"name":"unifyvars"},{"generics":["orwhereclause"],"name":"vec"}],"output":{"name":"orjoin"}}],[11,"is_fully_unified","","Return true if either the `OrJoin` is `UnifyVars::Implicit`, or if every variable mentioned inside the join is also mentioned in the `UnifyVars` list.",20,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"accumulate_mentioned_variables","","",40,{"inputs":[{"name":"self"},{"name":"btreeset"}],"output":null}],[11,"accumulate_mentioned_variables","","",39,{"inputs":[{"name":"self"},{"name":"btreeset"}],"output":null}],[11,"accumulate_mentioned_variables","","",20,{"inputs":[{"name":"self"},{"name":"btreeset"}],"output":null}],[11,"dismember","","",20,null],[11,"mentioned_variables","","",20,{"inputs":[{"name":"self"}],"output":{"name":"btreeset"}}],[11,"accumulate_mentioned_variables","","",21,{"inputs":[{"name":"self"},{"name":"btreeset"}],"output":null}],[11,"accumulate_mentioned_variables","","",18,{"inputs":[{"name":"self"},{"name":"btreeset"}],"output":null}],[11,"accumulate_mentioned_variables","","",22,{"inputs":[{"name":"self"},{"name":"btreeset"}],"output":null}],[11,"accumulate_mentioned_variables","","",37,{"inputs":[{"name":"self"},{"name":"btreeset"}],"output":null}],[11,"accumulate_mentioned_variables","","",19,{"inputs":[{"name":"self"},{"name":"btreeset"}],"output":null}],[11,"accumulate_mentioned_variables","","",17,{"inputs":[{"name":"self"},{"name":"btreeset"}],"output":null}],[0,"symbols","edn","",null,null],[3,"PlainSymbol","edn::symbols","A simplification of Clojure's Symbol.",null,null],[12,"0","","",43,null],[3,"NamespacedSymbol","","",null,null],[3,"Keyword","","A keyword is a symbol, optionally with a namespace, that prints with a leading colon. This concept is imported from Clojure, as it features in EDN and the query syntax that we use.",null,null],[11,"clone","","",43,{"inputs":[{"name":"self"}],"output":{"name":"plainsymbol"}}],[11,"fmt","","",43,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",43,null],[11,"cmp","","",43,{"inputs":[{"name":"self"},{"name":"plainsymbol"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",43,{"inputs":[{"name":"self"},{"name":"plainsymbol"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",43,{"inputs":[{"name":"self"},{"name":"plainsymbol"}],"output":{"name":"bool"}}],[11,"le","","",43,{"inputs":[{"name":"self"},{"name":"plainsymbol"}],"output":{"name":"bool"}}],[11,"gt","","",43,{"inputs":[{"name":"self"},{"name":"plainsymbol"}],"output":{"name":"bool"}}],[11,"ge","","",43,{"inputs":[{"name":"self"},{"name":"plainsymbol"}],"output":{"name":"bool"}}],[11,"eq","","",43,{"inputs":[{"name":"self"},{"name":"plainsymbol"}],"output":{"name":"bool"}}],[11,"ne","","",43,{"inputs":[{"name":"self"},{"name":"plainsymbol"}],"output":{"name":"bool"}}],[11,"clone","","",44,{"inputs":[{"name":"self"}],"output":{"name":"namespacedsymbol"}}],[11,"fmt","","",44,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",44,null],[11,"cmp","","",44,{"inputs":[{"name":"self"},{"name":"namespacedsymbol"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",44,{"inputs":[{"name":"self"},{"name":"namespacedsymbol"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",44,{"inputs":[{"name":"self"},{"name":"namespacedsymbol"}],"output":{"name":"bool"}}],[11,"le","","",44,{"inputs":[{"name":"self"},{"name":"namespacedsymbol"}],"output":{"name":"bool"}}],[11,"gt","","",44,{"inputs":[{"name":"self"},{"name":"namespacedsymbol"}],"output":{"name":"bool"}}],[11,"ge","","",44,{"inputs":[{"name":"self"},{"name":"namespacedsymbol"}],"output":{"name":"bool"}}],[11,"eq","","",44,{"inputs":[{"name":"self"},{"name":"namespacedsymbol"}],"output":{"name":"bool"}}],[11,"ne","","",44,{"inputs":[{"name":"self"},{"name":"namespacedsymbol"}],"output":{"name":"bool"}}],[11,"clone","","",45,{"inputs":[{"name":"self"}],"output":{"name":"keyword"}}],[11,"fmt","","",45,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",45,null],[11,"cmp","","",45,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",45,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",45,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"le","","",45,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"gt","","",45,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"ge","","",45,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"eq","","",45,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"ne","","",45,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"plain","","",43,{"inputs":[{"name":"t"}],"output":{"name":"self"}}],[11,"name","","Return the name of the symbol without any leading '?' or '$'.",43,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"is_var_symbol","","",43,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_src_symbol","","",43,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"namespaced","","",44,{"inputs":[{"name":"n"},{"name":"t"}],"output":{"name":"self"}}],[11,"name","","",44,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"namespace","","",44,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"components","","",44,null],[11,"plain","","",45,{"inputs":[{"name":"t"}],"output":{"name":"self"}}],[11,"namespaced","","Creates a new `Keyword`.",45,{"inputs":[{"name":"n"},{"name":"t"}],"output":{"name":"self"}}],[11,"name","","",45,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"namespace","","",45,{"inputs":[{"name":"self"}],"output":{"generics":["str"],"name":"option"}}],[11,"components","","",45,null],[11,"is_backward","","Whether this `Keyword` should be interpreted in reverse order. For example, the two following snippets are identical:",45,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_forward","","Whether this `Keyword` should be interpreted in forward order. See `symbols::Keyword::is_backward`.",45,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_namespaced","","",45,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"to_reversed","","Returns a `Keyword` with the same namespace and a 'backward' name. See `symbols::Keyword::is_backward`.",45,{"inputs":[{"name":"self"}],"output":{"name":"keyword"}}],[11,"unreversed","","If this `Keyword` is 'backward' (see `symbols::Keyword::is_backward`), return `Some('forward name')`; otherwise, return `None`.",45,{"inputs":[{"name":"self"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"fmt","","Print the symbol in EDN format.",43,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","Print the symbol in EDN format.",44,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","Print the keyword in EDN format.",45,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[0,"types","edn","",null,null],[3,"Span","edn::types","Span represents the current offset (start, end) into the input string.",null,null],[12,"0","","",46,null],[12,"1","","",46,null],[3,"ValueAndSpan","","A wrapper type around `SpannedValue` and `Span`, representing some EDN value and the parsing offset (start, end) in the original EDN string.",null,null],[12,"inner","","",47,null],[12,"span","","",47,null],[4,"Value","","Value represents one of the allowed values in an EDN string.",null,null],[13,"Nil","","",48,null],[13,"Boolean","","",48,null],[13,"Integer","","",48,null],[13,"Instant","","",48,null],[13,"BigInteger","","",48,null],[13,"Float","","",48,null],[13,"Text","","",48,null],[13,"Uuid","","",48,null],[13,"PlainSymbol","","",48,null],[13,"NamespacedSymbol","","",48,null],[13,"Keyword","","",48,null],[13,"Vector","","",48,null],[13,"List","","",48,null],[13,"Set","","",48,null],[13,"Map","","",48,null],[4,"SpannedValue","","`SpannedValue` is the parallel to `Value` but used in `ValueAndSpan`. Container types have `ValueAndSpan` children.",null,null],[13,"Nil","","",49,null],[13,"Boolean","","",49,null],[13,"Integer","","",49,null],[13,"Instant","","",49,null],[13,"BigInteger","","",49,null],[13,"Float","","",49,null],[13,"Text","","",49,null],[13,"Uuid","","",49,null],[13,"PlainSymbol","","",49,null],[13,"NamespacedSymbol","","",49,null],[13,"Keyword","","",49,null],[13,"Vector","","",49,null],[13,"List","","",49,null],[13,"Set","","",49,null],[13,"Map","","",49,null],[8,"FromMicros","","",null,null],[10,"from_micros","","",50,{"inputs":[{"name":"i64"}],"output":{"name":"self"}}],[8,"ToMicros","","",null,null],[10,"to_micros","","",51,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[11,"eq","","",48,{"inputs":[{"name":"self"},{"name":"value"}],"output":{"name":"bool"}}],[11,"ne","","",48,{"inputs":[{"name":"self"},{"name":"value"}],"output":{"name":"bool"}}],[11,"hash","","",48,null],[11,"clone","","",48,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"fmt","","",48,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",49,{"inputs":[{"name":"self"},{"name":"spannedvalue"}],"output":{"name":"bool"}}],[11,"ne","","",49,{"inputs":[{"name":"self"},{"name":"spannedvalue"}],"output":{"name":"bool"}}],[11,"hash","","",49,null],[11,"clone","","",49,{"inputs":[{"name":"self"}],"output":{"name":"spannedvalue"}}],[11,"fmt","","",49,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"clone","","",46,{"inputs":[{"name":"self"}],"output":{"name":"span"}}],[11,"fmt","","",46,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",46,null],[11,"eq","","",46,{"inputs":[{"name":"self"},{"name":"span"}],"output":{"name":"bool"}}],[11,"ne","","",46,{"inputs":[{"name":"self"},{"name":"span"}],"output":{"name":"bool"}}],[11,"new","","",46,{"inputs":[{"name":"usize"},{"name":"usize"}],"output":{"name":"span"}}],[11,"eq","","",47,{"inputs":[{"name":"self"},{"name":"valueandspan"}],"output":{"name":"bool"}}],[11,"ne","","",47,{"inputs":[{"name":"self"},{"name":"valueandspan"}],"output":{"name":"bool"}}],[11,"hash","","",47,null],[11,"clone","","",47,{"inputs":[{"name":"self"}],"output":{"name":"valueandspan"}}],[11,"fmt","","",47,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"new","","",47,{"inputs":[{"name":"spannedvalue"},{"name":"i"}],"output":{"name":"valueandspan"}}],[11,"into_atom","","",47,{"inputs":[{"name":"self"}],"output":{"generics":["valueandspan"],"name":"option"}}],[11,"is_atom","","",47,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"as_atom","","",47,{"inputs":[{"name":"self"}],"output":{"generics":["valueandspan"],"name":"option"}}],[11,"into_text","","",47,{"inputs":[{"name":"self"}],"output":{"generics":["string"],"name":"option"}}],[11,"as_text","","",47,{"inputs":[{"name":"self"}],"output":{"generics":["string"],"name":"option"}}],[11,"with_spans","","For debug use only!",48,{"inputs":[{"name":"self"}],"output":{"name":"valueandspan"}}],[11,"from","","",48,{"inputs":[{"name":"spannedvalue"}],"output":{"name":"value"}}],[11,"from","","",48,{"inputs":[{"name":"valueandspan"}],"output":{"name":"value"}}],[11,"is_nil","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_boolean","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_integer","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_instant","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_big_integer","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_float","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_text","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_uuid","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_symbol","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_namespaced_symbol","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_vector","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_list","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_set","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_map","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_keyword","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_namespaced_keyword","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"as_nil","","`as_nil` does not use the macro as it does not have an underlying value, and returns `Option<()>`.",48,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"as_boolean","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["bool"],"name":"option"}}],[11,"as_integer","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"as_instant","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"as_float","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["f64"],"name":"option"}}],[11,"as_big_integer","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["bigint"],"name":"option"}}],[11,"as_ordered_float","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["orderedfloat"],"name":"option"}}],[11,"as_text","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["string"],"name":"option"}}],[11,"as_uuid","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["uuid"],"name":"option"}}],[11,"as_symbol","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["plainsymbol"],"name":"option"}}],[11,"as_namespaced_symbol","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["namespacedsymbol"],"name":"option"}}],[11,"as_keyword","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"as_plain_keyword","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"as_namespaced_keyword","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"as_vector","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["vec"],"name":"option"}}],[11,"as_list","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["linkedlist"],"name":"option"}}],[11,"as_set","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["btreeset"],"name":"option"}}],[11,"as_map","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["btreemap"],"name":"option"}}],[11,"into_boolean","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["bool"],"name":"option"}}],[11,"into_integer","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_instant","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"into_big_integer","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["bigint"],"name":"option"}}],[11,"into_ordered_float","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["orderedfloat"],"name":"option"}}],[11,"into_float","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["f64"],"name":"option"}}],[11,"into_text","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["string"],"name":"option"}}],[11,"into_uuid","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["uuid"],"name":"option"}}],[11,"into_symbol","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["plainsymbol"],"name":"option"}}],[11,"into_namespaced_symbol","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["namespacedsymbol"],"name":"option"}}],[11,"into_keyword","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"into_plain_keyword","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"into_namespaced_keyword","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"into_vector","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["vec"],"name":"option"}}],[11,"into_list","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["linkedlist"],"name":"option"}}],[11,"into_set","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["btreeset"],"name":"option"}}],[11,"into_map","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["btreemap"],"name":"option"}}],[11,"from_bigint","","",48,{"inputs":[{"name":"str"}],"output":{"generics":["value"],"name":"option"}}],[11,"from_float","","",48,{"inputs":[{"name":"f64"}],"output":{"name":"value"}}],[11,"from_ordered_float","","",48,{"inputs":[{"generics":["f64"],"name":"orderedfloat"}],"output":{"name":"value"}}],[11,"from_symbol","","",48,{"inputs":[{"name":"t"},{"name":"str"}],"output":{"name":"value"}}],[11,"from_keyword","","",48,{"inputs":[{"name":"t"},{"name":"str"}],"output":{"name":"value"}}],[11,"is_collection","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_atom","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"into_atom","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["value"],"name":"option"}}],[11,"partial_cmp","","",48,{"inputs":[{"name":"self"},{"name":"value"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"cmp","","",48,{"inputs":[{"name":"self"},{"name":"value"}],"output":{"name":"ordering"}}],[11,"fmt","","",48,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"is_nil","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_boolean","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_integer","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_instant","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_big_integer","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_float","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_text","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_uuid","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_symbol","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_namespaced_symbol","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_vector","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_list","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_set","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_map","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_keyword","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_namespaced_keyword","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"as_nil","","`as_nil` does not use the macro as it does not have an underlying value, and returns `Option<()>`.",49,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"as_boolean","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["bool"],"name":"option"}}],[11,"as_integer","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"as_instant","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"as_float","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["f64"],"name":"option"}}],[11,"as_big_integer","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["bigint"],"name":"option"}}],[11,"as_ordered_float","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["orderedfloat"],"name":"option"}}],[11,"as_text","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["string"],"name":"option"}}],[11,"as_uuid","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["uuid"],"name":"option"}}],[11,"as_symbol","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["plainsymbol"],"name":"option"}}],[11,"as_namespaced_symbol","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["namespacedsymbol"],"name":"option"}}],[11,"as_keyword","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"as_plain_keyword","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"as_namespaced_keyword","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"as_vector","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["vec"],"name":"option"}}],[11,"as_list","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["linkedlist"],"name":"option"}}],[11,"as_set","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["btreeset"],"name":"option"}}],[11,"as_map","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["btreemap"],"name":"option"}}],[11,"into_boolean","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["bool"],"name":"option"}}],[11,"into_integer","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_instant","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"into_big_integer","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["bigint"],"name":"option"}}],[11,"into_ordered_float","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["orderedfloat"],"name":"option"}}],[11,"into_float","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["f64"],"name":"option"}}],[11,"into_text","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["string"],"name":"option"}}],[11,"into_uuid","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["uuid"],"name":"option"}}],[11,"into_symbol","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["plainsymbol"],"name":"option"}}],[11,"into_namespaced_symbol","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["namespacedsymbol"],"name":"option"}}],[11,"into_keyword","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"into_plain_keyword","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"into_namespaced_keyword","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"into_vector","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["vec"],"name":"option"}}],[11,"into_list","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["linkedlist"],"name":"option"}}],[11,"into_set","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["btreeset"],"name":"option"}}],[11,"into_map","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["btreemap"],"name":"option"}}],[11,"from_bigint","","",49,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"option"}}],[11,"from_float","","",49,{"inputs":[{"name":"f64"}],"output":{"name":"spannedvalue"}}],[11,"from_ordered_float","","",49,{"inputs":[{"generics":["f64"],"name":"orderedfloat"}],"output":{"name":"spannedvalue"}}],[11,"from_symbol","","",49,{"inputs":[{"name":"t"},{"name":"str"}],"output":{"name":"spannedvalue"}}],[11,"from_keyword","","",49,{"inputs":[{"name":"t"},{"name":"str"}],"output":{"name":"spannedvalue"}}],[11,"is_collection","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_atom","","",49,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"into_atom","","",49,{"inputs":[{"name":"self"}],"output":{"generics":["spannedvalue"],"name":"option"}}],[11,"partial_cmp","","",49,{"inputs":[{"name":"self"},{"name":"spannedvalue"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"cmp","","",49,{"inputs":[{"name":"self"},{"name":"spannedvalue"}],"output":{"name":"ordering"}}],[11,"fmt","","",49,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"without_spans","","",47,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"partial_cmp","","",47,{"inputs":[{"name":"self"},{"name":"valueandspan"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"cmp","","",47,{"inputs":[{"name":"self"},{"name":"valueandspan"}],"output":{"name":"ordering"}}],[11,"fmt","","",47,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"from_micros","edn","",52,{"inputs":[{"name":"i64"}],"output":{"name":"self"}}],[11,"to_micros","","",52,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[0,"pretty_print","","",null,null],[11,"to_pretty","edn::types","Return a pretty string representation of this `Value`.",48,{"inputs":[{"name":"self"},{"name":"usize"}],"output":{"generics":["string","error"],"name":"result"}}],[0,"utils","edn","",null,null],[5,"merge","edn::utils","Merge the EDN `Value::Map` instance `right` into `left`. Returns `None` if either `left` or `right` is not a `Value::Map`.",null,{"inputs":[{"name":"value"},{"name":"value"}],"output":{"generics":["value"],"name":"option"}}],[0,"matcher","edn","",null,null],[11,"matches","edn::types","Performs default pattern matching between this value and some `pattern`. Returns true if matching succeeds.",48,{"inputs":[{"name":"self"},{"name":"value"}],"output":{"name":"bool"}}],[0,"value_rc","edn","",null,null],[6,"ValueRc","edn::value_rc","This type alias exists to allow us to use different boxing mechanisms for values. This type must implement `FromRc` and `Cloned`, and a `From` implementation must exist for `TypedValue`.",null,null],[8,"FromRc","","",null,null],[10,"from_rc","","",53,{"inputs":[{"name":"rc"}],"output":{"name":"self"}}],[10,"from_arc","","",53,{"inputs":[{"name":"arc"}],"output":{"name":"self"}}],[8,"Cloned","","",null,null],[10,"cloned","","",54,{"inputs":[{"name":"self"}],"output":{"name":"t"}}],[10,"to_value_rc","","",54,{"inputs":[{"name":"self"}],"output":{"name":"valuerc"}}],[0,"parse","edn","",null,null],[3,"ParseError","edn::parse","",null,null],[12,"line","","",55,null],[12,"column","","",55,null],[12,"offset","","",55,null],[12,"expected","","",55,null],[5,"nil","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"nan","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"infinity","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"boolean","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"raw_bigint","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["bigint"],"name":"parseresult"}}],[5,"raw_octalinteger","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["i64"],"name":"parseresult"}}],[5,"raw_hexinteger","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["i64"],"name":"parseresult"}}],[5,"raw_basedinteger","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["i64"],"name":"parseresult"}}],[5,"raw_integer","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["i64"],"name":"parseresult"}}],[5,"raw_float","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["orderedfloat"],"name":"parseresult"}}],[5,"bigint","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"octalinteger","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"hexinteger","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"basedinteger","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"integer","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"float","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"raw_text","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["string"],"name":"parseresult"}}],[5,"text","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"uuid","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"symbol","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"keyword","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"list","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"vector","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"set","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"map","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["spannedvalue"],"name":"parseresult"}}],[5,"value","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["valueandspan"],"name":"parseresult"}}],[5,"op","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["optype"],"name":"parseresult"}}],[5,"entity","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["entity"],"name":"parseresult"}}],[5,"entities","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["vec"],"name":"parseresult"}}],[5,"where_fn","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["whereclause"],"name":"parseresult"}}],[5,"parse_query","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["parsedquery"],"name":"parseresult"}}],[6,"ParseResult","","",null,null],[11,"eq","","",55,{"inputs":[{"name":"self"},{"name":"parseerror"}],"output":{"name":"bool"}}],[11,"ne","","",55,{"inputs":[{"name":"self"},{"name":"parseerror"}],"output":{"name":"bool"}}],[11,"fmt","","",55,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"clone","","",55,{"inputs":[{"name":"self"}],"output":{"name":"parseerror"}}],[11,"fmt","","",55,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"description","","",55,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[14,"ns_keyword","edn","",null,null],[11,"from_utc","","Makes a new `DateTime` with given UTC datetime and offset. The local datetime should be constructed via the `TimeZone` trait.",52,null],[11,"date","","Retrieves a date component.",52,{"inputs":[{"name":"self"}],"output":{"name":"date"}}],[11,"time","","Retrieves a time component. Unlike `date`, this is not associated to the time zone.",52,{"inputs":[{"name":"self"}],"output":{"name":"naivetime"}}],[11,"timestamp","","Returns the number of non-leap seconds since January 1, 1970 0:00:00 UTC (aka \"UNIX timestamp\").",52,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[11,"timestamp_millis","","Returns the number of non-leap-milliseconds since January 1, 1970 UTC",52,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[11,"timestamp_nanos","","Returns the number of non-leap-nanoseconds since January 1, 1970 UTC",52,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[11,"timestamp_subsec_millis","","Returns the number of milliseconds since the last second boundary",52,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"timestamp_subsec_micros","","Returns the number of microseconds since the last second boundary",52,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"timestamp_subsec_nanos","","Returns the number of nanoseconds since the last second boundary",52,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"offset","","Retrieves an associated offset from UTC.",52,null],[11,"timezone","","Retrieves an associated time zone.",52,{"inputs":[{"name":"self"}],"output":{"name":"tz"}}],[11,"with_timezone","","Changes the associated time zone. This does not change the actual `DateTime` (but will change the string representation).",52,{"inputs":[{"name":"self"},{"name":"tz2"}],"output":{"name":"datetime"}}],[11,"checked_add_signed","","Adds given `Duration` to the current date and time.",52,{"inputs":[{"name":"self"},{"name":"duration"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"checked_sub_signed","","Subtracts given `Duration` from the current date and time.",52,{"inputs":[{"name":"self"},{"name":"duration"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"signed_duration_since","","Subtracts another `DateTime` from the current date and time. This does not overflow or underflow at all.",52,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"name":"duration"}}],[11,"naive_utc","","Returns a view to the naive UTC datetime.",52,{"inputs":[{"name":"self"}],"output":{"name":"naivedatetime"}}],[11,"naive_local","","Returns a view to the naive local datetime.",52,{"inputs":[{"name":"self"}],"output":{"name":"naivedatetime"}}],[11,"parse_from_rfc2822","","Parses an RFC 2822 date and time string such as `Tue, 1 Jul 2003 10:52:37 +0200`, then returns a new `DateTime` with a parsed `FixedOffset`.",52,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"parse_from_rfc3339","","Parses an RFC 3339 and ISO 8601 date and time string such as `1996-12-19T16:39:57-08:00`, then returns a new `DateTime` with a parsed `FixedOffset`.",52,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"parse_from_str","","Parses a string with the specified format string and returns a new `DateTime` with a parsed `FixedOffset`. See the `format::strftime` module on the supported escape sequences.",52,{"inputs":[{"name":"str"},{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"to_rfc2822","","Returns an RFC 2822 date and time string such as `Tue, 1 Jul 2003 10:52:37 +0200`.",52,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"to_rfc3339","","Returns an RFC 3339 and ISO 8601 date and time string such as `1996-12-19T16:39:57-08:00`.",52,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"to_rfc3339_opts","","Return an RFC 3339 and ISO 8601 date and time string with subseconds formatted as per a `SecondsFormat`. If passed `use_z` true and the timezone is UTC (offset 0), use 'Z', as per Fixed::TimezoneOffsetColonZ. If passed `use_z` false, use Fixed::TimezoneOffsetColon.",52,{"inputs":[{"name":"self"},{"name":"secondsformat"},{"name":"bool"}],"output":{"name":"string"}}],[11,"format_with_items","","Formats the combined date and time with the specified formatting items.",52,{"inputs":[{"name":"self"},{"name":"i"}],"output":{"name":"delayedformat"}}],[11,"format","","Formats the combined date and time with the specified format string. See the `format::strftime` module on the supported escape sequences.",52,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"generics":["strftimeitems"],"name":"delayedformat"}}],[11,"partial_cmp","","",52,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"clone","","",56,{"inputs":[{"name":"self"}],"output":{"name":"utc"}}],[11,"clone","","",52,{"inputs":[{"name":"self"}],"output":{"name":"datetime"}}],[11,"add","","",52,{"inputs":[{"name":"self"},{"name":"fixedoffset"}],"output":{"name":"datetime"}}],[11,"add","","",52,{"inputs":[{"name":"self"},{"name":"duration"}],"output":{"name":"datetime"}}],[11,"fix","","",56,{"inputs":[{"name":"self"}],"output":{"name":"fixedoffset"}}],[11,"from","","",52,{"inputs":[{"name":"systemtime"}],"output":{"generics":["local"],"name":"datetime"}}],[11,"from","","",52,{"inputs":[{"name":"systemtime"}],"output":{"generics":["utc"],"name":"datetime"}}],[11,"serialize","","Serialize into a rfc3339 time string",52,{"inputs":[{"name":"self"},{"name":"s"}],"output":{"name":"result"}}],[11,"sub","","",52,{"inputs":[{"name":"self"},{"name":"duration"}],"output":{"name":"datetime"}}],[11,"sub","","",52,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"name":"duration"}}],[11,"sub","","",52,{"inputs":[{"name":"self"},{"name":"fixedoffset"}],"output":{"name":"datetime"}}],[11,"from_str","","",52,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"from_str","","",52,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"from_str","","",52,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"cmp","","",52,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"name":"ordering"}}],[11,"hash","","",52,null],[11,"eq","","",56,{"inputs":[{"name":"self"},{"name":"utc"}],"output":{"name":"bool"}}],[11,"eq","","",52,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"name":"bool"}}],[11,"deserialize","","",52,{"inputs":[{"name":"d"}],"output":{"generics":["datetime"],"name":"result"}}],[11,"deserialize","","",52,{"inputs":[{"name":"d"}],"output":{"generics":["datetime"],"name":"result"}}],[11,"deserialize","","",52,{"inputs":[{"name":"d"}],"output":{"generics":["datetime"],"name":"result"}}],[11,"hour","","",52,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"minute","","",52,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"second","","",52,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"nanosecond","","",52,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"with_hour","","",52,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_minute","","",52,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_second","","",52,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_nanosecond","","",52,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"fmt","","",56,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",52,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"year","","",52,{"inputs":[{"name":"self"}],"output":{"name":"i32"}}],[11,"month","","",52,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"month0","","",52,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"day","","",52,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"day0","","",52,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"ordinal","","",52,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"ordinal0","","",52,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"weekday","","",52,{"inputs":[{"name":"self"}],"output":{"name":"weekday"}}],[11,"iso_week","","",52,{"inputs":[{"name":"self"}],"output":{"name":"isoweek"}}],[11,"with_year","","",52,{"inputs":[{"name":"self"},{"name":"i32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_month","","",52,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_month0","","",52,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_day","","",52,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_day0","","",52,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_ordinal","","",52,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_ordinal0","","",52,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"fmt","","",52,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",56,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"from_offset","","",56,{"inputs":[{"name":"utc"}],"output":{"name":"utc"}}],[11,"offset_from_local_date","","",56,{"inputs":[{"name":"self"},{"name":"naivedate"}],"output":{"generics":["utc"],"name":"localresult"}}],[11,"offset_from_local_datetime","","",56,{"inputs":[{"name":"self"},{"name":"naivedatetime"}],"output":{"generics":["utc"],"name":"localresult"}}],[11,"offset_from_utc_date","","",56,{"inputs":[{"name":"self"},{"name":"naivedate"}],"output":{"name":"utc"}}],[11,"offset_from_utc_datetime","","",56,{"inputs":[{"name":"self"},{"name":"naivedatetime"}],"output":{"name":"utc"}}],[11,"shl","","",57,{"inputs":[{"name":"self"},{"name":"usize"}],"output":{"name":"bigint"}}],[11,"to_bigint","","",57,{"inputs":[{"name":"self"}],"output":{"generics":["bigint"],"name":"option"}}],[11,"checked_add","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"generics":["bigint"],"name":"option"}}],[11,"checked_mul","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"generics":["bigint"],"name":"option"}}],[11,"clone","","",57,{"inputs":[{"name":"self"}],"output":{"name":"bigint"}}],[11,"fmt","","",57,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"u64"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"isize"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"i8"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"i16"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"i32"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"u16"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"i8"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"isize"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"u16"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"i16"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"u8"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"usize"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"u8"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"i32"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"usize"}],"output":{"name":"bigint"}}],[11,"rem","","",57,{"inputs":[{"name":"self"},{"name":"u64"}],"output":{"name":"bigint"}}],[11,"from_i64","","",57,{"inputs":[{"name":"i64"}],"output":{"generics":["bigint"],"name":"option"}}],[11,"from_u64","","",57,{"inputs":[{"name":"u64"}],"output":{"generics":["bigint"],"name":"option"}}],[11,"from_f64","","",57,{"inputs":[{"name":"f64"}],"output":{"generics":["bigint"],"name":"option"}}],[11,"from_str","","",57,{"inputs":[{"name":"str"}],"output":{"generics":["bigint","parsebiginterror"],"name":"result"}}],[11,"hash","","",57,null],[11,"abs","","",57,{"inputs":[{"name":"self"}],"output":{"name":"bigint"}}],[11,"abs_sub","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bigint"}}],[11,"signum","","",57,{"inputs":[{"name":"self"}],"output":{"name":"bigint"}}],[11,"is_positive","","",57,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_negative","","",57,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"to_i64","","",57,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"to_u64","","",57,{"inputs":[{"name":"self"}],"output":{"generics":["u64"],"name":"option"}}],[11,"to_f32","","",57,{"inputs":[{"name":"self"}],"output":{"generics":["f32"],"name":"option"}}],[11,"to_f64","","",57,{"inputs":[{"name":"self"}],"output":{"generics":["f64"],"name":"option"}}],[11,"from_str_radix","","Creates and initializes a BigInt.",57,{"inputs":[{"name":"str"},{"name":"u32"}],"output":{"generics":["bigint","parsebiginterror"],"name":"result"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"i8"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"u64"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"u16"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"isize"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"u64"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"isize"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"i16"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"i32"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"usize"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"u16"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"i32"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"i8"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"i16"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"usize"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"u8"}],"output":{"name":"bigint"}}],[11,"mul","","",57,{"inputs":[{"name":"self"},{"name":"u8"}],"output":{"name":"bigint"}}],[11,"checked_div","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"generics":["bigint"],"name":"option"}}],[11,"fmt","","",57,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"zero","","",57,{"inputs":[],"output":{"name":"bigint"}}],[11,"is_zero","","",57,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"fmt","","",57,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"decode","","",57,{"inputs":[{"name":"__d"}],"output":{"generics":["bigint"],"name":"result"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"u16"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"isize"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"u64"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"u16"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"i8"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"i16"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"u8"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"i32"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"i16"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"isize"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"usize"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"u8"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"u64"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"usize"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"i8"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"i32"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bigint"}}],[11,"div","","",57,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"name":"bigint"}}],[11,"one","","",57,{"inputs":[],"output":{"name":"bigint"}}],[11,"partial_cmp","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"encode","","",57,{"inputs":[{"name":"self"},{"name":"__s"}],"output":{"name":"result"}}],[11,"fmt","","",57,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"div_rem","","",57,null],[11,"div_floor","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bigint"}}],[11,"mod_floor","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bigint"}}],[11,"div_mod_floor","","",57,null],[11,"gcd","","Calculates the Greatest Common Divisor (GCD) of the number and `other`.",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bigint"}}],[11,"lcm","","Calculates the Lowest Common Multiple (LCM) of the number and `other`.",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bigint"}}],[11,"divides","","Deprecated, use `is_multiple_of` instead.",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bool"}}],[11,"is_multiple_of","","Returns `true` if the number is a multiple of `other`.",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bool"}}],[11,"is_even","","Returns `true` if the number is divisible by `2`.",57,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_odd","","Returns `true` if the number is not divisible by `2`.",57,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"fmt","","",57,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"to_biguint","","",57,{"inputs":[{"name":"self"}],"output":{"generics":["biguint"],"name":"option"}}],[11,"from","","",57,{"inputs":[{"name":"i16"}],"output":{"name":"bigint"}}],[11,"from","","",57,{"inputs":[{"name":"usize"}],"output":{"name":"bigint"}}],[11,"from","","",57,{"inputs":[{"name":"i32"}],"output":{"name":"bigint"}}],[11,"from","","",57,{"inputs":[{"name":"u64"}],"output":{"name":"bigint"}}],[11,"from","","",57,{"inputs":[{"name":"biguint"}],"output":{"name":"bigint"}}],[11,"from","","",57,{"inputs":[{"name":"i8"}],"output":{"name":"bigint"}}],[11,"from","","",57,{"inputs":[{"name":"u16"}],"output":{"name":"bigint"}}],[11,"from","","",57,{"inputs":[{"name":"isize"}],"output":{"name":"bigint"}}],[11,"from","","",57,{"inputs":[{"name":"i64"}],"output":{"name":"bigint"}}],[11,"from","","",57,{"inputs":[{"name":"u8"}],"output":{"name":"bigint"}}],[11,"from","","",57,{"inputs":[{"name":"u32"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"isize"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"i32"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"u8"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"isize"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"i32"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"i8"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"i8"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"i16"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"u8"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"u16"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"usize"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"u64"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"i16"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"u64"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"usize"}],"output":{"name":"bigint"}}],[11,"add","","",57,{"inputs":[{"name":"self"},{"name":"u16"}],"output":{"name":"bigint"}}],[11,"shr","","",57,{"inputs":[{"name":"self"},{"name":"usize"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"u16"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"i8"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"u64"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"i16"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"i8"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"isize"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"i16"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"usize"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"isize"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"i32"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"usize"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"u8"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"i32"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"u8"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"u16"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"u64"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bigint"}}],[11,"sub","","",57,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"name":"bigint"}}],[11,"cmp","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"ordering"}}],[11,"eq","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"name":"bool"}}],[11,"fmt","","",57,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"default","","",57,{"inputs":[],"output":{"name":"bigint"}}],[11,"neg","","",57,{"inputs":[{"name":"self"}],"output":{"name":"bigint"}}],[11,"checked_sub","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"generics":["bigint"],"name":"option"}}],[11,"clone","","",0,{"inputs":[{"name":"self"}],"output":{"name":"orderedfloat"}}],[11,"serialize","","",0,{"inputs":[{"name":"self"},{"name":"s"}],"output":{"name":"result"}}],[11,"hash","","",0,null],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"partial_cmp","","",0,{"inputs":[{"name":"self"},{"name":"orderedfloat"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",0,{"inputs":[{"name":"self"},{"name":"orderedfloat"}],"output":{"name":"bool"}}],[11,"le","","",0,{"inputs":[{"name":"self"},{"name":"orderedfloat"}],"output":{"name":"bool"}}],[11,"gt","","",0,{"inputs":[{"name":"self"},{"name":"orderedfloat"}],"output":{"name":"bool"}}],[11,"ge","","",0,{"inputs":[{"name":"self"},{"name":"orderedfloat"}],"output":{"name":"bool"}}],[11,"as_ref","","",0,{"inputs":[{"name":"self"}],"output":{"name":"t"}}],[11,"from","","",0,{"inputs":[{"name":"t"}],"output":{"name":"orderedfloat"}}],[11,"deref_mut","","",0,null],[11,"into","","",0,{"inputs":[{"name":"self"}],"output":{"name":"f32"}}],[11,"into","","",0,{"inputs":[{"name":"self"}],"output":{"name":"f64"}}],[11,"cmp","","",0,{"inputs":[{"name":"self"},{"name":"orderedfloat"}],"output":{"name":"ordering"}}],[11,"deserialize","","",0,{"inputs":[{"name":"d"}],"output":{"generics":["orderedfloat"],"name":"result"}}],[11,"eq","","",0,{"inputs":[{"name":"self"},{"name":"orderedfloat"}],"output":{"name":"bool"}}],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"deref","","",0,null],[11,"default","","",0,{"inputs":[],"output":{"name":"orderedfloat"}}],[11,"as_mut","","",0,{"inputs":[{"name":"self"}],"output":{"name":"t"}}],[11,"fmt","","",1,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",58,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",58,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",1,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"eq","","",58,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"ne","","",58,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"eq","","",1,{"inputs":[{"name":"self"},{"name":"parseerror"}],"output":{"name":"bool"}}],[11,"ne","","",1,{"inputs":[{"name":"self"},{"name":"parseerror"}],"output":{"name":"bool"}}],[11,"hash","","",58,null],[11,"from_str","","Parse a hex string and interpret as a `Uuid`.",58,{"inputs":[{"name":"str"}],"output":{"generics":["uuid","parseerror"],"name":"result"}}],[11,"cmp","","",58,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"ordering"}}],[11,"deserialize","","",58,{"inputs":[{"name":"d"}],"output":{"generics":["uuid"],"name":"result"}}],[11,"rand","","",58,{"inputs":[{"name":"r"}],"output":{"name":"uuid"}}],[11,"clone","","",1,{"inputs":[{"name":"self"}],"output":{"name":"parseerror"}}],[11,"clone","","",58,{"inputs":[{"name":"self"}],"output":{"name":"uuid"}}],[11,"partial_cmp","","",58,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",58,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"le","","",58,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"gt","","",58,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"ge","","",58,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"serialize","","",58,{"inputs":[{"name":"self"},{"name":"s"}],"output":{"name":"result"}}],[11,"default","","Returns the nil UUID, which is all zeroes",58,{"inputs":[],"output":{"name":"uuid"}}],[11,"description","","",1,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"today","","Returns a `Date` which corresponds to the current date.",56,{"inputs":[],"output":{"generics":["utc"],"name":"date"}}],[11,"now","","Returns a `DateTime` which corresponds to the current date.",56,{"inputs":[],"output":{"generics":["utc"],"name":"datetime"}}],[11,"new","","Creates and initializes a BigInt.",57,{"inputs":[{"name":"sign"},{"generics":["u32"],"name":"vec"}],"output":{"name":"bigint"}}],[11,"from_biguint","","Creates and initializes a `BigInt`.",57,{"inputs":[{"name":"sign"},{"name":"biguint"}],"output":{"name":"bigint"}}],[11,"from_slice","","Creates and initializes a `BigInt`.",57,null],[11,"assign_from_slice","","Reinitializes a `BigInt`.",57,null],[11,"from_bytes_be","","Creates and initializes a `BigInt`.",57,null],[11,"from_bytes_le","","Creates and initializes a `BigInt`.",57,null],[11,"from_signed_bytes_be","","Creates and initializes a `BigInt` from an array of bytes in two's complement binary representation.",57,null],[11,"from_signed_bytes_le","","Creates and initializes a `BigInt` from an array of bytes in two's complement.",57,null],[11,"parse_bytes","","Creates and initializes a `BigInt`.",57,null],[11,"from_radix_be","","Creates and initializes a `BigInt`. Each u8 of the input slice is interpreted as one digit of the number and must therefore be less than `radix`.",57,null],[11,"from_radix_le","","Creates and initializes a `BigInt`. Each u8 of the input slice is interpreted as one digit of the number and must therefore be less than `radix`.",57,null],[11,"to_bytes_be","","Returns the sign and the byte representation of the `BigInt` in big-endian byte order.",57,null],[11,"to_bytes_le","","Returns the sign and the byte representation of the `BigInt` in little-endian byte order.",57,null],[11,"to_signed_bytes_be","","Returns the two's complement byte representation of the `BigInt` in big-endian byte order.",57,{"inputs":[{"name":"self"}],"output":{"generics":["u8"],"name":"vec"}}],[11,"to_signed_bytes_le","","Returns the two's complement byte representation of the `BigInt` in little-endian byte order.",57,{"inputs":[{"name":"self"}],"output":{"generics":["u8"],"name":"vec"}}],[11,"to_str_radix","","Returns the integer formatted as a string in the given radix. `radix` must be in the range `2...36`.",57,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"name":"string"}}],[11,"to_radix_be","","Returns the integer in the requested base in big-endian digit order. The output is not given in a human readable alphabet but as a zero based u8 number. `radix` must be in the range `2...256`.",57,null],[11,"to_radix_le","","Returns the integer in the requested base in little-endian digit order. The output is not given in a human readable alphabet but as a zero based u8 number. `radix` must be in the range `2...256`.",57,null],[11,"sign","","Returns the sign of the `BigInt` as a `Sign`.",57,{"inputs":[{"name":"self"}],"output":{"name":"sign"}}],[11,"bits","","Determines the fewest bits necessary to express the `BigInt`, not including the sign.",57,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"to_biguint","","Converts this `BigInt` into a `BigUint`, if it's not negative.",57,{"inputs":[{"name":"self"}],"output":{"generics":["biguint"],"name":"option"}}],[11,"checked_add","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"generics":["bigint"],"name":"option"}}],[11,"checked_sub","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"generics":["bigint"],"name":"option"}}],[11,"checked_mul","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"generics":["bigint"],"name":"option"}}],[11,"checked_div","","",57,{"inputs":[{"name":"self"},{"name":"bigint"}],"output":{"generics":["bigint"],"name":"option"}}],[11,"modpow","","Returns `(self ^ exponent) mod modulus`",57,{"inputs":[{"name":"self"},{"name":"bigint"},{"name":"bigint"}],"output":{"name":"bigint"}}],[11,"into_inner","","Get the value out.",0,{"inputs":[{"name":"self"}],"output":{"name":"t"}}],[11,"nil","","The 'nil UUID'.",58,{"inputs":[],"output":{"name":"uuid"}}],[11,"new","","Creates a new `Uuid`.",58,{"inputs":[{"name":"uuidversion"}],"output":{"generics":["uuid"],"name":"option"}}],[11,"new_v4","","Creates a random `Uuid`.",58,{"inputs":[],"output":{"name":"uuid"}}],[11,"from_fields","","Creates a `Uuid` from four field values.",58,null],[11,"from_bytes","","Creates a `Uuid` using the supplied bytes.",58,null],[11,"get_variant","","Returns the variant of the `Uuid` structure.",58,{"inputs":[{"name":"self"}],"output":{"generics":["uuidvariant"],"name":"option"}}],[11,"get_version_num","","Returns the version number of the `Uuid`.",58,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"get_version","","Returns the version of the `Uuid`.",58,{"inputs":[{"name":"self"}],"output":{"generics":["uuidversion"],"name":"option"}}],[11,"as_bytes","","Return an array of 16 octets containing the UUID data",58,null],[11,"simple","","Returns a wrapper which when formatted via `fmt::Display` will format a string of 32 hexadecimal digits.",58,{"inputs":[{"name":"self"}],"output":{"name":"simple"}}],[11,"hyphenated","","Returns a wrapper which when formatted via `fmt::Display` will format a string of hexadecimal digits separated into groups with a hyphen.",58,{"inputs":[{"name":"self"}],"output":{"name":"hyphenated"}}],[11,"urn","","Returns a wrapper which when formatted via `fmt::Display` will format a string of the UUID as a full URN string.",58,{"inputs":[{"name":"self"}],"output":{"name":"urn"}}],[11,"to_timestamp","","Returns an Optional Tuple of (u64, u16) representing the timestamp and counter portion of a V1 UUID. If the supplied UUID is not V1, this will return None",58,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"parse_str","","Parses a `Uuid` from a string of hexadecimal digits with optional hyphens.",58,{"inputs":[{"name":"str"}],"output":{"generics":["uuid","parseerror"],"name":"result"}}],[11,"is_nil","","Tests if the UUID is nil",58,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}]],"paths":[[3,"OrderedFloat"],[4,"UuidParseError"],[3,"LookupRef"],[3,"TxFunction"],[4,"TempId"],[4,"Entid"],[4,"ValuePlace"],[4,"EntityPlace"],[4,"AttributePlace"],[4,"OpType"],[4,"Entity"],[3,"Variable"],[3,"QueryFunction"],[3,"Order"],[3,"NamedPullAttribute"],[3,"Pull"],[3,"Aggregate"],[3,"Pattern"],[3,"Predicate"],[3,"WhereFn"],[3,"OrJoin"],[3,"NotJoin"],[3,"TypeAnnotation"],[3,"ParsedQuery"],[4,"Direction"],[4,"SrcVar"],[4,"NonIntegerConstant"],[4,"FnArg"],[4,"PatternNonValuePlace"],[4,"IdentOrEntid"],[4,"PatternValuePlace"],[4,"PullConcreteAttribute"],[4,"PullAttributeSpec"],[4,"Element"],[4,"Limit"],[4,"FindSpec"],[4,"VariableOrPlaceholder"],[4,"Binding"],[4,"UnifyVars"],[4,"OrWhereClause"],[4,"WhereClause"],[8,"FromValue"],[8,"ContainsVariables"],[3,"PlainSymbol"],[3,"NamespacedSymbol"],[3,"Keyword"],[3,"Span"],[3,"ValueAndSpan"],[4,"Value"],[4,"SpannedValue"],[8,"FromMicros"],[8,"ToMicros"],[3,"DateTime"],[8,"FromRc"],[8,"Cloned"],[3,"ParseError"],[3,"Utc"],[3,"BigInt"],[3,"Uuid"]]}; +searchIndex["mentat"] = {"doc":"","items":[[3,"Attribute","mentat","A Mentat schema attribute has a value type and several other flags determining how assertions with the attribute are interpreted.",null,null],[12,"value_type","","The associated value type, i.e., `:db/valueType`?",0,null],[12,"multival","","`true` if this attribute is multi-valued, i.e., it is `:db/cardinality :db.cardinality/many`. `false` if this attribute is single-valued (the default), i.e., it is `:db/cardinality :db.cardinality/one`.",0,null],[12,"unique","","`None` if this attribute is neither unique-value nor unique-identity.",0,null],[12,"index","","`true` if this attribute is automatically indexed, i.e., it is `:db/indexing true`.",0,null],[12,"fulltext","","`true` if this attribute is automatically fulltext indexed, i.e., it is `:db/fulltext true`.",0,null],[12,"component","","`true` if this attribute is a component, i.e., it is `:db/isComponent true`.",0,null],[12,"no_history","","`true` if this attribute doesn't require history to be kept, i.e., it is `:db/noHistory true`.",0,null],[6,"Entid","","Represents one entid in the entid space.",null,null],[3,"DateTime","","ISO 8601 combined date and time with time zone.",null,null],[8,"HasSchema","","",null,null],[10,"entid_for_type","","",1,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"generics":["knownentid"],"name":"option"}}],[10,"get_ident","","",1,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["keyword"],"name":"option"}}],[10,"get_entid","","",1,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"generics":["knownentid"],"name":"option"}}],[10,"attribute_for_entid","","",1,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["attribute"],"name":"option"}}],[10,"attribute_for_ident","","",1,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"option"}}],[10,"is_attribute","","Return true if the provided entid identifies an attribute in this schema.",1,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"bool"}}],[10,"identifies_attribute","","Return true if the provided ident identifies an attribute in this schema.",1,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[10,"component_attributes","","",1,null],[3,"KnownEntid","","An entid that's either already in the store, or newly allocated to a tempid. TODO: we'd like to link this in some way to the lifetime of a particular PartitionMap.",null,null],[12,"0","","",2,null],[3,"Keyword","","A keyword is a symbol, optionally with a namespace, that prints with a leading colon. This concept is imported from Clojure, as it features in EDN and the query syntax that we use.",null,null],[3,"Schema","","Represents a Mentat schema.",null,null],[12,"entid_map","","Map entid->ident.",3,null],[12,"ident_map","","Map ident->entid.",3,null],[12,"attribute_map","","Map entid->attribute flags.",3,null],[12,"component_attributes","","Maintain a vec of unique attribute IDs for which the corresponding attribute in `attribute_map` has `.component == true`.",3,null],[4,"Binding","","The values bound in a query specification can be:",null,null],[13,"Scalar","","",4,null],[13,"Vec","","",4,null],[13,"Map","","",4,null],[4,"TypedValue","","Represents a value that can be stored in a Mentat store.",null,null],[13,"Ref","","",5,null],[13,"Boolean","","",5,null],[13,"Long","","",5,null],[13,"Double","","",5,null],[13,"Instant","","",5,null],[13,"String","","",5,null],[13,"Keyword","","",5,null],[13,"Uuid","","",5,null],[3,"Uuid","","A Universally Unique Identifier (UUID).",null,null],[3,"Utc","","The UTC time zone. This is the most efficient time zone when you don't need the local time. It is also used as an offset (which is also a dummy type).",null,null],[4,"ValueType","","The attribute of each Mentat assertion has a :db/valueType constraining the value to a particular set. Mentat recognizes the following :db/valueType values.",null,null],[13,"Ref","","",6,null],[13,"Boolean","","",6,null],[13,"Instant","","",6,null],[13,"Long","","",6,null],[13,"Double","","",6,null],[13,"String","","",6,null],[13,"Keyword","","",6,null],[13,"Uuid","","",6,null],[4,"FindSpec","","A definition of the first part of a find query: the `[:find ?foo ?bar…]` bit.",null,null],[13,"FindRel","","Returns an array of arrays, represented as a single array with length a multiple of width.",7,null],[13,"FindColl","","Returns an array of scalars, usually homogeneous. This is equivalent to mapping over the results of a `FindRel`, returning the first value of each.",7,null],[13,"FindTuple","","Returns a single tuple: a heterogeneous array of scalars. Equivalent to taking the first result from a `FindRel`.",7,null],[13,"FindScalar","","Returns a single scalar value. Equivalent to taking the first result from a `FindColl`.",7,null],[17,"CORE_SCHEMA_VERSION","","",null,null],[17,"DB_SCHEMA_CORE","","",null,null],[6,"AttributeSet","","",null,null],[3,"TxObserver","","",null,null],[3,"TxReport","","A transaction report summarizes an applied transaction.",null,null],[12,"tx_id","","The transaction ID of the transaction.",8,null],[12,"tx_instant","","The timestamp when the transaction began to be committed.",8,null],[12,"tempids","","A map from string literal tempid to resolved or allocated entid.",8,null],[5,"new_connection","","",null,{"inputs":[{"name":"t"}],"output":{"generics":["connection","error"],"name":"result"}}],[3,"PlainSymbol","","A simplification of Clojure's Symbol.",null,null],[12,"0","","",9,null],[3,"QueryInputs","","Define the inputs to a query. This is in two parts: a set of values known now, and a set of types known now. The separate map of types is to allow queries to be algebrized without full knowledge of the bindings that will be used at execution time. When built correctly, `types` is guaranteed to contain the types of `values` -- use `QueryInputs::new` or `QueryInputs::with_values` to construct an instance.",null,null],[3,"QueryOutput","","",null,null],[12,"spec","","",10,null],[12,"results","","",10,null],[4,"QueryResults","","",null,null],[13,"Scalar","","",11,null],[13,"Tuple","","",11,null],[13,"Coll","","",11,null],[13,"Rel","","",11,null],[3,"RelResult","","The result you get from a 'rel' query, like:",null,null],[12,"width","","",12,null],[12,"values","","",12,null],[3,"Variable","","",null,null],[12,"0","","",13,null],[0,"errors","","",null,null],[4,"MentatError","mentat::errors","",null,null],[13,"PathAlreadyExists","","",14,null],[13,"UnboundVariables","","",14,null],[13,"InvalidArgumentName","","",14,null],[13,"UnknownAttribute","","",14,null],[13,"InvalidVocabularyVersion","","",14,null],[13,"ConflictingAttributeDefinitions","","",14,null],[13,"ExistingVocabularyTooNew","","",14,null],[13,"UnexpectedCoreSchema","","",14,null],[13,"UnexpectedLostTransactRace","","",14,null],[13,"MissingCoreVocabulary","","",14,null],[13,"PreparedQuerySchemaMismatch","","",14,null],[13,"ValueTypeMismatch","","",14,null],[6,"Result","","",null,null],[11,"fmt","","",14,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"cause","","",14,{"inputs":[{"name":"self"}],"output":{"generics":["fail"],"name":"option"}}],[11,"backtrace","","",14,{"inputs":[{"name":"self"}],"output":{"generics":["backtrace"],"name":"option"}}],[11,"fmt","","",14,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[0,"conn","mentat","",null,null],[3,"Metadata","mentat::conn","Connection metadata required to query from, or apply transactions to, a Mentat store.",null,null],[12,"generation","","",15,null],[12,"partition_map","","",15,null],[12,"schema","","",15,null],[12,"attribute_cache","","",15,null],[3,"Conn","","A mutable, safe reference to the current Mentat store.",null,null],[3,"InProgress","","Represents an in-progress, not yet committed, set of changes to the store. Call `commit` to commit your changes, or `rollback` to discard them. A transaction is held open until you do so. Your changes will be implicitly dropped along with this struct.",null,null],[3,"InProgressRead","","Represents an in-progress set of reads to the store. Just like `InProgress`, which is read-write, but only allows for reads.",null,null],[4,"CacheDirection","","",null,null],[13,"Forward","","",16,null],[13,"Reverse","","",16,null],[13,"Both","","",16,null],[4,"CacheAction","","",null,null],[13,"Register","","",17,null],[13,"Deregister","","",17,null],[8,"Queryable","","",null,null],[10,"q_explain","","",18,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryexplanation"],"name":"result"}}],[10,"q_once","","",18,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryoutput"],"name":"result"}}],[10,"q_prepare","","",18,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"name":"preparedresult"}}],[10,"lookup_values_for_attribute","","",18,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"}],"output":{"generics":["vec"],"name":"result"}}],[10,"lookup_value_for_attribute","","",18,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"}],"output":{"generics":["option"],"name":"result"}}],[8,"Pullable","","",null,null],[10,"pull_attributes_for_entities","","",19,{"inputs":[{"name":"self"},{"name":"e"},{"name":"a"}],"output":{"generics":["btreemap"],"name":"result"}}],[10,"pull_attributes_for_entity","","",19,{"inputs":[{"name":"self"},{"name":"entid"},{"name":"a"}],"output":{"generics":["structuredmap"],"name":"result"}}],[8,"Syncable","","",null,null],[10,"sync","","",20,{"inputs":[{"name":"self"},{"name":"string"},{"name":"string"}],"output":{"name":"result"}}],[11,"q_once","","",21,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryoutput"],"name":"result"}}],[11,"q_prepare","","",21,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"name":"preparedresult"}}],[11,"q_explain","","",21,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryexplanation"],"name":"result"}}],[11,"lookup_values_for_attribute","","",21,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"}],"output":{"generics":["vec"],"name":"result"}}],[11,"lookup_value_for_attribute","","",21,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"}],"output":{"generics":["option"],"name":"result"}}],[11,"pull_attributes_for_entities","","",21,{"inputs":[{"name":"self"},{"name":"e"},{"name":"a"}],"output":{"generics":["btreemap"],"name":"result"}}],[11,"pull_attributes_for_entity","","",21,{"inputs":[{"name":"self"},{"name":"entid"},{"name":"a"}],"output":{"generics":["structuredmap"],"name":"result"}}],[11,"q_once","","",22,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryoutput"],"name":"result"}}],[11,"q_prepare","","",22,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"name":"preparedresult"}}],[11,"q_explain","","",22,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryexplanation"],"name":"result"}}],[11,"lookup_values_for_attribute","","",22,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"}],"output":{"generics":["vec"],"name":"result"}}],[11,"lookup_value_for_attribute","","",22,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"}],"output":{"generics":["option"],"name":"result"}}],[11,"pull_attributes_for_entities","","",22,{"inputs":[{"name":"self"},{"name":"e"},{"name":"a"}],"output":{"generics":["btreemap"],"name":"result"}}],[11,"pull_attributes_for_entity","","",22,{"inputs":[{"name":"self"},{"name":"entid"},{"name":"a"}],"output":{"generics":["structuredmap"],"name":"result"}}],[11,"entid_for_type","","",21,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"get_ident","","",21,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"get_entid","","",21,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"attribute_for_entid","","",21,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["attribute"],"name":"option"}}],[11,"attribute_for_ident","","",21,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"option"}}],[11,"is_attribute","","Return true if the provided entid identifies an attribute in this schema.",21,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"bool"}}],[11,"identifies_attribute","","Return true if the provided ident identifies an attribute in this schema.",21,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"component_attributes","","",21,null],[11,"entid_for_type","","",22,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"get_ident","","",22,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"get_entid","","",22,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"attribute_for_entid","","",22,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["attribute"],"name":"option"}}],[11,"attribute_for_ident","","",22,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"option"}}],[11,"is_attribute","","Return true if the provided entid identifies an attribute in this schema.",22,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"bool"}}],[11,"identifies_attribute","","Return true if the provided ident identifies an attribute in this schema.",22,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"component_attributes","","",22,null],[11,"builder","","",22,{"inputs":[{"name":"self"}],"output":{"name":"inprogressbuilder"}}],[11,"use_caching","","Choose whether to use in-memory caches for running queries.",22,{"inputs":[{"name":"self"},{"name":"bool"}],"output":null}],[11,"transact_builder","","If you only have a reference to an `InProgress`, you can't use the easy builder. This exists so you can make your own.",22,{"inputs":[{"name":"self"},{"name":"termbuilder"}],"output":{"generics":["txreport"],"name":"result"}}],[11,"transact_terms","","",22,{"inputs":[{"name":"self"},{"name":"i"},{"generics":["tempid"],"name":"internset"}],"output":{"generics":["txreport"],"name":"result"}}],[11,"transact_entities","","",22,{"inputs":[{"name":"self"},{"name":"i"}],"output":{"generics":["txreport"],"name":"result"}}],[11,"transact","","",22,{"inputs":[{"name":"self"},{"name":"b"}],"output":{"generics":["txreport"],"name":"result"}}],[11,"import","","",22,{"inputs":[{"name":"self"},{"name":"p"}],"output":{"generics":["txreport"],"name":"result"}}],[11,"rollback","","",22,{"inputs":[{"name":"self"}],"output":{"name":"result"}}],[11,"commit","","",22,{"inputs":[{"name":"self"}],"output":{"name":"result"}}],[11,"cache","","",22,{"inputs":[{"name":"self"},{"name":"keyword"},{"name":"cachedirection"},{"name":"cacheaction"}],"output":{"name":"result"}}],[11,"clone","","",16,{"inputs":[{"name":"self"}],"output":{"name":"cachedirection"}}],[11,"fmt","","",16,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",16,{"inputs":[{"name":"self"},{"name":"cachedirection"}],"output":{"name":"bool"}}],[11,"clone","","",17,{"inputs":[{"name":"self"}],"output":{"name":"cacheaction"}}],[11,"fmt","","",17,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",17,{"inputs":[{"name":"self"},{"name":"cacheaction"}],"output":{"name":"bool"}}],[11,"connect","","",23,{"inputs":[{"name":"connection"}],"output":{"generics":["conn"],"name":"result"}}],[11,"current_schema","","Yield a clone of the current `Schema` instance.",23,{"inputs":[{"name":"self"}],"output":{"generics":["schema"],"name":"arc"}}],[11,"current_cache","","",23,{"inputs":[{"name":"self"}],"output":{"name":"sqliteattributecache"}}],[11,"q_once","","Query the Mentat store, using the given connection and the current metadata.",23,{"inputs":[{"name":"self"},{"name":"connection"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryoutput"],"name":"result"}}],[11,"q_uncached","","Query the Mentat store, using the given connection and the current metadata, but without using the cache.",23,{"inputs":[{"name":"self"},{"name":"connection"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryoutput"],"name":"result"}}],[11,"q_prepare","","",23,{"inputs":[{"name":"self"},{"name":"connection"},{"name":"str"},{"name":"t"}],"output":{"name":"preparedresult"}}],[11,"q_explain","","",23,{"inputs":[{"name":"self"},{"name":"connection"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryexplanation"],"name":"result"}}],[11,"pull_attributes_for_entities","","",23,{"inputs":[{"name":"self"},{"name":"connection"},{"name":"e"},{"name":"a"}],"output":{"generics":["btreemap"],"name":"result"}}],[11,"pull_attributes_for_entity","","",23,{"inputs":[{"name":"self"},{"name":"connection"},{"name":"entid"},{"name":"a"}],"output":{"generics":["structuredmap"],"name":"result"}}],[11,"lookup_values_for_attribute","","",23,{"inputs":[{"name":"self"},{"name":"connection"},{"name":"entid"},{"name":"keyword"}],"output":{"generics":["vec"],"name":"result"}}],[11,"lookup_value_for_attribute","","",23,{"inputs":[{"name":"self"},{"name":"connection"},{"name":"entid"},{"name":"keyword"}],"output":{"generics":["option"],"name":"result"}}],[11,"begin_read","","",23,{"inputs":[{"name":"self"},{"name":"connection"}],"output":{"generics":["inprogressread"],"name":"result"}}],[11,"begin_uncached_read","","",23,{"inputs":[{"name":"self"},{"name":"connection"}],"output":{"generics":["inprogressread"],"name":"result"}}],[11,"begin_transaction","","IMMEDIATE means 'start the transaction now, but don't exclude readers'. It prevents other connections from taking immediate or exclusive transactions. This is appropriate for our writes and `InProgress`: it means we are ready to write whenever we want to, and nobody else can start a transaction that's not `DEFERRED`, but we don't need exclusivity yet.",23,{"inputs":[{"name":"self"},{"name":"connection"}],"output":{"generics":["inprogress"],"name":"result"}}],[11,"transact","","Transact entities against the Mentat store, using the given connection and the current metadata.",23,{"inputs":[{"name":"self"},{"name":"connection"},{"name":"b"}],"output":{"generics":["txreport"],"name":"result"}}],[11,"cache","","Adds or removes the values of a given attribute to an in-memory cache. The attribute should be a namespaced string: e.g., `:foo/bar`. `cache_action` determines if the attribute should be added or removed from the cache. CacheAction::Add is idempotent - each attribute is only added once. CacheAction::Remove throws an error if the attribute does not currently exist in the cache.",23,{"inputs":[{"name":"self"},{"name":"connection"},{"name":"schema"},{"name":"keyword"},{"name":"cachedirection"},{"name":"cacheaction"}],"output":{"name":"result"}}],[11,"register_observer","","",23,{"inputs":[{"name":"self"},{"name":"string"},{"generics":["txobserver"],"name":"arc"}],"output":null}],[11,"unregister_observer","","",23,{"inputs":[{"name":"self"},{"name":"string"}],"output":null}],[0,"entity_builder","mentat","",null,null],[3,"TermBuilder","mentat::entity_builder","",null,null],[3,"EntityBuilder","","",null,null],[3,"InProgressBuilder","","",null,null],[6,"Terms","","",null,null],[8,"BuildTerms","","",null,null],[10,"named_tempid","","",24,{"inputs":[{"name":"self"},{"name":"string"}],"output":{"name":"tempidhandle"}}],[10,"describe_tempid","","",24,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"name":"entitybuilder"}}],[10,"describe","","",24,{"inputs":[{"name":"self"},{"name":"e"}],"output":{"name":"entitybuilder"}}],[10,"add","","",24,{"inputs":[{"name":"self"},{"name":"e"},{"name":"knownentid"},{"name":"v"}],"output":{"name":"result"}}],[10,"retract","","",24,{"inputs":[{"name":"self"},{"name":"e"},{"name":"knownentid"},{"name":"v"}],"output":{"name":"result"}}],[8,"IntoThing","","",null,null],[10,"into_thing","","",25,{"inputs":[{"name":"self"}],"output":{"name":"t"}}],[8,"FromThing","","",null,null],[10,"from_thing","","",26,{"inputs":[{"name":"t"}],"output":{"name":"self"}}],[11,"named_tempid","","",27,{"inputs":[{"name":"self"},{"name":"string"}],"output":{"name":"tempidhandle"}}],[11,"describe_tempid","","",27,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"name":"entitybuilder"}}],[11,"describe","","",27,{"inputs":[{"name":"self"},{"name":"e"}],"output":{"name":"entitybuilder"}}],[11,"add","","",27,{"inputs":[{"name":"self"},{"name":"e"},{"name":"knownentid"},{"name":"v"}],"output":{"name":"result"}}],[11,"retract","","",27,{"inputs":[{"name":"self"},{"name":"e"},{"name":"knownentid"},{"name":"v"}],"output":{"name":"result"}}],[11,"build","","",27,{"inputs":[{"name":"self"}],"output":{"generics":["terms"],"name":"result"}}],[11,"new","","",27,{"inputs":[],"output":{"name":"termbuilder"}}],[11,"is_empty","","",27,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"numbered_tempid","","",27,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"tempidhandle"}}],[11,"finish","","",28,null],[11,"add","","",28,{"inputs":[{"name":"self"},{"name":"knownentid"},{"name":"v"}],"output":{"name":"result"}}],[11,"retract","","",28,{"inputs":[{"name":"self"},{"name":"knownentid"},{"name":"v"}],"output":{"name":"result"}}],[11,"new","","",29,{"inputs":[{"name":"inprogress"}],"output":{"name":"self"}}],[11,"transact","","Build the terms from this builder and transact them against the current `InProgress`. This method always returns the `InProgress` -- failure doesn't imply an automatic rollback.",29,null],[11,"commit","","Transact the contents of the builder and commit the `InProgress`. If any step fails, roll back. Return the `TxReport`.",29,{"inputs":[{"name":"self"}],"output":{"generics":["txreport"],"name":"result"}}],[11,"named_tempid","","",29,{"inputs":[{"name":"self"},{"name":"string"}],"output":{"name":"tempidhandle"}}],[11,"describe_tempid","","",29,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"generics":["inprogressbuilder"],"name":"entitybuilder"}}],[11,"describe","","",29,{"inputs":[{"name":"self"},{"name":"e"}],"output":{"generics":["inprogressbuilder"],"name":"entitybuilder"}}],[11,"add","","",29,{"inputs":[{"name":"self"},{"name":"e"},{"name":"knownentid"},{"name":"v"}],"output":{"name":"result"}}],[11,"retract","","",29,{"inputs":[{"name":"self"},{"name":"e"},{"name":"knownentid"},{"name":"v"}],"output":{"name":"result"}}],[11,"add_kw","","",29,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"},{"name":"v"}],"output":{"name":"result"}}],[11,"retract_kw","","",29,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"},{"name":"v"}],"output":{"name":"result"}}],[11,"add_kw","","",28,{"inputs":[{"name":"self"},{"name":"keyword"},{"name":"v"}],"output":{"name":"result"}}],[11,"retract_kw","","",28,{"inputs":[{"name":"self"},{"name":"keyword"},{"name":"v"}],"output":{"name":"result"}}],[11,"transact","","Build the terms from this builder and transact them against the current `InProgress`. This method always returns the `InProgress` -- failure doesn't imply an automatic rollback.",28,null],[11,"commit","","Transact the contents of the builder and commit the `InProgress`. If any step fails, roll back. Return the `TxReport`.",28,{"inputs":[{"name":"self"}],"output":{"generics":["txreport"],"name":"result"}}],[0,"ident","mentat","",null,null],[6,"EntId","mentat::ident","",null,null],[8,"ToIdent","","The ability to transform entity identifiers (entids) into keyword names (idents).",null,null],[10,"ident","","",30,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"generics":["keyword"],"name":"option"}}],[8,"ToEntId","","The ability to transform idents into the corresponding entid.",null,null],[10,"entid","","",31,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"generics":["entid"],"name":"option"}}],[0,"query","mentat","",null,null],[3,"QueryInputs","mentat::query","Define the inputs to a query. This is in two parts: a set of values known now, and a set of types known now. The separate map of types is to allow queries to be algebrized without full knowledge of the bindings that will be used at execution time. When built correctly, `types` is guaranteed to contain the types of `values` -- use `QueryInputs::new` or `QueryInputs::with_values` to construct an instance.",null,null],[3,"Keyword","","A keyword is a symbol, optionally with a namespace, that prints with a leading colon. This concept is imported from Clojure, as it features in EDN and the query syntax that we use.",null,null],[3,"PlainSymbol","","A simplification of Clojure's Symbol.",null,null],[12,"0","","",9,null],[3,"Variable","","",null,null],[12,"0","","",13,null],[3,"Known","","A convenience wrapper around things known in memory: the schema and caches. We use a trait object here to avoid making dozens of functions generic over the type of the cache. If performance becomes a concern, we should hard-code specific kinds of cache right here, and/or eliminate the Option.",null,null],[12,"schema","","",32,null],[12,"cache","","",32,null],[3,"QueryOutput","","",null,null],[12,"spec","","",10,null],[12,"results","","",10,null],[4,"QueryResults","","",null,null],[13,"Scalar","","",11,null],[13,"Tuple","","",11,null],[13,"Coll","","",11,null],[13,"Rel","","",11,null],[3,"RelResult","","The result you get from a 'rel' query, like:",null,null],[12,"width","","",12,null],[12,"values","","",12,null],[3,"QueryPlanStep","","A single row in the output of SQLite's `EXPLAIN QUERY PLAN`. See https://www.sqlite.org/eqp.html for an explanation of each field.",null,null],[12,"select_id","","",33,null],[12,"order","","",33,null],[12,"from","","",33,null],[12,"detail","","",33,null],[4,"PreparedQuery","","",null,null],[13,"Empty","","",34,null],[12,"find_spec","mentat::query::PreparedQuery","",34,null],[13,"Constant","mentat::query","",34,null],[12,"select","mentat::query::PreparedQuery","",34,null],[13,"Bound","mentat::query","",34,null],[12,"statement","mentat::query::PreparedQuery","",34,null],[12,"schema","","",34,null],[12,"connection","","",34,null],[12,"args","","",34,null],[12,"projector","","",34,null],[4,"QueryExplanation","mentat::query","A struct describing information about how Mentat would execute a query.",null,null],[13,"KnownEmpty","","A query known in advance to be empty, and why we believe that.",35,null],[13,"KnownConstant","","A query known in advance to return a constant value.",35,null],[13,"ExecutionPlan","","A query that takes actual work to execute.",35,null],[12,"query","mentat::query::QueryExplanation","The translated query and any bindings.",35,null],[12,"steps","","The output of SQLite's `EXPLAIN QUERY PLAN`.",35,null],[5,"lookup_value","mentat::query","Return a single value for the provided entity and attribute. If the attribute is multi-valued, an arbitrary value is returned. If no value is present for that entity, `None` is returned. If `attribute` isn't an attribute, `None` is returned.",null,{"inputs":[{"name":"connection"},{"name":"known"},{"name":"e"},{"name":"a"}],"output":{"generics":["option"],"name":"result"}}],[5,"lookup_values","","",null,{"inputs":[{"name":"connection"},{"name":"known"},{"name":"e"},{"name":"a"}],"output":{"generics":["vec"],"name":"result"}}],[5,"lookup_value_for_attribute","","Return a single value for the provided entity and attribute. If the attribute is multi-valued, an arbitrary value is returned. If no value is present for that entity, `None` is returned. If `attribute` doesn't name an attribute, an error is returned.",null,{"inputs":[{"name":"connection"},{"name":"known"},{"name":"e"},{"name":"keyword"}],"output":{"generics":["option"],"name":"result"}}],[5,"lookup_values_for_attribute","","",null,{"inputs":[{"name":"connection"},{"name":"known"},{"name":"e"},{"name":"keyword"}],"output":{"generics":["vec"],"name":"result"}}],[5,"q_once","","Take an EDN query string, a reference to an open SQLite connection, a Mentat schema, and an optional collection of input bindings (which should be keyed by `\"?varname\"`), and execute the query immediately, blocking the current thread. Returns a structure that corresponds to the kind of input query, populated with `TypedValue` instances. The caller is responsible for ensuring that the SQLite connection has an open transaction if isolation is required.",null,{"inputs":[{"name":"connection"},{"name":"known"},{"name":"str"},{"name":"t"}],"output":{"name":"queryexecutionresult"}}],[5,"q_uncached","","Just like `q_once`, but doesn't use any cached values.",null,{"inputs":[{"name":"connection"},{"name":"schema"},{"name":"str"},{"name":"t"}],"output":{"name":"queryexecutionresult"}}],[5,"q_prepare","","",null,{"inputs":[{"name":"connection"},{"name":"known"},{"name":"str"},{"name":"t"}],"output":{"name":"preparedresult"}}],[5,"q_explain","","",null,{"inputs":[{"name":"connection"},{"name":"known"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryexplanation"],"name":"result"}}],[6,"QueryExecutionResult","","",null,null],[6,"PreparedResult","","",null,null],[8,"IntoResult","","",null,null],[10,"into_scalar_result","","",36,{"inputs":[{"name":"self"}],"output":{"generics":["option"],"name":"result"}}],[10,"into_coll_result","","",36,{"inputs":[{"name":"self"}],"output":{"generics":["vec"],"name":"result"}}],[10,"into_tuple_result","","",36,{"inputs":[{"name":"self"}],"output":{"generics":["option"],"name":"result"}}],[10,"into_rel_result","","",36,{"inputs":[{"name":"self"}],"output":{"generics":["relresult"],"name":"result"}}],[11,"run","","",34,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"queryexecutionresult"}}],[11,"into_scalar_result","","",37,{"inputs":[{"name":"self"}],"output":{"generics":["option"],"name":"result"}}],[11,"into_coll_result","","",37,{"inputs":[{"name":"self"}],"output":{"generics":["vec"],"name":"result"}}],[11,"into_tuple_result","","",37,{"inputs":[{"name":"self"}],"output":{"generics":["option"],"name":"result"}}],[11,"into_rel_result","","",37,{"inputs":[{"name":"self"}],"output":{"generics":["relresult"],"name":"result"}}],[0,"query_builder","mentat","",null,null],[3,"QueryBuilder","mentat::query_builder","",null,null],[11,"new","","",38,{"inputs":[{"name":"store"},{"name":"t"}],"output":{"name":"querybuilder"}}],[11,"bind_value","","",38,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"name":"self"}}],[11,"bind_ref_from_kw","","",38,{"inputs":[{"name":"self"},{"name":"str"},{"name":"keyword"}],"output":{"name":"result"}}],[11,"bind_ref","","",38,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"name":"self"}}],[11,"bind_long","","",38,{"inputs":[{"name":"self"},{"name":"str"},{"name":"i64"}],"output":{"name":"self"}}],[11,"bind_instant","","",38,{"inputs":[{"name":"self"},{"name":"str"},{"name":"i64"}],"output":{"name":"self"}}],[11,"bind_date_time","","",38,{"inputs":[{"name":"self"},{"name":"str"},{"generics":["utc"],"name":"datetime"}],"output":{"name":"self"}}],[11,"bind_type","","",38,{"inputs":[{"name":"self"},{"name":"str"},{"name":"valuetype"}],"output":{"name":"self"}}],[11,"execute","","",38,{"inputs":[{"name":"self"}],"output":{"generics":["queryoutput"],"name":"result"}}],[11,"execute_scalar","","",38,{"inputs":[{"name":"self"}],"output":{"generics":["option"],"name":"result"}}],[11,"execute_coll","","",38,{"inputs":[{"name":"self"}],"output":{"generics":["vec"],"name":"result"}}],[11,"execute_tuple","","",38,{"inputs":[{"name":"self"}],"output":{"generics":["option"],"name":"result"}}],[11,"execute_rel","","",38,{"inputs":[{"name":"self"}],"output":{"generics":["relresult"],"name":"result"}}],[0,"store","mentat","",null,null],[3,"Store","mentat::store","A convenience wrapper around a single SQLite connection and a Conn. This is suitable for applications that don't require complex connection management.",null,null],[11,"open","","Open a store at the supplied path, ensuring that it includes the bootstrap schema.",39,{"inputs":[{"name":"str"}],"output":{"generics":["store"],"name":"result"}}],[11,"open_empty","","Returns a totally blank store with no bootstrap schema. Use `open` instead.",39,{"inputs":[{"name":"str"}],"output":{"generics":["store"],"name":"result"}}],[11,"transact","","",39,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"generics":["txreport"],"name":"result"}}],[11,"sqlite_mut","","Intended for use from tests.",39,{"inputs":[{"name":"self"}],"output":{"name":"connection"}}],[11,"dismantle","","",39,null],[11,"conn","","",39,{"inputs":[{"name":"self"}],"output":{"name":"conn"}}],[11,"begin_read","","",39,{"inputs":[{"name":"self"}],"output":{"generics":["inprogressread"],"name":"result"}}],[11,"begin_transaction","","",39,{"inputs":[{"name":"self"}],"output":{"generics":["inprogress"],"name":"result"}}],[11,"cache","","",39,{"inputs":[{"name":"self"},{"name":"keyword"},{"name":"cachedirection"}],"output":{"name":"result"}}],[11,"register_observer","","",39,{"inputs":[{"name":"self"},{"name":"string"},{"generics":["txobserver"],"name":"arc"}],"output":null}],[11,"unregister_observer","","",39,{"inputs":[{"name":"self"},{"name":"string"}],"output":null}],[11,"q_once","","",39,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryoutput"],"name":"result"}}],[11,"q_prepare","","",39,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"name":"preparedresult"}}],[11,"q_explain","","",39,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryexplanation"],"name":"result"}}],[11,"lookup_values_for_attribute","","",39,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"}],"output":{"generics":["vec"],"name":"result"}}],[11,"lookup_value_for_attribute","","",39,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"}],"output":{"generics":["option"],"name":"result"}}],[11,"pull_attributes_for_entities","","",39,{"inputs":[{"name":"self"},{"name":"e"},{"name":"a"}],"output":{"generics":["btreemap"],"name":"result"}}],[11,"pull_attributes_for_entity","","",39,{"inputs":[{"name":"self"},{"name":"entid"},{"name":"a"}],"output":{"generics":["structuredmap"],"name":"result"}}],[11,"sync","","",39,{"inputs":[{"name":"self"},{"name":"string"},{"name":"string"}],"output":{"name":"result"}}],[0,"vocabulary","mentat","This module exposes an interface for programmatic management of vocabularies.",null,null],[0,"attribute","mentat::vocabulary","",null,null],[4,"Unique","mentat::vocabulary::attribute","",null,null],[13,"Value","","",40,null],[13,"Identity","","",40,null],[3,"AttributeBuilder","mentat::vocabulary","",null,null],[12,"value_type","","",41,null],[12,"multival","","",41,null],[12,"unique","","",41,null],[12,"index","","",41,null],[12,"fulltext","","",41,null],[12,"component","","",41,null],[12,"no_history","","",41,null],[3,"Definition","","A definition of an attribute that is independent of a particular store.",null,null],[12,"name","","",42,null],[12,"version","","",42,null],[12,"attributes","","",42,null],[12,"pre","","",42,null],[12,"post","","",42,null],[3,"Vocabulary","","A definition of a vocabulary as retrieved from a particular store.",null,null],[12,"entity","","",43,null],[12,"version","","",43,null],[3,"Vocabularies","","A collection of named `Vocabulary` instances, as retrieved from the store.",null,null],[12,"0","","",44,null],[3,"SimpleVocabularySource","","A convenience struct to package simple `pre` and `post` functions with a collection of vocabulary `Definition`s.",null,null],[12,"definitions","","",45,null],[12,"pre","","",45,null],[12,"post","","",45,null],[4,"VocabularyCheck","","This enum captures the various relationships between a particular vocabulary pair — one `Definition` and one `Vocabulary`, if present.",null,null],[13,"NotPresent","","The provided definition is not already present in the store.",46,null],[13,"Present","","The provided definition is present in the store, and all of its attributes exist.",46,null],[13,"PresentButNeedsUpdate","","The provided definition is present in the store with an earlier version number.",46,null],[12,"older_version","mentat::vocabulary::VocabularyCheck","",46,null],[13,"PresentButTooNew","mentat::vocabulary","The provided definition is present in the store with a more recent version number.",46,null],[12,"newer_version","mentat::vocabulary::VocabularyCheck","",46,null],[13,"PresentButMissingAttributes","mentat::vocabulary","The provided definition is present in the store, but some of its attributes are not.",46,null],[12,"attributes","mentat::vocabulary::VocabularyCheck","",46,null],[4,"VocabularyOutcome","mentat::vocabulary","This enum captures the outcome of attempting to ensure that a vocabulary definition is present and up-to-date in the store.",null,null],[13,"Installed","","The vocabulary was absent and has been installed.",47,null],[13,"InstalledMissingAttributes","","The vocabulary was present with this version, but some attributes were absent. They have been installed.",47,null],[13,"Existed","","The vocabulary was present, at the correct version, and all attributes were present.",47,null],[13,"Upgraded","","The vocabulary was present, at an older version, and it has been upgraded. Any missing attributes were installed.",47,null],[6,"Version","","",null,null],[6,"Datom","","",null,null],[8,"HasVocabularies","","This trait captures the ability to retrieve and describe stored vocabularies.",null,null],[10,"read_vocabularies","","",48,{"inputs":[{"name":"self"}],"output":{"generics":["vocabularies"],"name":"result"}}],[10,"read_vocabulary_named","","",48,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"generics":["option"],"name":"result"}}],[8,"VersionedStore","","This trait captures the ability of a store to check and install/upgrade vocabularies.",null,null],[11,"check_vocabulary","","Check whether the vocabulary described by the provided metadata is present in the store.",49,{"inputs":[{"name":"self"},{"name":"definition"}],"output":{"generics":["vocabularycheck"],"name":"result"}}],[10,"ensure_vocabulary","","Check whether the provided vocabulary is present in the store. If it isn't, make it so.",49,{"inputs":[{"name":"self"},{"name":"definition"}],"output":{"generics":["vocabularyoutcome"],"name":"result"}}],[10,"ensure_vocabularies","","Check whether the provided vocabularies are present in the store at the correct version and with all defined attributes. If any are not, invoke the `pre` function on the provided `VocabularySource`, install or upgrade the necessary vocabularies, then invoke `post`. Returns `Ok` if all of these steps succeed.",49,{"inputs":[{"name":"self"},{"name":"vocabularysource"}],"output":{"generics":["btreemap"],"name":"result"}}],[11,"verify_core_schema","","Make sure that our expectations of the core vocabulary — basic types and attributes — are met.",49,{"inputs":[{"name":"self"}],"output":{"name":"result"}}],[8,"VocabularyStatus","","`VocabularyStatus` is passed to `pre` function when attempting to add or upgrade vocabularies via `ensure_vocabularies`. This is how you can find the status and versions of existing vocabularies — you can retrieve the requested definition and the resulting `VocabularyCheck` by name.",null,null],[10,"get","","",50,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"option"}}],[10,"version","","",50,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"generics":["version"],"name":"option"}}],[8,"VocabularySource","","Implement `VocabularySource` to have full programmatic control over how a set of `Definition`s are checked against and transacted into a store.",null,null],[10,"definitions","","Called to obtain the list of `Definition`s to install. This will be called before `pre`.",51,{"inputs":[{"name":"self"}],"output":{"generics":["definition"],"name":"vec"}}],[11,"pre","","Called before the supplied `Definition`s are transacted. Do not commit the `InProgress`. If this function returns `Err`, the entire vocabulary operation will fail.",51,{"inputs":[{"name":"self"},{"name":"inprogress"},{"name":"vocabularystatus"}],"output":{"name":"result"}}],[11,"post","","Called after the supplied `Definition`s are transacted. Do not commit the `InProgress`. If this function returns `Err`, the entire vocabulary operation will fail.",51,{"inputs":[{"name":"self"},{"name":"inprogress"}],"output":{"name":"result"}}],[11,"clone","","",42,{"inputs":[{"name":"self"}],"output":{"name":"definition"}}],[11,"no_op","","",42,{"inputs":[{"name":"inprogress"},{"name":"vocabulary"}],"output":{"name":"result"}}],[11,"new","","",42,{"inputs":[{"name":"n"},{"name":"version"},{"name":"a"}],"output":{"name":"definition"}}],[11,"clone","","",43,{"inputs":[{"name":"self"}],"output":{"name":"vocabulary"}}],[11,"fmt","","",43,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",43,{"inputs":[{"name":"self"},{"name":"vocabulary"}],"output":{"name":"bool"}}],[11,"ne","","",43,{"inputs":[{"name":"self"},{"name":"vocabulary"}],"output":{"name":"bool"}}],[11,"attributes","","",43,{"inputs":[{"name":"self"}],"output":{"name":"vec"}}],[11,"fmt","","",44,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"default","","",44,{"inputs":[],"output":{"name":"vocabularies"}}],[11,"clone","","",44,{"inputs":[{"name":"self"}],"output":{"name":"vocabularies"}}],[11,"len","","",44,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"get","","",44,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"generics":["vocabulary"],"name":"option"}}],[11,"iter","","",44,{"inputs":[{"name":"self"}],"output":{"generics":["keyword","vocabulary"],"name":"iter"}}],[11,"fmt","","",46,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",46,{"inputs":[{"name":"self"},{"name":"vocabularycheck"}],"output":{"name":"bool"}}],[11,"ne","","",46,{"inputs":[{"name":"self"},{"name":"vocabularycheck"}],"output":{"name":"bool"}}],[11,"fmt","","",47,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",47,{"inputs":[{"name":"self"},{"name":"vocabularyoutcome"}],"output":{"name":"bool"}}],[11,"ensure_vocabulary","mentat::conn","",22,{"inputs":[{"name":"self"},{"name":"definition"}],"output":{"generics":["vocabularyoutcome"],"name":"result"}}],[11,"ensure_vocabularies","","",22,{"inputs":[{"name":"self"},{"name":"vocabularysource"}],"output":{"generics":["btreemap"],"name":"result"}}],[11,"new","mentat::vocabulary","",45,{"inputs":[{"generics":["definition"],"name":"vec"},{"name":"option"},{"name":"option"}],"output":{"name":"simplevocabularysource"}}],[11,"with_definitions","","",45,{"inputs":[{"generics":["definition"],"name":"vec"}],"output":{"name":"simplevocabularysource"}}],[11,"pre","","",45,{"inputs":[{"name":"self"},{"name":"inprogress"},{"name":"vocabularystatus"}],"output":{"name":"result"}}],[11,"post","","",45,{"inputs":[{"name":"self"},{"name":"inprogress"}],"output":{"name":"result"}}],[11,"definitions","","",45,{"inputs":[{"name":"self"}],"output":{"generics":["definition"],"name":"vec"}}],[14,"var","mentat","Produce the appropriate `Variable` for the provided valid ?-prefixed name. This lives here because we can't re-export macros: https://github.com/rust-lang/rust/issues/29638.",null,null],[14,"kw","","Produce the appropriate `Keyword` for the provided namespace and name. This lives here because we can't re-export macros: https://github.com/rust-lang/rust/issues/29638.",null,null],[14,"bail","","",null,null],[11,"flags","","Combine several attribute flags into a bitfield used in temporary search tables.",0,{"inputs":[{"name":"self"}],"output":{"name":"u8"}}],[11,"to_edn_value","","",0,{"inputs":[{"name":"self"},{"generics":["keyword"],"name":"option"}],"output":{"name":"value"}}],[11,"fmt","","",52,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",52,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"eq","","",52,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"ne","","",52,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"hash","","",52,null],[11,"from_str","","Parse a hex string and interpret as a `Uuid`.",52,{"inputs":[{"name":"str"}],"output":{"generics":["uuid","parseerror"],"name":"result"}}],[11,"cmp","","",52,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"ordering"}}],[11,"deserialize","","",52,{"inputs":[{"name":"d"}],"output":{"generics":["uuid"],"name":"result"}}],[11,"rand","","",52,{"inputs":[{"name":"r"}],"output":{"name":"uuid"}}],[11,"clone","","",52,{"inputs":[{"name":"self"}],"output":{"name":"uuid"}}],[11,"partial_cmp","","",52,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",52,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"le","","",52,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"gt","","",52,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"ge","","",52,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"serialize","","",52,{"inputs":[{"name":"self"},{"name":"s"}],"output":{"name":"result"}}],[11,"default","","Returns the nil UUID, which is all zeroes",52,{"inputs":[],"output":{"name":"uuid"}}],[11,"to_micros","","",53,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[11,"partial_cmp","mentat::query","",9,{"inputs":[{"name":"self"},{"name":"plainsymbol"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",9,{"inputs":[{"name":"self"},{"name":"plainsymbol"}],"output":{"name":"bool"}}],[11,"le","","",9,{"inputs":[{"name":"self"},{"name":"plainsymbol"}],"output":{"name":"bool"}}],[11,"gt","","",9,{"inputs":[{"name":"self"},{"name":"plainsymbol"}],"output":{"name":"bool"}}],[11,"ge","","",9,{"inputs":[{"name":"self"},{"name":"plainsymbol"}],"output":{"name":"bool"}}],[11,"partial_cmp","","",13,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",13,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"le","","",13,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"gt","","",13,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"ge","","",13,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"partial_cmp","","",54,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",54,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"le","","",54,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"gt","","",54,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"ge","","",54,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"clone","","",9,{"inputs":[{"name":"self"}],"output":{"name":"plainsymbol"}}],[11,"clone","","",54,{"inputs":[{"name":"self"}],"output":{"name":"keyword"}}],[11,"clone","","",13,{"inputs":[{"name":"self"}],"output":{"name":"variable"}}],[11,"cmp","","",9,{"inputs":[{"name":"self"},{"name":"plainsymbol"}],"output":{"name":"ordering"}}],[11,"cmp","","",13,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"ordering"}}],[11,"cmp","","",54,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"ordering"}}],[11,"deserialize","","",54,{"inputs":[{"name":"__d"}],"output":{"generics":["keyword"],"name":"result"}}],[11,"hash","","",9,null],[11,"hash","","",13,null],[11,"hash","","",54,null],[11,"eq","","",13,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"ne","","",13,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"eq","","",9,{"inputs":[{"name":"self"},{"name":"plainsymbol"}],"output":{"name":"bool"}}],[11,"ne","","",9,{"inputs":[{"name":"self"},{"name":"plainsymbol"}],"output":{"name":"bool"}}],[11,"eq","","",54,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"ne","","",54,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"eq","mentat","",7,{"inputs":[{"name":"self"},{"name":"findspec"}],"output":{"name":"bool"}}],[11,"ne","","",7,{"inputs":[{"name":"self"},{"name":"findspec"}],"output":{"name":"bool"}}],[11,"fmt","mentat::query","Print the keyword in EDN format.",54,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",13,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","Print the symbol in EDN format.",9,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","mentat","",7,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","mentat::query","",54,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",9,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",13,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"from_micros","mentat","",53,{"inputs":[{"name":"i64"}],"output":{"generics":["utc"],"name":"datetime"}}],[11,"serialize","mentat::query","",54,{"inputs":[{"name":"self"},{"name":"__s"}],"output":{"name":"result"}}],[11,"from_value","","",13,{"inputs":[{"name":"valueandspan"}],"output":{"generics":["variable"],"name":"option"}}],[11,"partial_cmp","mentat","",53,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"clone","","",55,{"inputs":[{"name":"self"}],"output":{"name":"utc"}}],[11,"clone","","",53,{"inputs":[{"name":"self"}],"output":{"name":"datetime"}}],[11,"add","","",53,{"inputs":[{"name":"self"},{"name":"fixedoffset"}],"output":{"name":"datetime"}}],[11,"add","","",53,{"inputs":[{"name":"self"},{"name":"duration"}],"output":{"name":"datetime"}}],[11,"fix","","",55,{"inputs":[{"name":"self"}],"output":{"name":"fixedoffset"}}],[11,"from","","",53,{"inputs":[{"name":"systemtime"}],"output":{"generics":["local"],"name":"datetime"}}],[11,"from","","",53,{"inputs":[{"name":"systemtime"}],"output":{"generics":["utc"],"name":"datetime"}}],[11,"serialize","","Serialize into a rfc3339 time string",53,{"inputs":[{"name":"self"},{"name":"s"}],"output":{"name":"result"}}],[11,"sub","","",53,{"inputs":[{"name":"self"},{"name":"duration"}],"output":{"name":"datetime"}}],[11,"sub","","",53,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"name":"duration"}}],[11,"sub","","",53,{"inputs":[{"name":"self"},{"name":"fixedoffset"}],"output":{"name":"datetime"}}],[11,"from_str","","",53,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"from_str","","",53,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"from_str","","",53,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"cmp","","",53,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"name":"ordering"}}],[11,"hash","","",53,null],[11,"eq","","",55,{"inputs":[{"name":"self"},{"name":"utc"}],"output":{"name":"bool"}}],[11,"eq","","",53,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"name":"bool"}}],[11,"deserialize","","",53,{"inputs":[{"name":"d"}],"output":{"generics":["datetime"],"name":"result"}}],[11,"deserialize","","",53,{"inputs":[{"name":"d"}],"output":{"generics":["datetime"],"name":"result"}}],[11,"deserialize","","",53,{"inputs":[{"name":"d"}],"output":{"generics":["datetime"],"name":"result"}}],[11,"hour","","",53,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"minute","","",53,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"second","","",53,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"nanosecond","","",53,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"with_hour","","",53,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_minute","","",53,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_second","","",53,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_nanosecond","","",53,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"fmt","","",55,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",53,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"year","","",53,{"inputs":[{"name":"self"}],"output":{"name":"i32"}}],[11,"month","","",53,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"month0","","",53,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"day","","",53,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"day0","","",53,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"ordinal","","",53,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"ordinal0","","",53,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"weekday","","",53,{"inputs":[{"name":"self"}],"output":{"name":"weekday"}}],[11,"iso_week","","",53,{"inputs":[{"name":"self"}],"output":{"name":"isoweek"}}],[11,"with_year","","",53,{"inputs":[{"name":"self"},{"name":"i32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_month","","",53,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_month0","","",53,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_day","","",53,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_day0","","",53,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_ordinal","","",53,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_ordinal0","","",53,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"fmt","","",53,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",55,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"from_offset","","",55,{"inputs":[{"name":"utc"}],"output":{"name":"utc"}}],[11,"offset_from_local_date","","",55,{"inputs":[{"name":"self"},{"name":"naivedate"}],"output":{"generics":["utc"],"name":"localresult"}}],[11,"offset_from_local_datetime","","",55,{"inputs":[{"name":"self"},{"name":"naivedatetime"}],"output":{"generics":["utc"],"name":"localresult"}}],[11,"offset_from_utc_date","","",55,{"inputs":[{"name":"self"},{"name":"naivedate"}],"output":{"name":"utc"}}],[11,"offset_from_utc_datetime","","",55,{"inputs":[{"name":"self"},{"name":"naivedatetime"}],"output":{"name":"utc"}}],[11,"sql_representation","","",6,null],[11,"value_type_tag","","",6,{"inputs":[{"name":"self"}],"output":{"name":"i32"}}],[11,"accommodates_integer","","Returns true if the provided integer is in the SQLite value space of this type. For example, `1` is how we encode `true`.",6,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"bool"}}],[11,"entid_for_type","","",3,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"get_ident","","",3,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"get_entid","","",3,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"attribute_for_entid","","",3,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["attribute"],"name":"option"}}],[11,"attribute_for_ident","","",3,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"option"}}],[11,"is_attribute","","Return true if the provided entid identifies an attribute in this schema.",3,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"bool"}}],[11,"identifies_attribute","","Return true if the provided ident identifies an attribute in this schema.",3,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"component_attributes","","",3,null],[11,"partial_cmp","","",2,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",2,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"le","","",2,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"gt","","",2,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"ge","","",2,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"partial_cmp","","",5,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",5,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"le","","",5,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"gt","","",5,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"ge","","",5,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"partial_cmp","mentat::vocabulary::attribute","",40,{"inputs":[{"name":"self"},{"name":"unique"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"partial_cmp","mentat","",3,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",3,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"le","","",3,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"gt","","",3,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"ge","","",3,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"partial_cmp","","",0,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",0,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"le","","",0,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"gt","","",0,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"ge","","",0,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"partial_cmp","","",6,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"clone","","",4,{"inputs":[{"name":"self"}],"output":{"name":"binding"}}],[11,"clone","","",6,{"inputs":[{"name":"self"}],"output":{"name":"valuetype"}}],[11,"clone","","",3,{"inputs":[{"name":"self"}],"output":{"name":"schema"}}],[11,"clone","mentat::vocabulary::attribute","",40,{"inputs":[{"name":"self"}],"output":{"name":"unique"}}],[11,"clone","mentat","",5,{"inputs":[{"name":"self"}],"output":{"name":"typedvalue"}}],[11,"clone","","",2,{"inputs":[{"name":"self"}],"output":{"name":"knownentid"}}],[11,"clone","","",0,{"inputs":[{"name":"self"}],"output":{"name":"attribute"}}],[11,"from","","",4,{"inputs":[{"name":"structuredmap"}],"output":{"name":"binding"}}],[11,"from","","",5,{"inputs":[{"generics":["utc"],"name":"datetime"}],"output":{"name":"typedvalue"}}],[11,"from","","",5,{"inputs":[{"name":"uuid"}],"output":{"name":"typedvalue"}}],[11,"from","","",5,{"inputs":[{"name":"string"}],"output":{"name":"typedvalue"}}],[11,"from","","",4,{"inputs":[{"generics":["binding"],"name":"vec"}],"output":{"name":"binding"}}],[11,"from","","",5,{"inputs":[{"name":"bool"}],"output":{"name":"typedvalue"}}],[11,"from","","",5,{"inputs":[{"generics":["string"],"name":"box"}],"output":{"name":"typedvalue"}}],[11,"from","","",5,{"inputs":[{"name":"i32"}],"output":{"name":"typedvalue"}}],[11,"from","","",5,{"inputs":[{"generics":["keyword"],"name":"rc"}],"output":{"name":"typedvalue"}}],[11,"from","","",4,{"inputs":[{"name":"t"}],"output":{"name":"binding"}}],[11,"from","","",5,{"inputs":[{"name":"str"}],"output":{"name":"typedvalue"}}],[11,"from","","",5,{"inputs":[{"name":"keyword"}],"output":{"name":"typedvalue"}}],[11,"from","","",5,{"inputs":[{"generics":["string"],"name":"rc"}],"output":{"name":"typedvalue"}}],[11,"from","","",5,{"inputs":[{"generics":["string"],"name":"arc"}],"output":{"name":"typedvalue"}}],[11,"from","","",5,{"inputs":[{"generics":["keyword"],"name":"arc"}],"output":{"name":"typedvalue"}}],[11,"from","","",5,{"inputs":[{"name":"u32"}],"output":{"name":"typedvalue"}}],[11,"from","","",5,{"inputs":[{"name":"f64"}],"output":{"name":"typedvalue"}}],[11,"from","","",5,{"inputs":[{"name":"knownentid"}],"output":{"name":"typedvalue"}}],[11,"cmp","mentat::vocabulary::attribute","",40,{"inputs":[{"name":"self"},{"name":"unique"}],"output":{"name":"ordering"}}],[11,"cmp","mentat","",3,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"ordering"}}],[11,"cmp","","",0,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"ordering"}}],[11,"cmp","","",2,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"ordering"}}],[11,"cmp","","",5,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"ordering"}}],[11,"cmp","","",6,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"ordering"}}],[11,"deserialize","","",5,{"inputs":[{"name":"__d"}],"output":{"generics":["typedvalue"],"name":"result"}}],[11,"hash","","",2,null],[11,"hash","","",5,null],[11,"hash","","",0,null],[11,"hash","","",3,null],[11,"hash","","",6,null],[11,"hash","mentat::vocabulary::attribute","",40,null],[11,"eq","","",40,{"inputs":[{"name":"self"},{"name":"unique"}],"output":{"name":"bool"}}],[11,"eq","mentat","",5,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"ne","","",5,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"eq","","",3,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"ne","","",3,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"eq","","",0,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"ne","","",0,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"eq","","",6,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"bool"}}],[11,"eq","","",4,{"inputs":[{"name":"self"},{"name":"binding"}],"output":{"name":"bool"}}],[11,"ne","","",4,{"inputs":[{"name":"self"},{"name":"binding"}],"output":{"name":"bool"}}],[11,"eq","","",2,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"ne","","",2,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"fmt","","",6,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",4,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",3,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","mentat::vocabulary::attribute","",40,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","mentat","",5,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",2,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",6,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"to_u32","","",6,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"from_u32","","",6,{"inputs":[{"name":"u32"}],"output":{"name":"valuetype"}}],[11,"serialize","","",5,{"inputs":[{"name":"self"},{"name":"__s"}],"output":{"name":"result"}}],[11,"default","","",0,{"inputs":[],"output":{"name":"attribute"}}],[11,"default","","",3,{"inputs":[],"output":{"name":"schema"}}],[11,"clone","mentat::vocabulary","",41,{"inputs":[{"name":"self"}],"output":{"name":"attributebuilder"}}],[11,"clone","mentat","",8,{"inputs":[{"name":"self"}],"output":{"name":"txreport"}}],[11,"into_typed_value","","",5,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"valuetype"}],"output":{"generics":["typedvalue","error"],"name":"result"}}],[11,"into_entity_place","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["entityplace","error"],"name":"result"}}],[11,"as_tempid","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["tempid"],"name":"option"}}],[11,"hash","mentat::vocabulary","",41,null],[11,"hash","mentat","",8,null],[11,"fmt","","",8,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","mentat::vocabulary","",41,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"validate","mentat","",0,{"inputs":[{"name":"self"},{"name":"f"}],"output":{"generics":["error"],"name":"result"}}],[11,"partial_cmp","","",8,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",8,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"le","","",8,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"gt","","",8,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"ge","","",8,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"partial_cmp","mentat::vocabulary","",41,{"inputs":[{"name":"self"},{"name":"attributebuilder"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",41,{"inputs":[{"name":"self"},{"name":"attributebuilder"}],"output":{"name":"bool"}}],[11,"le","","",41,{"inputs":[{"name":"self"},{"name":"attributebuilder"}],"output":{"name":"bool"}}],[11,"gt","","",41,{"inputs":[{"name":"self"},{"name":"attributebuilder"}],"output":{"name":"bool"}}],[11,"ge","","",41,{"inputs":[{"name":"self"},{"name":"attributebuilder"}],"output":{"name":"bool"}}],[11,"cmp","mentat","",8,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"ordering"}}],[11,"cmp","mentat::vocabulary","",41,{"inputs":[{"name":"self"},{"name":"attributebuilder"}],"output":{"name":"ordering"}}],[11,"eq","","",41,{"inputs":[{"name":"self"},{"name":"attributebuilder"}],"output":{"name":"bool"}}],[11,"ne","","",41,{"inputs":[{"name":"self"},{"name":"attributebuilder"}],"output":{"name":"bool"}}],[11,"eq","mentat","",8,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"ne","","",8,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"from_sql_value_pair","","Given a SQLite `value` and a `value_type_tag`, return the corresponding `TypedValue`.",5,{"inputs":[{"name":"value"},{"name":"i32"}],"output":{"generics":["typedvalue","error"],"name":"result"}}],[11,"from_edn_value","","Given an EDN `value`, return a corresponding Mentat `TypedValue`.",5,{"inputs":[{"name":"value"}],"output":{"generics":["typedvalue"],"name":"option"}}],[11,"to_sql_value_pair","","Return the corresponding SQLite `value` and `value_type_tag` pair.",5,null],[11,"to_edn_value_pair","","Return the corresponding EDN `value` and `value_type` pair.",5,null],[11,"default","mentat::vocabulary","",41,{"inputs":[],"output":{"name":"attributebuilder"}}],[11,"clone","mentat::query","",32,{"inputs":[{"name":"self"}],"output":{"name":"known"}}],[11,"default","","",56,{"inputs":[],"output":{"name":"queryinputs"}}],[11,"into_iter","","",12,null],[11,"clone","","",11,{"inputs":[{"name":"self"}],"output":{"name":"queryresults"}}],[11,"clone","","",12,{"inputs":[{"name":"self"}],"output":{"name":"relresult"}}],[11,"from","","",12,{"inputs":[{"generics":["vec"],"name":"vec"}],"output":{"generics":["binding"],"name":"relresult"}}],[11,"from","","",11,{"inputs":[{"name":"queryoutput"}],"output":{"name":"queryresults"}}],[11,"eq","","",11,{"inputs":[{"name":"self"},{"name":"queryresults"}],"output":{"name":"bool"}}],[11,"ne","","",11,{"inputs":[{"name":"self"},{"name":"queryresults"}],"output":{"name":"bool"}}],[11,"eq","","",12,{"inputs":[{"name":"self"},{"name":"relresult"}],"output":{"name":"bool"}}],[11,"ne","","",12,{"inputs":[{"name":"self"},{"name":"relresult"}],"output":{"name":"bool"}}],[11,"eq","","",10,{"inputs":[{"name":"self"},{"name":"queryoutput"}],"output":{"name":"bool"}}],[11,"ne","","",10,{"inputs":[{"name":"self"},{"name":"queryoutput"}],"output":{"name":"bool"}}],[11,"fmt","","",10,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",11,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",12,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"from_utc","mentat","Makes a new `DateTime` with given UTC datetime and offset. The local datetime should be constructed via the `TimeZone` trait.",53,null],[11,"date","","Retrieves a date component.",53,{"inputs":[{"name":"self"}],"output":{"name":"date"}}],[11,"time","","Retrieves a time component. Unlike `date`, this is not associated to the time zone.",53,{"inputs":[{"name":"self"}],"output":{"name":"naivetime"}}],[11,"timestamp","","Returns the number of non-leap seconds since January 1, 1970 0:00:00 UTC (aka \"UNIX timestamp\").",53,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[11,"timestamp_millis","","Returns the number of non-leap-milliseconds since January 1, 1970 UTC",53,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[11,"timestamp_nanos","","Returns the number of non-leap-nanoseconds since January 1, 1970 UTC",53,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[11,"timestamp_subsec_millis","","Returns the number of milliseconds since the last second boundary",53,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"timestamp_subsec_micros","","Returns the number of microseconds since the last second boundary",53,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"timestamp_subsec_nanos","","Returns the number of nanoseconds since the last second boundary",53,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"offset","","Retrieves an associated offset from UTC.",53,null],[11,"timezone","","Retrieves an associated time zone.",53,{"inputs":[{"name":"self"}],"output":{"name":"tz"}}],[11,"with_timezone","","Changes the associated time zone. This does not change the actual `DateTime` (but will change the string representation).",53,{"inputs":[{"name":"self"},{"name":"tz2"}],"output":{"name":"datetime"}}],[11,"checked_add_signed","","Adds given `Duration` to the current date and time.",53,{"inputs":[{"name":"self"},{"name":"duration"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"checked_sub_signed","","Subtracts given `Duration` from the current date and time.",53,{"inputs":[{"name":"self"},{"name":"duration"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"signed_duration_since","","Subtracts another `DateTime` from the current date and time. This does not overflow or underflow at all.",53,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"name":"duration"}}],[11,"naive_utc","","Returns a view to the naive UTC datetime.",53,{"inputs":[{"name":"self"}],"output":{"name":"naivedatetime"}}],[11,"naive_local","","Returns a view to the naive local datetime.",53,{"inputs":[{"name":"self"}],"output":{"name":"naivedatetime"}}],[11,"parse_from_rfc2822","","Parses an RFC 2822 date and time string such as `Tue, 1 Jul 2003 10:52:37 +0200`, then returns a new `DateTime` with a parsed `FixedOffset`.",53,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"parse_from_rfc3339","","Parses an RFC 3339 and ISO 8601 date and time string such as `1996-12-19T16:39:57-08:00`, then returns a new `DateTime` with a parsed `FixedOffset`.",53,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"parse_from_str","","Parses a string with the specified format string and returns a new `DateTime` with a parsed `FixedOffset`. See the `format::strftime` module on the supported escape sequences.",53,{"inputs":[{"name":"str"},{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"to_rfc2822","","Returns an RFC 2822 date and time string such as `Tue, 1 Jul 2003 10:52:37 +0200`.",53,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"to_rfc3339","","Returns an RFC 3339 and ISO 8601 date and time string such as `1996-12-19T16:39:57-08:00`.",53,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"to_rfc3339_opts","","Return an RFC 3339 and ISO 8601 date and time string with subseconds formatted as per a `SecondsFormat`. If passed `use_z` true and the timezone is UTC (offset 0), use 'Z', as per Fixed::TimezoneOffsetColonZ. If passed `use_z` false, use Fixed::TimezoneOffsetColon.",53,{"inputs":[{"name":"self"},{"name":"secondsformat"},{"name":"bool"}],"output":{"name":"string"}}],[11,"format_with_items","","Formats the combined date and time with the specified formatting items.",53,{"inputs":[{"name":"self"},{"name":"i"}],"output":{"name":"delayedformat"}}],[11,"format","","Formats the combined date and time with the specified format string. See the `format::strftime` module on the supported escape sequences.",53,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"generics":["strftimeitems"],"name":"delayedformat"}}],[11,"plain","mentat::query","",54,{"inputs":[{"name":"t"}],"output":{"name":"keyword"}}],[11,"namespaced","","Creates a new `Keyword`.",54,{"inputs":[{"name":"n"},{"name":"t"}],"output":{"name":"keyword"}}],[11,"name","","",54,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"namespace","","",54,{"inputs":[{"name":"self"}],"output":{"generics":["str"],"name":"option"}}],[11,"components","","",54,null],[11,"is_backward","","Whether this `Keyword` should be interpreted in reverse order. For example, the two following snippets are identical:",54,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_forward","","Whether this `Keyword` should be interpreted in forward order. See `symbols::Keyword::is_backward`.",54,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_namespaced","","",54,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"to_reversed","","Returns a `Keyword` with the same namespace and a 'backward' name. See `symbols::Keyword::is_backward`.",54,{"inputs":[{"name":"self"}],"output":{"name":"keyword"}}],[11,"unreversed","","If this `Keyword` is 'backward' (see `symbols::Keyword::is_backward`), return `Some('forward name')`; otherwise, return `None`.",54,{"inputs":[{"name":"self"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"new","mentat","",3,{"inputs":[{"generics":["keyword","i64"],"name":"btreemap"},{"generics":["i64","keyword"],"name":"btreemap"},{"generics":["i64","attribute"],"name":"btreemap"}],"output":{"name":"schema"}}],[11,"to_edn_value","","Returns an symbolic representation of the schema suitable for applying across Mentat stores.",3,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"update_component_attributes","","",3,null],[11,"val","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["typedvalue"],"name":"option"}}],[11,"is_congruent_with","","Returns true if the provided type is `Some` and matches this value's type, or if the provided type is `None`.",4,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"bool"}}],[11,"matches_type","","",4,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"bool"}}],[11,"value_type","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["valuetype"],"name":"option"}}],[11,"into_known_entid","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"into_entid","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_kw","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["arc"],"name":"option"}}],[11,"into_boolean","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["bool"],"name":"option"}}],[11,"into_long","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_double","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["f64"],"name":"option"}}],[11,"into_instant","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"into_timestamp","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_string","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["arc"],"name":"option"}}],[11,"into_uuid","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["uuid"],"name":"option"}}],[11,"into_uuid_string","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["string"],"name":"option"}}],[11,"into_c_string","","",4,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_kw_c_string","","",4,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_uuid_c_string","","",4,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"is_congruent_with","","Returns true if the provided type is `Some` and matches this value's type, or if the provided type is `None`.",5,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"bool"}}],[11,"matches_type","","",5,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"bool"}}],[11,"value_type","","",5,{"inputs":[{"name":"self"}],"output":{"name":"valuetype"}}],[11,"typed_ns_keyword","","Construct a new `TypedValue::Keyword` instance by cloning the provided values and wrapping them in a new `ValueRc`. This is expensive, so this might be best limited to tests.",5,{"inputs":[{"name":"str"},{"name":"str"}],"output":{"name":"typedvalue"}}],[11,"typed_string","","Construct a new `TypedValue::String` instance by cloning the provided value and wrapping it in a new `ValueRc`. This is expensive, so this might be best limited to tests.",5,{"inputs":[{"name":"str"}],"output":{"name":"typedvalue"}}],[11,"current_instant","","",5,{"inputs":[],"output":{"name":"typedvalue"}}],[11,"instant","","Construct a new `TypedValue::Instant` instance from the provided microsecond timestamp.",5,{"inputs":[{"name":"i64"}],"output":{"name":"typedvalue"}}],[11,"into_known_entid","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"into_entid","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_kw","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["arc"],"name":"option"}}],[11,"into_boolean","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["bool"],"name":"option"}}],[11,"into_long","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_double","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["f64"],"name":"option"}}],[11,"into_instant","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"into_timestamp","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_string","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["arc"],"name":"option"}}],[11,"into_c_string","","",5,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_kw_c_string","","",5,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_uuid_c_string","","",5,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_uuid","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["uuid"],"name":"option"}}],[11,"into_uuid_string","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["string"],"name":"option"}}],[11,"nil","","The 'nil UUID'.",52,{"inputs":[],"output":{"name":"uuid"}}],[11,"new","","Creates a new `Uuid`.",52,{"inputs":[{"name":"uuidversion"}],"output":{"generics":["uuid"],"name":"option"}}],[11,"new_v4","","Creates a random `Uuid`.",52,{"inputs":[],"output":{"name":"uuid"}}],[11,"from_fields","","Creates a `Uuid` from four field values.",52,null],[11,"from_bytes","","Creates a `Uuid` using the supplied bytes.",52,null],[11,"get_variant","","Returns the variant of the `Uuid` structure.",52,{"inputs":[{"name":"self"}],"output":{"generics":["uuidvariant"],"name":"option"}}],[11,"get_version_num","","Returns the version number of the `Uuid`.",52,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"get_version","","Returns the version of the `Uuid`.",52,{"inputs":[{"name":"self"}],"output":{"generics":["uuidversion"],"name":"option"}}],[11,"as_bytes","","Return an array of 16 octets containing the UUID data",52,null],[11,"simple","","Returns a wrapper which when formatted via `fmt::Display` will format a string of 32 hexadecimal digits.",52,{"inputs":[{"name":"self"}],"output":{"name":"simple"}}],[11,"hyphenated","","Returns a wrapper which when formatted via `fmt::Display` will format a string of hexadecimal digits separated into groups with a hyphen.",52,{"inputs":[{"name":"self"}],"output":{"name":"hyphenated"}}],[11,"urn","","Returns a wrapper which when formatted via `fmt::Display` will format a string of the UUID as a full URN string.",52,{"inputs":[{"name":"self"}],"output":{"name":"urn"}}],[11,"to_timestamp","","Returns an Optional Tuple of (u64, u16) representing the timestamp and counter portion of a V1 UUID. If the supplied UUID is not V1, this will return None",52,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"parse_str","","Parses a `Uuid` from a string of hexadecimal digits with optional hyphens.",52,{"inputs":[{"name":"str"}],"output":{"generics":["uuid","parseerror"],"name":"result"}}],[11,"is_nil","","Tests if the UUID is nil",52,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"today","","Returns a `Date` which corresponds to the current date.",55,{"inputs":[],"output":{"generics":["utc"],"name":"date"}}],[11,"now","","Returns a `DateTime` which corresponds to the current date.",55,{"inputs":[],"output":{"generics":["utc"],"name":"datetime"}}],[11,"all_enums","","",6,{"inputs":[],"output":{"generics":["valuetype"],"name":"enumset"}}],[11,"into_keyword","","",6,{"inputs":[{"name":"self"}],"output":{"name":"keyword"}}],[11,"from_keyword","","",6,{"inputs":[{"name":"keyword"}],"output":{"generics":["valuetype"],"name":"option"}}],[11,"into_typed_value","","",6,{"inputs":[{"name":"self"}],"output":{"name":"typedvalue"}}],[11,"into_edn_value","","",6,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"is_numeric","","",6,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_unit_limited","","",7,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"expected_column_count","","",7,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"requires_distinct","","Returns true if the provided `FindSpec` cares about distinct results.",7,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"columns","","",7,{"inputs":[{"name":"self"}],"output":{"generics":["iterator"],"name":"box"}}],[11,"new","","",57,{"inputs":[{"generics":["i64"],"name":"btreeset"},{"name":"f"}],"output":{"name":"txobserver"}}],[11,"applicable_reports","","",57,{"inputs":[{"name":"self"},{"name":"indexmap"}],"output":{"generics":["i64","btreeset","randomstate"],"name":"indexmap"}}],[11,"plain","mentat::query","",9,{"inputs":[{"name":"t"}],"output":{"name":"plainsymbol"}}],[11,"name","","Return the name of the symbol without any leading '?' or '$'.",9,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"is_var_symbol","","",9,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_src_symbol","","",9,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"with_value_sequence","","",56,{"inputs":[{"name":"vec"}],"output":{"name":"queryinputs"}}],[11,"with_type_sequence","","",56,{"inputs":[{"name":"vec"}],"output":{"name":"queryinputs"}}],[11,"with_values","","",56,{"inputs":[{"generics":["variable","typedvalue"],"name":"btreemap"}],"output":{"name":"queryinputs"}}],[11,"new","","",56,{"inputs":[{"generics":["variable","valuetype"],"name":"btreemap"},{"generics":["variable","typedvalue"],"name":"btreemap"}],"output":{"generics":["queryinputs","error"],"name":"result"}}],[11,"empty_factory","","",10,{"inputs":[{"name":"findspec"}],"output":{"generics":["fn"],"name":"box"}}],[11,"len","","",10,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"is_empty","","",10,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"empty","","",10,{"inputs":[{"name":"rc"}],"output":{"name":"queryoutput"}}],[11,"from_constants","","",10,{"inputs":[{"name":"rc"},{"generics":["variable","typedvalue"],"name":"btreemap"}],"output":{"name":"queryresults"}}],[11,"into_scalar","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["option","error"],"name":"result"}}],[11,"into_coll","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["vec","error"],"name":"result"}}],[11,"into_tuple","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["option","error"],"name":"result"}}],[11,"into_rel","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["relresult","error"],"name":"result"}}],[11,"len","","",11,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"is_empty","","",11,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"into_scalar","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["option","error"],"name":"result"}}],[11,"into_coll","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["vec","error"],"name":"result"}}],[11,"into_tuple","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["option","error"],"name":"result"}}],[11,"into_rel","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["relresult","error"],"name":"result"}}],[11,"empty","","",12,{"inputs":[{"name":"usize"}],"output":{"name":"relresult"}}],[11,"is_empty","","",12,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"row_count","","",12,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"rows","","",12,{"inputs":[{"name":"self"}],"output":{"name":"chunks"}}],[11,"row","","",12,{"inputs":[{"name":"self"},{"name":"usize"}],"output":{"name":"option"}}],[11,"as_str","","",13,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"to_string","","",13,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"name","","",13,{"inputs":[{"name":"self"}],"output":{"name":"plainsymbol"}}],[11,"from_valid_name","","Return a new `Variable`, assuming that the provided string is a valid name.",13,{"inputs":[{"name":"str"}],"output":{"name":"variable"}}],[11,"from_rc","","",13,{"inputs":[{"generics":["plainsymbol"],"name":"rc"}],"output":{"generics":["variable"],"name":"option"}}],[11,"from_symbol","","TODO: intern strings. #398.",13,{"inputs":[{"name":"plainsymbol"}],"output":{"generics":["variable"],"name":"option"}}],[11,"for_schema","","",32,{"inputs":[{"name":"schema"}],"output":{"name":"known"}}],[11,"new","","",32,{"inputs":[{"name":"schema"},{"generics":["cachedattributes"],"name":"option"}],"output":{"name":"known"}}],[11,"is_attribute_cached_reverse","","",32,{"inputs":[{"name":"self"},{"name":"u"}],"output":{"name":"bool"}}],[11,"is_attribute_cached_forward","","",32,{"inputs":[{"name":"self"},{"name":"u"}],"output":{"name":"bool"}}],[11,"get_values_for_entid","","",32,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"u"},{"name":"v"}],"output":{"generics":["vec"],"name":"option"}}],[11,"get_value_for_entid","","",32,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"u"},{"name":"v"}],"output":{"generics":["typedvalue"],"name":"option"}}],[11,"get_entid_for_value","","",32,{"inputs":[{"name":"self"},{"name":"u"},{"name":"typedvalue"}],"output":{"generics":["i64"],"name":"option"}}],[11,"get_entids_for_value","","",32,{"inputs":[{"name":"self"},{"name":"u"},{"name":"typedvalue"}],"output":{"generics":["btreeset"],"name":"option"}}],[11,"into_typed_value","mentat::vocabulary::attribute","",40,{"inputs":[{"name":"self"}],"output":{"name":"typedvalue"}}],[11,"helpful","mentat::vocabulary","Make a new AttributeBuilder for human consumption: it will help you by flipping relevant flags.",41,{"inputs":[],"output":{"name":"attributebuilder"}}],[11,"to_modify_attribute","","Make a new AttributeBuilder from an existing Attribute. This is important to allow retraction. Only attributes that we allow to change are duplicated here.",41,{"inputs":[{"name":"attribute"}],"output":{"name":"attributebuilder"}}],[11,"value_type","","",41,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"attributebuilder"}}],[11,"multival","","",41,{"inputs":[{"name":"self"},{"name":"bool"}],"output":{"name":"attributebuilder"}}],[11,"non_unique","","",41,{"inputs":[{"name":"self"}],"output":{"name":"attributebuilder"}}],[11,"unique","","",41,{"inputs":[{"name":"self"},{"name":"unique"}],"output":{"name":"attributebuilder"}}],[11,"index","","",41,{"inputs":[{"name":"self"},{"name":"bool"}],"output":{"name":"attributebuilder"}}],[11,"fulltext","","",41,{"inputs":[{"name":"self"},{"name":"bool"}],"output":{"name":"attributebuilder"}}],[11,"component","","",41,{"inputs":[{"name":"self"},{"name":"bool"}],"output":{"name":"attributebuilder"}}],[11,"no_history","","",41,{"inputs":[{"name":"self"},{"name":"bool"}],"output":{"name":"attributebuilder"}}],[11,"validate_install_attribute","","",41,{"inputs":[{"name":"self"}],"output":{"generics":["error"],"name":"result"}}],[11,"validate_alter_attribute","","",41,{"inputs":[{"name":"self"}],"output":{"generics":["error"],"name":"result"}}],[11,"build","","",41,{"inputs":[{"name":"self"}],"output":{"name":"attribute"}}],[11,"mutate","","",41,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"generics":["attributealteration"],"name":"vec"}}]],"paths":[[3,"Attribute"],[8,"HasSchema"],[3,"KnownEntid"],[3,"Schema"],[4,"Binding"],[4,"TypedValue"],[4,"ValueType"],[4,"FindSpec"],[3,"TxReport"],[3,"PlainSymbol"],[3,"QueryOutput"],[4,"QueryResults"],[3,"RelResult"],[3,"Variable"],[4,"MentatError"],[3,"Metadata"],[4,"CacheDirection"],[4,"CacheAction"],[8,"Queryable"],[8,"Pullable"],[8,"Syncable"],[3,"InProgressRead"],[3,"InProgress"],[3,"Conn"],[8,"BuildTerms"],[8,"IntoThing"],[8,"FromThing"],[3,"TermBuilder"],[3,"EntityBuilder"],[3,"InProgressBuilder"],[8,"ToIdent"],[8,"ToEntId"],[3,"Known"],[3,"QueryPlanStep"],[4,"PreparedQuery"],[4,"QueryExplanation"],[8,"IntoResult"],[6,"QueryExecutionResult"],[3,"QueryBuilder"],[3,"Store"],[4,"Unique"],[3,"AttributeBuilder"],[3,"Definition"],[3,"Vocabulary"],[3,"Vocabularies"],[3,"SimpleVocabularySource"],[4,"VocabularyCheck"],[4,"VocabularyOutcome"],[8,"HasVocabularies"],[8,"VersionedStore"],[8,"VocabularyStatus"],[8,"VocabularySource"],[3,"Uuid"],[3,"DateTime"],[3,"Keyword"],[3,"Utc"],[3,"QueryInputs"],[3,"TxObserver"]]}; +searchIndex["mentat_cli"] = {"doc":"","items":[[4,"CliError","mentat_cli","",null,null],[13,"CommandParse","","",0,null],[5,"run","","",null,{"inputs":[],"output":{"name":"i32"}}],[5,"version","","Returns a version string.",null,{"inputs":[],"output":{"name":"str"}}],[0,"command_parser","","",null,null],[4,"Command","mentat_cli::command_parser","",null,null],[13,"Cache","","",1,null],[13,"Close","","",1,null],[13,"Exit","","",1,null],[13,"Help","","",1,null],[13,"Import","","",1,null],[13,"Open","","",1,null],[13,"OpenEmpty","","",1,null],[13,"OpenEncrypted","","",1,null],[13,"OpenEmptyEncrypted","","",1,null],[13,"Query","","",1,null],[13,"QueryExplain","","",1,null],[13,"QueryPrepared","","",1,null],[13,"Schema","","",1,null],[13,"Sync","","",1,null],[13,"Timer","","",1,null],[13,"Transact","","",1,null],[5,"command","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["command","error"],"name":"result"}}],[7,"COMMAND_CACHE","","",null,null],[7,"COMMAND_CLOSE","","",null,null],[7,"COMMAND_EXIT_LONG","","",null,null],[7,"COMMAND_EXIT_SHORT","","",null,null],[7,"COMMAND_HELP","","",null,null],[7,"COMMAND_IMPORT_LONG","","",null,null],[7,"COMMAND_IMPORT_SHORT","","",null,null],[7,"COMMAND_OPEN","","",null,null],[7,"COMMAND_OPEN_EMPTY","","",null,null],[7,"COMMAND_OPEN_ENCRYPTED","","",null,null],[7,"COMMAND_OPEN_EMPTY_ENCRYPTED","","",null,null],[7,"COMMAND_QUERY_LONG","","",null,null],[7,"COMMAND_QUERY_SHORT","","",null,null],[7,"COMMAND_QUERY_EXPLAIN_LONG","","",null,null],[7,"COMMAND_QUERY_EXPLAIN_SHORT","","",null,null],[7,"COMMAND_QUERY_PREPARED_LONG","","",null,null],[7,"COMMAND_SCHEMA","","",null,null],[7,"COMMAND_SYNC","","",null,null],[7,"COMMAND_TIMER_LONG","","",null,null],[7,"COMMAND_TRANSACT_LONG","","",null,null],[7,"COMMAND_TRANSACT_SHORT","","",null,null],[11,"clone","","",1,{"inputs":[{"name":"self"}],"output":{"name":"command"}}],[11,"fmt","","",1,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",1,{"inputs":[{"name":"self"},{"name":"command"}],"output":{"name":"bool"}}],[11,"ne","","",1,{"inputs":[{"name":"self"},{"name":"command"}],"output":{"name":"bool"}}],[11,"is_complete","","is_complete returns true if no more input is required for the command to be successfully executed. false is returned if the command is not considered valid. Defaults to true for all commands except Query and Transact. TODO: for query and transact commands, they will be considered complete if a parsable EDN has been entered as an argument",1,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_timed","","",1,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"output","","",1,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[0,"input","mentat_cli","",null,null],[3,"InputReader","mentat_cli::input","Reads input from `stdin`",null,null],[4,"InputResult","","Possible results from reading input from `InputReader`",null,null],[13,"MetaCommand","","mentat command as input; (name, rest of line)",2,null],[13,"Empty","","An empty line",2,null],[13,"More","","Needs more input",2,null],[13,"Eof","","End of file reached",2,null],[11,"clone","","",2,{"inputs":[{"name":"self"}],"output":{"name":"inputresult"}}],[11,"fmt","","",2,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"new","","Constructs a new `InputReader` reading from `stdin`.",3,{"inputs":[],"output":{"name":"inputreader"}}],[11,"is_tty","","Returns whether the `InputReader` is reading from a TTY.",3,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"read_input","","Reads a single command, item, or statement from `stdin`. Returns `More` if further input is required for a complete result. In this case, the input received so far is buffered internally.",3,{"inputs":[{"name":"self"}],"output":{"generics":["inputresult","error"],"name":"result"}}],[0,"repl","mentat_cli","",null,null],[3,"Repl","mentat_cli::repl","Executes input and maintains state of persistent items.",null,null],[11,"db_name","","",4,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"new","","Constructs a new `Repl`.",4,{"inputs":[],"output":{"generics":["repl","string"],"name":"result"}}],[11,"run","","Runs the REPL interactively.",4,{"inputs":[{"name":"self"},{"generics":["vec"],"name":"option"}],"output":null}],[11,"explain_query","","",4,{"inputs":[{"name":"self"},{"name":"string"}],"output":null}],[11,"execute_transact","","",4,{"inputs":[{"name":"self"},{"name":"string"}],"output":null}],[11,"fmt","mentat_cli","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"cause","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["fail"],"name":"option"}}],[11,"backtrace","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["backtrace"],"name":"option"}}],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[14,"bail","","",null,null]],"paths":[[4,"CliError"],[4,"Command"],[4,"InputResult"],[3,"InputReader"],[3,"Repl"]]}; +searchIndex["mentat_core"] = {"doc":"","items":[[3,"Uuid","mentat_core","A Universally Unique Identifier (UUID).",null,null],[3,"DateTime","","ISO 8601 combined date and time with time zone.",null,null],[8,"Timelike","","The common set of methods for time component.",null,null],[10,"hour","","Returns the hour number from 0 to 23.",0,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"hour12","","Returns the hour number from 1 to 12 with a boolean flag, which is false for AM and true for PM.",0,null],[10,"minute","","Returns the minute number from 0 to 59.",0,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[10,"second","","Returns the second number from 0 to 59.",0,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[10,"nanosecond","","Returns the number of nanoseconds since the whole non-leap second. The range from 1,000,000,000 to 1,999,999,999 represents the leap second.",0,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[10,"with_hour","","Makes a new value with the hour number changed.",0,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"name":"option"}}],[10,"with_minute","","Makes a new value with the minute number changed.",0,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"name":"option"}}],[10,"with_second","","Makes a new value with the second number changed.",0,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"name":"option"}}],[10,"with_nanosecond","","Makes a new value with nanoseconds since the whole non-leap second changed.",0,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"name":"option"}}],[11,"num_seconds_from_midnight","","Returns the number of non-leap seconds past the last midnight.",0,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[8,"Cloned","","",null,null],[10,"cloned","","",1,{"inputs":[{"name":"self"}],"output":{"name":"t"}}],[10,"to_value_rc","","",1,{"inputs":[{"name":"self"}],"output":{"name":"arc"}}],[8,"FromMicros","","",null,null],[10,"from_micros","","",2,{"inputs":[{"name":"i64"}],"output":{"name":"self"}}],[8,"FromRc","","",null,null],[10,"from_rc","","",3,{"inputs":[{"name":"rc"}],"output":{"name":"self"}}],[10,"from_arc","","",3,{"inputs":[{"name":"arc"}],"output":{"name":"self"}}],[3,"Keyword","","A keyword is a symbol, optionally with a namespace, that prints with a leading colon. This concept is imported from Clojure, as it features in EDN and the query syntax that we use.",null,null],[8,"ToMicros","","",null,null],[10,"to_micros","","",4,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[3,"Utc","","The UTC time zone. This is the most efficient time zone when you don't need the local time. It is also used as an offset (which is also a dummy type).",null,null],[6,"ValueRc","","This type alias exists to allow us to use different boxing mechanisms for values. This type must implement `FromRc` and `Cloned`, and a `From` implementation must exist for `TypedValue`.",null,null],[5,"parse_query","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["parsedquery","parseerror"],"name":"result"}}],[3,"EdnParseError","","",null,null],[12,"line","","",5,null],[12,"column","","",5,null],[12,"offset","","",5,null],[12,"expected","","",5,null],[3,"KnownEntid","","An entid that's either already in the store, or newly allocated to a tempid. TODO: we'd like to link this in some way to the lifetime of a particular PartitionMap.",null,null],[12,"0","","",6,null],[3,"StructuredMap","","A pull expression expands a binding into a structure. The returned structure associates attributes named in the input or retrieved from the store with values. This association is a `StructuredMap`.",null,null],[12,"0","","",7,null],[3,"ValueTypeSet","","",null,null],[12,"0","","",8,null],[3,"Attribute","","A Mentat schema attribute has a value type and several other flags determining how assertions with the attribute are interpreted.",null,null],[12,"value_type","","The associated value type, i.e., `:db/valueType`?",9,null],[12,"multival","","`true` if this attribute is multi-valued, i.e., it is `:db/cardinality :db.cardinality/many`. `false` if this attribute is single-valued (the default), i.e., it is `:db/cardinality :db.cardinality/one`.",9,null],[12,"unique","","`None` if this attribute is neither unique-value nor unique-identity.",9,null],[12,"index","","`true` if this attribute is automatically indexed, i.e., it is `:db/indexing true`.",9,null],[12,"fulltext","","`true` if this attribute is automatically fulltext indexed, i.e., it is `:db/fulltext true`.",9,null],[12,"component","","`true` if this attribute is a component, i.e., it is `:db/isComponent true`.",9,null],[12,"no_history","","`true` if this attribute doesn't require history to be kept, i.e., it is `:db/noHistory true`.",9,null],[3,"Schema","","Represents a Mentat schema.",null,null],[12,"entid_map","","Map entid->ident.",10,null],[12,"ident_map","","Map ident->entid.",10,null],[12,"attribute_map","","Map entid->attribute flags.",10,null],[12,"component_attributes","","Maintain a vec of unique attribute IDs for which the corresponding attribute in `attribute_map` has `.component == true`.",10,null],[4,"Binding","","The values bound in a query specification can be:",null,null],[13,"Scalar","","",11,null],[13,"Vec","","",11,null],[13,"Map","","",11,null],[4,"TypedValue","","Represents a value that can be stored in a Mentat store.",null,null],[13,"Ref","","",12,null],[13,"Boolean","","",12,null],[13,"Long","","",12,null],[13,"Double","","",12,null],[13,"Instant","","",12,null],[13,"String","","",12,null],[13,"Keyword","","",12,null],[13,"Uuid","","",12,null],[4,"ValueType","","The attribute of each Mentat assertion has a :db/valueType constraining the value to a particular set. Mentat recognizes the following :db/valueType values.",null,null],[13,"Ref","","",13,null],[13,"Boolean","","",13,null],[13,"Instant","","",13,null],[13,"Long","","",13,null],[13,"Double","","",13,null],[13,"String","","",13,null],[13,"Keyword","","",13,null],[13,"Uuid","","",13,null],[4,"SQLTypeAffinity","","Type safe representation of the possible return values from SQLite's `typeof`",null,null],[13,"Null","","",14,null],[13,"Integer","","",14,null],[13,"Real","","",14,null],[13,"Text","","",14,null],[13,"Blob","","",14,null],[4,"AttributeBitFlags","","Bit flags used in `flags0` column in temporary tables created during search, such as the `search_results`, `inexact_searches` and `exact_searches` tables. When moving to a more concrete table, such as `datoms`, they are expanded out via these flags and put into their own column rather than a bit field.",null,null],[13,"IndexAVET","","",15,null],[13,"IndexVAET","","",15,null],[13,"IndexFulltext","","",15,null],[13,"UniqueValue","","",15,null],[5,"now","","Return the current time as a UTC `DateTime` instance with microsecond precision.",null,{"inputs":[],"output":{"generics":["utc"],"name":"datetime"}}],[0,"values","","",null,null],[3,"DB_ADD","mentat_core::values","",null,null],[3,"DB_ALTER_ATTRIBUTE","","",null,null],[3,"DB_CARDINALITY","","",null,null],[3,"DB_CARDINALITY_MANY","","",null,null],[3,"DB_CARDINALITY_ONE","","",null,null],[3,"DB_FULLTEXT","","",null,null],[3,"DB_IDENT","","",null,null],[3,"DB_INDEX","","",null,null],[3,"DB_INSTALL_ATTRIBUTE","","",null,null],[3,"DB_IS_COMPONENT","","",null,null],[3,"DB_NO_HISTORY","","",null,null],[3,"DB_PART_DB","","",null,null],[3,"DB_RETRACT","","",null,null],[3,"DB_TYPE_BOOLEAN","","",null,null],[3,"DB_TYPE_DOUBLE","","",null,null],[3,"DB_TYPE_INSTANT","","",null,null],[3,"DB_TYPE_KEYWORD","","",null,null],[3,"DB_TYPE_LONG","","",null,null],[3,"DB_TYPE_REF","","",null,null],[3,"DB_TYPE_STRING","","",null,null],[3,"DB_TYPE_URI","","",null,null],[3,"DB_TYPE_UUID","","",null,null],[3,"DB_UNIQUE","","",null,null],[3,"DB_UNIQUE_IDENTITY","","",null,null],[3,"DB_UNIQUE_VALUE","","",null,null],[3,"DB_VALUE_TYPE","","",null,null],[11,"deref","","",16,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",16,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",17,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",17,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",18,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",18,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",19,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",19,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",20,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",20,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",21,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",21,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",22,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",22,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",23,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",23,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",24,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",24,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",25,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",25,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",26,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",26,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",27,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",27,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",28,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",28,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",29,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",29,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",30,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",30,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",31,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",31,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",32,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",32,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",33,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",33,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",34,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",34,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",35,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",35,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",36,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",36,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",37,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",37,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",38,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",38,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",39,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",39,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",40,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",40,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",41,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"initialize","","",41,{"inputs":[{"name":"self"}],"output":null}],[11,"clone","mentat_core","",6,{"inputs":[{"name":"self"}],"output":{"name":"knownentid"}}],[11,"fmt","","",6,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",6,null],[11,"eq","","",6,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"ne","","",6,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"cmp","","",6,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",6,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",6,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"le","","",6,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"gt","","",6,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"ge","","",6,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"from","","",12,{"inputs":[{"name":"knownentid"}],"output":{"name":"typedvalue"}}],[11,"clone","","",13,{"inputs":[{"name":"self"}],"output":{"name":"valuetype"}}],[11,"fmt","","",13,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",13,null],[11,"cmp","","",13,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",13,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"eq","","",13,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"bool"}}],[11,"all_enums","","",13,{"inputs":[],"output":{"generics":["valuetype"],"name":"enumset"}}],[11,"to_u32","","",13,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"from_u32","","",13,{"inputs":[{"name":"u32"}],"output":{"name":"valuetype"}}],[11,"into_keyword","","",13,{"inputs":[{"name":"self"}],"output":{"name":"keyword"}}],[11,"from_keyword","","",13,{"inputs":[{"name":"keyword"}],"output":{"name":"option"}}],[11,"into_typed_value","","",13,{"inputs":[{"name":"self"}],"output":{"name":"typedvalue"}}],[11,"into_edn_value","","",13,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"is_numeric","","",13,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"fmt","","",13,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"clone","","",12,{"inputs":[{"name":"self"}],"output":{"name":"typedvalue"}}],[11,"fmt","","",12,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",12,null],[11,"cmp","","",12,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",12,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",12,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"le","","",12,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"gt","","",12,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"ge","","",12,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"eq","","",12,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"ne","","",12,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"clone","","",11,{"inputs":[{"name":"self"}],"output":{"name":"binding"}}],[11,"fmt","","",11,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",11,{"inputs":[{"name":"self"},{"name":"binding"}],"output":{"name":"bool"}}],[11,"ne","","",11,{"inputs":[{"name":"self"},{"name":"binding"}],"output":{"name":"bool"}}],[11,"from","","",11,{"inputs":[{"name":"t"}],"output":{"name":"self"}}],[11,"from","","",11,{"inputs":[{"name":"structuredmap"}],"output":{"name":"self"}}],[11,"from","","",11,{"inputs":[{"generics":["binding"],"name":"vec"}],"output":{"name":"self"}}],[11,"val","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["typedvalue"],"name":"option"}}],[11,"clone","","",7,{"inputs":[{"name":"self"}],"output":{"name":"structuredmap"}}],[11,"fmt","","",7,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"default","","",7,{"inputs":[],"output":{"name":"structuredmap"}}],[11,"eq","","",7,{"inputs":[{"name":"self"},{"name":"structuredmap"}],"output":{"name":"bool"}}],[11,"ne","","",7,{"inputs":[{"name":"self"},{"name":"structuredmap"}],"output":{"name":"bool"}}],[11,"insert","","",7,{"inputs":[{"name":"self"},{"name":"n"},{"name":"b"}],"output":null}],[11,"from","","",7,{"inputs":[{"generics":["valuerc","binding"],"name":"indexmap"}],"output":{"name":"self"}}],[11,"from","","",7,{"inputs":[{"name":"vec"}],"output":{"name":"self"}}],[11,"is_congruent_with","","Returns true if the provided type is `Some` and matches this value's type, or if the provided type is `None`.",11,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"bool"}}],[11,"matches_type","","",11,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"bool"}}],[11,"value_type","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["valuetype"],"name":"option"}}],[11,"is_congruent_with","","Returns true if the provided type is `Some` and matches this value's type, or if the provided type is `None`.",12,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"bool"}}],[11,"matches_type","","",12,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"bool"}}],[11,"value_type","","",12,{"inputs":[{"name":"self"}],"output":{"name":"valuetype"}}],[11,"typed_ns_keyword","","Construct a new `TypedValue::Keyword` instance by cloning the provided values and wrapping them in a new `ValueRc`. This is expensive, so this might be best limited to tests.",12,{"inputs":[{"name":"str"},{"name":"str"}],"output":{"name":"typedvalue"}}],[11,"typed_string","","Construct a new `TypedValue::String` instance by cloning the provided value and wrapping it in a new `ValueRc`. This is expensive, so this might be best limited to tests.",12,{"inputs":[{"name":"str"}],"output":{"name":"typedvalue"}}],[11,"current_instant","","",12,{"inputs":[],"output":{"name":"typedvalue"}}],[11,"instant","","Construct a new `TypedValue::Instant` instance from the provided microsecond timestamp.",12,{"inputs":[{"name":"i64"}],"output":{"name":"typedvalue"}}],[11,"from","","",12,{"inputs":[{"name":"bool"}],"output":{"name":"typedvalue"}}],[11,"from","","",12,{"inputs":[{"generics":["utc"],"name":"datetime"}],"output":{"name":"typedvalue"}}],[11,"from","","",12,{"inputs":[{"name":"uuid"}],"output":{"name":"typedvalue"}}],[11,"from","","",12,{"inputs":[{"name":"str"}],"output":{"name":"typedvalue"}}],[11,"from","","",12,{"inputs":[{"generics":["string"],"name":"arc"}],"output":{"name":"typedvalue"}}],[11,"from","","",12,{"inputs":[{"generics":["string"],"name":"rc"}],"output":{"name":"typedvalue"}}],[11,"from","","",12,{"inputs":[{"generics":["string"],"name":"box"}],"output":{"name":"typedvalue"}}],[11,"from","","",12,{"inputs":[{"name":"string"}],"output":{"name":"typedvalue"}}],[11,"from","","",12,{"inputs":[{"generics":["keyword"],"name":"arc"}],"output":{"name":"typedvalue"}}],[11,"from","","",12,{"inputs":[{"generics":["keyword"],"name":"rc"}],"output":{"name":"typedvalue"}}],[11,"from","","",12,{"inputs":[{"name":"keyword"}],"output":{"name":"typedvalue"}}],[11,"from","","",12,{"inputs":[{"name":"u32"}],"output":{"name":"typedvalue"}}],[11,"from","","",12,{"inputs":[{"name":"i32"}],"output":{"name":"typedvalue"}}],[11,"from","","",12,{"inputs":[{"name":"f64"}],"output":{"name":"typedvalue"}}],[11,"into_known_entid","","",12,{"inputs":[{"name":"self"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"into_entid","","",12,{"inputs":[{"name":"self"}],"output":{"generics":["entid"],"name":"option"}}],[11,"into_kw","","",12,{"inputs":[{"name":"self"}],"output":{"generics":["valuerc"],"name":"option"}}],[11,"into_boolean","","",12,{"inputs":[{"name":"self"}],"output":{"generics":["bool"],"name":"option"}}],[11,"into_long","","",12,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_double","","",12,{"inputs":[{"name":"self"}],"output":{"generics":["f64"],"name":"option"}}],[11,"into_instant","","",12,{"inputs":[{"name":"self"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"into_timestamp","","",12,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_string","","",12,{"inputs":[{"name":"self"}],"output":{"generics":["valuerc"],"name":"option"}}],[11,"into_c_string","","",12,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_kw_c_string","","",12,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_uuid_c_string","","",12,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_uuid","","",12,{"inputs":[{"name":"self"}],"output":{"generics":["uuid"],"name":"option"}}],[11,"into_uuid_string","","",12,{"inputs":[{"name":"self"}],"output":{"generics":["string"],"name":"option"}}],[11,"into_known_entid","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"into_entid","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["entid"],"name":"option"}}],[11,"into_kw","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["valuerc"],"name":"option"}}],[11,"into_boolean","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["bool"],"name":"option"}}],[11,"into_long","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_double","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["f64"],"name":"option"}}],[11,"into_instant","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"into_timestamp","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_string","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["valuerc"],"name":"option"}}],[11,"into_uuid","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["uuid"],"name":"option"}}],[11,"into_uuid_string","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["string"],"name":"option"}}],[11,"into_c_string","","",11,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_kw_c_string","","",11,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_uuid_c_string","","",11,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"clone","","",8,{"inputs":[{"name":"self"}],"output":{"name":"valuetypeset"}}],[11,"fmt","","",8,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",8,{"inputs":[{"name":"self"},{"name":"valuetypeset"}],"output":{"name":"bool"}}],[11,"ne","","",8,{"inputs":[{"name":"self"},{"name":"valuetypeset"}],"output":{"name":"bool"}}],[11,"default","","",8,{"inputs":[],"output":{"name":"valuetypeset"}}],[11,"any","","",8,{"inputs":[],"output":{"name":"valuetypeset"}}],[11,"none","","",8,{"inputs":[],"output":{"name":"valuetypeset"}}],[11,"of_one","","Return a set containing only `t`.",8,{"inputs":[{"name":"valuetype"}],"output":{"name":"valuetypeset"}}],[11,"of_numeric_types","","Return a set containing `Double` and `Long`.",8,{"inputs":[],"output":{"name":"valuetypeset"}}],[11,"of_numeric_and_instant_types","","Return a set containing `Double`, `Long`, and `Instant`.",8,{"inputs":[],"output":{"name":"valuetypeset"}}],[11,"of_keywords","","Return a set containing `Ref` and `Keyword`.",8,{"inputs":[],"output":{"name":"valuetypeset"}}],[11,"of_longs","","Return a set containing `Ref` and `Long`.",8,{"inputs":[],"output":{"name":"valuetypeset"}}],[11,"insert","","",8,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"bool"}}],[11,"len","","",8,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"union","","Returns a set containing all the types in this set and `other`.",8,{"inputs":[{"name":"self"},{"name":"valuetypeset"}],"output":{"name":"valuetypeset"}}],[11,"intersection","","",8,{"inputs":[{"name":"self"},{"name":"valuetypeset"}],"output":{"name":"valuetypeset"}}],[11,"difference","","Returns the set difference between `self` and `other`, which is the set of items in `self` that are not in `other`.",8,{"inputs":[{"name":"self"},{"name":"valuetypeset"}],"output":{"name":"valuetypeset"}}],[11,"exemplar","","Return an arbitrary type that's part of this set. For a set containing a single type, this will be that type.",8,{"inputs":[{"name":"self"}],"output":{"generics":["valuetype"],"name":"option"}}],[11,"is_subset","","",8,{"inputs":[{"name":"self"},{"name":"valuetypeset"}],"output":{"name":"bool"}}],[11,"is_disjoint","","Returns true if `self` and `other` contain no items in common.",8,{"inputs":[{"name":"self"},{"name":"valuetypeset"}],"output":{"name":"bool"}}],[11,"contains","","",8,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"bool"}}],[11,"is_empty","","",8,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_unit","","",8,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"iter","","",8,{"inputs":[{"name":"self"}],"output":{"generics":["valuetype"],"name":"iter"}}],[11,"from","","",8,{"inputs":[{"name":"valuetype"}],"output":{"name":"self"}}],[11,"is_only_numeric","","",8,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"into_iter","","",8,null],[11,"from_iter","","",8,{"inputs":[{"name":"i"}],"output":{"name":"self"}}],[11,"extend","","",8,{"inputs":[{"name":"self"},{"name":"i"}],"output":null}],[11,"clone","","",14,{"inputs":[{"name":"self"}],"output":{"name":"sqltypeaffinity"}}],[11,"fmt","","",14,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",14,null],[11,"cmp","","",14,{"inputs":[{"name":"self"},{"name":"sqltypeaffinity"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",14,{"inputs":[{"name":"self"},{"name":"sqltypeaffinity"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"eq","","",14,{"inputs":[{"name":"self"},{"name":"sqltypeaffinity"}],"output":{"name":"bool"}}],[11,"sql_representation","","",13,null],[11,"value_type_tag","","",13,{"inputs":[{"name":"self"}],"output":{"name":"valuetypetag"}}],[11,"accommodates_integer","","Returns true if the provided integer is in the SQLite value space of this type. For example, `1` is how we encode `true`.",13,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"bool"}}],[11,"value_type_tags","","",8,{"inputs":[{"name":"self"}],"output":{"generics":["valuetypetag"],"name":"btreeset"}}],[11,"unique_type_tag","","",8,{"inputs":[{"name":"self"}],"output":{"generics":["valuetypetag"],"name":"option"}}],[11,"has_unique_type_tag","","",8,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[0,"attribute","","",null,null],[4,"Unique","mentat_core::attribute","",null,null],[13,"Value","","",42,null],[13,"Identity","","",42,null],[11,"clone","","",42,{"inputs":[{"name":"self"}],"output":{"name":"unique"}}],[11,"fmt","","",42,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",42,null],[11,"cmp","","",42,{"inputs":[{"name":"self"},{"name":"unique"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",42,{"inputs":[{"name":"self"},{"name":"unique"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"eq","","",42,{"inputs":[{"name":"self"},{"name":"unique"}],"output":{"name":"bool"}}],[11,"into_typed_value","","",42,{"inputs":[{"name":"self"}],"output":{"name":"typedvalue"}}],[0,"intern_set","mentat_core","",null,null],[3,"InternSet","mentat_core::intern_set","An `InternSet` allows to \"intern\" some potentially large values, maintaining a single value instance owned by the `InternSet` and leaving consumers with lightweight ref-counted handles to the large owned value. This can avoid expensive clone() operations.",null,null],[12,"inner","","",43,null],[11,"clone","","",43,{"inputs":[{"name":"self"}],"output":{"name":"internset"}}],[11,"fmt","","",43,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"default","","",43,{"inputs":[],"output":{"name":"internset"}}],[11,"eq","","",43,{"inputs":[{"name":"self"},{"name":"internset"}],"output":{"name":"bool"}}],[11,"ne","","",43,{"inputs":[{"name":"self"},{"name":"internset"}],"output":{"name":"bool"}}],[11,"new","","",43,{"inputs":[],"output":{"name":"internset"}}],[11,"len","","",43,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"intern","","Intern a value, providing a ref-counted handle to the interned value.",43,{"inputs":[{"name":"self"},{"name":"r"}],"output":{"name":"rc"}}],[0,"counter","mentat_core","",null,null],[3,"RcCounter","mentat_core::counter","",null,null],[11,"clone","","",44,{"inputs":[{"name":"self"}],"output":{"name":"rccounter"}}],[11,"with_initial","","",44,{"inputs":[{"name":"usize"}],"output":{"name":"self"}}],[11,"new","","",44,{"inputs":[],"output":{"name":"self"}}],[11,"next","","Return the next value in the sequence.",44,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[0,"util","mentat_core","",null,null],[4,"Either","mentat_core::util","",null,null],[13,"Left","","",45,null],[13,"Right","","",45,null],[8,"ResultEffect","","Side-effect chaining on `Result`.",null,null],[10,"when_ok","","Invoke `f` if `self` is `Ok`, returning `self`.",46,{"inputs":[{"name":"self"},{"name":"f"}],"output":{"name":"self"}}],[10,"when_err","","Invoke `f` if `self` is `Err`, returning `self`.",46,{"inputs":[{"name":"self"},{"name":"f"}],"output":{"name":"self"}}],[8,"OptionEffect","","Side-effect chaining on `Option`.",null,null],[10,"when_none","","Invoke `f` if `self` is `None`, returning `self`.",47,{"inputs":[{"name":"self"},{"name":"f"}],"output":{"name":"self"}}],[10,"when_some","","Invoke `f` if `self` is `Some`, returning `self`.",47,{"inputs":[{"name":"self"},{"name":"f"}],"output":{"name":"self"}}],[11,"clone","","",45,{"inputs":[{"name":"self"}],"output":{"name":"either"}}],[11,"fmt","","",45,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",45,null],[11,"cmp","","",45,{"inputs":[{"name":"self"},{"name":"either"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",45,{"inputs":[{"name":"self"},{"name":"either"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",45,{"inputs":[{"name":"self"},{"name":"either"}],"output":{"name":"bool"}}],[11,"le","","",45,{"inputs":[{"name":"self"},{"name":"either"}],"output":{"name":"bool"}}],[11,"gt","","",45,{"inputs":[{"name":"self"},{"name":"either"}],"output":{"name":"bool"}}],[11,"ge","","",45,{"inputs":[{"name":"self"},{"name":"either"}],"output":{"name":"bool"}}],[11,"eq","","",45,{"inputs":[{"name":"self"},{"name":"either"}],"output":{"name":"bool"}}],[11,"ne","","",45,{"inputs":[{"name":"self"},{"name":"either"}],"output":{"name":"bool"}}],[11,"map_left","","",45,{"inputs":[{"name":"self"},{"name":"f"}],"output":{"name":"either"}}],[11,"map_right","","",45,{"inputs":[{"name":"self"},{"name":"f"}],"output":{"name":"either"}}],[6,"Entid","mentat_core","Represents one entid in the entid space.",null,null],[6,"ValueTypeTag","","",null,null],[6,"IdentMap","","Map `Keyword` idents (`:db/ident`) to positive integer entids (`1`).",null,null],[6,"EntidMap","","Map positive integer entids (`1`) to `Keyword` idents (`:db/ident`).",null,null],[6,"AttributeMap","","Map attribute entids to `Attribute` instances.",null,null],[8,"CachedAttributes","","",null,null],[10,"is_attribute_cached_reverse","","",48,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[10,"is_attribute_cached_forward","","",48,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[10,"has_cached_attributes","","",48,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[10,"get_values_for_entid","","",48,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"entid"},{"name":"entid"}],"output":{"generics":["vec"],"name":"option"}}],[10,"get_value_for_entid","","",48,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"entid"},{"name":"entid"}],"output":{"generics":["typedvalue"],"name":"option"}}],[10,"get_entid_for_value","","Reverse lookup.",48,{"inputs":[{"name":"self"},{"name":"entid"},{"name":"typedvalue"}],"output":{"generics":["entid"],"name":"option"}}],[10,"get_entids_for_value","","",48,{"inputs":[{"name":"self"},{"name":"entid"},{"name":"typedvalue"}],"output":{"generics":["btreeset"],"name":"option"}}],[8,"UpdateableCache","","",null,null],[10,"update","","",49,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"i"},{"name":"i"}],"output":{"name":"result"}}],[8,"SQLValueType","","",null,null],[10,"value_type_tag","","",50,{"inputs":[{"name":"self"}],"output":{"name":"valuetypetag"}}],[10,"accommodates_integer","","",50,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"bool"}}],[10,"sql_representation","","Return a pair of the ValueTypeTag for this value type, and the SQLTypeAffinity required to distinguish it from any other types that share the same tag.",50,null],[8,"SQLValueTypeSet","","We have an enum of types, `ValueType`. It can be collected into a set, `ValueTypeSet`. Each type is associated with a type tag, which is how a type is represented in, e.g., SQL storage. Types can share type tags, because backing SQL storage is able to differentiate between some types (e.g., longs and doubles), and so distinct tags aren't necessary. That association is defined by `SQLValueType`. That trait similarly extends to `ValueTypeSet`, which maps a collection of types into a collection of tags.",null,null],[10,"value_type_tags","","",51,{"inputs":[{"name":"self"}],"output":{"generics":["valuetypetag"],"name":"btreeset"}}],[10,"has_unique_type_tag","","",51,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[10,"unique_type_tag","","",51,{"inputs":[{"name":"self"}],"output":{"generics":["valuetypetag"],"name":"option"}}],[8,"HasSchema","","",null,null],[10,"entid_for_type","","",52,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"generics":["knownentid"],"name":"option"}}],[10,"get_ident","","",52,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["keyword"],"name":"option"}}],[10,"get_entid","","",52,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"generics":["knownentid"],"name":"option"}}],[10,"attribute_for_entid","","",52,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["attribute"],"name":"option"}}],[10,"attribute_for_ident","","",52,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"option"}}],[10,"is_attribute","","Return true if the provided entid identifies an attribute in this schema.",52,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"bool"}}],[10,"identifies_attribute","","Return true if the provided ident identifies an attribute in this schema.",52,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[10,"component_attributes","","",52,null],[11,"clone","","",9,{"inputs":[{"name":"self"}],"output":{"name":"attribute"}}],[11,"fmt","","",9,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",9,null],[11,"cmp","","",9,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",9,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",9,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"le","","",9,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"gt","","",9,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"ge","","",9,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"eq","","",9,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"ne","","",9,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"flags","","Combine several attribute flags into a bitfield used in temporary search tables.",9,{"inputs":[{"name":"self"}],"output":{"name":"u8"}}],[11,"to_edn_value","","",9,{"inputs":[{"name":"self"},{"generics":["keyword"],"name":"option"}],"output":{"name":"value"}}],[11,"default","","",9,{"inputs":[],"output":{"name":"attribute"}}],[11,"clone","","",10,{"inputs":[{"name":"self"}],"output":{"name":"schema"}}],[11,"fmt","","",10,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"default","","",10,{"inputs":[],"output":{"name":"schema"}}],[11,"hash","","",10,null],[11,"cmp","","",10,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",10,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",10,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"le","","",10,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"gt","","",10,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"ge","","",10,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"eq","","",10,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"ne","","",10,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"new","","",10,{"inputs":[{"name":"identmap"},{"name":"entidmap"},{"name":"attributemap"}],"output":{"name":"schema"}}],[11,"to_edn_value","","Returns an symbolic representation of the schema suitable for applying across Mentat stores.",10,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"update_component_attributes","","",10,{"inputs":[{"name":"self"}],"output":null}],[11,"entid_for_type","","",10,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"get_ident","","",10,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"get_entid","","",10,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"attribute_for_entid","","",10,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["attribute"],"name":"option"}}],[11,"attribute_for_ident","","",10,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"option"}}],[11,"is_attribute","","Return true if the provided entid identifies an attribute in this schema.",10,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"bool"}}],[11,"identifies_attribute","","Return true if the provided ident identifies an attribute in this schema.",10,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"component_attributes","","",10,null],[14,"interpose","","A helper macro to sequentially process an iterable sequence, evaluating a block between each pair of items.",null,null],[14,"interpose_iter","","A helper to bind `name` to values in `across`, running `body` for each value, and running `inter` between each value. See `interpose` for examples.",null,null],[11,"nil","","The 'nil UUID'.",53,{"inputs":[],"output":{"name":"uuid"}}],[11,"new","","Creates a new `Uuid`.",53,{"inputs":[{"name":"uuidversion"}],"output":{"generics":["uuid"],"name":"option"}}],[11,"new_v4","","Creates a random `Uuid`.",53,{"inputs":[],"output":{"name":"uuid"}}],[11,"from_fields","","Creates a `Uuid` from four field values.",53,null],[11,"from_bytes","","Creates a `Uuid` using the supplied bytes.",53,null],[11,"get_variant","","Returns the variant of the `Uuid` structure.",53,{"inputs":[{"name":"self"}],"output":{"generics":["uuidvariant"],"name":"option"}}],[11,"get_version_num","","Returns the version number of the `Uuid`.",53,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"get_version","","Returns the version of the `Uuid`.",53,{"inputs":[{"name":"self"}],"output":{"generics":["uuidversion"],"name":"option"}}],[11,"as_bytes","","Return an array of 16 octets containing the UUID data",53,null],[11,"simple","","Returns a wrapper which when formatted via `fmt::Display` will format a string of 32 hexadecimal digits.",53,{"inputs":[{"name":"self"}],"output":{"name":"simple"}}],[11,"hyphenated","","Returns a wrapper which when formatted via `fmt::Display` will format a string of hexadecimal digits separated into groups with a hyphen.",53,{"inputs":[{"name":"self"}],"output":{"name":"hyphenated"}}],[11,"urn","","Returns a wrapper which when formatted via `fmt::Display` will format a string of the UUID as a full URN string.",53,{"inputs":[{"name":"self"}],"output":{"name":"urn"}}],[11,"to_timestamp","","Returns an Optional Tuple of (u64, u16) representing the timestamp and counter portion of a V1 UUID. If the supplied UUID is not V1, this will return None",53,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"parse_str","","Parses a `Uuid` from a string of hexadecimal digits with optional hyphens.",53,{"inputs":[{"name":"str"}],"output":{"generics":["uuid","parseerror"],"name":"result"}}],[11,"is_nil","","Tests if the UUID is nil",53,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"partial_cmp","","",54,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"clone","","",55,{"inputs":[{"name":"self"}],"output":{"name":"utc"}}],[11,"clone","","",54,{"inputs":[{"name":"self"}],"output":{"name":"datetime"}}],[11,"add","","",54,{"inputs":[{"name":"self"},{"name":"fixedoffset"}],"output":{"name":"datetime"}}],[11,"add","","",54,{"inputs":[{"name":"self"},{"name":"duration"}],"output":{"name":"datetime"}}],[11,"fix","","",55,{"inputs":[{"name":"self"}],"output":{"name":"fixedoffset"}}],[11,"from","","",54,{"inputs":[{"name":"systemtime"}],"output":{"generics":["local"],"name":"datetime"}}],[11,"from","","",54,{"inputs":[{"name":"systemtime"}],"output":{"generics":["utc"],"name":"datetime"}}],[11,"serialize","","Serialize into a rfc3339 time string",54,{"inputs":[{"name":"self"},{"name":"s"}],"output":{"name":"result"}}],[11,"sub","","",54,{"inputs":[{"name":"self"},{"name":"duration"}],"output":{"name":"datetime"}}],[11,"sub","","",54,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"name":"duration"}}],[11,"sub","","",54,{"inputs":[{"name":"self"},{"name":"fixedoffset"}],"output":{"name":"datetime"}}],[11,"from_str","","",54,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"from_str","","",54,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"from_str","","",54,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"cmp","","",54,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"name":"ordering"}}],[11,"hash","","",54,null],[11,"eq","","",55,{"inputs":[{"name":"self"},{"name":"utc"}],"output":{"name":"bool"}}],[11,"eq","","",54,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"name":"bool"}}],[11,"deserialize","","",54,{"inputs":[{"name":"d"}],"output":{"generics":["datetime"],"name":"result"}}],[11,"deserialize","","",54,{"inputs":[{"name":"d"}],"output":{"generics":["datetime"],"name":"result"}}],[11,"deserialize","","",54,{"inputs":[{"name":"d"}],"output":{"generics":["datetime"],"name":"result"}}],[11,"hour","","",54,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"minute","","",54,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"second","","",54,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"nanosecond","","",54,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"with_hour","","",54,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_minute","","",54,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_second","","",54,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_nanosecond","","",54,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"fmt","","",55,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",54,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"year","","",54,{"inputs":[{"name":"self"}],"output":{"name":"i32"}}],[11,"month","","",54,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"month0","","",54,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"day","","",54,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"day0","","",54,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"ordinal","","",54,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"ordinal0","","",54,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"weekday","","",54,{"inputs":[{"name":"self"}],"output":{"name":"weekday"}}],[11,"iso_week","","",54,{"inputs":[{"name":"self"}],"output":{"name":"isoweek"}}],[11,"with_year","","",54,{"inputs":[{"name":"self"},{"name":"i32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_month","","",54,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_month0","","",54,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_day","","",54,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_day0","","",54,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_ordinal","","",54,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_ordinal0","","",54,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"fmt","","",54,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",55,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"from_offset","","",55,{"inputs":[{"name":"utc"}],"output":{"name":"utc"}}],[11,"offset_from_local_date","","",55,{"inputs":[{"name":"self"},{"name":"naivedate"}],"output":{"generics":["utc"],"name":"localresult"}}],[11,"offset_from_local_datetime","","",55,{"inputs":[{"name":"self"},{"name":"naivedatetime"}],"output":{"generics":["utc"],"name":"localresult"}}],[11,"offset_from_utc_date","","",55,{"inputs":[{"name":"self"},{"name":"naivedate"}],"output":{"name":"utc"}}],[11,"offset_from_utc_datetime","","",55,{"inputs":[{"name":"self"},{"name":"naivedatetime"}],"output":{"name":"utc"}}],[11,"fmt","","",53,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",53,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"eq","","",53,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"ne","","",53,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"hash","","",53,null],[11,"from_str","","Parse a hex string and interpret as a `Uuid`.",53,{"inputs":[{"name":"str"}],"output":{"generics":["uuid","parseerror"],"name":"result"}}],[11,"cmp","","",53,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"ordering"}}],[11,"deserialize","","",53,{"inputs":[{"name":"d"}],"output":{"generics":["uuid"],"name":"result"}}],[11,"rand","","",53,{"inputs":[{"name":"r"}],"output":{"name":"uuid"}}],[11,"clone","","",53,{"inputs":[{"name":"self"}],"output":{"name":"uuid"}}],[11,"partial_cmp","","",53,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",53,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"le","","",53,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"gt","","",53,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"ge","","",53,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"serialize","","",53,{"inputs":[{"name":"self"},{"name":"s"}],"output":{"name":"result"}}],[11,"default","","Returns the nil UUID, which is all zeroes",53,{"inputs":[],"output":{"name":"uuid"}}],[11,"to_micros","","",54,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[11,"partial_cmp","","",56,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",56,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"le","","",56,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"gt","","",56,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"ge","","",56,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"clone","","",5,{"inputs":[{"name":"self"}],"output":{"name":"parseerror"}}],[11,"clone","","",56,{"inputs":[{"name":"self"}],"output":{"name":"keyword"}}],[11,"cmp","","",56,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"ordering"}}],[11,"deserialize","","",56,{"inputs":[{"name":"__d"}],"output":{"generics":["keyword"],"name":"result"}}],[11,"hash","","",56,null],[11,"eq","","",5,{"inputs":[{"name":"self"},{"name":"parseerror"}],"output":{"name":"bool"}}],[11,"ne","","",5,{"inputs":[{"name":"self"},{"name":"parseerror"}],"output":{"name":"bool"}}],[11,"eq","","",56,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"ne","","",56,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"fmt","","Print the keyword in EDN format.",56,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",5,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",56,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",5,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"from_micros","","",54,{"inputs":[{"name":"i64"}],"output":{"generics":["utc"],"name":"datetime"}}],[11,"description","","",5,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"serialize","","",56,{"inputs":[{"name":"self"},{"name":"__s"}],"output":{"name":"result"}}],[11,"from_utc","","Makes a new `DateTime` with given UTC datetime and offset. The local datetime should be constructed via the `TimeZone` trait.",54,null],[11,"date","","Retrieves a date component.",54,{"inputs":[{"name":"self"}],"output":{"name":"date"}}],[11,"time","","Retrieves a time component. Unlike `date`, this is not associated to the time zone.",54,{"inputs":[{"name":"self"}],"output":{"name":"naivetime"}}],[11,"timestamp","","Returns the number of non-leap seconds since January 1, 1970 0:00:00 UTC (aka \"UNIX timestamp\").",54,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[11,"timestamp_millis","","Returns the number of non-leap-milliseconds since January 1, 1970 UTC",54,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[11,"timestamp_nanos","","Returns the number of non-leap-nanoseconds since January 1, 1970 UTC",54,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[11,"timestamp_subsec_millis","","Returns the number of milliseconds since the last second boundary",54,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"timestamp_subsec_micros","","Returns the number of microseconds since the last second boundary",54,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"timestamp_subsec_nanos","","Returns the number of nanoseconds since the last second boundary",54,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"offset","","Retrieves an associated offset from UTC.",54,null],[11,"timezone","","Retrieves an associated time zone.",54,{"inputs":[{"name":"self"}],"output":{"name":"tz"}}],[11,"with_timezone","","Changes the associated time zone. This does not change the actual `DateTime` (but will change the string representation).",54,{"inputs":[{"name":"self"},{"name":"tz2"}],"output":{"name":"datetime"}}],[11,"checked_add_signed","","Adds given `Duration` to the current date and time.",54,{"inputs":[{"name":"self"},{"name":"duration"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"checked_sub_signed","","Subtracts given `Duration` from the current date and time.",54,{"inputs":[{"name":"self"},{"name":"duration"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"signed_duration_since","","Subtracts another `DateTime` from the current date and time. This does not overflow or underflow at all.",54,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"name":"duration"}}],[11,"naive_utc","","Returns a view to the naive UTC datetime.",54,{"inputs":[{"name":"self"}],"output":{"name":"naivedatetime"}}],[11,"naive_local","","Returns a view to the naive local datetime.",54,{"inputs":[{"name":"self"}],"output":{"name":"naivedatetime"}}],[11,"parse_from_rfc2822","","Parses an RFC 2822 date and time string such as `Tue, 1 Jul 2003 10:52:37 +0200`, then returns a new `DateTime` with a parsed `FixedOffset`.",54,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"parse_from_rfc3339","","Parses an RFC 3339 and ISO 8601 date and time string such as `1996-12-19T16:39:57-08:00`, then returns a new `DateTime` with a parsed `FixedOffset`.",54,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"parse_from_str","","Parses a string with the specified format string and returns a new `DateTime` with a parsed `FixedOffset`. See the `format::strftime` module on the supported escape sequences.",54,{"inputs":[{"name":"str"},{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"to_rfc2822","","Returns an RFC 2822 date and time string such as `Tue, 1 Jul 2003 10:52:37 +0200`.",54,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"to_rfc3339","","Returns an RFC 3339 and ISO 8601 date and time string such as `1996-12-19T16:39:57-08:00`.",54,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"to_rfc3339_opts","","Return an RFC 3339 and ISO 8601 date and time string with subseconds formatted as per a `SecondsFormat`. If passed `use_z` true and the timezone is UTC (offset 0), use 'Z', as per Fixed::TimezoneOffsetColonZ. If passed `use_z` false, use Fixed::TimezoneOffsetColon.",54,{"inputs":[{"name":"self"},{"name":"secondsformat"},{"name":"bool"}],"output":{"name":"string"}}],[11,"format_with_items","","Formats the combined date and time with the specified formatting items.",54,{"inputs":[{"name":"self"},{"name":"i"}],"output":{"name":"delayedformat"}}],[11,"format","","Formats the combined date and time with the specified format string. See the `format::strftime` module on the supported escape sequences.",54,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"generics":["strftimeitems"],"name":"delayedformat"}}],[11,"plain","","",56,{"inputs":[{"name":"t"}],"output":{"name":"keyword"}}],[11,"namespaced","","Creates a new `Keyword`.",56,{"inputs":[{"name":"n"},{"name":"t"}],"output":{"name":"keyword"}}],[11,"name","","",56,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"namespace","","",56,{"inputs":[{"name":"self"}],"output":{"generics":["str"],"name":"option"}}],[11,"components","","",56,null],[11,"is_backward","","Whether this `Keyword` should be interpreted in reverse order. For example, the two following snippets are identical:",56,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_forward","","Whether this `Keyword` should be interpreted in forward order. See `symbols::Keyword::is_backward`.",56,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_namespaced","","",56,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"to_reversed","","Returns a `Keyword` with the same namespace and a 'backward' name. See `symbols::Keyword::is_backward`.",56,{"inputs":[{"name":"self"}],"output":{"name":"keyword"}}],[11,"unreversed","","If this `Keyword` is 'backward' (see `symbols::Keyword::is_backward`), return `Some('forward name')`; otherwise, return `None`.",56,{"inputs":[{"name":"self"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"today","","Returns a `Date` which corresponds to the current date.",55,{"inputs":[],"output":{"generics":["utc"],"name":"date"}}],[11,"now","","Returns a `DateTime` which corresponds to the current date.",55,{"inputs":[],"output":{"generics":["utc"],"name":"datetime"}}],[11,"from","","",57,{"inputs":[{"name":"knownentid"}],"output":{"name":"entid"}}]],"paths":[[8,"Timelike"],[8,"Cloned"],[8,"FromMicros"],[8,"FromRc"],[8,"ToMicros"],[3,"EdnParseError"],[3,"KnownEntid"],[3,"StructuredMap"],[3,"ValueTypeSet"],[3,"Attribute"],[3,"Schema"],[4,"Binding"],[4,"TypedValue"],[4,"ValueType"],[4,"SQLTypeAffinity"],[4,"AttributeBitFlags"],[3,"DB_ADD"],[3,"DB_ALTER_ATTRIBUTE"],[3,"DB_CARDINALITY"],[3,"DB_CARDINALITY_MANY"],[3,"DB_CARDINALITY_ONE"],[3,"DB_FULLTEXT"],[3,"DB_IDENT"],[3,"DB_INDEX"],[3,"DB_INSTALL_ATTRIBUTE"],[3,"DB_IS_COMPONENT"],[3,"DB_NO_HISTORY"],[3,"DB_PART_DB"],[3,"DB_RETRACT"],[3,"DB_TYPE_BOOLEAN"],[3,"DB_TYPE_DOUBLE"],[3,"DB_TYPE_INSTANT"],[3,"DB_TYPE_KEYWORD"],[3,"DB_TYPE_LONG"],[3,"DB_TYPE_REF"],[3,"DB_TYPE_STRING"],[3,"DB_TYPE_URI"],[3,"DB_TYPE_UUID"],[3,"DB_UNIQUE"],[3,"DB_UNIQUE_IDENTITY"],[3,"DB_UNIQUE_VALUE"],[3,"DB_VALUE_TYPE"],[4,"Unique"],[3,"InternSet"],[3,"RcCounter"],[4,"Either"],[8,"ResultEffect"],[8,"OptionEffect"],[8,"CachedAttributes"],[8,"UpdateableCache"],[8,"SQLValueType"],[8,"SQLValueTypeSet"],[8,"HasSchema"],[3,"Uuid"],[3,"DateTime"],[3,"Utc"],[3,"Keyword"],[6,"Entid"]]}; +searchIndex["mentat_db"] = {"doc":"","items":[[3,"AttributeBuilder","mentat_db","",null,null],[12,"value_type","","",0,null],[12,"multival","","",0,null],[12,"unique","","",0,null],[12,"index","","",0,null],[12,"fulltext","","",0,null],[12,"component","","",0,null],[12,"no_history","","",0,null],[5,"transact","","Transact the given `entities` against the given SQLite `conn`, using the given metadata. If you want this work to occur inside a SQLite transaction, establish one on the connection prior to calling this function.",null,{"inputs":[{"name":"connection"},{"name":"partitionmap"},{"name":"schema"},{"name":"schema"},{"name":"w"},{"name":"i"}],"output":{"name":"result"}}],[5,"transact_terms","","Just like `transact`, but accepts lower-level inputs to allow bypassing the parser interface.",null,{"inputs":[{"name":"connection"},{"name":"partitionmap"},{"name":"schema"},{"name":"schema"},{"name":"w"},{"name":"i"},{"generics":["tempid"],"name":"internset"}],"output":{"name":"result"}}],[5,"to_namespaced_keyword","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["keyword"],"name":"result"}}],[5,"repeat_values","","Prepare an SQL `VALUES` block, like (?, ?, ?), (?, ?, ?).",null,{"inputs":[{"name":"usize"},{"name":"usize"}],"output":{"name":"string"}}],[0,"errors","","",null,null],[3,"DbSqlError","mentat_db::errors","",null,null],[4,"CardinalityConflict","","",null,null],[13,"CardinalityOneAddConflict","","A cardinality one attribute has multiple assertions `[e a v1], [e a v2], ...`.",1,null],[12,"e","mentat_db::errors::CardinalityConflict","",1,null],[12,"a","","",1,null],[12,"vs","","",1,null],[13,"AddRetractConflict","mentat_db::errors","A datom has been both asserted and retracted, like `[:db/add e a v]` and `[:db/retract e a v]`.",1,null],[12,"e","mentat_db::errors::CardinalityConflict","",1,null],[12,"a","","",1,null],[12,"vs","","",1,null],[4,"SchemaConstraintViolation","mentat_db::errors","",null,null],[13,"ConflictingUpserts","","A transaction tried to assert datoms where one tempid upserts to two (or more) distinct entids.",2,null],[12,"conflicting_upserts","mentat_db::errors::SchemaConstraintViolation","A map from tempid to the entids it would upsert to.",2,null],[13,"TypeDisagreements","mentat_db::errors","A transaction tried to assert a datom or datoms with the wrong value `v` type(s).",2,null],[12,"conflicting_datoms","mentat_db::errors::SchemaConstraintViolation","The key (`[e a v]`) has an invalid value `v`: it is not of the expected value type.",2,null],[13,"CardinalityConflicts","mentat_db::errors","A transaction tried to assert datoms that don't observe the schema's cardinality constraints.",2,null],[12,"conflicts","mentat_db::errors::SchemaConstraintViolation","",2,null],[4,"InputError","mentat_db::errors","",null,null],[13,"BadDbId","","Map notation included a bad `:db/id` value.",3,null],[13,"BadEntityPlace","","A value place cannot be interpreted as an entity place (for example, in nested map notation).",3,null],[4,"DbError","","",null,null],[13,"NotYetImplemented","","We're just not done yet. Message that the feature is recognized but not yet implemented.",4,null],[13,"BadValuePair","","We've been given a value that isn't the correct Mentat type.",4,null],[13,"BadSQLValuePair","","We've got corrupt data in the SQL store: a value and value_type_tag don't line up. TODO _1.data_type()",4,null],[13,"BadBootstrapDefinition","","A bootstrap definition couldn't be parsed or installed. This is a programmer error, not a runtime error.",4,null],[13,"BadSchemaAssertion","","A schema assertion couldn't be parsed.",4,null],[13,"UnrecognizedIdent","","An ident->entid mapping failed.",4,null],[13,"UnrecognizedEntid","","An entid->ident mapping failed. We also use this error if you try to transact an entid that we didn't allocate, in part because we blow the stack in error_chain if we define a new enum!",4,null],[13,"UnknownAttribute","","",4,null],[13,"CannotCacheNonUniqueAttributeInReverse","","",4,null],[13,"SchemaAlterationFailed","","",4,null],[13,"SchemaConstraintViolation","","A transaction tried to violate a constraint of the schema of the Mentat store.",4,null],[13,"InputError","","The transaction was malformed in some way (that was not recognized at parse time; for example, in a way that is schema-dependent).",4,null],[13,"WrongTypeValueForFtsAssertion","","",4,null],[4,"DbSqlErrorKind","","",null,null],[13,"CouldNotSetVersionPragma","","",5,null],[13,"CouldNotGetVersionPragma","","",5,null],[13,"CouldNotSearch","","",5,null],[13,"TxInsertFailedToAddMissingDatoms","","",5,null],[13,"TxInsertFailedToRetractDatoms","","",5,null],[13,"DatomsUpdateFailedToRetract","","",5,null],[13,"DatomsUpdateFailedToAdd","","",5,null],[13,"FailedToCreateTempTables","","",5,null],[13,"NonFtsInsertionIntoTempSearchTableFailed","","",5,null],[13,"FtsInsertionFailed","","",5,null],[13,"FtsInsertionIntoTempSearchTableFailed","","",5,null],[13,"FtsFailedToDropSearchIds","","",5,null],[13,"FailedToUpdatePartitionMap","","",5,null],[6,"Result","","",null,null],[11,"clone","","",1,{"inputs":[{"name":"self"}],"output":{"name":"cardinalityconflict"}}],[11,"fmt","","",1,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",1,{"inputs":[{"name":"self"},{"name":"cardinalityconflict"}],"output":{"name":"bool"}}],[11,"ne","","",1,{"inputs":[{"name":"self"},{"name":"cardinalityconflict"}],"output":{"name":"bool"}}],[11,"clone","","",2,{"inputs":[{"name":"self"}],"output":{"name":"schemaconstraintviolation"}}],[11,"fmt","","",2,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",2,{"inputs":[{"name":"self"},{"name":"schemaconstraintviolation"}],"output":{"name":"bool"}}],[11,"ne","","",2,{"inputs":[{"name":"self"},{"name":"schemaconstraintviolation"}],"output":{"name":"bool"}}],[11,"cause","","",2,{"inputs":[{"name":"self"}],"output":{"generics":["fail"],"name":"option"}}],[11,"backtrace","","",2,{"inputs":[{"name":"self"}],"output":{"generics":["backtrace"],"name":"option"}}],[11,"fmt","","",2,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"clone","","",3,{"inputs":[{"name":"self"}],"output":{"name":"inputerror"}}],[11,"fmt","","",3,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",3,{"inputs":[{"name":"self"},{"name":"inputerror"}],"output":{"name":"bool"}}],[11,"fmt","","",3,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",4,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"cause","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["fail"],"name":"option"}}],[11,"backtrace","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["backtrace"],"name":"option"}}],[11,"fmt","","",4,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",6,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"cause","","",6,{"inputs":[{"name":"self"}],"output":{"generics":["fail"],"name":"option"}}],[11,"backtrace","","",6,{"inputs":[{"name":"self"}],"output":{"generics":["backtrace"],"name":"option"}}],[11,"fmt","","",6,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"kind","","",6,{"inputs":[{"name":"self"}],"output":{"name":"dbsqlerrorkind"}}],[11,"from","","",6,{"inputs":[{"name":"dbsqlerrorkind"}],"output":{"name":"dbsqlerror"}}],[11,"from","","",6,{"inputs":[{"generics":["dbsqlerrorkind"],"name":"context"}],"output":{"name":"dbsqlerror"}}],[11,"clone","","",5,{"inputs":[{"name":"self"}],"output":{"name":"dbsqlerrorkind"}}],[11,"eq","","",5,{"inputs":[{"name":"self"},{"name":"dbsqlerrorkind"}],"output":{"name":"bool"}}],[11,"fmt","","",5,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"cause","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["fail"],"name":"option"}}],[11,"backtrace","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["backtrace"],"name":"option"}}],[11,"fmt","","",5,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[0,"cache","mentat_db","",null,null],[3,"AevFactory","mentat_db::cache","",null,null],[3,"AevRows","","",null,null],[3,"AttributeCaches","","",null,null],[3,"SQLiteAttributeCache","","",null,null],[3,"InProgressSQLiteAttributeCache","","We maintain a diff on top of the `inner` -- existing -- cache. That involves tracking unregisterings and registerings.",null,null],[12,"overlay","","",7,null],[3,"InProgressCacheTransactWatcher","","",null,null],[4,"AttributeSpec","","",null,null],[13,"All","","",8,null],[13,"Specified","","",8,null],[12,"fts","mentat_db::cache::AttributeSpec","",8,null],[12,"non_fts","","",8,null],[6,"CacheMap","mentat_db::cache","",null,null],[6,"Aev","","",null,null],[8,"AttributeCache","","",null,null],[10,"has_e","","",9,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[10,"binding_for_e","","",9,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"generics":["binding"],"name":"option"}}],[11,"next","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["aev"],"name":"option"}}],[11,"clone","","",11,{"inputs":[{"name":"self"}],"output":{"name":"attributecaches"}}],[11,"fmt","","",11,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"default","","",11,{"inputs":[],"output":{"name":"attributecaches"}}],[11,"unregister_attribute","","",11,{"inputs":[{"name":"self"},{"name":"u"}],"output":null}],[11,"clone","","",8,{"inputs":[{"name":"self"}],"output":{"name":"attributespec"}}],[11,"all","","",8,{"inputs":[],"output":{"name":"attributespec"}}],[11,"specified","","",8,{"inputs":[{"name":"btreeset"},{"name":"schema"}],"output":{"name":"attributespec"}}],[11,"forward_attribute_cache_for_attribute","","Return a reference to the cache for the provided `a`, if `a` names an attribute that is cached in the forward direction. If `a` doesn't name an attribute, or it's not cached at all, or it's only cached in reverse (`v` to `e`, not `e` to `v`), `None` is returned.",11,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"entid"}],"output":{"generics":["attributecache"],"name":"option"}}],[11,"extend_cache_for_entities_and_attributes","","Fetch the requested entities and attributes from the store and put them in the cache. The caller is responsible for ensuring that `entities` is unique. Attributes for which every entity is already cached will not be processed again.",11,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"connection"},{"name":"attributespec"},{"name":"vec"}],"output":{"name":"result"}}],[11,"make_cache_for_entities_and_attributes","","Fetch the requested entities and attributes and put them in a new cache. The caller is responsible for ensuring that `entities` is unique.",11,{"inputs":[{"name":"schema"},{"name":"connection"},{"name":"attributespec"},{"name":"vec"}],"output":{"generics":["attributecaches"],"name":"result"}}],[11,"get_values_for_entid","","",11,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"entid"},{"name":"entid"}],"output":{"generics":["vec"],"name":"option"}}],[11,"get_value_for_entid","","",11,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"entid"},{"name":"entid"}],"output":{"generics":["typedvalue"],"name":"option"}}],[11,"has_cached_attributes","","",11,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_attribute_cached_reverse","","",11,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[11,"is_attribute_cached_forward","","",11,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[11,"get_entid_for_value","","",11,{"inputs":[{"name":"self"},{"name":"entid"},{"name":"typedvalue"}],"output":{"generics":["entid"],"name":"option"}}],[11,"get_entids_for_value","","",11,{"inputs":[{"name":"self"},{"name":"entid"},{"name":"typedvalue"}],"output":{"generics":["btreeset"],"name":"option"}}],[11,"update","","",11,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"i"},{"name":"i"}],"output":{"name":"result"}}],[11,"clone","","",12,{"inputs":[{"name":"self"}],"output":{"name":"sqliteattributecache"}}],[11,"fmt","","",12,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"default","","",12,{"inputs":[],"output":{"name":"sqliteattributecache"}}],[11,"register_forward","","",12,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"connection"},{"name":"u"}],"output":{"name":"result"}}],[11,"register_reverse","","",12,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"connection"},{"name":"u"}],"output":{"name":"result"}}],[11,"register","","",12,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"connection"},{"name":"u"}],"output":{"name":"result"}}],[11,"unregister","","",12,{"inputs":[{"name":"self"},{"name":"u"}],"output":null}],[11,"unregister_all","","",12,{"inputs":[{"name":"self"}],"output":null}],[11,"update","","",12,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"i"},{"name":"i"}],"output":{"name":"result"}}],[11,"get_values_for_entid","","",12,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"entid"},{"name":"entid"}],"output":{"generics":["vec"],"name":"option"}}],[11,"get_value_for_entid","","",12,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"entid"},{"name":"entid"}],"output":{"generics":["typedvalue"],"name":"option"}}],[11,"is_attribute_cached_reverse","","",12,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[11,"is_attribute_cached_forward","","",12,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[11,"has_cached_attributes","","",12,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"get_entids_for_value","","",12,{"inputs":[{"name":"self"},{"name":"entid"},{"name":"typedvalue"}],"output":{"generics":["btreeset"],"name":"option"}}],[11,"get_entid_for_value","","",12,{"inputs":[{"name":"self"},{"name":"entid"},{"name":"typedvalue"}],"output":{"generics":["entid"],"name":"option"}}],[11,"values_pairs","","Intended for use from tests.",12,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"u"}],"output":{"generics":["btreemap"],"name":"option"}}],[11,"value_pairs","","Intended for use from tests.",12,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"u"}],"output":{"generics":["btreemap"],"name":"option"}}],[11,"fmt","","",7,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"default","","",7,{"inputs":[],"output":{"name":"inprogresssqliteattributecache"}}],[11,"from_cache","","",7,{"inputs":[{"name":"sqliteattributecache"}],"output":{"name":"inprogresssqliteattributecache"}}],[11,"register_forward","","",7,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"connection"},{"name":"u"}],"output":{"name":"result"}}],[11,"register_reverse","","",7,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"connection"},{"name":"u"}],"output":{"name":"result"}}],[11,"register","","",7,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"connection"},{"name":"u"}],"output":{"name":"result"}}],[11,"unregister","","",7,{"inputs":[{"name":"self"},{"name":"u"}],"output":null}],[11,"unregister_all","","",7,{"inputs":[{"name":"self"}],"output":null}],[11,"update","","",7,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"i"},{"name":"i"}],"output":{"name":"result"}}],[11,"get_values_for_entid","","",7,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"entid"},{"name":"entid"}],"output":{"generics":["vec"],"name":"option"}}],[11,"get_value_for_entid","","",7,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"entid"},{"name":"entid"}],"output":{"generics":["typedvalue"],"name":"option"}}],[11,"is_attribute_cached_reverse","","",7,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[11,"is_attribute_cached_forward","","",7,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[11,"has_cached_attributes","","",7,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"get_entids_for_value","","",7,{"inputs":[{"name":"self"},{"name":"entid"},{"name":"typedvalue"}],"output":{"generics":["btreeset"],"name":"option"}}],[11,"get_entid_for_value","","",7,{"inputs":[{"name":"self"},{"name":"entid"},{"name":"typedvalue"}],"output":{"generics":["entid"],"name":"option"}}],[11,"values_pairs","","Intended for use from tests.",7,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"u"}],"output":{"generics":["btreemap"],"name":"option"}}],[11,"value_pairs","","Intended for use from tests.",7,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"u"}],"output":{"generics":["btreemap"],"name":"option"}}],[11,"commit_to","","",7,{"inputs":[{"name":"self"},{"name":"sqliteattributecache"}],"output":null}],[11,"datom","","",13,{"inputs":[{"name":"self"},{"name":"optype"},{"name":"entid"},{"name":"entid"},{"name":"typedvalue"}],"output":null}],[11,"done","","",13,{"inputs":[{"name":"self"},{"name":"entid"},{"name":"schema"}],"output":{"name":"result"}}],[11,"transact_watcher","","",7,{"inputs":[{"name":"self"}],"output":{"name":"inprogresscachetransactwatcher"}}],[0,"db","mentat_db","",null,null],[4,"SearchType","mentat_db::db","",null,null],[13,"Exact","","",14,null],[13,"Inexact","","",14,null],[5,"new_connection","","",null,{"inputs":[{"name":"t"}],"output":{"generics":["connection"],"name":"result"}}],[5,"create_empty_current_version","","Do just enough work that either `create_current_version` or sync can populate the DB.",null,{"inputs":[{"name":"connection"}],"output":{"name":"result"}}],[5,"create_current_version","","",null,{"inputs":[{"name":"connection"}],"output":{"generics":["db"],"name":"result"}}],[5,"ensure_current_version","","",null,{"inputs":[{"name":"connection"}],"output":{"generics":["db"],"name":"result"}}],[5,"read_db","","Read the materialized views from the given SQL store and return a Mentat `DB` for querying and applying transactions.",null,{"inputs":[{"name":"connection"}],"output":{"generics":["db"],"name":"result"}}],[5,"update_partition_map","","Update the current partition map materialized view.",null,{"inputs":[{"name":"connection"},{"name":"partitionmap"}],"output":{"name":"result"}}],[5,"update_metadata","","Update the metadata materialized views based on the given metadata report.",null,{"inputs":[{"name":"connection"},{"name":"schema"},{"name":"schema"},{"name":"metadatareport"}],"output":{"name":"result"}}],[6,"ReducedEntity","","Internal representation of an [e a v added] datom, ready to be transacted against the store.",null,null],[17,"CURRENT_VERSION","","Version history:",null,null],[8,"TypedSQLValue","","",null,null],[10,"from_sql_value_pair","","",15,{"inputs":[{"name":"value"},{"name":"i32"}],"output":{"generics":["typedvalue"],"name":"result"}}],[10,"to_sql_value_pair","","",15,null],[10,"from_edn_value","","",15,{"inputs":[{"name":"value"}],"output":{"generics":["typedvalue"],"name":"option"}}],[10,"to_edn_value_pair","","",15,null],[8,"MentatStoring","","`MentatStoring` will be the trait that encapsulates the storage layer. It is consumed by the transaction processing layer.",null,null],[10,"resolve_avs","","Given a slice of [a v] lookup-refs, look up the corresponding [e a v] triples.",16,null],[10,"begin_tx_application","","Begin (or prepare) the underlying storage layer for a new Mentat transaction.",16,{"inputs":[{"name":"self"}],"output":{"name":"result"}}],[10,"insert_non_fts_searches","","",16,null],[10,"insert_fts_searches","","",16,null],[10,"commit_transaction","","Finalize the underlying storage layer after a Mentat transaction.",16,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"result"}}],[10,"committed_metadata_assertions","","Extract metadata-related [e a typed_value added] datoms committed in the given transaction.",16,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"generics":["vec"],"name":"result"}}],[8,"PartitionMapping","","",null,null],[10,"allocate_entid","","",17,{"inputs":[{"name":"self"},{"name":"s"}],"output":{"name":"i64"}}],[10,"allocate_entids","","",17,{"inputs":[{"name":"self"},{"name":"s"},{"name":"usize"}],"output":{"generics":["i64"],"name":"range"}}],[10,"contains_entid","","",17,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[11,"clone","","",14,{"inputs":[{"name":"self"}],"output":{"name":"searchtype"}}],[11,"fmt","","",14,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",14,null],[11,"cmp","","",14,{"inputs":[{"name":"self"},{"name":"searchtype"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",14,{"inputs":[{"name":"self"},{"name":"searchtype"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"eq","","",14,{"inputs":[{"name":"self"},{"name":"searchtype"}],"output":{"name":"bool"}}],[0,"debug","mentat_db","",null,null],[0,"entids","","",null,null],[3,"IDENTS_SQL_LIST","mentat_db::entids","Attributes that are \"ident related\". These might change the \"idents\" materialized view.",null,null],[3,"SCHEMA_SQL_LIST","","Attributes that are \"schema related\". These might change the \"schema\" materialized view.",null,null],[3,"METADATA_SQL_LIST","","Attributes that are \"metadata\" related. These might change one of the materialized views.",null,null],[5,"might_update_metadata","","Return `false` if the given attribute will not change the metadata: recognized idents, schema, partitions in the partition map.",null,{"inputs":[{"name":"entid"}],"output":{"name":"bool"}}],[17,"DB_IDENT","","",null,null],[17,"DB_PART_DB","","",null,null],[17,"DB_TX_INSTANT","","",null,null],[17,"DB_INSTALL_PARTITION","","",null,null],[17,"DB_INSTALL_VALUE_TYPE","","",null,null],[17,"DB_INSTALL_ATTRIBUTE","","",null,null],[17,"DB_VALUE_TYPE","","",null,null],[17,"DB_CARDINALITY","","",null,null],[17,"DB_UNIQUE","","",null,null],[17,"DB_IS_COMPONENT","","",null,null],[17,"DB_INDEX","","",null,null],[17,"DB_FULLTEXT","","",null,null],[17,"DB_NO_HISTORY","","",null,null],[17,"DB_ADD","","",null,null],[17,"DB_RETRACT","","",null,null],[17,"DB_PART_USER","","",null,null],[17,"DB_PART_TX","","",null,null],[17,"DB_EXCISE","","",null,null],[17,"DB_EXCISE_ATTRS","","",null,null],[17,"DB_EXCISE_BEFORE_T","","",null,null],[17,"DB_EXCISE_BEFORE","","",null,null],[17,"DB_ALTER_ATTRIBUTE","","",null,null],[17,"DB_TYPE_REF","","",null,null],[17,"DB_TYPE_KEYWORD","","",null,null],[17,"DB_TYPE_LONG","","",null,null],[17,"DB_TYPE_DOUBLE","","",null,null],[17,"DB_TYPE_STRING","","",null,null],[17,"DB_TYPE_UUID","","",null,null],[17,"DB_TYPE_URI","","",null,null],[17,"DB_TYPE_BOOLEAN","","",null,null],[17,"DB_TYPE_INSTANT","","",null,null],[17,"DB_TYPE_BYTES","","",null,null],[17,"DB_CARDINALITY_ONE","","",null,null],[17,"DB_CARDINALITY_MANY","","",null,null],[17,"DB_UNIQUE_VALUE","","",null,null],[17,"DB_UNIQUE_IDENTITY","","",null,null],[17,"DB_DOC","","",null,null],[17,"DB_SCHEMA_VERSION","","",null,null],[17,"DB_SCHEMA_ATTRIBUTE","","",null,null],[17,"DB_SCHEMA_CORE","","",null,null],[11,"deref","","",18,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"initialize","","",18,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",19,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"initialize","","",19,{"inputs":[{"name":"self"}],"output":null}],[11,"deref","","",20,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"initialize","","",20,{"inputs":[{"name":"self"}],"output":null}],[0,"internal_types","mentat_db","Types used only within the transactor. These should not be exposed outside of this crate.",null,null],[4,"Term","mentat_db::internal_types","",null,null],[13,"AddOrRetract","","",21,null],[4,"LookupRefOrTempId","","Internal representation of an entid on its way to resolution. We either have the simple case (a numeric entid), a lookup-ref that still needs to be resolved (an atomized [a v] pair), or a temp ID that needs to be upserted or allocated (an atomized tempid).",null,null],[13,"LookupRef","","",22,null],[13,"TempId","","",22,null],[5,"replace_lookup_ref","","Given a `KnownEntidOr` or a `TypedValueOr`, replace any internal `LookupRef` with the entid from the given map. Fail if any `LookupRef` cannot be replaced.",null,{"inputs":[{"name":"avmap"},{"generics":["lookuprefortempid"],"name":"either"},{"name":"u"}],"output":{"generics":["either"],"name":"result"}}],[6,"KnownEntidOr","","",null,null],[6,"TypedValueOr","","",null,null],[6,"TempIdHandle","","",null,null],[6,"TempIdMap","","",null,null],[6,"LookupRef","","",null,null],[6,"TermWithTempIdsAndLookupRefs","","",null,null],[6,"TermWithTempIds","","",null,null],[6,"TermWithoutTempIds","","",null,null],[6,"Population","","",null,null],[11,"clone","","",21,{"inputs":[{"name":"self"}],"output":{"name":"term"}}],[11,"fmt","","",21,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",21,null],[11,"cmp","","",21,{"inputs":[{"name":"self"},{"name":"term"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",21,{"inputs":[{"name":"self"},{"name":"term"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",21,{"inputs":[{"name":"self"},{"name":"term"}],"output":{"name":"bool"}}],[11,"le","","",21,{"inputs":[{"name":"self"},{"name":"term"}],"output":{"name":"bool"}}],[11,"gt","","",21,{"inputs":[{"name":"self"},{"name":"term"}],"output":{"name":"bool"}}],[11,"ge","","",21,{"inputs":[{"name":"self"},{"name":"term"}],"output":{"name":"bool"}}],[11,"eq","","",21,{"inputs":[{"name":"self"},{"name":"term"}],"output":{"name":"bool"}}],[11,"ne","","",21,{"inputs":[{"name":"self"},{"name":"term"}],"output":{"name":"bool"}}],[11,"clone","","",22,{"inputs":[{"name":"self"}],"output":{"name":"lookuprefortempid"}}],[11,"fmt","","",22,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",22,null],[11,"cmp","","",22,{"inputs":[{"name":"self"},{"name":"lookuprefortempid"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",22,{"inputs":[{"name":"self"},{"name":"lookuprefortempid"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",22,{"inputs":[{"name":"self"},{"name":"lookuprefortempid"}],"output":{"name":"bool"}}],[11,"le","","",22,{"inputs":[{"name":"self"},{"name":"lookuprefortempid"}],"output":{"name":"bool"}}],[11,"gt","","",22,{"inputs":[{"name":"self"},{"name":"lookuprefortempid"}],"output":{"name":"bool"}}],[11,"ge","","",22,{"inputs":[{"name":"self"},{"name":"lookuprefortempid"}],"output":{"name":"bool"}}],[11,"eq","","",22,{"inputs":[{"name":"self"},{"name":"lookuprefortempid"}],"output":{"name":"bool"}}],[11,"ne","","",22,{"inputs":[{"name":"self"},{"name":"lookuprefortempid"}],"output":{"name":"bool"}}],[11,"clone","mentat_db","",0,{"inputs":[{"name":"self"}],"output":{"name":"attributebuilder"}}],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"default","","",0,{"inputs":[],"output":{"name":"attributebuilder"}}],[11,"hash","","",0,null],[11,"cmp","","",0,{"inputs":[{"name":"self"},{"name":"attributebuilder"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",0,{"inputs":[{"name":"self"},{"name":"attributebuilder"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",0,{"inputs":[{"name":"self"},{"name":"attributebuilder"}],"output":{"name":"bool"}}],[11,"le","","",0,{"inputs":[{"name":"self"},{"name":"attributebuilder"}],"output":{"name":"bool"}}],[11,"gt","","",0,{"inputs":[{"name":"self"},{"name":"attributebuilder"}],"output":{"name":"bool"}}],[11,"ge","","",0,{"inputs":[{"name":"self"},{"name":"attributebuilder"}],"output":{"name":"bool"}}],[11,"eq","","",0,{"inputs":[{"name":"self"},{"name":"attributebuilder"}],"output":{"name":"bool"}}],[11,"ne","","",0,{"inputs":[{"name":"self"},{"name":"attributebuilder"}],"output":{"name":"bool"}}],[11,"helpful","","Make a new AttributeBuilder for human consumption: it will help you by flipping relevant flags.",0,{"inputs":[],"output":{"name":"self"}}],[11,"to_modify_attribute","","Make a new AttributeBuilder from an existing Attribute. This is important to allow retraction. Only attributes that we allow to change are duplicated here.",0,{"inputs":[{"name":"attribute"}],"output":{"name":"self"}}],[11,"value_type","","",0,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"self"}}],[11,"multival","","",0,{"inputs":[{"name":"self"},{"name":"bool"}],"output":{"name":"self"}}],[11,"non_unique","","",0,{"inputs":[{"name":"self"}],"output":{"name":"self"}}],[11,"unique","","",0,{"inputs":[{"name":"self"},{"name":"unique"}],"output":{"name":"self"}}],[11,"index","","",0,{"inputs":[{"name":"self"},{"name":"bool"}],"output":{"name":"self"}}],[11,"fulltext","","",0,{"inputs":[{"name":"self"},{"name":"bool"}],"output":{"name":"self"}}],[11,"component","","",0,{"inputs":[{"name":"self"},{"name":"bool"}],"output":{"name":"self"}}],[11,"no_history","","",0,{"inputs":[{"name":"self"},{"name":"bool"}],"output":{"name":"self"}}],[11,"validate_install_attribute","","",0,{"inputs":[{"name":"self"}],"output":{"name":"result"}}],[11,"validate_alter_attribute","","",0,{"inputs":[{"name":"self"}],"output":{"name":"result"}}],[11,"build","","",0,{"inputs":[{"name":"self"}],"output":{"name":"attribute"}}],[11,"mutate","","",0,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"generics":["attributealteration"],"name":"vec"}}],[0,"tx_observer","","",null,null],[3,"TxObserver","mentat_db::tx_observer","",null,null],[3,"TxCommand","","",null,null],[3,"TxObservationService","","",null,null],[3,"InProgressObserverTransactWatcher","","",null,null],[12,"txes","","",23,null],[8,"Command","","",null,null],[10,"execute","","",24,{"inputs":[{"name":"self"}],"output":null}],[11,"new","","",25,{"inputs":[{"name":"attributeset"},{"name":"f"}],"output":{"name":"txobserver"}}],[11,"applicable_reports","","",25,{"inputs":[{"name":"self"},{"name":"indexmap"}],"output":{"generics":["entid","attributeset"],"name":"indexmap"}}],[11,"execute","","",26,{"inputs":[{"name":"self"}],"output":null}],[11,"new","","",27,{"inputs":[],"output":{"name":"self"}}],[11,"is_registered","","",27,{"inputs":[{"name":"self"},{"name":"string"}],"output":{"name":"bool"}}],[11,"register","","",27,{"inputs":[{"name":"self"},{"name":"string"},{"generics":["txobserver"],"name":"arc"}],"output":null}],[11,"deregister","","",27,{"inputs":[{"name":"self"},{"name":"string"}],"output":null}],[11,"has_observers","","",27,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"in_progress_did_commit","","",27,{"inputs":[{"name":"self"},{"generics":["entid","attributeset"],"name":"indexmap"}],"output":null}],[11,"drop","","",27,{"inputs":[{"name":"self"}],"output":null}],[11,"new","","",23,{"inputs":[],"output":{"name":"inprogressobservertransactwatcher"}}],[11,"datom","","",23,{"inputs":[{"name":"self"},{"name":"optype"},{"name":"entid"},{"name":"entid"},{"name":"typedvalue"}],"output":null}],[11,"done","","",23,{"inputs":[{"name":"self"},{"name":"entid"},{"name":"schema"}],"output":{"name":"result"}}],[0,"types","mentat_db","",null,null],[3,"Attribute","mentat_db::types","A Mentat schema attribute has a value type and several other flags determining how assertions with the attribute are interpreted.",null,null],[12,"value_type","","The associated value type, i.e., `:db/valueType`?",28,null],[12,"multival","","`true` if this attribute is multi-valued, i.e., it is `:db/cardinality :db.cardinality/many`. `false` if this attribute is single-valued (the default), i.e., it is `:db/cardinality :db.cardinality/one`.",28,null],[12,"unique","","`None` if this attribute is neither unique-value nor unique-identity.",28,null],[12,"index","","`true` if this attribute is automatically indexed, i.e., it is `:db/indexing true`.",28,null],[12,"fulltext","","`true` if this attribute is automatically fulltext indexed, i.e., it is `:db/fulltext true`.",28,null],[12,"component","","`true` if this attribute is a component, i.e., it is `:db/isComponent true`.",28,null],[12,"no_history","","`true` if this attribute doesn't require history to be kept, i.e., it is `:db/noHistory true`.",28,null],[4,"AttributeBitFlags","","Bit flags used in `flags0` column in temporary tables created during search, such as the `search_results`, `inexact_searches` and `exact_searches` tables. When moving to a more concrete table, such as `datoms`, they are expanded out via these flags and put into their own column rather than a bit field.",null,null],[13,"IndexAVET","","",29,null],[13,"IndexVAET","","",29,null],[13,"IndexFulltext","","",29,null],[13,"UniqueValue","","",29,null],[3,"DateTime","","ISO 8601 combined date and time with time zone.",null,null],[6,"Entid","","Represents one entid in the entid space.",null,null],[3,"Schema","","Represents a Mentat schema.",null,null],[12,"entid_map","","Map entid->ident.",30,null],[12,"ident_map","","Map ident->entid.",30,null],[12,"attribute_map","","Map entid->attribute flags.",30,null],[12,"component_attributes","","Maintain a vec of unique attribute IDs for which the corresponding attribute in `attribute_map` has `.component == true`.",30,null],[4,"TypedValue","","Represents a value that can be stored in a Mentat store.",null,null],[13,"Ref","","",31,null],[13,"Boolean","","",31,null],[13,"Long","","",31,null],[13,"Double","","",31,null],[13,"Instant","","",31,null],[13,"String","","",31,null],[13,"Keyword","","",31,null],[13,"Uuid","","",31,null],[3,"Utc","","The UTC time zone. This is the most efficient time zone when you don't need the local time. It is also used as an offset (which is also a dummy type).",null,null],[4,"ValueType","","The attribute of each Mentat assertion has a :db/valueType constraining the value to a particular set. Mentat recognizes the following :db/valueType values.",null,null],[13,"Ref","","",32,null],[13,"Boolean","","",32,null],[13,"Instant","","",32,null],[13,"Long","","",32,null],[13,"Double","","",32,null],[13,"String","","",32,null],[13,"Keyword","","",32,null],[13,"Uuid","","",32,null],[3,"Partition","","Represents one partition of the entid space.",null,null],[12,"start","","The first entid in the partition.",33,null],[12,"index","","The next entid to be allocated in the partition.",33,null],[3,"DB","","Represents the metadata required to query from, or apply transactions to, a Mentat store.",null,null],[12,"partition_map","","Map partition name->`Partition`.",34,null],[12,"schema","","The schema of the store.",34,null],[3,"TxReport","","A transaction report summarizes an applied transaction.",null,null],[12,"tx_id","","The transaction ID of the transaction.",35,null],[12,"tx_instant","","The timestamp when the transaction began to be committed.",35,null],[12,"tempids","","A map from string literal tempid to resolved or allocated entid.",35,null],[6,"PartitionMap","","Map partition names to `Partition` instances.",null,null],[6,"AVPair","","A pair [a v] in the store.",null,null],[6,"AVMap","","Map [a v] pairs to existing entids.",null,null],[6,"AttributeSet","","",null,null],[8,"TransactableValue","","The transactor is tied to `edn::ValueAndSpan` right now, but in the future we'd like to support `TypedValue` directly for programmatic use. `TransactableValue` encapsulates the interface value types (i.e., values in the value place) need to support to be transacted.",null,null],[10,"into_typed_value","","Coerce this value place into the given type. This is where we perform schema-aware coercion, for example coercing an integral value into a ref where appropriate.",36,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"valuetype"}],"output":{"generics":["typedvalue"],"name":"result"}}],[10,"into_entity_place","","Make an entity place out of this value place. This is where we limit values in nested maps to valid entity places.",36,{"inputs":[{"name":"self"}],"output":{"generics":["entityplace"],"name":"result"}}],[10,"as_tempid","","",36,{"inputs":[{"name":"self"}],"output":{"generics":["tempid"],"name":"option"}}],[11,"clone","","",33,{"inputs":[{"name":"self"}],"output":{"name":"partition"}}],[11,"fmt","","",33,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",33,null],[11,"cmp","","",33,{"inputs":[{"name":"self"},{"name":"partition"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",33,{"inputs":[{"name":"self"},{"name":"partition"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",33,{"inputs":[{"name":"self"},{"name":"partition"}],"output":{"name":"bool"}}],[11,"le","","",33,{"inputs":[{"name":"self"},{"name":"partition"}],"output":{"name":"bool"}}],[11,"gt","","",33,{"inputs":[{"name":"self"},{"name":"partition"}],"output":{"name":"bool"}}],[11,"ge","","",33,{"inputs":[{"name":"self"},{"name":"partition"}],"output":{"name":"bool"}}],[11,"eq","","",33,{"inputs":[{"name":"self"},{"name":"partition"}],"output":{"name":"bool"}}],[11,"ne","","",33,{"inputs":[{"name":"self"},{"name":"partition"}],"output":{"name":"bool"}}],[11,"new","","",33,{"inputs":[{"name":"i64"},{"name":"i64"}],"output":{"name":"partition"}}],[11,"contains_entid","","",33,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"bool"}}],[11,"clone","","",34,{"inputs":[{"name":"self"}],"output":{"name":"db"}}],[11,"fmt","","",34,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"default","","",34,{"inputs":[],"output":{"name":"db"}}],[11,"hash","","",34,null],[11,"cmp","","",34,{"inputs":[{"name":"self"},{"name":"db"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",34,{"inputs":[{"name":"self"},{"name":"db"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",34,{"inputs":[{"name":"self"},{"name":"db"}],"output":{"name":"bool"}}],[11,"le","","",34,{"inputs":[{"name":"self"},{"name":"db"}],"output":{"name":"bool"}}],[11,"gt","","",34,{"inputs":[{"name":"self"},{"name":"db"}],"output":{"name":"bool"}}],[11,"ge","","",34,{"inputs":[{"name":"self"},{"name":"db"}],"output":{"name":"bool"}}],[11,"eq","","",34,{"inputs":[{"name":"self"},{"name":"db"}],"output":{"name":"bool"}}],[11,"ne","","",34,{"inputs":[{"name":"self"},{"name":"db"}],"output":{"name":"bool"}}],[11,"new","","",34,{"inputs":[{"name":"partitionmap"},{"name":"schema"}],"output":{"name":"db"}}],[11,"clone","","",35,{"inputs":[{"name":"self"}],"output":{"name":"txreport"}}],[11,"fmt","","",35,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"hash","","",35,null],[11,"cmp","","",35,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"ordering"}}],[11,"partial_cmp","","",35,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",35,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"le","","",35,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"gt","","",35,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"ge","","",35,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"eq","","",35,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"ne","","",35,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[17,"TX0","mentat_db","The first transaction ID applied to the knowledge base.",null,null],[17,"USER0","","This is the start of the :db.part/user partition.",null,null],[17,"CORE_SCHEMA_VERSION","","",null,null],[8,"AttributeValidation","","",null,null],[10,"validate","","",37,{"inputs":[{"name":"self"},{"name":"f"}],"output":{"name":"result"}}],[8,"TransactWatcher","","",null,null],[10,"datom","","",38,{"inputs":[{"name":"self"},{"name":"optype"},{"name":"entid"},{"name":"entid"},{"name":"typedvalue"}],"output":null}],[10,"done","","Only return an error if you want to interrupt the transact! Called with the schema prior to the transact -- any attributes or attribute changes transacted during this transact are not reflected in the schema.",38,{"inputs":[{"name":"self"},{"name":"entid"},{"name":"schema"}],"output":{"name":"result"}}],[14,"bail","","",null,null],[11,"to_micros","mentat_db::types","",39,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[11,"from_micros","","",39,{"inputs":[{"name":"i64"}],"output":{"generics":["utc"],"name":"datetime"}}],[11,"partial_cmp","","",39,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"clone","","",40,{"inputs":[{"name":"self"}],"output":{"name":"utc"}}],[11,"clone","","",39,{"inputs":[{"name":"self"}],"output":{"name":"datetime"}}],[11,"add","","",39,{"inputs":[{"name":"self"},{"name":"fixedoffset"}],"output":{"name":"datetime"}}],[11,"add","","",39,{"inputs":[{"name":"self"},{"name":"duration"}],"output":{"name":"datetime"}}],[11,"fix","","",40,{"inputs":[{"name":"self"}],"output":{"name":"fixedoffset"}}],[11,"from","","",39,{"inputs":[{"name":"systemtime"}],"output":{"generics":["local"],"name":"datetime"}}],[11,"from","","",39,{"inputs":[{"name":"systemtime"}],"output":{"generics":["utc"],"name":"datetime"}}],[11,"serialize","","Serialize into a rfc3339 time string",39,{"inputs":[{"name":"self"},{"name":"s"}],"output":{"name":"result"}}],[11,"sub","","",39,{"inputs":[{"name":"self"},{"name":"duration"}],"output":{"name":"datetime"}}],[11,"sub","","",39,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"name":"duration"}}],[11,"sub","","",39,{"inputs":[{"name":"self"},{"name":"fixedoffset"}],"output":{"name":"datetime"}}],[11,"from_str","","",39,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"from_str","","",39,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"from_str","","",39,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"cmp","","",39,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"name":"ordering"}}],[11,"hash","","",39,null],[11,"eq","","",40,{"inputs":[{"name":"self"},{"name":"utc"}],"output":{"name":"bool"}}],[11,"eq","","",39,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"name":"bool"}}],[11,"deserialize","","",39,{"inputs":[{"name":"d"}],"output":{"generics":["datetime"],"name":"result"}}],[11,"deserialize","","",39,{"inputs":[{"name":"d"}],"output":{"generics":["datetime"],"name":"result"}}],[11,"deserialize","","",39,{"inputs":[{"name":"d"}],"output":{"generics":["datetime"],"name":"result"}}],[11,"hour","","",39,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"minute","","",39,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"second","","",39,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"nanosecond","","",39,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"with_hour","","",39,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_minute","","",39,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_second","","",39,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_nanosecond","","",39,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"fmt","","",40,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",39,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"year","","",39,{"inputs":[{"name":"self"}],"output":{"name":"i32"}}],[11,"month","","",39,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"month0","","",39,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"day","","",39,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"day0","","",39,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"ordinal","","",39,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"ordinal0","","",39,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"weekday","","",39,{"inputs":[{"name":"self"}],"output":{"name":"weekday"}}],[11,"iso_week","","",39,{"inputs":[{"name":"self"}],"output":{"name":"isoweek"}}],[11,"with_year","","",39,{"inputs":[{"name":"self"},{"name":"i32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_month","","",39,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_month0","","",39,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_day","","",39,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_day0","","",39,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_ordinal","","",39,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"with_ordinal0","","",39,{"inputs":[{"name":"self"},{"name":"u32"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"fmt","","",39,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",40,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"from_offset","","",40,{"inputs":[{"name":"utc"}],"output":{"name":"utc"}}],[11,"offset_from_local_date","","",40,{"inputs":[{"name":"self"},{"name":"naivedate"}],"output":{"generics":["utc"],"name":"localresult"}}],[11,"offset_from_local_datetime","","",40,{"inputs":[{"name":"self"},{"name":"naivedatetime"}],"output":{"generics":["utc"],"name":"localresult"}}],[11,"offset_from_utc_date","","",40,{"inputs":[{"name":"self"},{"name":"naivedate"}],"output":{"name":"utc"}}],[11,"offset_from_utc_datetime","","",40,{"inputs":[{"name":"self"},{"name":"naivedatetime"}],"output":{"name":"utc"}}],[11,"sql_representation","","",32,null],[11,"value_type_tag","","",32,{"inputs":[{"name":"self"}],"output":{"name":"i32"}}],[11,"accommodates_integer","","Returns true if the provided integer is in the SQLite value space of this type. For example, `1` is how we encode `true`.",32,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"bool"}}],[11,"entid_for_type","","",30,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"get_ident","","",30,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"get_entid","","",30,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"attribute_for_entid","","",30,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["attribute"],"name":"option"}}],[11,"attribute_for_ident","","",30,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"option"}}],[11,"is_attribute","","Return true if the provided entid identifies an attribute in this schema.",30,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"bool"}}],[11,"identifies_attribute","","Return true if the provided ident identifies an attribute in this schema.",30,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"component_attributes","","",30,null],[11,"partial_cmp","","",31,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",31,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"le","","",31,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"gt","","",31,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"ge","","",31,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"partial_cmp","","",30,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",30,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"le","","",30,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"gt","","",30,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"ge","","",30,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"partial_cmp","","",28,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",28,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"le","","",28,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"gt","","",28,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"ge","","",28,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"partial_cmp","","",32,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"clone","","",32,{"inputs":[{"name":"self"}],"output":{"name":"valuetype"}}],[11,"clone","","",30,{"inputs":[{"name":"self"}],"output":{"name":"schema"}}],[11,"clone","","",31,{"inputs":[{"name":"self"}],"output":{"name":"typedvalue"}}],[11,"clone","","",28,{"inputs":[{"name":"self"}],"output":{"name":"attribute"}}],[11,"from","","",31,{"inputs":[{"generics":["utc"],"name":"datetime"}],"output":{"name":"typedvalue"}}],[11,"from","","",31,{"inputs":[{"name":"uuid"}],"output":{"name":"typedvalue"}}],[11,"from","","",31,{"inputs":[{"name":"string"}],"output":{"name":"typedvalue"}}],[11,"from","","",31,{"inputs":[{"name":"bool"}],"output":{"name":"typedvalue"}}],[11,"from","","",31,{"inputs":[{"generics":["string"],"name":"box"}],"output":{"name":"typedvalue"}}],[11,"from","","",31,{"inputs":[{"name":"i32"}],"output":{"name":"typedvalue"}}],[11,"from","","",31,{"inputs":[{"generics":["keyword"],"name":"rc"}],"output":{"name":"typedvalue"}}],[11,"from","","",31,{"inputs":[{"name":"str"}],"output":{"name":"typedvalue"}}],[11,"from","","",31,{"inputs":[{"name":"keyword"}],"output":{"name":"typedvalue"}}],[11,"from","","",31,{"inputs":[{"generics":["string"],"name":"rc"}],"output":{"name":"typedvalue"}}],[11,"from","","",31,{"inputs":[{"generics":["string"],"name":"arc"}],"output":{"name":"typedvalue"}}],[11,"from","","",31,{"inputs":[{"generics":["keyword"],"name":"arc"}],"output":{"name":"typedvalue"}}],[11,"from","","",31,{"inputs":[{"name":"u32"}],"output":{"name":"typedvalue"}}],[11,"from","","",31,{"inputs":[{"name":"f64"}],"output":{"name":"typedvalue"}}],[11,"from","","",31,{"inputs":[{"name":"knownentid"}],"output":{"name":"typedvalue"}}],[11,"cmp","","",30,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"ordering"}}],[11,"cmp","","",28,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"ordering"}}],[11,"cmp","","",31,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"ordering"}}],[11,"cmp","","",32,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"ordering"}}],[11,"deserialize","","",31,{"inputs":[{"name":"__d"}],"output":{"generics":["typedvalue"],"name":"result"}}],[11,"hash","","",31,null],[11,"hash","","",28,null],[11,"hash","","",30,null],[11,"hash","","",32,null],[11,"eq","","",31,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"ne","","",31,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"eq","","",30,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"ne","","",30,{"inputs":[{"name":"self"},{"name":"schema"}],"output":{"name":"bool"}}],[11,"eq","","",28,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"ne","","",28,{"inputs":[{"name":"self"},{"name":"attribute"}],"output":{"name":"bool"}}],[11,"eq","","",32,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"bool"}}],[11,"fmt","","",32,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",30,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",31,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",28,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",32,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"to_u32","","",32,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"from_u32","","",32,{"inputs":[{"name":"u32"}],"output":{"name":"valuetype"}}],[11,"serialize","","",31,{"inputs":[{"name":"self"},{"name":"__s"}],"output":{"name":"result"}}],[11,"default","","",28,{"inputs":[],"output":{"name":"attribute"}}],[11,"default","","",30,{"inputs":[],"output":{"name":"schema"}}],[11,"from_sql_value_pair","","Given a SQLite `value` and a `value_type_tag`, return the corresponding `TypedValue`.",31,{"inputs":[{"name":"value"},{"name":"i32"}],"output":{"generics":["typedvalue"],"name":"result"}}],[11,"from_edn_value","","Given an EDN `value`, return a corresponding Mentat `TypedValue`.",31,{"inputs":[{"name":"value"}],"output":{"generics":["typedvalue"],"name":"option"}}],[11,"to_sql_value_pair","","Return the corresponding SQLite `value` and `value_type_tag` pair.",31,null],[11,"to_edn_value_pair","","Return the corresponding EDN `value` and `value_type` pair.",31,null],[11,"allocate_entid","","Allocate a single fresh entid in the given `partition`.",41,{"inputs":[{"name":"self"},{"name":"s"}],"output":{"name":"i64"}}],[11,"allocate_entids","","Allocate `n` fresh entids in the given `partition`.",41,{"inputs":[{"name":"self"},{"name":"s"},{"name":"usize"}],"output":{"generics":["i64"],"name":"range"}}],[11,"contains_entid","","",41,{"inputs":[{"name":"self"},{"name":"entid"}],"output":{"name":"bool"}}],[11,"into_typed_value","","",31,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"valuetype"}],"output":{"generics":["typedvalue"],"name":"result"}}],[11,"into_entity_place","","",31,{"inputs":[{"name":"self"}],"output":{"generics":["entityplace"],"name":"result"}}],[11,"as_tempid","","",31,{"inputs":[{"name":"self"}],"output":{"generics":["tempid"],"name":"option"}}],[11,"validate","","",28,{"inputs":[{"name":"self"},{"name":"f"}],"output":{"name":"result"}}],[11,"flags","","Combine several attribute flags into a bitfield used in temporary search tables.",28,{"inputs":[{"name":"self"}],"output":{"name":"u8"}}],[11,"to_edn_value","","",28,{"inputs":[{"name":"self"},{"generics":["keyword"],"name":"option"}],"output":{"name":"value"}}],[11,"from_utc","","Makes a new `DateTime` with given UTC datetime and offset. The local datetime should be constructed via the `TimeZone` trait.",39,null],[11,"date","","Retrieves a date component.",39,{"inputs":[{"name":"self"}],"output":{"name":"date"}}],[11,"time","","Retrieves a time component. Unlike `date`, this is not associated to the time zone.",39,{"inputs":[{"name":"self"}],"output":{"name":"naivetime"}}],[11,"timestamp","","Returns the number of non-leap seconds since January 1, 1970 0:00:00 UTC (aka \"UNIX timestamp\").",39,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[11,"timestamp_millis","","Returns the number of non-leap-milliseconds since January 1, 1970 UTC",39,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[11,"timestamp_nanos","","Returns the number of non-leap-nanoseconds since January 1, 1970 UTC",39,{"inputs":[{"name":"self"}],"output":{"name":"i64"}}],[11,"timestamp_subsec_millis","","Returns the number of milliseconds since the last second boundary",39,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"timestamp_subsec_micros","","Returns the number of microseconds since the last second boundary",39,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"timestamp_subsec_nanos","","Returns the number of nanoseconds since the last second boundary",39,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"offset","","Retrieves an associated offset from UTC.",39,null],[11,"timezone","","Retrieves an associated time zone.",39,{"inputs":[{"name":"self"}],"output":{"name":"tz"}}],[11,"with_timezone","","Changes the associated time zone. This does not change the actual `DateTime` (but will change the string representation).",39,{"inputs":[{"name":"self"},{"name":"tz2"}],"output":{"name":"datetime"}}],[11,"checked_add_signed","","Adds given `Duration` to the current date and time.",39,{"inputs":[{"name":"self"},{"name":"duration"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"checked_sub_signed","","Subtracts given `Duration` from the current date and time.",39,{"inputs":[{"name":"self"},{"name":"duration"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"signed_duration_since","","Subtracts another `DateTime` from the current date and time. This does not overflow or underflow at all.",39,{"inputs":[{"name":"self"},{"name":"datetime"}],"output":{"name":"duration"}}],[11,"naive_utc","","Returns a view to the naive UTC datetime.",39,{"inputs":[{"name":"self"}],"output":{"name":"naivedatetime"}}],[11,"naive_local","","Returns a view to the naive local datetime.",39,{"inputs":[{"name":"self"}],"output":{"name":"naivedatetime"}}],[11,"parse_from_rfc2822","","Parses an RFC 2822 date and time string such as `Tue, 1 Jul 2003 10:52:37 +0200`, then returns a new `DateTime` with a parsed `FixedOffset`.",39,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"parse_from_rfc3339","","Parses an RFC 3339 and ISO 8601 date and time string such as `1996-12-19T16:39:57-08:00`, then returns a new `DateTime` with a parsed `FixedOffset`.",39,{"inputs":[{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"parse_from_str","","Parses a string with the specified format string and returns a new `DateTime` with a parsed `FixedOffset`. See the `format::strftime` module on the supported escape sequences.",39,{"inputs":[{"name":"str"},{"name":"str"}],"output":{"generics":["datetime","parseerror"],"name":"result"}}],[11,"to_rfc2822","","Returns an RFC 2822 date and time string such as `Tue, 1 Jul 2003 10:52:37 +0200`.",39,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"to_rfc3339","","Returns an RFC 3339 and ISO 8601 date and time string such as `1996-12-19T16:39:57-08:00`.",39,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"to_rfc3339_opts","","Return an RFC 3339 and ISO 8601 date and time string with subseconds formatted as per a `SecondsFormat`. If passed `use_z` true and the timezone is UTC (offset 0), use 'Z', as per Fixed::TimezoneOffsetColonZ. If passed `use_z` false, use Fixed::TimezoneOffsetColon.",39,{"inputs":[{"name":"self"},{"name":"secondsformat"},{"name":"bool"}],"output":{"name":"string"}}],[11,"format_with_items","","Formats the combined date and time with the specified formatting items.",39,{"inputs":[{"name":"self"},{"name":"i"}],"output":{"name":"delayedformat"}}],[11,"format","","Formats the combined date and time with the specified format string. See the `format::strftime` module on the supported escape sequences.",39,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"generics":["strftimeitems"],"name":"delayedformat"}}],[11,"new","","",30,{"inputs":[{"generics":["keyword","i64"],"name":"btreemap"},{"generics":["i64","keyword"],"name":"btreemap"},{"generics":["i64","attribute"],"name":"btreemap"}],"output":{"name":"schema"}}],[11,"to_edn_value","","Returns an symbolic representation of the schema suitable for applying across Mentat stores.",30,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"update_component_attributes","","",30,null],[11,"is_congruent_with","","Returns true if the provided type is `Some` and matches this value's type, or if the provided type is `None`.",31,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"bool"}}],[11,"matches_type","","",31,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"bool"}}],[11,"value_type","","",31,{"inputs":[{"name":"self"}],"output":{"name":"valuetype"}}],[11,"typed_ns_keyword","","Construct a new `TypedValue::Keyword` instance by cloning the provided values and wrapping them in a new `ValueRc`. This is expensive, so this might be best limited to tests.",31,{"inputs":[{"name":"str"},{"name":"str"}],"output":{"name":"typedvalue"}}],[11,"typed_string","","Construct a new `TypedValue::String` instance by cloning the provided value and wrapping it in a new `ValueRc`. This is expensive, so this might be best limited to tests.",31,{"inputs":[{"name":"str"}],"output":{"name":"typedvalue"}}],[11,"current_instant","","",31,{"inputs":[],"output":{"name":"typedvalue"}}],[11,"instant","","Construct a new `TypedValue::Instant` instance from the provided microsecond timestamp.",31,{"inputs":[{"name":"i64"}],"output":{"name":"typedvalue"}}],[11,"into_known_entid","","",31,{"inputs":[{"name":"self"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"into_entid","","",31,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_kw","","",31,{"inputs":[{"name":"self"}],"output":{"generics":["arc"],"name":"option"}}],[11,"into_boolean","","",31,{"inputs":[{"name":"self"}],"output":{"generics":["bool"],"name":"option"}}],[11,"into_long","","",31,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_double","","",31,{"inputs":[{"name":"self"}],"output":{"generics":["f64"],"name":"option"}}],[11,"into_instant","","",31,{"inputs":[{"name":"self"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"into_timestamp","","",31,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_string","","",31,{"inputs":[{"name":"self"}],"output":{"generics":["arc"],"name":"option"}}],[11,"into_c_string","","",31,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_kw_c_string","","",31,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_uuid_c_string","","",31,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_uuid","","",31,{"inputs":[{"name":"self"}],"output":{"generics":["uuid"],"name":"option"}}],[11,"into_uuid_string","","",31,{"inputs":[{"name":"self"}],"output":{"generics":["string"],"name":"option"}}],[11,"today","","Returns a `Date` which corresponds to the current date.",40,{"inputs":[],"output":{"generics":["utc"],"name":"date"}}],[11,"now","","Returns a `DateTime` which corresponds to the current date.",40,{"inputs":[],"output":{"generics":["utc"],"name":"datetime"}}],[11,"all_enums","","",32,{"inputs":[],"output":{"generics":["valuetype"],"name":"enumset"}}],[11,"into_keyword","","",32,{"inputs":[{"name":"self"}],"output":{"name":"keyword"}}],[11,"from_keyword","","",32,{"inputs":[{"name":"keyword"}],"output":{"generics":["valuetype"],"name":"option"}}],[11,"into_typed_value","","",32,{"inputs":[{"name":"self"}],"output":{"name":"typedvalue"}}],[11,"into_edn_value","","",32,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"is_numeric","","",32,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}]],"paths":[[3,"AttributeBuilder"],[4,"CardinalityConflict"],[4,"SchemaConstraintViolation"],[4,"InputError"],[4,"DbError"],[4,"DbSqlErrorKind"],[3,"DbSqlError"],[3,"InProgressSQLiteAttributeCache"],[4,"AttributeSpec"],[8,"AttributeCache"],[3,"AevRows"],[3,"AttributeCaches"],[3,"SQLiteAttributeCache"],[3,"InProgressCacheTransactWatcher"],[4,"SearchType"],[8,"TypedSQLValue"],[8,"MentatStoring"],[8,"PartitionMapping"],[3,"IDENTS_SQL_LIST"],[3,"SCHEMA_SQL_LIST"],[3,"METADATA_SQL_LIST"],[4,"Term"],[4,"LookupRefOrTempId"],[3,"InProgressObserverTransactWatcher"],[8,"Command"],[3,"TxObserver"],[3,"TxCommand"],[3,"TxObservationService"],[3,"Attribute"],[4,"AttributeBitFlags"],[3,"Schema"],[4,"TypedValue"],[4,"ValueType"],[3,"Partition"],[3,"DB"],[3,"TxReport"],[8,"TransactableValue"],[8,"AttributeValidation"],[8,"TransactWatcher"],[3,"DateTime"],[3,"Utc"],[6,"PartitionMap"]]}; +searchIndex["mentat_ffi"] = {"doc":"This module exposes an Foreign Function Interface (FFI) that allows Mentat to be called from other languages.","items":[[4,"Binding","mentat_ffi","The values bound in a query specification can be:",null,null],[13,"Scalar","","",0,null],[13,"Vec","","",0,null],[13,"Map","","",0,null],[4,"CacheDirection","","",null,null],[13,"Forward","","",1,null],[13,"Reverse","","",1,null],[13,"Both","","",1,null],[6,"Entid","","Represents one entid in the entid space.",null,null],[4,"FindSpec","","A definition of the first part of a find query: the `[:find ?foo ?bar…]` bit.",null,null],[13,"FindRel","","Returns an array of arrays, represented as a single array with length a multiple of width.",2,null],[13,"FindColl","","Returns an array of scalars, usually homogeneous. This is equivalent to mapping over the results of a `FindRel`, returning the first value of each.",2,null],[13,"FindTuple","","Returns a single tuple: a heterogeneous array of scalars. Equivalent to taking the first result from a `FindRel`.",2,null],[13,"FindScalar","","Returns a single scalar value. Equivalent to taking the first result from a `FindColl`.",2,null],[8,"HasSchema","","",null,null],[10,"entid_for_type","","",3,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"generics":["knownentid"],"name":"option"}}],[10,"get_ident","","",3,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["keyword"],"name":"option"}}],[10,"get_entid","","",3,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"generics":["knownentid"],"name":"option"}}],[10,"attribute_for_entid","","",3,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["attribute"],"name":"option"}}],[10,"attribute_for_ident","","",3,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"option"}}],[10,"is_attribute","","Return true if the provided entid identifies an attribute in this schema.",3,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"bool"}}],[10,"identifies_attribute","","Return true if the provided ident identifies an attribute in this schema.",3,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[10,"component_attributes","","",3,null],[3,"InProgress","","Represents an in-progress, not yet committed, set of changes to the store. Call `commit` to commit your changes, or `rollback` to discard them. A transaction is held open until you do so. Your changes will be implicitly dropped along with this struct.",null,null],[3,"KnownEntid","","An entid that's either already in the store, or newly allocated to a tempid. TODO: we'd like to link this in some way to the lifetime of a particular PartitionMap.",null,null],[12,"0","","",4,null],[8,"Queryable","","",null,null],[10,"q_explain","","",5,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryexplanation","error"],"name":"result"}}],[10,"q_once","","",5,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryoutput","error"],"name":"result"}}],[10,"q_prepare","","",5,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["preparedquery","error"],"name":"result"}}],[10,"lookup_values_for_attribute","","",5,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"}],"output":{"generics":["vec","error"],"name":"result"}}],[10,"lookup_value_for_attribute","","",5,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"}],"output":{"generics":["option","error"],"name":"result"}}],[3,"QueryBuilder","","",null,null],[3,"QueryInputs","","Define the inputs to a query. This is in two parts: a set of values known now, and a set of types known now. The separate map of types is to allow queries to be algebrized without full knowledge of the bindings that will be used at execution time. When built correctly, `types` is guaranteed to contain the types of `values` -- use `QueryInputs::new` or `QueryInputs::with_values` to construct an instance.",null,null],[3,"QueryOutput","","",null,null],[12,"spec","","",6,null],[12,"results","","",6,null],[4,"QueryResults","","",null,null],[13,"Scalar","","",7,null],[13,"Tuple","","",7,null],[13,"Coll","","",7,null],[13,"Rel","","",7,null],[3,"RelResult","","The result you get from a 'rel' query, like:",null,null],[12,"width","","",8,null],[12,"values","","",8,null],[3,"Store","","A convenience wrapper around a single SQLite connection and a Conn. This is suitable for applications that don't require complex connection management.",null,null],[8,"Syncable","","",null,null],[10,"sync","","",9,{"inputs":[{"name":"self"},{"name":"string"},{"name":"string"}],"output":{"generics":["error"],"name":"result"}}],[4,"TypedValue","","Represents a value that can be stored in a Mentat store.",null,null],[13,"Ref","","",10,null],[13,"Boolean","","",10,null],[13,"Long","","",10,null],[13,"Double","","",10,null],[13,"Instant","","",10,null],[13,"String","","",10,null],[13,"Keyword","","",10,null],[13,"Uuid","","",10,null],[3,"TxObserver","","",null,null],[3,"TxReport","","A transaction report summarizes an applied transaction.",null,null],[12,"tx_id","","The transaction ID of the transaction.",11,null],[12,"tx_instant","","The timestamp when the transaction began to be committed.",11,null],[12,"tempids","","A map from string literal tempid to resolved or allocated entid.",11,null],[3,"Uuid","","A Universally Unique Identifier (UUID).",null,null],[4,"ValueType","","The attribute of each Mentat assertion has a :db/valueType constraining the value to a particular set. Mentat recognizes the following :db/valueType values.",null,null],[13,"Ref","","",12,null],[13,"Boolean","","",12,null],[13,"Instant","","",12,null],[13,"Long","","",12,null],[13,"Double","","",12,null],[13,"String","","",12,null],[13,"Keyword","","",12,null],[13,"Uuid","","",12,null],[3,"Variable","","",null,null],[12,"0","","",13,null],[8,"BuildTerms","","",null,null],[10,"named_tempid","","",14,{"inputs":[{"name":"self"},{"name":"string"}],"output":{"generics":["tempid"],"name":"rc"}}],[10,"describe_tempid","","",14,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"name":"entitybuilder"}}],[10,"describe","","",14,{"inputs":[{"name":"self"},{"name":"e"}],"output":{"name":"entitybuilder"}}],[10,"add","","",14,{"inputs":[{"name":"self"},{"name":"e"},{"name":"knownentid"},{"name":"v"}],"output":{"generics":["error"],"name":"result"}}],[10,"retract","","",14,{"inputs":[{"name":"self"},{"name":"e"},{"name":"knownentid"},{"name":"v"}],"output":{"generics":["error"],"name":"result"}}],[3,"EntityBuilder","","",null,null],[3,"InProgressBuilder","","",null,null],[8,"IntoThing","","",null,null],[10,"into_thing","","",15,{"inputs":[{"name":"self"}],"output":{"name":"t"}}],[3,"TransactionChange","","A C representation of the change provided by the transaction observers from a single transact. Holds a transaction identifier, the changes as a set of affected attributes and the length of the list of changes.",null,null],[12,"txid","","",16,null],[12,"changes_len","","",16,null],[12,"changes","","",16,null],[3,"TxChangeList","","A C representation of the list of changes provided by the transaction observers. Provides the list of changes as the length of the list.",null,null],[12,"reports","","",17,null],[12,"len","","",17,null],[3,"ExternOption","","A C representation Rust's Option. A value of `Some` results in `value` containing a raw pointer as a `c_void`. A value of `None` results in `value` containing a null pointer.",null,null],[12,"value","","",18,null],[3,"ExternResult","","A C representation Rust's Result. A value of `Ok` results in `ok` containing a raw pointer as a `c_void` and `err` containing a null pointer. A value of `Err` results in `value` containing a null pointer and `err` containing an error message.",null,null],[12,"ok","","",19,null],[12,"err","","",19,null],[3,"InProgressTransactResult","","",null,null],[12,"in_progress","","",20,null],[12,"result","","",20,null],[5,"store_open","","A store cannot be opened twice to the same location. Once created, the reference to the store is held by the caller and not Rust, therefore the caller is responsible for calling `destroy` to release the memory used by the Store in order to avoid a memory leak.",null,null],[5,"store_begin_transaction","","Starts a new transaction to allow multiple transacts to be performed together. This is more efficient than performing a large set of individual commits.",null,null],[5,"in_progress_transact","","Perform a single transact operation using the current in progress transaction. Takes edn as a string to transact.",null,null],[5,"in_progress_commit","","Commit all the transacts that have been performed using this in progress transaction.",null,null],[5,"in_progress_rollback","","Rolls back all the transacts that have been performed using this in progress transaction.",null,null],[5,"in_progress_builder","","Creates a builder using the in progress transaction to allow for programmatic assertion of values.",null,null],[5,"in_progress_entity_builder_from_temp_id","","Creates a builder for an entity with `tempid` using the in progress transaction to allow for programmatic assertion of values for that entity.",null,null],[5,"in_progress_entity_builder_from_entid","","Creates a builder for an entity with `entid` using the in progress transaction to allow for programmatic assertion of values for that entity.",null,null],[5,"store_in_progress_builder","","Starts a new transaction and creates a builder using the transaction to allow for programmatic assertion of values.",null,null],[5,"store_entity_builder_from_temp_id","","Starts a new transaction and creates a builder for an entity with `tempid` using the transaction to allow for programmatic assertion of values for that entity.",null,null],[5,"store_entity_builder_from_entid","","Starts a new transaction and creates a builder for an entity with `entid` using the transaction to allow for programmatic assertion of values for that entity.",null,null],[5,"in_progress_builder_add_string","","Uses `builder` to assert `value` for `kw` on entity `entid`.",null,null],[5,"in_progress_builder_add_long","","Uses `builder` to assert `value` for `kw` on entity `entid`.",null,null],[5,"in_progress_builder_add_ref","","Uses `builder` to assert `value` for `kw` on entity `entid`.",null,null],[5,"in_progress_builder_add_keyword","","Uses `builder` to assert `value` for `kw` on entity `entid`.",null,null],[5,"in_progress_builder_add_boolean","","Uses `builder` to assert `value` for `kw` on entity `entid`.",null,null],[5,"in_progress_builder_add_double","","Uses `builder` to assert `value` for `kw` on entity `entid`.",null,null],[5,"in_progress_builder_add_timestamp","","Uses `builder` to assert `value` for `kw` on entity `entid`.",null,null],[5,"in_progress_builder_add_uuid","","Uses `builder` to assert `value` for `kw` on entity `entid`.",null,null],[5,"in_progress_builder_retract_string","","Uses `builder` to retract `value` for `kw` on entity `entid`.",null,null],[5,"in_progress_builder_retract_long","","Uses `builder` to retract `value` for `kw` on entity `entid`.",null,null],[5,"in_progress_builder_retract_ref","","Uses `builder` to retract `value` for `kw` on entity `entid`.",null,null],[5,"in_progress_builder_retract_keyword","","Uses `builder` to retract `value` for `kw` on entity `entid`.",null,null],[5,"in_progress_builder_retract_boolean","","Uses `builder` to retract `value` for `kw` on entity `entid`.",null,null],[5,"in_progress_builder_retract_double","","Uses `builder` to retract `value` for `kw` on entity `entid`.",null,null],[5,"in_progress_builder_retract_timestamp","","Uses `builder` to retract `value` for `kw` on entity `entid`.",null,null],[5,"in_progress_builder_retract_uuid","","Uses `builder` to retract `value` for `kw` on entity `entid`.",null,null],[5,"in_progress_builder_commit","","Transacts and commits all the assertions and retractions that have been performed using this builder.",null,null],[5,"in_progress_builder_transact","","Transacts all the assertions and retractions that have been performed using this builder.",null,null],[5,"entity_builder_add_string","","Uses `builder` to assert `value` for `kw` on entity `entid`.",null,null],[5,"entity_builder_add_long","","Uses `builder` to assert `value` for `kw` on entity `entid`.",null,null],[5,"entity_builder_add_ref","","Uses `builder` to assert `value` for `kw` on entity `entid`.",null,null],[5,"entity_builder_add_keyword","","Uses `builder` to assert `value` for `kw` on entity `entid`.",null,null],[5,"entity_builder_add_boolean","","Uses `builder` to assert `value` for `kw` on entity `entid`.",null,null],[5,"entity_builder_add_double","","Uses `builder` to assert `value` for `kw` on entity `entid`.",null,null],[5,"entity_builder_add_timestamp","","Uses `builder` to assert `value` for `kw` on entity `entid`.",null,null],[5,"entity_builder_add_uuid","","Uses `builder` to assert `value` for `kw` on entity `entid`.",null,null],[5,"entity_builder_retract_string","","Uses `builder` to retract `value` for `kw` on entity `entid`.",null,null],[5,"entity_builder_retract_long","","Uses `builder` to retract `value` for `kw` on entity `entid`.",null,null],[5,"entity_builder_retract_ref","","Uses `builder` to retract `value` for `kw` on entity `entid`.",null,null],[5,"entity_builder_retract_keyword","","Uses `builder` to retract `value` for `kw` on entity `entid`.",null,null],[5,"entity_builder_retract_boolean","","Uses `builder` to retract `value` for `kw` on entity `entid`.",null,null],[5,"entity_builder_retract_double","","Uses `builder` to retract `value` for `kw` on entity `entid`.",null,null],[5,"entity_builder_retract_timestamp","","Uses `builder` to retract `value` for `kw` on entity `entid`.",null,null],[5,"entity_builder_retract_uuid","","Uses `builder` to retract `value` for `kw` on entity `entid`.",null,null],[5,"entity_builder_transact","","Transacts all the assertions and retractions that have been performed using this builder.",null,null],[5,"entity_builder_commit","","Transacts and commits all the assertions and retractions that have been performed using this builder.",null,null],[5,"store_transact","","Performs a single transaction against the store.",null,null],[5,"tx_report_get_entid","","Fetches the `tx_id` for the given TxReport`.",null,null],[5,"tx_report_get_tx_instant","","Fetches the `tx_instant` for the given TxReport.",null,null],[5,"tx_report_entity_for_temp_id","","Fetches the Entid assigned to the `tempid` during the transaction represented by the given TxReport.",null,null],[5,"store_cache_attribute_forward","","Adds an attribute to the cache. `store_cache_attribute_forward` caches values for an attribute keyed by entity (i.e. find values and entities that have this attribute, or find values of attribute for an entity)",null,null],[5,"store_cache_attribute_reverse","","Adds an attribute to the cache. `store_cache_attribute_reverse` caches entities for an attribute keyed by value. (i.e. find entities that have a particular value for an attribute).",null,null],[5,"store_cache_attribute_bi_directional","","Adds an attribute to the cache. `store_cache_attribute_bi_directional` caches entity in both available directions, forward and reverse.",null,null],[5,"store_query","","Creates a QueryBuilder from the given store to execute the provided query.",null,null],[5,"query_builder_bind_long","","Binds a TypedValue::Long to a Variable with the given name.",null,null],[5,"query_builder_bind_ref","","Binds a TypedValue::Ref to a Variable with the given name.",null,null],[5,"query_builder_bind_ref_kw","","Binds a TypedValue::Ref to a Variable with the given name. Takes a keyword as a c string in the format `:namespace/name` and converts it into an NamespacedKeyworf.",null,null],[5,"query_builder_bind_kw","","Binds a TypedValue::Ref to a Variable with the given name. Takes a keyword as a c string in the format `:namespace/name` and converts it into an NamespacedKeyworf.",null,null],[5,"query_builder_bind_boolean","","Binds a TypedValue::Boolean to a Variable with the given name.",null,null],[5,"query_builder_bind_double","","Binds a TypedValue::Double to a Variable with the given name.",null,null],[5,"query_builder_bind_timestamp","","Binds a TypedValue::Instant to a Variable with the given name. Takes a timestamp in microseconds.",null,null],[5,"query_builder_bind_string","","Binds a TypedValue::String to a Variable with the given name.",null,null],[5,"query_builder_bind_uuid","","Binds a TypedValue::Uuid to a Variable with the given name. Takes a `UUID` as a byte slice of length 16. This maps directly to the `uuid_t` C type.",null,null],[5,"query_builder_execute_scalar","","Executes a query and returns the results as a Scalar.",null,null],[5,"query_builder_execute_coll","","Executes a query and returns the results as a Coll.",null,null],[5,"query_builder_execute_tuple","","Executes a query and returns the results as a Tuple.",null,null],[5,"query_builder_execute","","Executes a query and returns the results as a Rel.",null,null],[5,"typed_value_into_long","","Consumes a Binding and returns the value as a C `long`.",null,null],[5,"typed_value_into_entid","","Consumes a Binding and returns the value as an Entid.",null,null],[5,"typed_value_into_kw","","Consumes a Binding and returns the value as an keyword C `String`.",null,null],[5,"typed_value_into_boolean","","Consumes a Binding and returns the value as a boolean represented as an `i32`. If the value of the boolean is `true` the value returned is 1. If the value of the boolean is `false` the value returned is 0.",null,null],[5,"typed_value_into_double","","Consumes a Binding and returns the value as a `f64`.",null,null],[5,"typed_value_into_timestamp","","Consumes a Binding and returns the value as a microsecond timestamp.",null,null],[5,"typed_value_into_string","","Consumes a Binding and returns the value as a C `String`.",null,null],[5,"typed_value_into_uuid","","Consumes a Binding and returns the value as a UUID byte slice of length 16.",null,null],[5,"typed_value_value_type","","Returns the ValueType of this Binding.",null,null],[5,"row_at_index","","Returns the value at the provided `index` as a `Vec`. If there is no value present at the `index`, a null pointer is returned.",null,null],[5,"typed_value_result_set_into_iter","","Consumes the `RelResult` and returns an iterator over the values.",null,null],[5,"typed_value_result_set_iter_next","","Returns the next value in the `iter` as a `Vec`. If there is no value next value, a null pointer is returned.",null,null],[5,"typed_value_list_into_iter","","Consumes the `Vec` and returns an iterator over the values.",null,null],[5,"typed_value_list_iter_next","","Returns the next value in the `iter` as a Binding. If there is no value next value, a null pointer is returned.",null,null],[5,"value_at_index","","Returns the value at the provided `index` as a Binding. If there is no value present at the `index`, a null pointer is returned.",null,null],[5,"value_at_index_into_long","","Returns the value of the Binding at `index` as a `long`.",null,null],[5,"value_at_index_into_entid","","Returns the value of the Binding at `index` as an Entid.",null,null],[5,"value_at_index_into_kw","","Returns the value of the Binding at `index` as a keyword C `String`.",null,null],[5,"value_at_index_into_boolean","","Returns the value of the Binding at `index` as a boolean represented by a `i32`. If the value of the `boolean` is `true` then the value returned is 1. If the value of the `boolean` is `false` then the value returned is 0.",null,null],[5,"value_at_index_into_double","","Returns the value of the Binding at `index` as an `f64`.",null,null],[5,"value_at_index_into_timestamp","","Returns the value of the Binding at `index` as a microsecond timestamp.",null,null],[5,"value_at_index_into_string","","Returns the value of the Binding at `index` as a C `String`.",null,null],[5,"value_at_index_into_uuid","","Returns the value of the Binding at `index` as a UUID byte slice of length 16.",null,null],[5,"store_value_for_attribute","","Returns an ExternResult containing the Binding associated with the `attribute` as `:namespace/name` for the given `entid`. If there is a value for that `attribute` on the entity with id `entid` then the value is returned in `ok`. If there no value for that `attribute` on the entity with id `entid` but the attribute is value, then a null pointer is returned in `ok`. If there is no Attribute in the Schema for the given `attribute` then an error is returned in `err`.",null,null],[5,"store_register_observer","","Registers a TxObserver with the `key` to observe changes to `attributes` on this `store`. Calls `callback` is a relevant transaction occurs.",null,null],[5,"store_unregister_observer","","Unregisters a TxObserver with the `key` to observe changes on this `store`.",null,null],[5,"store_entid_for_attribute","","Returns the Entid associated with the `attr` as `:namespace/name`.",null,null],[5,"tx_change_list_entry_at","","Returns the value at the provided `index` as a TransactionChange .",null,null],[5,"changelist_entry_at","","Returns the value at the provided `index` as a Entid .",null,null],[5,"destroy","","",null,null],[5,"in_progress_builder_destroy","","",null,null],[5,"entity_builder_destroy","","",null,null],[5,"query_builder_destroy","","",null,null],[5,"store_destroy","","",null,null],[5,"tx_report_destroy","","",null,null],[5,"typed_value_destroy","","",null,null],[5,"typed_value_list_destroy","","",null,null],[5,"typed_value_list_iter_destroy","","",null,null],[5,"typed_value_result_set_destroy","","",null,null],[5,"typed_value_result_set_iter_destroy","","",null,null],[5,"in_progress_destroy","","",null,null],[0,"android","","",null,null],[4,"LogLevel","mentat_ffi::android","",null,null],[13,"Debug","","",21,null],[13,"Info","","",21,null],[13,"Warn","","",21,null],[13,"Error","","",21,null],[5,"__android_log_write","","",null,null],[0,"utils","mentat_ffi","",null,null],[0,"strings","mentat_ffi::utils","",null,null],[5,"c_char_to_string","mentat_ffi::utils::strings","",null,null],[5,"string_to_c_char","","",null,null],[5,"kw_from_string","","",null,{"inputs":[{"name":"str"}],"output":{"name":"keyword"}}],[0,"log","mentat_ffi::utils","",null,null],[5,"d","mentat_ffi::utils::log","",null,{"inputs":[{"name":"str"}],"output":null}],[6,"BindingIterator","mentat_ffi","",null,null],[6,"BindingListIterator","","",null,null],[11,"fmt","","",16,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"clone","","",16,{"inputs":[{"name":"self"}],"output":{"name":"transactionchange"}}],[11,"fmt","","",17,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",18,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"from","","",18,{"inputs":[{"name":"option"}],"output":{"name":"self"}}],[11,"fmt","","",19,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"from","","",19,{"inputs":[{"name":"result"}],"output":{"name":"self"}}],[11,"fmt","","",20,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"val","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["typedvalue"],"name":"option"}}],[11,"is_congruent_with","","Returns true if the provided type is `Some` and matches this value's type, or if the provided type is `None`.",0,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"bool"}}],[11,"matches_type","","",0,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"bool"}}],[11,"value_type","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["valuetype"],"name":"option"}}],[11,"into_known_entid","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"into_entid","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_kw","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["arc"],"name":"option"}}],[11,"into_boolean","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["bool"],"name":"option"}}],[11,"into_long","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_double","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["f64"],"name":"option"}}],[11,"into_instant","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"into_timestamp","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_string","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["arc"],"name":"option"}}],[11,"into_uuid","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["uuid"],"name":"option"}}],[11,"into_uuid_string","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["string"],"name":"option"}}],[11,"into_c_string","","",0,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_kw_c_string","","",0,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_uuid_c_string","","",0,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"clone","","",1,{"inputs":[{"name":"self"}],"output":{"name":"cachedirection"}}],[11,"sync","","",22,{"inputs":[{"name":"self"},{"name":"string"},{"name":"string"}],"output":{"generics":["error"],"name":"result"}}],[11,"pull_attributes_for_entities","","",22,{"inputs":[{"name":"self"},{"name":"e"},{"name":"a"}],"output":{"generics":["btreemap","error"],"name":"result"}}],[11,"pull_attributes_for_entity","","",22,{"inputs":[{"name":"self"},{"name":"i64"},{"name":"a"}],"output":{"generics":["structuredmap","error"],"name":"result"}}],[11,"pull_attributes_for_entities","","",23,{"inputs":[{"name":"self"},{"name":"e"},{"name":"a"}],"output":{"generics":["btreemap","error"],"name":"result"}}],[11,"pull_attributes_for_entity","","",23,{"inputs":[{"name":"self"},{"name":"i64"},{"name":"a"}],"output":{"generics":["structuredmap","error"],"name":"result"}}],[11,"named_tempid","","",24,{"inputs":[{"name":"self"},{"name":"string"}],"output":{"generics":["tempid"],"name":"rc"}}],[11,"describe_tempid","","",24,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"generics":["inprogressbuilder"],"name":"entitybuilder"}}],[11,"describe","","",24,{"inputs":[{"name":"self"},{"name":"e"}],"output":{"generics":["inprogressbuilder"],"name":"entitybuilder"}}],[11,"add","","",24,{"inputs":[{"name":"self"},{"name":"e"},{"name":"knownentid"},{"name":"v"}],"output":{"generics":["error"],"name":"result"}}],[11,"retract","","",24,{"inputs":[{"name":"self"},{"name":"e"},{"name":"knownentid"},{"name":"v"}],"output":{"generics":["error"],"name":"result"}}],[11,"ensure_vocabulary","","",23,{"inputs":[{"name":"self"},{"name":"definition"}],"output":{"generics":["vocabularyoutcome","error"],"name":"result"}}],[11,"ensure_vocabularies","","",23,{"inputs":[{"name":"self"},{"name":"vocabularysource"}],"output":{"generics":["btreemap","error"],"name":"result"}}],[11,"q_once","","",23,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryoutput","error"],"name":"result"}}],[11,"q_prepare","","",23,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["preparedquery","error"],"name":"result"}}],[11,"q_explain","","",23,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryexplanation","error"],"name":"result"}}],[11,"lookup_values_for_attribute","","",23,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"}],"output":{"generics":["vec","error"],"name":"result"}}],[11,"lookup_value_for_attribute","","",23,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"}],"output":{"generics":["option","error"],"name":"result"}}],[11,"q_once","","",22,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryoutput","error"],"name":"result"}}],[11,"q_prepare","","",22,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["preparedquery","error"],"name":"result"}}],[11,"q_explain","","",22,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"generics":["queryexplanation","error"],"name":"result"}}],[11,"lookup_values_for_attribute","","",22,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"}],"output":{"generics":["vec","error"],"name":"result"}}],[11,"lookup_value_for_attribute","","",22,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"}],"output":{"generics":["option","error"],"name":"result"}}],[11,"eq","","",1,{"inputs":[{"name":"self"},{"name":"cachedirection"}],"output":{"name":"bool"}}],[11,"entid_for_type","","",23,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"get_ident","","",23,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["keyword"],"name":"option"}}],[11,"get_entid","","",23,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"attribute_for_entid","","",23,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"generics":["attribute"],"name":"option"}}],[11,"attribute_for_ident","","",23,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"option"}}],[11,"is_attribute","","Return true if the provided entid identifies an attribute in this schema.",23,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"bool"}}],[11,"identifies_attribute","","Return true if the provided ident identifies an attribute in this schema.",23,{"inputs":[{"name":"self"},{"name":"keyword"}],"output":{"name":"bool"}}],[11,"component_attributes","","",23,null],[11,"fmt","","",1,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",25,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",25,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"eq","","",25,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"ne","","",25,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"hash","","",25,null],[11,"from_str","","Parse a hex string and interpret as a `Uuid`.",25,{"inputs":[{"name":"str"}],"output":{"generics":["uuid","parseerror"],"name":"result"}}],[11,"cmp","","",25,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"ordering"}}],[11,"deserialize","","",25,{"inputs":[{"name":"d"}],"output":{"generics":["uuid"],"name":"result"}}],[11,"rand","","",25,{"inputs":[{"name":"r"}],"output":{"name":"uuid"}}],[11,"clone","","",25,{"inputs":[{"name":"self"}],"output":{"name":"uuid"}}],[11,"partial_cmp","","",25,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",25,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"le","","",25,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"gt","","",25,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"ge","","",25,{"inputs":[{"name":"self"},{"name":"uuid"}],"output":{"name":"bool"}}],[11,"serialize","","",25,{"inputs":[{"name":"self"},{"name":"s"}],"output":{"name":"result"}}],[11,"default","","Returns the nil UUID, which is all zeroes",25,{"inputs":[],"output":{"name":"uuid"}}],[11,"partial_cmp","","",13,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",13,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"le","","",13,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"gt","","",13,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"ge","","",13,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"clone","","",13,{"inputs":[{"name":"self"}],"output":{"name":"variable"}}],[11,"cmp","","",13,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"ordering"}}],[11,"hash","","",13,null],[11,"eq","","",13,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"ne","","",13,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"eq","","",2,{"inputs":[{"name":"self"},{"name":"findspec"}],"output":{"name":"bool"}}],[11,"ne","","",2,{"inputs":[{"name":"self"},{"name":"findspec"}],"output":{"name":"bool"}}],[11,"fmt","","",13,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",2,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",13,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"from_value","","",13,{"inputs":[{"name":"valueandspan"}],"output":{"generics":["variable"],"name":"option"}}],[11,"sql_representation","","",12,null],[11,"value_type_tag","","",12,{"inputs":[{"name":"self"}],"output":{"name":"i32"}}],[11,"accommodates_integer","","Returns true if the provided integer is in the SQLite value space of this type. For example, `1` is how we encode `true`.",12,{"inputs":[{"name":"self"},{"name":"i64"}],"output":{"name":"bool"}}],[11,"partial_cmp","","",4,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",4,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"le","","",4,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"gt","","",4,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"ge","","",4,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"partial_cmp","","",10,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",10,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"le","","",10,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"gt","","",10,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"ge","","",10,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"partial_cmp","","",12,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"clone","","",0,{"inputs":[{"name":"self"}],"output":{"name":"binding"}}],[11,"clone","","",12,{"inputs":[{"name":"self"}],"output":{"name":"valuetype"}}],[11,"clone","","",10,{"inputs":[{"name":"self"}],"output":{"name":"typedvalue"}}],[11,"clone","","",4,{"inputs":[{"name":"self"}],"output":{"name":"knownentid"}}],[11,"from","","",0,{"inputs":[{"name":"structuredmap"}],"output":{"name":"binding"}}],[11,"from","","",10,{"inputs":[{"generics":["utc"],"name":"datetime"}],"output":{"name":"typedvalue"}}],[11,"from","","",10,{"inputs":[{"name":"uuid"}],"output":{"name":"typedvalue"}}],[11,"from","","",10,{"inputs":[{"name":"string"}],"output":{"name":"typedvalue"}}],[11,"from","","",0,{"inputs":[{"generics":["binding"],"name":"vec"}],"output":{"name":"binding"}}],[11,"from","","",10,{"inputs":[{"name":"bool"}],"output":{"name":"typedvalue"}}],[11,"from","","",10,{"inputs":[{"generics":["string"],"name":"box"}],"output":{"name":"typedvalue"}}],[11,"from","","",10,{"inputs":[{"name":"i32"}],"output":{"name":"typedvalue"}}],[11,"from","","",10,{"inputs":[{"generics":["keyword"],"name":"rc"}],"output":{"name":"typedvalue"}}],[11,"from","","",0,{"inputs":[{"name":"t"}],"output":{"name":"binding"}}],[11,"from","","",10,{"inputs":[{"name":"str"}],"output":{"name":"typedvalue"}}],[11,"from","","",10,{"inputs":[{"name":"keyword"}],"output":{"name":"typedvalue"}}],[11,"from","","",10,{"inputs":[{"generics":["string"],"name":"rc"}],"output":{"name":"typedvalue"}}],[11,"from","","",10,{"inputs":[{"generics":["string"],"name":"arc"}],"output":{"name":"typedvalue"}}],[11,"from","","",10,{"inputs":[{"generics":["keyword"],"name":"arc"}],"output":{"name":"typedvalue"}}],[11,"from","","",10,{"inputs":[{"name":"u32"}],"output":{"name":"typedvalue"}}],[11,"from","","",10,{"inputs":[{"name":"f64"}],"output":{"name":"typedvalue"}}],[11,"from","","",10,{"inputs":[{"name":"knownentid"}],"output":{"name":"typedvalue"}}],[11,"cmp","","",4,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"ordering"}}],[11,"cmp","","",10,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"ordering"}}],[11,"cmp","","",12,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"ordering"}}],[11,"deserialize","","",10,{"inputs":[{"name":"__d"}],"output":{"generics":["typedvalue"],"name":"result"}}],[11,"hash","","",4,null],[11,"hash","","",10,null],[11,"hash","","",12,null],[11,"eq","","",10,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"ne","","",10,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"bool"}}],[11,"eq","","",12,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"bool"}}],[11,"eq","","",0,{"inputs":[{"name":"self"},{"name":"binding"}],"output":{"name":"bool"}}],[11,"ne","","",0,{"inputs":[{"name":"self"},{"name":"binding"}],"output":{"name":"bool"}}],[11,"eq","","",4,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"ne","","",4,{"inputs":[{"name":"self"},{"name":"knownentid"}],"output":{"name":"bool"}}],[11,"fmt","","",12,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",10,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",4,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",12,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"to_u32","","",12,{"inputs":[{"name":"self"}],"output":{"name":"u32"}}],[11,"from_u32","","",12,{"inputs":[{"name":"u32"}],"output":{"name":"valuetype"}}],[11,"serialize","","",10,{"inputs":[{"name":"self"},{"name":"__s"}],"output":{"name":"result"}}],[11,"clone","","",11,{"inputs":[{"name":"self"}],"output":{"name":"txreport"}}],[11,"into_typed_value","","",10,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"valuetype"}],"output":{"generics":["typedvalue","error"],"name":"result"}}],[11,"into_entity_place","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["entityplace","error"],"name":"result"}}],[11,"as_tempid","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["tempid"],"name":"option"}}],[11,"hash","","",11,null],[11,"fmt","","",11,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"partial_cmp","","",11,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"lt","","",11,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"le","","",11,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"gt","","",11,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"ge","","",11,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"cmp","","",11,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"ordering"}}],[11,"eq","","",11,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"ne","","",11,{"inputs":[{"name":"self"},{"name":"txreport"}],"output":{"name":"bool"}}],[11,"from_sql_value_pair","","Given a SQLite `value` and a `value_type_tag`, return the corresponding `TypedValue`.",10,{"inputs":[{"name":"value"},{"name":"i32"}],"output":{"generics":["typedvalue","error"],"name":"result"}}],[11,"from_edn_value","","Given an EDN `value`, return a corresponding Mentat `TypedValue`.",10,{"inputs":[{"name":"value"}],"output":{"generics":["typedvalue"],"name":"option"}}],[11,"to_sql_value_pair","","Return the corresponding SQLite `value` and `value_type_tag` pair.",10,null],[11,"to_edn_value_pair","","Return the corresponding EDN `value` and `value_type` pair.",10,null],[11,"default","","",26,{"inputs":[],"output":{"name":"queryinputs"}}],[11,"into_iter","","",8,null],[11,"clone","","",7,{"inputs":[{"name":"self"}],"output":{"name":"queryresults"}}],[11,"clone","","",8,{"inputs":[{"name":"self"}],"output":{"name":"relresult"}}],[11,"from","","",8,{"inputs":[{"generics":["vec"],"name":"vec"}],"output":{"generics":["binding"],"name":"relresult"}}],[11,"from","","",7,{"inputs":[{"name":"queryoutput"}],"output":{"name":"queryresults"}}],[11,"eq","","",7,{"inputs":[{"name":"self"},{"name":"queryresults"}],"output":{"name":"bool"}}],[11,"ne","","",7,{"inputs":[{"name":"self"},{"name":"queryresults"}],"output":{"name":"bool"}}],[11,"eq","","",8,{"inputs":[{"name":"self"},{"name":"relresult"}],"output":{"name":"bool"}}],[11,"ne","","",8,{"inputs":[{"name":"self"},{"name":"relresult"}],"output":{"name":"bool"}}],[11,"eq","","",6,{"inputs":[{"name":"self"},{"name":"queryoutput"}],"output":{"name":"bool"}}],[11,"ne","","",6,{"inputs":[{"name":"self"},{"name":"queryoutput"}],"output":{"name":"bool"}}],[11,"fmt","","",6,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",7,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"fmt","","",8,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"is_unit_limited","","",2,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"expected_column_count","","",2,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"requires_distinct","","Returns true if the provided `FindSpec` cares about distinct results.",2,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"columns","","",2,{"inputs":[{"name":"self"}],"output":{"generics":["iterator"],"name":"box"}}],[11,"builder","","",23,{"inputs":[{"name":"self"}],"output":{"name":"inprogressbuilder"}}],[11,"use_caching","","Choose whether to use in-memory caches for running queries.",23,null],[11,"transact_builder","","If you only have a reference to an `InProgress`, you can't use the easy builder. This exists so you can make your own.",23,{"inputs":[{"name":"self"},{"name":"termbuilder"}],"output":{"generics":["txreport","error"],"name":"result"}}],[11,"transact_terms","","",23,{"inputs":[{"name":"self"},{"name":"i"},{"generics":["tempid"],"name":"internset"}],"output":{"generics":["txreport","error"],"name":"result"}}],[11,"transact_entities","","",23,{"inputs":[{"name":"self"},{"name":"i"}],"output":{"generics":["txreport","error"],"name":"result"}}],[11,"transact","","",23,{"inputs":[{"name":"self"},{"name":"b"}],"output":{"generics":["txreport","error"],"name":"result"}}],[11,"import","","",23,{"inputs":[{"name":"self"},{"name":"p"}],"output":{"generics":["txreport","error"],"name":"result"}}],[11,"rollback","","",23,{"inputs":[{"name":"self"}],"output":{"generics":["error"],"name":"result"}}],[11,"commit","","",23,{"inputs":[{"name":"self"}],"output":{"generics":["error"],"name":"result"}}],[11,"cache","","",23,{"inputs":[{"name":"self"},{"name":"keyword"},{"name":"cachedirection"},{"name":"cacheaction"}],"output":{"generics":["error"],"name":"result"}}],[11,"new","","",27,{"inputs":[{"name":"store"},{"name":"t"}],"output":{"name":"querybuilder"}}],[11,"bind_value","","",27,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"name":"querybuilder"}}],[11,"bind_ref_from_kw","","",27,{"inputs":[{"name":"self"},{"name":"str"},{"name":"keyword"}],"output":{"generics":["querybuilder","error"],"name":"result"}}],[11,"bind_ref","","",27,{"inputs":[{"name":"self"},{"name":"str"},{"name":"t"}],"output":{"name":"querybuilder"}}],[11,"bind_long","","",27,{"inputs":[{"name":"self"},{"name":"str"},{"name":"i64"}],"output":{"name":"querybuilder"}}],[11,"bind_instant","","",27,{"inputs":[{"name":"self"},{"name":"str"},{"name":"i64"}],"output":{"name":"querybuilder"}}],[11,"bind_date_time","","",27,{"inputs":[{"name":"self"},{"name":"str"},{"generics":["utc"],"name":"datetime"}],"output":{"name":"querybuilder"}}],[11,"bind_type","","",27,{"inputs":[{"name":"self"},{"name":"str"},{"name":"valuetype"}],"output":{"name":"querybuilder"}}],[11,"execute","","",27,{"inputs":[{"name":"self"}],"output":{"generics":["queryoutput","error"],"name":"result"}}],[11,"execute_scalar","","",27,{"inputs":[{"name":"self"}],"output":{"generics":["option","error"],"name":"result"}}],[11,"execute_coll","","",27,{"inputs":[{"name":"self"}],"output":{"generics":["vec","error"],"name":"result"}}],[11,"execute_tuple","","",27,{"inputs":[{"name":"self"}],"output":{"generics":["option","error"],"name":"result"}}],[11,"execute_rel","","",27,{"inputs":[{"name":"self"}],"output":{"generics":["relresult","error"],"name":"result"}}],[11,"with_value_sequence","","",26,{"inputs":[{"name":"vec"}],"output":{"name":"queryinputs"}}],[11,"with_type_sequence","","",26,{"inputs":[{"name":"vec"}],"output":{"name":"queryinputs"}}],[11,"with_values","","",26,{"inputs":[{"generics":["variable","typedvalue"],"name":"btreemap"}],"output":{"name":"queryinputs"}}],[11,"new","","",26,{"inputs":[{"generics":["variable","valuetype"],"name":"btreemap"},{"generics":["variable","typedvalue"],"name":"btreemap"}],"output":{"generics":["queryinputs","error"],"name":"result"}}],[11,"empty_factory","","",6,{"inputs":[{"name":"findspec"}],"output":{"generics":["fn"],"name":"box"}}],[11,"len","","",6,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"is_empty","","",6,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"empty","","",6,{"inputs":[{"name":"rc"}],"output":{"name":"queryoutput"}}],[11,"from_constants","","",6,{"inputs":[{"name":"rc"},{"generics":["variable","typedvalue"],"name":"btreemap"}],"output":{"name":"queryresults"}}],[11,"into_scalar","","",6,{"inputs":[{"name":"self"}],"output":{"generics":["option","error"],"name":"result"}}],[11,"into_coll","","",6,{"inputs":[{"name":"self"}],"output":{"generics":["vec","error"],"name":"result"}}],[11,"into_tuple","","",6,{"inputs":[{"name":"self"}],"output":{"generics":["option","error"],"name":"result"}}],[11,"into_rel","","",6,{"inputs":[{"name":"self"}],"output":{"generics":["relresult","error"],"name":"result"}}],[11,"len","","",7,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"is_empty","","",7,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"into_scalar","","",7,{"inputs":[{"name":"self"}],"output":{"generics":["option","error"],"name":"result"}}],[11,"into_coll","","",7,{"inputs":[{"name":"self"}],"output":{"generics":["vec","error"],"name":"result"}}],[11,"into_tuple","","",7,{"inputs":[{"name":"self"}],"output":{"generics":["option","error"],"name":"result"}}],[11,"into_rel","","",7,{"inputs":[{"name":"self"}],"output":{"generics":["relresult","error"],"name":"result"}}],[11,"empty","","",8,{"inputs":[{"name":"usize"}],"output":{"name":"relresult"}}],[11,"is_empty","","",8,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"row_count","","",8,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"rows","","",8,{"inputs":[{"name":"self"}],"output":{"name":"chunks"}}],[11,"row","","",8,{"inputs":[{"name":"self"},{"name":"usize"}],"output":{"name":"option"}}],[11,"open","","Open a store at the supplied path, ensuring that it includes the bootstrap schema.",22,{"inputs":[{"name":"str"}],"output":{"generics":["store","error"],"name":"result"}}],[11,"open_empty","","Returns a totally blank store with no bootstrap schema. Use `open` instead.",22,{"inputs":[{"name":"str"}],"output":{"generics":["store","error"],"name":"result"}}],[11,"transact","","",22,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"generics":["txreport","error"],"name":"result"}}],[11,"sqlite_mut","","Intended for use from tests.",22,{"inputs":[{"name":"self"}],"output":{"name":"connection"}}],[11,"dismantle","","",22,null],[11,"conn","","",22,{"inputs":[{"name":"self"}],"output":{"name":"conn"}}],[11,"begin_read","","",22,{"inputs":[{"name":"self"}],"output":{"generics":["inprogressread","error"],"name":"result"}}],[11,"begin_transaction","","",22,{"inputs":[{"name":"self"}],"output":{"generics":["inprogress","error"],"name":"result"}}],[11,"cache","","",22,{"inputs":[{"name":"self"},{"name":"keyword"},{"name":"cachedirection"}],"output":{"generics":["error"],"name":"result"}}],[11,"register_observer","","",22,null],[11,"unregister_observer","","",22,null],[11,"is_congruent_with","","Returns true if the provided type is `Some` and matches this value's type, or if the provided type is `None`.",10,{"inputs":[{"name":"self"},{"name":"t"}],"output":{"name":"bool"}}],[11,"matches_type","","",10,{"inputs":[{"name":"self"},{"name":"valuetype"}],"output":{"name":"bool"}}],[11,"value_type","","",10,{"inputs":[{"name":"self"}],"output":{"name":"valuetype"}}],[11,"typed_ns_keyword","","Construct a new `TypedValue::Keyword` instance by cloning the provided values and wrapping them in a new `ValueRc`. This is expensive, so this might be best limited to tests.",10,{"inputs":[{"name":"str"},{"name":"str"}],"output":{"name":"typedvalue"}}],[11,"typed_string","","Construct a new `TypedValue::String` instance by cloning the provided value and wrapping it in a new `ValueRc`. This is expensive, so this might be best limited to tests.",10,{"inputs":[{"name":"str"}],"output":{"name":"typedvalue"}}],[11,"current_instant","","",10,{"inputs":[],"output":{"name":"typedvalue"}}],[11,"instant","","Construct a new `TypedValue::Instant` instance from the provided microsecond timestamp.",10,{"inputs":[{"name":"i64"}],"output":{"name":"typedvalue"}}],[11,"into_known_entid","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["knownentid"],"name":"option"}}],[11,"into_entid","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_kw","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["arc"],"name":"option"}}],[11,"into_boolean","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["bool"],"name":"option"}}],[11,"into_long","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_double","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["f64"],"name":"option"}}],[11,"into_instant","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["datetime"],"name":"option"}}],[11,"into_timestamp","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["i64"],"name":"option"}}],[11,"into_string","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["arc"],"name":"option"}}],[11,"into_c_string","","",10,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_kw_c_string","","",10,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_uuid_c_string","","",10,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"into_uuid","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["uuid"],"name":"option"}}],[11,"into_uuid_string","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["string"],"name":"option"}}],[11,"new","","",28,{"inputs":[{"generics":["i64"],"name":"btreeset"},{"name":"f"}],"output":{"name":"txobserver"}}],[11,"applicable_reports","","",28,{"inputs":[{"name":"self"},{"name":"indexmap"}],"output":{"generics":["i64","btreeset","randomstate"],"name":"indexmap"}}],[11,"nil","","The 'nil UUID'.",25,{"inputs":[],"output":{"name":"uuid"}}],[11,"new","","Creates a new `Uuid`.",25,{"inputs":[{"name":"uuidversion"}],"output":{"generics":["uuid"],"name":"option"}}],[11,"new_v4","","Creates a random `Uuid`.",25,{"inputs":[],"output":{"name":"uuid"}}],[11,"from_fields","","Creates a `Uuid` from four field values.",25,null],[11,"from_bytes","","Creates a `Uuid` using the supplied bytes.",25,null],[11,"get_variant","","Returns the variant of the `Uuid` structure.",25,{"inputs":[{"name":"self"}],"output":{"generics":["uuidvariant"],"name":"option"}}],[11,"get_version_num","","Returns the version number of the `Uuid`.",25,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"get_version","","Returns the version of the `Uuid`.",25,{"inputs":[{"name":"self"}],"output":{"generics":["uuidversion"],"name":"option"}}],[11,"as_bytes","","Return an array of 16 octets containing the UUID data",25,null],[11,"simple","","Returns a wrapper which when formatted via `fmt::Display` will format a string of 32 hexadecimal digits.",25,{"inputs":[{"name":"self"}],"output":{"name":"simple"}}],[11,"hyphenated","","Returns a wrapper which when formatted via `fmt::Display` will format a string of hexadecimal digits separated into groups with a hyphen.",25,{"inputs":[{"name":"self"}],"output":{"name":"hyphenated"}}],[11,"urn","","Returns a wrapper which when formatted via `fmt::Display` will format a string of the UUID as a full URN string.",25,{"inputs":[{"name":"self"}],"output":{"name":"urn"}}],[11,"to_timestamp","","Returns an Optional Tuple of (u64, u16) representing the timestamp and counter portion of a V1 UUID. If the supplied UUID is not V1, this will return None",25,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"parse_str","","Parses a `Uuid` from a string of hexadecimal digits with optional hyphens.",25,{"inputs":[{"name":"str"}],"output":{"generics":["uuid","parseerror"],"name":"result"}}],[11,"is_nil","","Tests if the UUID is nil",25,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"all_enums","","",12,{"inputs":[],"output":{"generics":["valuetype"],"name":"enumset"}}],[11,"into_keyword","","",12,{"inputs":[{"name":"self"}],"output":{"name":"keyword"}}],[11,"from_keyword","","",12,{"inputs":[{"name":"keyword"}],"output":{"generics":["valuetype"],"name":"option"}}],[11,"into_typed_value","","",12,{"inputs":[{"name":"self"}],"output":{"name":"typedvalue"}}],[11,"into_edn_value","","",12,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"is_numeric","","",12,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"as_str","","",13,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"to_string","","",13,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"name","","",13,{"inputs":[{"name":"self"}],"output":{"name":"plainsymbol"}}],[11,"from_valid_name","","Return a new `Variable`, assuming that the provided string is a valid name.",13,{"inputs":[{"name":"str"}],"output":{"name":"variable"}}],[11,"from_rc","","",13,{"inputs":[{"generics":["plainsymbol"],"name":"rc"}],"output":{"generics":["variable"],"name":"option"}}],[11,"from_symbol","","TODO: intern strings. #398.",13,{"inputs":[{"name":"plainsymbol"}],"output":{"generics":["variable"],"name":"option"}}],[11,"finish","","",29,null],[11,"add","","",29,{"inputs":[{"name":"self"},{"name":"knownentid"},{"name":"v"}],"output":{"generics":["error"],"name":"result"}}],[11,"retract","","",29,{"inputs":[{"name":"self"},{"name":"knownentid"},{"name":"v"}],"output":{"generics":["error"],"name":"result"}}],[11,"add_kw","","",29,{"inputs":[{"name":"self"},{"name":"keyword"},{"name":"v"}],"output":{"generics":["error"],"name":"result"}}],[11,"retract_kw","","",29,{"inputs":[{"name":"self"},{"name":"keyword"},{"name":"v"}],"output":{"generics":["error"],"name":"result"}}],[11,"transact","","Build the terms from this builder and transact them against the current `InProgress`. This method always returns the `InProgress` -- failure doesn't imply an automatic rollback.",29,null],[11,"commit","","Transact the contents of the builder and commit the `InProgress`. If any step fails, roll back. Return the `TxReport`.",29,{"inputs":[{"name":"self"}],"output":{"generics":["txreport","error"],"name":"result"}}],[11,"new","","",24,{"inputs":[{"name":"inprogress"}],"output":{"name":"inprogressbuilder"}}],[11,"transact","","Build the terms from this builder and transact them against the current `InProgress`. This method always returns the `InProgress` -- failure doesn't imply an automatic rollback.",24,null],[11,"commit","","Transact the contents of the builder and commit the `InProgress`. If any step fails, roll back. Return the `TxReport`.",24,{"inputs":[{"name":"self"}],"output":{"generics":["txreport","error"],"name":"result"}}],[11,"add_kw","","",24,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"},{"name":"v"}],"output":{"generics":["error"],"name":"result"}}],[11,"retract_kw","","",24,{"inputs":[{"name":"self"},{"name":"e"},{"name":"keyword"},{"name":"v"}],"output":{"generics":["error"],"name":"result"}}]],"paths":[[4,"Binding"],[4,"CacheDirection"],[4,"FindSpec"],[8,"HasSchema"],[3,"KnownEntid"],[8,"Queryable"],[3,"QueryOutput"],[4,"QueryResults"],[3,"RelResult"],[8,"Syncable"],[4,"TypedValue"],[3,"TxReport"],[4,"ValueType"],[3,"Variable"],[8,"BuildTerms"],[8,"IntoThing"],[3,"TransactionChange"],[3,"TxChangeList"],[3,"ExternOption"],[3,"ExternResult"],[3,"InProgressTransactResult"],[4,"LogLevel"],[3,"Store"],[3,"InProgress"],[3,"InProgressBuilder"],[3,"Uuid"],[3,"QueryInputs"],[3,"QueryBuilder"],[3,"TxObserver"],[3,"EntityBuilder"]]}; +searchIndex["mentat_parser_utils"] = {"doc":"","items":[[3,"ValueParseError","mentat_parser_utils","A `ValueParseError` is a `combine::primitives::ParseError`-alike that implements the `Debug`, `Display`, and `std::error::Error` traits. In addition, it doesn't capture references.",null,null],[12,"position","","",0,null],[12,"errors","","",0,null],[0,"macros","","",null,null],[3,"KeywordMapParser","mentat_parser_utils::macros","",null,null],[12,"0","","",1,null],[6,"ResultParser","","A type definition for a function parser that either parses an `O` from an input stream of type `I`, or fails with an \"expected\" failure. See https://docs.rs/combine/2.2.1/combine/trait.Parser.html#method.expected for more illumination. Nothing about this is specific to the result type of the parser.",null,null],[0,"log","mentat_parser_utils","",null,null],[0,"value_and_span","","",null,null],[3,"SpanPosition","mentat_parser_utils::value_and_span","A wrapper to let us order `edn::Span` in whatever way is appropriate for parsing with `combine`.",null,null],[12,"0","","",2,null],[3,"Stream","","A single `combine::Stream` implementation iterating `edn::ValueAndSpan` instances. Equivalent to `combine::IteratorStream` as produced by `combine::from_iter`, but specialized to `edn::ValueAndSpan`.",null,null],[3,"OfExactly","","`OfExactly` and `of_exactly` allow us to express nested parsers naturally.",null,null],[4,"Iter","","An iterator specifically for iterating `edn::ValueAndSpan` instances in various ways.",null,null],[13,"Empty","","",3,null],[13,"Atom","","",3,null],[13,"Vector","","",3,null],[13,"List","","",3,null],[13,"Map","","Iterates a map {:k1 v1, :k2 v2, ...} as a single `flat_map` slice [k1, v1, k2, v2, ...].",3,null],[13,"KeywordMap","","Iterates a map with vector values {:k1 [v11 v12 ...], :k2 [v21 v22 ...], ...} as a single flattened map [k1, v11, v12, ..., k2, v21, v22, ...].",3,null],[5,"of_exactly","","",null,{"inputs":[{"name":"p"},{"name":"n"}],"output":{"name":"ofexactly"}}],[5,"vector_","","Shorthands, just enough to convert the `mentat_db` crate for now. Written using `Box` for now: it's simple and we can address allocation issues if and when they surface.",null,{"inputs":[{"name":"stream"}],"output":{"generics":["stream","stream"],"name":"parseresult"}}],[5,"vector","","",null,{"inputs":[],"output":{"generics":["fnparser"],"name":"expected"}}],[5,"list_","","",null,{"inputs":[{"name":"stream"}],"output":{"generics":["stream","stream"],"name":"parseresult"}}],[5,"list","","",null,{"inputs":[],"output":{"generics":["fnparser"],"name":"expected"}}],[5,"seq_","","",null,{"inputs":[{"name":"stream"}],"output":{"generics":["stream","stream"],"name":"parseresult"}}],[5,"seq","","",null,{"inputs":[],"output":{"generics":["fnparser"],"name":"expected"}}],[5,"map_","","",null,{"inputs":[{"name":"stream"}],"output":{"generics":["stream","stream"],"name":"parseresult"}}],[5,"map","","",null,{"inputs":[],"output":{"generics":["fnparser"],"name":"expected"}}],[5,"is_valid_keyword_map_k_v","","A `[k v]` pair in the map form of a keyword map must have the shape `[:k, [v1, v2, ...]]`, with none of `v1`, `v2`, ... a keyword: without loss of generality, we cannot represent the case where `vn` is a keyword `:l`, since `[:k v1 v2 ... :l]`, isn't a valid keyword map in vector form. This function tests that a `[k v]` pair obeys these constraints.",null,null],[5,"keyword_map_","","",null,{"inputs":[{"name":"stream"}],"output":{"generics":["stream","stream"],"name":"parseresult"}}],[5,"keyword_map","","",null,{"inputs":[],"output":{"generics":["fnparser"],"name":"expected"}}],[5,"integer_","","",null,{"inputs":[{"name":"stream"}],"output":{"generics":["i64","stream"],"name":"parseresult"}}],[5,"integer","","",null,{"inputs":[],"output":{"generics":["fnparser"],"name":"expected"}}],[5,"any_keyword_","","",null,{"inputs":[{"name":"stream"}],"output":{"generics":["keyword","stream"],"name":"parseresult"}}],[5,"namespaced_keyword_","","",null,{"inputs":[{"name":"stream"}],"output":{"generics":["keyword","stream"],"name":"parseresult"}}],[5,"any_keyword","","",null,{"inputs":[],"output":{"generics":["fnparser"],"name":"expected"}}],[5,"namespaced_keyword","","",null,{"inputs":[],"output":{"generics":["fnparser"],"name":"expected"}}],[5,"forward_any_keyword_","","",null,{"inputs":[{"name":"stream"}],"output":{"generics":["keyword","stream"],"name":"parseresult"}}],[5,"forward_any_keyword","","",null,{"inputs":[],"output":{"generics":["fnparser"],"name":"expected"}}],[5,"forward_namespaced_keyword_","","",null,{"inputs":[{"name":"stream"}],"output":{"generics":["keyword","stream"],"name":"parseresult"}}],[5,"forward_namespaced_keyword","","",null,{"inputs":[],"output":{"generics":["fnparser"],"name":"expected"}}],[5,"backward_namespaced_keyword_","","",null,{"inputs":[{"name":"stream"}],"output":{"generics":["keyword","stream"],"name":"parseresult"}}],[5,"backward_namespaced_keyword","","",null,{"inputs":[],"output":{"generics":["fnparser"],"name":"expected"}}],[8,"Item","","Things specific to parsing with `combine` and our `Stream` that need a trait to live outside of the `edn` crate.",null,null],[16,"Position","","Position could be specialized to `SpanPosition`.",4,null],[10,"start","","A slight generalization of `combine::Positioner` that allows to set the position based on the `edn::ValueAndSpan` being iterated.",4,null],[10,"update_position","","",4,null],[10,"child_iter","","",4,{"inputs":[{"name":"self"}],"output":{"name":"iter"}}],[10,"child_stream","","",4,{"inputs":[{"name":"self"}],"output":{"name":"stream"}}],[10,"atom_iter","","",4,{"inputs":[{"name":"self"}],"output":{"name":"iter"}}],[10,"atom_stream","","",4,{"inputs":[{"name":"self"}],"output":{"name":"stream"}}],[10,"keyword_map_iter","","",4,{"inputs":[{"name":"self"}],"output":{"name":"iter"}}],[10,"keyword_map_stream","","",4,{"inputs":[{"name":"self"}],"output":{"name":"stream"}}],[8,"Streaming","","",null,null],[10,"as_stream","","",5,{"inputs":[{"name":"self"}],"output":{"name":"stream"}}],[8,"OfExactlyParsing","","We need a trait to define `Parser.of` and have it live outside of the `combine` crate.",null,null],[10,"of_exactly","","",6,{"inputs":[{"name":"self"},{"name":"n"}],"output":{"name":"ofexactly"}}],[11,"clone","","",2,{"inputs":[{"name":"self"}],"output":{"name":"spanposition"}}],[11,"fmt","","",2,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",2,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",2,{"inputs":[{"name":"self"},{"name":"self"}],"output":{"name":"bool"}}],[11,"partial_cmp","","",2,{"inputs":[{"name":"self"},{"name":"self"}],"output":{"generics":["ordering"],"name":"option"}}],[11,"cmp","","",2,{"inputs":[{"name":"self"},{"name":"self"}],"output":{"name":"ordering"}}],[11,"clone","","",3,{"inputs":[{"name":"self"}],"output":{"name":"iter"}}],[11,"next","","",3,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"clone","","",7,{"inputs":[{"name":"self"}],"output":{"name":"stream"}}],[11,"clone","","",8,{"inputs":[{"name":"self"}],"output":{"name":"ofexactly"}}],[11,"as_stream","","",7,{"inputs":[{"name":"self"}],"output":{"name":"stream"}}],[11,"parse_lazy","","",8,null],[11,"add_error","","",8,{"inputs":[{"name":"self"},{"name":"parseerror"}],"output":null}],[11,"uncons","","",7,{"inputs":[{"name":"self"}],"output":{"generics":["error"],"name":"result"}}],[11,"position","","",7,null],[11,"parse_lazy","mentat_parser_utils::macros","",1,{"inputs":[{"name":"self"},{"name":"stream"}],"output":{"generics":["stream"],"name":"consumedresult"}}],[11,"parse_lazy","","",1,{"inputs":[{"name":"self"},{"name":"stream"}],"output":{"generics":["stream"],"name":"consumedresult"}}],[11,"parse_lazy","","",1,{"inputs":[{"name":"self"},{"name":"stream"}],"output":{"generics":["stream"],"name":"consumedresult"}}],[11,"parse_lazy","","",1,{"inputs":[{"name":"self"},{"name":"stream"}],"output":{"generics":["stream"],"name":"consumedresult"}}],[11,"parse_lazy","","",1,{"inputs":[{"name":"self"},{"name":"stream"}],"output":{"generics":["stream"],"name":"consumedresult"}}],[11,"parse_lazy","","",1,{"inputs":[{"name":"self"},{"name":"stream"}],"output":{"generics":["stream"],"name":"consumedresult"}}],[11,"eq","mentat_parser_utils","",0,{"inputs":[{"name":"self"},{"name":"valueparseerror"}],"output":{"name":"bool"}}],[11,"ne","","",0,{"inputs":[{"name":"self"},{"name":"valueparseerror"}],"output":{"name":"bool"}}],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"description","","",0,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"from","","",0,{"inputs":[{"generics":["stream"],"name":"parseerror"}],"output":{"name":"valueparseerror"}}],[14,"satisfy_unwrap","","`satisfy_unwrap!` makes it a little easier to implement a `satisfy_map` body that matches a particular `Value` enum case, otherwise returning `None`.",null,null],[14,"matches_plain_symbol","","Generate a `satisfy_map` expression that matches a `PlainSymbol` value with the given name.",null,null],[14,"def_parser","","",null,null],[14,"assert_parses_to","","`assert_parses_to!` simplifies some of the boilerplate around running a parser function against input and expecting a certain result.",null,null],[14,"assert_edn_parses_to","","`assert_edn_parses_to!` simplifies some of the boilerplate around running a parser function against string input and expecting a certain result.",null,null],[14,"assert_parse_failure_contains","","`assert_parse_failure_contains!` simplifies running a parser function against string input and expecting a certain failure. This is working around the complexity of pattern matching parse errors that contain spans.",null,null],[14,"keyword_map_of","","",null,null],[14,"def_matches_plain_symbol","","Generate a `satisfy` expression that matches a `PlainSymbol` value with the given name.",null,null],[14,"def_matches_keyword","","Generate a `satisfy` expression that matches a `Keyword` value with the given name.",null,null],[14,"def_matches_namespaced_keyword","","Generate a `satisfy` expression that matches a `Keyword` value with the given namespace and name.",null,null]],"paths":[[3,"ValueParseError"],[3,"KeywordMapParser"],[3,"SpanPosition"],[4,"Iter"],[8,"Item"],[8,"Streaming"],[8,"OfExactlyParsing"],[3,"Stream"],[3,"OfExactly"]]}; +searchIndex["mentat_query"] = {"doc":"","items":[],"paths":[]}; +searchIndex["mentat_query_algebrizer"] = {"doc":"","items":[[3,"InvalidBinding","mentat_query_algebrizer","",null,null],[12,"function","","",0,null],[12,"inner","","",0,null],[3,"QueryInputs","","Define the inputs to a query. This is in two parts: a set of values known now, and a set of types known now. The separate map of types is to allow queries to be algebrized without full knowledge of the bindings that will be used at execution time. When built correctly, `types` is guaranteed to contain the types of `values` -- use `QueryInputs::new` or `QueryInputs::with_values` to construct an instance.",null,null],[3,"FindQuery","","A `FindQuery` represents a valid query to the query algebrizer.",null,null],[12,"find_spec","","",1,null],[12,"default_source","","",1,null],[12,"with","","",1,null],[12,"in_vars","","",1,null],[12,"in_sources","","",1,null],[12,"limit","","",1,null],[12,"where_clauses","","",1,null],[12,"order","","",1,null],[3,"Known","","A convenience wrapper around things known in memory: the schema and caches. We use a trait object here to avoid making dozens of functions generic over the type of the cache. If performance becomes a concern, we should hard-code specific kinds of cache right here, and/or eliminate the Option.",null,null],[12,"schema","","",2,null],[12,"cache","","",2,null],[3,"AlgebraicQuery","","",null,null],[12,"find_spec","","",3,null],[12,"with","","The set of variables that the caller wishes to be used for grouping when aggregating. These are specified in the query input, as `:with`, and are then chewed up during projection. If no variables are supplied, then no additional grouping is necessary beyond the non-aggregated projection list.",3,null],[12,"named_projection","","Some query features, such as ordering, are implemented by implicit reference to SQL columns. In order for these references to be 'live', those columns must be projected. This is the set of variables that must be so projected. This is not necessarily every variable that will be so required -- some variables will already be in the projection list.",3,null],[12,"order","","",3,null],[12,"limit","","",3,null],[12,"cc","","",3,null],[3,"ConjoiningClauses","","A `ConjoiningClauses` (CC) is a collection of clauses that are combined with `JOIN`. The topmost form in a query is a `ConjoiningClauses`.",null,null],[12,"empty_because","","`Some` if this set of clauses cannot yield results in the context of the current schema.",4,null],[12,"from","","A vector of source/alias pairs used to construct a SQL `FROM` list.",4,null],[12,"computed_tables","","A vector of computed tables (typically subqueries). The index into this vector is used as an identifier in a `DatomsTable::Computed(c)` table reference.",4,null],[12,"wheres","","A list of fragments that can be joined by `AND`.",4,null],[12,"column_bindings","","A map from var to qualified columns. Used to project.",4,null],[12,"input_variables","","A list of variables mentioned in the enclosing query's :in clause. These must all be bound before the query can be executed. TODO: clarify what this means for nested CCs.",4,null],[12,"known_types","","A map from var to type. Whenever a var maps unambiguously to two different types, it cannot yield results, so we don't represent that case here. If a var isn't present in the map, it means that its type is not known in advance. Usually that state should be represented by `ValueTypeSet::Any`.",4,null],[12,"extracted_types","","A mapping, similar to `column_bindings`, but used to pull type tags out of the store at runtime. If a var isn't unit in `known_types`, it should be present here.",4,null],[3,"ColumnAlternation","","A `ColumnAlternation` constraint is satisfied if at least one of its inner constraints is satisfied. An empty `ColumnAlternation` is never satisfied.",null,null],[12,"0","","",5,null],[3,"ColumnIntersection","","A `ColumnIntersection` constraint is satisfied if all of its inner constraints are satisfied. An empty intersection is always satisfied.",null,null],[12,"0","","",6,null],[3,"OrderBy","","Represents an entry in the ORDER BY list: a variable or a variable's type tag. (We require order vars to be projected, so we can simply use a variable here.)",null,null],[12,"0","","",7,null],[12,"1","","",7,null],[3,"QualifiedAlias","","A particular column of a particular aliased table. E.g., \"datoms123\", Attribute.",null,null],[12,"0","","",8,null],[12,"1","","",8,null],[3,"SourceAlias","","The association between a table and its alias. E.g., AllDatoms, \"all_datoms123\".",null,null],[12,"0","","",9,null],[12,"1","","",9,null],[4,"AlgebrizerError","","",null,null],[13,"DuplicateVariableError","","",10,null],[13,"UnsupportedArgument","","",10,null],[13,"InputTypeDisagreement","","",10,null],[13,"InvalidNumberOfArguments","","",10,null],[13,"InvalidArgument","","",10,null],[13,"InvalidArgumentType","","",10,null],[13,"InvalidGroundConstant","","",10,null],[13,"InvalidLimit","","",10,null],[13,"GroundBindingsMismatch","","",10,null],[13,"UnrecognizedIdent","","",10,null],[13,"UnknownFunction","","",10,null],[13,"UnknownLimitVar","","",10,null],[13,"UnboundVariable","","",10,null],[13,"NonMatchingVariablesInOrClause","","",10,null],[13,"NonMatchingVariablesInNotClause","","",10,null],[4,"BindingError","","",null,null],[13,"NoBoundVariable","","",11,null],[13,"UnexpectedBinding","","",11,null],[13,"RepeatedBoundVariable","","",11,null],[13,"ExpectedBindRel","","Expected `[[?x ?y]]` but got some other type of binding. Mentat is deliberately more strict than Datomic: we won't try to make sense of non-obvious (and potentially erroneous) bindings.",11,null],[13,"ExpectedBindRelOrBindColl","","Expected `[[?x ?y]]` or `[?x ...]` but got some other type of binding. Mentat is deliberately more strict than Datomic: we won't try to make sense of non-obvious (and potentially erroneous) bindings.",11,null],[13,"InvalidNumberOfBindings","","Expected `[?x1 … ?xN]` or `[[?x1 … ?xN]]` but got some other number of bindings. Mentat is deliberately more strict than Datomic: we prefer placeholders to omission.",11,null],[12,"number","mentat_query_algebrizer::BindingError","",11,null],[12,"expected","","",11,null],[4,"EmptyBecause","mentat_query_algebrizer","",null,null],[13,"CachedAttributeHasNoValues","","",12,null],[12,"entity","mentat_query_algebrizer::EmptyBecause","",12,null],[12,"attr","","",12,null],[13,"CachedAttributeHasNoEntity","mentat_query_algebrizer","",12,null],[12,"value","mentat_query_algebrizer::EmptyBecause","",12,null],[12,"attr","","",12,null],[13,"ConflictingBindings","mentat_query_algebrizer","",12,null],[12,"var","mentat_query_algebrizer::EmptyBecause","",12,null],[12,"existing","","",12,null],[12,"desired","","",12,null],[13,"TypeMismatch","mentat_query_algebrizer","",12,null],[12,"var","mentat_query_algebrizer::EmptyBecause","",12,null],[12,"existing","","",12,null],[12,"desired","","",12,null],[13,"KnownTypeMismatch","mentat_query_algebrizer","",12,null],[12,"left","mentat_query_algebrizer::EmptyBecause","",12,null],[12,"right","","",12,null],[13,"NoValidTypes","mentat_query_algebrizer","",12,null],[13,"NonAttributeArgument","","",12,null],[13,"NonInstantArgument","","",12,null],[13,"NonNumericArgument","","",12,null],[13,"NonEntityArgument","","",12,null],[13,"NonStringFulltextValue","","",12,null],[13,"NonFulltextAttribute","","",12,null],[13,"UnresolvedIdent","","",12,null],[13,"InvalidAttributeIdent","","",12,null],[13,"InvalidAttributeEntid","","",12,null],[13,"InvalidBinding","","",12,null],[13,"ValueTypeMismatch","","",12,null],[13,"AttributeLookupFailed","","",12,null],[4,"Column","","",null,null],[13,"Fixed","","",13,null],[13,"Fulltext","","",13,null],[13,"Variable","","",13,null],[13,"Transactions","","",13,null],[4,"ColumnConstraint","","",null,null],[13,"Equals","","",14,null],[13,"Inequality","","",14,null],[12,"operator","mentat_query_algebrizer::ColumnConstraint","",14,null],[12,"left","","",14,null],[12,"right","","",14,null],[13,"HasTypes","mentat_query_algebrizer","",14,null],[12,"value","mentat_query_algebrizer::ColumnConstraint","",14,null],[12,"value_types","","",14,null],[12,"check_value","","",14,null],[13,"NotExists","mentat_query_algebrizer","",14,null],[13,"Matches","","",14,null],[4,"ColumnConstraintOrAlternation","","",null,null],[13,"Constraint","","",15,null],[13,"Alternation","","",15,null],[4,"ComputedTable","","A source of rows that isn't a named table -- typically a subquery or union.",null,null],[13,"Subquery","","",16,null],[13,"Union","","",16,null],[12,"projection","mentat_query_algebrizer::ComputedTable","",16,null],[12,"type_extraction","","",16,null],[12,"arms","","",16,null],[13,"NamedValues","mentat_query_algebrizer","",16,null],[12,"names","mentat_query_algebrizer::ComputedTable","",16,null],[12,"values","","",16,null],[4,"DatomsColumn","mentat_query_algebrizer","One of the named columns of our tables.",null,null],[13,"Entity","","",17,null],[13,"Attribute","","",17,null],[13,"Value","","",17,null],[13,"Tx","","",17,null],[13,"ValueTypeTag","","",17,null],[4,"DatomsTable","","This enum models the fixed set of default tables we have -- two tables and two views -- and computed tables defined in the enclosing CC.",null,null],[13,"Datoms","","",18,null],[13,"FulltextValues","","",18,null],[13,"FulltextDatoms","","",18,null],[13,"AllDatoms","","",18,null],[13,"Computed","","",18,null],[13,"Transactions","","",18,null],[4,"FulltextColumn","","One of the named columns of our fulltext values table.",null,null],[13,"Rowid","","",19,null],[13,"Text","","",19,null],[4,"QueryValue","","",null,null],[13,"Column","","",20,null],[13,"Entid","","",20,null],[13,"TypedValue","","",20,null],[13,"PrimitiveLong","","",20,null],[4,"VariableColumn","","",null,null],[13,"Variable","","",21,null],[13,"VariableTypeTag","","",21,null],[5,"algebrize_with_counter","","",null,{"inputs":[{"name":"known"},{"name":"findquery"},{"name":"usize"}],"output":{"generics":["algebraicquery"],"name":"result"}}],[5,"algebrize","","",null,{"inputs":[{"name":"known"},{"name":"findquery"}],"output":{"generics":["algebraicquery"],"name":"result"}}],[5,"algebrize_with_inputs","","",null,{"inputs":[{"name":"known"},{"name":"findquery"},{"name":"usize"},{"name":"queryinputs"}],"output":{"generics":["algebraicquery"],"name":"result"}}],[5,"parse_find_string","","",null,{"inputs":[{"name":"str"}],"output":{"generics":["findquery"],"name":"result"}}],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"new","","",0,{"inputs":[{"name":"plainsymbol"},{"name":"bindingerror"}],"output":{"name":"invalidbinding"}}],[11,"cause","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["fail"],"name":"option"}}],[11,"backtrace","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["backtrace"],"name":"option"}}],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",11,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"clone","","",11,{"inputs":[{"name":"self"}],"output":{"name":"bindingerror"}}],[11,"fmt","","",11,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",11,{"inputs":[{"name":"self"},{"name":"bindingerror"}],"output":{"name":"bool"}}],[11,"ne","","",11,{"inputs":[{"name":"self"},{"name":"bindingerror"}],"output":{"name":"bool"}}],[11,"cause","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["fail"],"name":"option"}}],[11,"backtrace","","",11,{"inputs":[{"name":"self"}],"output":{"generics":["backtrace"],"name":"option"}}],[11,"fmt","","",10,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"cause","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["fail"],"name":"option"}}],[11,"backtrace","","",10,{"inputs":[{"name":"self"}],"output":{"generics":["backtrace"],"name":"option"}}],[11,"fmt","","",10,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",18,{"inputs":[{"name":"self"},{"name":"datomstable"}],"output":{"name":"bool"}}],[11,"ne","","",18,{"inputs":[{"name":"self"},{"name":"datomstable"}],"output":{"name":"bool"}}],[11,"clone","","",18,{"inputs":[{"name":"self"}],"output":{"name":"datomstable"}}],[11,"fmt","","",18,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",16,{"inputs":[{"name":"self"},{"name":"computedtable"}],"output":{"name":"bool"}}],[11,"ne","","",16,{"inputs":[{"name":"self"},{"name":"computedtable"}],"output":{"name":"bool"}}],[11,"fmt","","",16,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"name","","",18,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"eq","","",17,{"inputs":[{"name":"self"},{"name":"datomscolumn"}],"output":{"name":"bool"}}],[11,"clone","","",17,{"inputs":[{"name":"self"}],"output":{"name":"datomscolumn"}}],[11,"eq","","",19,{"inputs":[{"name":"self"},{"name":"fulltextcolumn"}],"output":{"name":"bool"}}],[11,"clone","","",19,{"inputs":[{"name":"self"}],"output":{"name":"fulltextcolumn"}}],[11,"eq","","",21,{"inputs":[{"name":"self"},{"name":"variablecolumn"}],"output":{"name":"bool"}}],[11,"ne","","",21,{"inputs":[{"name":"self"},{"name":"variablecolumn"}],"output":{"name":"bool"}}],[11,"clone","","",21,{"inputs":[{"name":"self"}],"output":{"name":"variablecolumn"}}],[11,"eq","","",13,{"inputs":[{"name":"self"},{"name":"column"}],"output":{"name":"bool"}}],[11,"ne","","",13,{"inputs":[{"name":"self"},{"name":"column"}],"output":{"name":"bool"}}],[11,"clone","","",13,{"inputs":[{"name":"self"}],"output":{"name":"column"}}],[11,"from","","",13,{"inputs":[{"name":"datomscolumn"}],"output":{"name":"column"}}],[11,"from","","",13,{"inputs":[{"name":"variablecolumn"}],"output":{"name":"column"}}],[11,"as_str","","",17,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"associated_type_tag_column","","The type of the `v` column is determined by the `value_type_tag` column. Return the associated column determining the type of this column, if there is one.",17,{"inputs":[{"name":"self"}],"output":{"generics":["datomscolumn"],"name":"option"}}],[11,"column_name","","",17,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"column_name","","",21,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"fmt","","",21,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",17,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",13,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"as_str","","",19,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"column_name","","",19,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"fmt","","",19,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",9,{"inputs":[{"name":"self"},{"name":"sourcealias"}],"output":{"name":"bool"}}],[11,"ne","","",9,{"inputs":[{"name":"self"},{"name":"sourcealias"}],"output":{"name":"bool"}}],[11,"clone","","",9,{"inputs":[{"name":"self"}],"output":{"name":"sourcealias"}}],[11,"fmt","","",9,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",8,{"inputs":[{"name":"self"},{"name":"qualifiedalias"}],"output":{"name":"bool"}}],[11,"ne","","",8,{"inputs":[{"name":"self"},{"name":"qualifiedalias"}],"output":{"name":"bool"}}],[11,"clone","","",8,{"inputs":[{"name":"self"}],"output":{"name":"qualifiedalias"}}],[11,"fmt","","",8,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"new","","",8,{"inputs":[{"name":"tablealias"},{"name":"c"}],"output":{"name":"self"}}],[11,"for_associated_type_tag","","",8,{"inputs":[{"name":"self"}],"output":{"generics":["qualifiedalias"],"name":"option"}}],[11,"eq","","",20,{"inputs":[{"name":"self"},{"name":"queryvalue"}],"output":{"name":"bool"}}],[11,"ne","","",20,{"inputs":[{"name":"self"},{"name":"queryvalue"}],"output":{"name":"bool"}}],[11,"clone","","",20,{"inputs":[{"name":"self"}],"output":{"name":"queryvalue"}}],[11,"fmt","","",20,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"clone","","",7,{"inputs":[{"name":"self"}],"output":{"name":"orderby"}}],[11,"fmt","","",7,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",7,{"inputs":[{"name":"self"},{"name":"orderby"}],"output":{"name":"bool"}}],[11,"ne","","",7,{"inputs":[{"name":"self"},{"name":"orderby"}],"output":{"name":"bool"}}],[11,"from","","",7,{"inputs":[{"name":"order"}],"output":{"name":"orderby"}}],[11,"eq","","",14,{"inputs":[{"name":"self"},{"name":"columnconstraint"}],"output":{"name":"bool"}}],[11,"ne","","",14,{"inputs":[{"name":"self"},{"name":"columnconstraint"}],"output":{"name":"bool"}}],[11,"has_unit_type","","",14,{"inputs":[{"name":"tablealias"},{"name":"valuetype"}],"output":{"name":"columnconstraint"}}],[11,"eq","","",15,{"inputs":[{"name":"self"},{"name":"columnconstraintoralternation"}],"output":{"name":"bool"}}],[11,"ne","","",15,{"inputs":[{"name":"self"},{"name":"columnconstraintoralternation"}],"output":{"name":"bool"}}],[11,"fmt","","",15,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"from","","",15,{"inputs":[{"name":"columnconstraint"}],"output":{"name":"self"}}],[11,"eq","","",6,{"inputs":[{"name":"self"},{"name":"columnintersection"}],"output":{"name":"bool"}}],[11,"ne","","",6,{"inputs":[{"name":"self"},{"name":"columnintersection"}],"output":{"name":"bool"}}],[11,"from","","",6,{"inputs":[{"generics":["columnconstraint"],"name":"vec"}],"output":{"name":"self"}}],[11,"default","","",6,{"inputs":[],"output":{"name":"self"}}],[11,"into_iter","","",6,null],[11,"len","","",6,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"is_empty","","",6,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"add","","",6,{"inputs":[{"name":"self"},{"name":"columnconstraintoralternation"}],"output":null}],[11,"add_intersection","","",6,{"inputs":[{"name":"self"},{"name":"columnconstraint"}],"output":null}],[11,"append","","",6,{"inputs":[{"name":"self"},{"name":"self"}],"output":null}],[11,"eq","","",5,{"inputs":[{"name":"self"},{"name":"columnalternation"}],"output":{"name":"bool"}}],[11,"ne","","",5,{"inputs":[{"name":"self"},{"name":"columnalternation"}],"output":{"name":"bool"}}],[11,"fmt","","",5,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"default","","",5,{"inputs":[],"output":{"name":"self"}}],[11,"into_iter","","",5,null],[11,"add_alternate","","",5,{"inputs":[{"name":"self"},{"name":"columnintersection"}],"output":null}],[11,"fmt","","",6,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",14,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",12,{"inputs":[{"name":"self"},{"name":"emptybecause"}],"output":{"name":"bool"}}],[11,"ne","","",12,{"inputs":[{"name":"self"},{"name":"emptybecause"}],"output":{"name":"bool"}}],[11,"clone","","",12,{"inputs":[{"name":"self"}],"output":{"name":"emptybecause"}}],[11,"fmt","","",12,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",1,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",1,{"inputs":[{"name":"self"},{"name":"findquery"}],"output":{"name":"bool"}}],[11,"ne","","",1,{"inputs":[{"name":"self"},{"name":"findquery"}],"output":{"name":"bool"}}],[11,"default","","",22,{"inputs":[],"output":{"name":"self"}}],[11,"with_value_sequence","","",22,{"inputs":[{"name":"vec"}],"output":{"name":"queryinputs"}}],[11,"with_type_sequence","","",22,{"inputs":[{"name":"vec"}],"output":{"name":"queryinputs"}}],[11,"with_values","","",22,{"inputs":[{"generics":["variable","typedvalue"],"name":"btreemap"}],"output":{"name":"queryinputs"}}],[11,"new","","",22,{"inputs":[{"generics":["variable","valuetype"],"name":"btreemap"},{"generics":["variable","typedvalue"],"name":"btreemap"}],"output":{"generics":["queryinputs"],"name":"result"}}],[11,"eq","","",4,{"inputs":[{"name":"self"},{"name":"conjoiningclauses"}],"output":{"name":"bool"}}],[11,"fmt","","",4,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"default","","",4,{"inputs":[],"output":{"name":"conjoiningclauses"}}],[11,"bind_value","","Be careful with this. It'll overwrite existing bindings.",4,{"inputs":[{"name":"self"},{"name":"variable"},{"name":"typedvalue"}],"output":null}],[11,"bound_value","","",4,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"generics":["typedvalue"],"name":"option"}}],[11,"is_value_bound","","",4,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"bool"}}],[11,"value_bindings","","",4,{"inputs":[{"name":"self"},{"name":"btreeset"}],"output":{"name":"variablebindings"}}],[11,"value_bound_variables","","Return an iterator over the variables externally bound to values.",4,{"inputs":[{"name":"self"}],"output":{"name":"variableiterator"}}],[11,"value_bound_variable_set","","Return a set of the variables externally bound to values.",4,{"inputs":[{"name":"self"}],"output":{"generics":["variable"],"name":"btreeset"}}],[11,"known_type","","Return a single `ValueType` if the given variable is known to have a precise type. Returns `None` if the type of the variable is unknown. Returns `None` if the type of the variable is known but not precise -- \"double or integer\" isn't good enough.",4,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"generics":["valuetype"],"name":"option"}}],[11,"known_type_set","","",4,{"inputs":[{"name":"self"},{"name":"variable"}],"output":{"name":"valuetypeset"}}],[11,"is_known_empty","","",4,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[6,"Result","","",null,null],[6,"VariableBindings","","",null,null],[6,"TableAlias","","A specific instance of a table within a query. E.g., \"datoms123\".",null,null],[8,"ColumnName","","",null,null],[10,"column_name","","",23,{"inputs":[{"name":"self"}],"output":{"name":"string"}}],[11,"clone","","",2,{"inputs":[{"name":"self"}],"output":{"name":"known"}}],[11,"for_schema","","",2,{"inputs":[{"name":"schema"}],"output":{"name":"known"}}],[11,"new","","",2,{"inputs":[{"name":"schema"},{"generics":["cachedattributes"],"name":"option"}],"output":{"name":"known"}}],[11,"is_attribute_cached_reverse","","",2,{"inputs":[{"name":"self"},{"name":"u"}],"output":{"name":"bool"}}],[11,"is_attribute_cached_forward","","",2,{"inputs":[{"name":"self"},{"name":"u"}],"output":{"name":"bool"}}],[11,"get_values_for_entid","","",2,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"u"},{"name":"v"}],"output":{"generics":["vec"],"name":"option"}}],[11,"get_value_for_entid","","",2,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"u"},{"name":"v"}],"output":{"generics":["typedvalue"],"name":"option"}}],[11,"get_entid_for_value","","",2,{"inputs":[{"name":"self"},{"name":"u"},{"name":"typedvalue"}],"output":{"generics":["entid"],"name":"option"}}],[11,"get_entids_for_value","","",2,{"inputs":[{"name":"self"},{"name":"u"},{"name":"typedvalue"}],"output":{"generics":["btreeset"],"name":"option"}}],[11,"fmt","","",3,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"is_known_empty","","",3,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_fully_bound","","Return true if every variable in the find spec is fully bound to a single value.",3,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"is_fully_unit_bound","","Return true if every variable in the find spec is fully bound to a single value, and evaluating the query doesn't require running SQL.",3,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"unbound_variables","","Return a set of the input variables mentioned in the `:in` clause that have not yet been bound. We do this by looking at the CC.",3,{"inputs":[{"name":"self"}],"output":{"generics":["variable"],"name":"btreeset"}}],[11,"simple","","",1,{"inputs":[{"name":"findspec"},{"generics":["whereclause"],"name":"vec"}],"output":{"name":"findquery"}}],[11,"from_parsed_query","","",1,{"inputs":[{"name":"parsedquery"}],"output":{"generics":["findquery"],"name":"result"}}],[14,"bail","","",null,null]],"paths":[[3,"InvalidBinding"],[3,"FindQuery"],[3,"Known"],[3,"AlgebraicQuery"],[3,"ConjoiningClauses"],[3,"ColumnAlternation"],[3,"ColumnIntersection"],[3,"OrderBy"],[3,"QualifiedAlias"],[3,"SourceAlias"],[4,"AlgebrizerError"],[4,"BindingError"],[4,"EmptyBecause"],[4,"Column"],[4,"ColumnConstraint"],[4,"ColumnConstraintOrAlternation"],[4,"ComputedTable"],[4,"DatomsColumn"],[4,"DatomsTable"],[4,"FulltextColumn"],[4,"QueryValue"],[4,"VariableColumn"],[3,"QueryInputs"],[8,"ColumnName"]]}; +searchIndex["mentat_query_projector"] = {"doc":"","items":[[3,"ConstantProjector","mentat_query_projector","A projector that produces a `QueryResult` containing fixed data. Takes a boxed function that should return an empty result set of the desired type.",null,null],[3,"RelResult","","The result you get from a 'rel' query, like:",null,null],[12,"width","","",0,null],[12,"values","","",0,null],[3,"QueryOutput","","",null,null],[12,"spec","","",1,null],[12,"results","","",1,null],[3,"CombinedProjection","","Combines the things you need to turn a query into SQL and turn its results into `QueryResults`: SQL-related projection information (`DISTINCT`, columns, etc.) and a Datalog projector that turns SQL into structures.",null,null],[12,"sql_projection","","A SQL projection, mapping columns mentioned in the body of the query to columns in the output.",2,null],[12,"pre_aggregate_projection","","If a query contains aggregates, we need to generate a nested subquery: an inner query that returns our distinct variable bindings (and any `:with` vars), and an outer query that applies aggregation. That's so we can put `DISTINCT` in the inner query and apply aggregation afterwards -- `SELECT DISTINCT count(foo)` counts then uniques, and we need the opposite to implement Datalog distinct semantics. If this is the case, `sql_projection` will be the outer query's projection list, and `pre_aggregate_projection` will be the inner. If the query doesn't use aggregation, this field will be `None`.",2,null],[12,"datalog_projector","","A Datalog projection. This consumes rows of the appropriate shape (as defined by the SQL projection) to yield one of the four kinds of Datalog query result.",2,null],[12,"distinct","","True if this query requires the SQL query to include DISTINCT.",2,null],[12,"group_by_cols","","",2,null],[4,"SimpleAggregationOp","","",null,null],[13,"Avg","","",3,null],[13,"Count","","",3,null],[13,"Max","","",3,null],[13,"Min","","",3,null],[13,"Sum","","",3,null],[4,"QueryResults","","",null,null],[13,"Scalar","","",4,null],[13,"Tuple","","",4,null],[13,"Coll","","",4,null],[13,"Rel","","",4,null],[5,"projected_column_for_var","","Return the projected column -- that is, a value or SQL column and an associated name -- for a given variable. Also return the type. Callers are expected to determine whether to project a type tag as an additional SQL column.",null,{"inputs":[{"name":"variable"},{"name":"conjoiningclauses"}],"output":{"name":"result"}}],[5,"query_projection","","Compute a suitable SQL projection for an algebrized query. This takes into account a number of things: - The variable list in the find spec. - The presence of any aggregate operations in the find spec. TODO: for now we only handle simple variables - The bindings established by the topmost CC. - The types known at algebrizing time. - The types extracted from the store for unknown attributes.",null,{"inputs":[{"name":"schema"},{"name":"algebraicquery"}],"output":{"generics":["either"],"name":"result"}}],[0,"errors","","",null,null],[4,"ProjectorError","mentat_query_projector::errors","",null,null],[13,"NotYetImplemented","","We're just not done yet. Message that the feature is recognized but not yet implemented.",5,null],[13,"CannotProjectImpossibleBinding","","",5,null],[13,"CannotApplyAggregateOperationToTypes","","",5,null],[13,"InvalidProjection","","",5,null],[13,"UnboundVariable","","",5,null],[13,"NoTypeAvailableForVariable","","",5,null],[13,"UnexpectedResultsType","","",5,null],[13,"AmbiguousAggregates","","",5,null],[6,"Result","","",null,null],[11,"fmt","","",5,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"cause","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["fail"],"name":"option"}}],[11,"backtrace","","",5,{"inputs":[{"name":"self"}],"output":{"generics":["backtrace"],"name":"option"}}],[11,"fmt","","",5,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"clone","mentat_query_projector","",3,{"inputs":[{"name":"self"}],"output":{"name":"simpleaggregationop"}}],[11,"fmt","","",3,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",3,{"inputs":[{"name":"self"},{"name":"simpleaggregationop"}],"output":{"name":"bool"}}],[11,"new","","",6,{"inputs":[{"generics":["findspec"],"name":"rc"},{"generics":["fn"],"name":"box"}],"output":{"name":"constantprojector"}}],[11,"project_without_rows","","",6,{"inputs":[{"name":"self"}],"output":{"generics":["queryoutput"],"name":"result"}}],[11,"project","","",6,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"connection"},{"name":"rows"}],"output":{"generics":["queryoutput"],"name":"result"}}],[11,"columns","","",6,{"inputs":[{"name":"self"}],"output":{"generics":["iterator"],"name":"box"}}],[11,"clone","","",0,{"inputs":[{"name":"self"}],"output":{"name":"relresult"}}],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",0,{"inputs":[{"name":"self"},{"name":"relresult"}],"output":{"name":"bool"}}],[11,"ne","","",0,{"inputs":[{"name":"self"},{"name":"relresult"}],"output":{"name":"bool"}}],[11,"empty","","",0,{"inputs":[{"name":"usize"}],"output":{"name":"relresult"}}],[11,"is_empty","","",0,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"row_count","","",0,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"rows","","",0,{"inputs":[{"name":"self"}],"output":{"name":"chunks"}}],[11,"row","","",0,{"inputs":[{"name":"self"},{"name":"usize"}],"output":{"name":"option"}}],[11,"from","","",0,{"inputs":[{"generics":["vec"],"name":"vec"}],"output":{"name":"self"}}],[11,"into_iter","","",0,null],[6,"StructuredRelResult","","",null,null],[8,"Projector","","",null,null],[10,"project","","",7,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"connection"},{"name":"rows"}],"output":{"generics":["queryoutput"],"name":"result"}}],[10,"columns","","",7,{"inputs":[{"name":"self"}],"output":{"generics":["iterator"],"name":"box"}}],[11,"fmt","","",1,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",1,{"inputs":[{"name":"self"},{"name":"queryoutput"}],"output":{"name":"bool"}}],[11,"ne","","",1,{"inputs":[{"name":"self"},{"name":"queryoutput"}],"output":{"name":"bool"}}],[11,"clone","","",4,{"inputs":[{"name":"self"}],"output":{"name":"queryresults"}}],[11,"fmt","","",4,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",4,{"inputs":[{"name":"self"},{"name":"queryresults"}],"output":{"name":"bool"}}],[11,"ne","","",4,{"inputs":[{"name":"self"},{"name":"queryresults"}],"output":{"name":"bool"}}],[11,"from","","",4,{"inputs":[{"name":"queryoutput"}],"output":{"name":"queryresults"}}],[11,"empty_factory","","",1,{"inputs":[{"name":"findspec"}],"output":{"generics":["fn"],"name":"box"}}],[11,"len","","",1,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"is_empty","","",1,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"empty","","",1,{"inputs":[{"name":"rc"}],"output":{"name":"queryoutput"}}],[11,"from_constants","","",1,{"inputs":[{"name":"rc"},{"name":"variablebindings"}],"output":{"name":"queryresults"}}],[11,"into_scalar","","",1,{"inputs":[{"name":"self"}],"output":{"generics":["option"],"name":"result"}}],[11,"into_coll","","",1,{"inputs":[{"name":"self"}],"output":{"generics":["vec"],"name":"result"}}],[11,"into_tuple","","",1,{"inputs":[{"name":"self"}],"output":{"generics":["option"],"name":"result"}}],[11,"into_rel","","",1,{"inputs":[{"name":"self"}],"output":{"generics":["relresult"],"name":"result"}}],[11,"len","","",4,{"inputs":[{"name":"self"}],"output":{"name":"usize"}}],[11,"is_empty","","",4,{"inputs":[{"name":"self"}],"output":{"name":"bool"}}],[11,"into_scalar","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["option"],"name":"result"}}],[11,"into_coll","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["vec"],"name":"result"}}],[11,"into_tuple","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["option"],"name":"result"}}],[11,"into_rel","","",4,{"inputs":[{"name":"self"}],"output":{"generics":["relresult"],"name":"result"}}],[14,"bail","","",null,null]],"paths":[[3,"RelResult"],[3,"QueryOutput"],[3,"CombinedProjection"],[4,"SimpleAggregationOp"],[4,"QueryResults"],[4,"ProjectorError"],[3,"ConstantProjector"],[8,"Projector"]]}; +searchIndex["mentat_query_pull"] = {"doc":"","items":[[3,"Puller","mentat_query_pull","A `Puller` constructs on demand a map from a provided set of entity IDs to a set of structured maps.",null,null],[5,"pull_attributes_for_entity","","",null,{"inputs":[{"name":"schema"},{"name":"connection"},{"name":"entid"},{"name":"a"}],"output":{"generics":["structuredmap"],"name":"result"}}],[5,"pull_attributes_for_entities","","",null,{"inputs":[{"name":"schema"},{"name":"connection"},{"name":"e"},{"name":"a"}],"output":{"generics":["btreemap"],"name":"result"}}],[0,"errors","","",null,null],[4,"PullError","mentat_query_pull::errors","",null,null],[13,"UnnamedAttribute","","",0,null],[13,"RepeatedDbId","","",0,null],[6,"Result","","",null,null],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"cause","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["fail"],"name":"option"}}],[11,"backtrace","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["backtrace"],"name":"option"}}],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"prepare","mentat_query_pull","",1,{"inputs":[{"name":"schema"},{"generics":["pullattributespec"],"name":"vec"}],"output":{"generics":["puller"],"name":"result"}}],[11,"pull","","",1,{"inputs":[{"name":"self"},{"name":"schema"},{"name":"connection"},{"name":"e"}],"output":{"generics":["btreemap"],"name":"result"}}]],"paths":[[4,"PullError"],[3,"Puller"]]}; +searchIndex["mentat_query_sql"] = {"doc":"","items":[[3,"ProjectedColumn","mentat_query_sql","",null,null],[12,"0","","",0,null],[12,"1","","",0,null],[3,"Op","","",null,null],[12,"0","","",1,null],[3,"TableList","","",null,null],[12,"0","","",2,null],[3,"Join","","",null,null],[3,"SelectQuery","","",null,null],[12,"distinct","","",3,null],[12,"projection","","",3,null],[12,"from","","",3,null],[12,"constraints","","",3,null],[12,"group_by","","",3,null],[12,"order","","",3,null],[12,"limit","","",3,null],[4,"ColumnOrExpression","","One of the things that can appear in a projection or a constraint. Note that we use `TypedValue` here; it's not pure SQL, but it avoids us having to concern ourselves at this point with the translation between a `TypedValue` and the storage-layer representation.",null,null],[13,"Column","","",4,null],[13,"ExistingColumn","","",4,null],[13,"Entid","","",4,null],[13,"Integer","","",4,null],[13,"Long","","",4,null],[13,"Value","","",4,null],[13,"NullableAggregate","","",4,null],[13,"Expression","","",4,null],[4,"Expression","","",null,null],[13,"Unary","","",5,null],[12,"sql_op","mentat_query_sql::Expression","",5,null],[12,"arg","","",5,null],[4,"Projection","mentat_query_sql","",null,null],[13,"Columns","","",6,null],[13,"Star","","",6,null],[13,"One","","",6,null],[4,"GroupBy","","",null,null],[13,"ProjectedColumn","","",7,null],[13,"QueryColumn","","",7,null],[4,"Constraint","","",null,null],[13,"Infix","","",8,null],[12,"op","mentat_query_sql::Constraint","",8,null],[12,"left","","",8,null],[12,"right","","",8,null],[13,"Or","mentat_query_sql","",8,null],[12,"constraints","mentat_query_sql::Constraint","",8,null],[13,"And","mentat_query_sql","",8,null],[12,"constraints","mentat_query_sql::Constraint","",8,null],[13,"In","mentat_query_sql","",8,null],[12,"left","mentat_query_sql::Constraint","",8,null],[12,"list","","",8,null],[13,"IsNull","mentat_query_sql","",8,null],[12,"value","mentat_query_sql::Constraint","",8,null],[13,"IsNotNull","mentat_query_sql","",8,null],[12,"value","mentat_query_sql::Constraint","",8,null],[13,"NotExists","mentat_query_sql","",8,null],[12,"subquery","mentat_query_sql::Constraint","",8,null],[13,"TypeCheck","mentat_query_sql","",8,null],[12,"value","mentat_query_sql::Constraint","",8,null],[12,"affinity","","",8,null],[4,"TableOrSubquery","mentat_query_sql","",null,null],[13,"Table","","",9,null],[13,"Union","","",9,null],[13,"Subquery","","",9,null],[13,"Values","","",9,null],[4,"Values","","",null,null],[13,"Unnamed","","Like \"VALUES (0, 1), (2, 3), ...\". The vector must be of a length that is a multiple of the given size.",10,null],[13,"Named","","Like \"SELECT 0 AS x, SELECT 0 AS y WHERE 0 UNION ALL VALUES (0, 1), (2, 3), ...\". The vector of values must be of a length that is a multiple of the length of the vector of names.",10,null],[4,"FromClause","","",null,null],[13,"TableList","","",11,null],[13,"Join","","",11,null],[13,"Nothing","","",11,null],[6,"Name","","",null,null],[11,"from","","",4,{"inputs":[{"name":"queryvalue"}],"output":{"name":"self"}}],[11,"fmt","","",7,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"eq","","",7,{"inputs":[{"name":"self"},{"name":"groupby"}],"output":{"name":"bool"}}],[11,"ne","","",7,{"inputs":[{"name":"self"},{"name":"groupby"}],"output":{"name":"bool"}}],[11,"push_sql","","",7,{"inputs":[{"name":"self"},{"name":"querybuilder"}],"output":{"name":"buildqueryresult"}}],[11,"clone","","",1,{"inputs":[{"name":"self"}],"output":{"name":"op"}}],[11,"not_equal","","",8,{"inputs":[{"name":"columnorexpression"},{"name":"columnorexpression"}],"output":{"name":"constraint"}}],[11,"equal","","",8,{"inputs":[{"name":"columnorexpression"},{"name":"columnorexpression"}],"output":{"name":"constraint"}}],[11,"fulltext_match","","",8,{"inputs":[{"name":"columnorexpression"},{"name":"columnorexpression"}],"output":{"name":"constraint"}}],[11,"push_sql","","",4,{"inputs":[{"name":"self"},{"name":"querybuilder"}],"output":{"name":"buildqueryresult"}}],[11,"push_sql","","",5,{"inputs":[{"name":"self"},{"name":"querybuilder"}],"output":{"name":"buildqueryresult"}}],[11,"push_sql","","",6,{"inputs":[{"name":"self"},{"name":"querybuilder"}],"output":{"name":"buildqueryresult"}}],[11,"push_sql","","",1,{"inputs":[{"name":"self"},{"name":"querybuilder"}],"output":{"name":"buildqueryresult"}}],[11,"push_sql","","",8,{"inputs":[{"name":"self"},{"name":"querybuilder"}],"output":{"name":"buildqueryresult"}}],[11,"push_sql","","",2,{"inputs":[{"name":"self"},{"name":"querybuilder"}],"output":{"name":"buildqueryresult"}}],[11,"push_sql","","",12,{"inputs":[{"name":"self"},{"name":"querybuilder"}],"output":{"name":"buildqueryresult"}}],[11,"push_sql","","",9,{"inputs":[{"name":"self"},{"name":"querybuilder"}],"output":{"name":"buildqueryresult"}}],[11,"push_sql","","",10,{"inputs":[{"name":"self"},{"name":"querybuilder"}],"output":{"name":"buildqueryresult"}}],[11,"push_sql","","",11,{"inputs":[{"name":"self"},{"name":"querybuilder"}],"output":{"name":"buildqueryresult"}}],[11,"push_sql","","",3,{"inputs":[{"name":"self"},{"name":"querybuilder"}],"output":{"name":"buildqueryresult"}}],[11,"to_sql_query","","",3,{"inputs":[{"name":"self"}],"output":{"generics":["sqlquery","sqlerror"],"name":"result"}}]],"paths":[[3,"ProjectedColumn"],[3,"Op"],[3,"TableList"],[3,"SelectQuery"],[4,"ColumnOrExpression"],[4,"Expression"],[4,"Projection"],[4,"GroupBy"],[4,"Constraint"],[4,"TableOrSubquery"],[4,"Values"],[4,"FromClause"],[3,"Join"]]}; +searchIndex["mentat_query_translator"] = {"doc":"","items":[[4,"Projection","mentat_query_translator","",null,null],[13,"Columns","","",0,null],[13,"Star","","",0,null],[13,"One","","",0,null],[4,"ProjectedSelect","","",null,null],[13,"Constant","","",1,null],[13,"Query","","",1,null],[12,"query","mentat_query_translator::ProjectedSelect","",1,null],[12,"projector","","",1,null],[5,"cc_to_exists","mentat_query_translator","Return a query that projects `1` if the `cc` matches the store, and returns no results if it doesn't.",null,{"inputs":[{"name":"conjoiningclauses"}],"output":{"name":"selectquery"}}],[5,"query_to_select","","Consume a provided `AlgebraicQuery` to yield a new `ProjectedSelect`.",null,{"inputs":[{"name":"schema"},{"name":"algebraicquery"}],"output":{"generics":["projectedselect","error"],"name":"result"}}],[11,"push_sql","","",0,{"inputs":[{"name":"self"},{"name":"querybuilder"}],"output":{"generics":["sqlerror"],"name":"result"}}]],"paths":[[4,"Projection"],[4,"ProjectedSelect"]]}; +searchIndex["mentat_sql"] = {"doc":"","items":[[4,"Value","mentat_sql","Owning dynamic type value. Value's type is typically dictated by SQLite (not by the caller).",null,null],[13,"Null","","The value is a `NULL` value.",0,null],[13,"Integer","","The value is a signed integer.",0,null],[13,"Real","","The value is a floating point number.",0,null],[13,"Text","","The value is a text string.",0,null],[13,"Blob","","The value is a blob of data",0,null],[3,"SQLQuery","","We want to accumulate values that will later be substituted into a SQL statement execution. This struct encapsulates the generated string and the initial argument list. Additional user-supplied argument bindings, with their placeholders accumulated via `push_bind_param`, will be appended to this argument list.",null,null],[12,"sql","","",1,null],[12,"args","","These will eventually perhaps be rusqlite `ToSql` instances.",1,null],[3,"SQLiteQueryBuilder","","A QueryBuilder that implements SQLite's specific escaping rules.",null,null],[12,"sql","","",2,null],[4,"SQLError","","",null,null],[13,"InvalidParameterName","","",3,null],[13,"BindParamCouldBeGenerated","","",3,null],[6,"BuildQueryResult","","",null,null],[8,"QueryBuilder","","Gratefully based on Diesel's QueryBuilder trait: https://github.com/diesel-rs/diesel/blob/4885f61b8205f7f3c2cfa03837ed6714831abe6b/diesel/src/query_builder/mod.rs#L56",null,null],[10,"push_sql","","",4,{"inputs":[{"name":"self"},{"name":"str"}],"output":null}],[10,"push_identifier","","",4,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"name":"buildqueryresult"}}],[10,"push_typed_value","","",4,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"buildqueryresult"}}],[10,"push_bind_param","","",4,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"name":"buildqueryresult"}}],[10,"finish","","",4,{"inputs":[{"name":"self"}],"output":{"name":"sqlquery"}}],[8,"QueryFragment","","",null,null],[10,"push_sql","","",5,{"inputs":[{"name":"self"},{"name":"querybuilder"}],"output":{"name":"buildqueryresult"}}],[11,"fmt","","",3,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"cause","","",3,{"inputs":[{"name":"self"}],"output":{"generics":["fail"],"name":"option"}}],[11,"backtrace","","",3,{"inputs":[{"name":"self"}],"output":{"generics":["backtrace"],"name":"option"}}],[11,"fmt","","",3,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"new","","",2,{"inputs":[],"output":{"name":"self"}}],[11,"with_prefix","","",2,{"inputs":[{"name":"string"}],"output":{"name":"self"}}],[11,"push_sql","","",2,{"inputs":[{"name":"self"},{"name":"str"}],"output":null}],[11,"push_identifier","","",2,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"name":"buildqueryresult"}}],[11,"push_typed_value","","",2,{"inputs":[{"name":"self"},{"name":"typedvalue"}],"output":{"name":"buildqueryresult"}}],[11,"push_bind_param","","Our bind parameters will be interleaved with pushed `TypedValue` instances. That means we need to use named parameters, not positional parameters. The `name` argument to this method is expected to be alphanumeric. If not, this method returns an `InvalidParameterName` error result. Callers should make sure that the name doesn't overlap with generated parameter names. If it does, `BindParamCouldBeGenerated` is the error.",2,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"name":"buildqueryresult"}}],[11,"finish","","",2,{"inputs":[{"name":"self"}],"output":{"name":"sqlquery"}}],[11,"data_type","","",0,{"inputs":[{"name":"self"}],"output":{"name":"type"}}],[11,"clone","","",0,{"inputs":[{"name":"self"}],"output":{"name":"value"}}],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"generics":["error"],"name":"result"}}],[11,"column_result","","",0,{"inputs":[{"name":"valueref"}],"output":{"generics":["value","fromsqlerror"],"name":"result"}}],[11,"to_sql","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["tosqloutput","error"],"name":"result"}}],[11,"from","","",0,{"inputs":[{"name":"i16"}],"output":{"name":"value"}}],[11,"from","","",0,{"inputs":[{"name":"isize"}],"output":{"name":"value"}}],[11,"from","","",0,{"inputs":[{"name":"bool"}],"output":{"name":"value"}}],[11,"from","","",0,{"inputs":[{"name":"i32"}],"output":{"name":"value"}}],[11,"from","","",0,{"inputs":[{"name":"null"}],"output":{"name":"value"}}],[11,"from","","",0,{"inputs":[{"name":"i8"}],"output":{"name":"value"}}],[11,"from","","",0,{"inputs":[{"name":"u8"}],"output":{"name":"value"}}],[11,"from","","",0,{"inputs":[{"generics":["u8"],"name":"vec"}],"output":{"name":"value"}}],[11,"from","","",0,{"inputs":[{"name":"u16"}],"output":{"name":"value"}}],[11,"from","","",0,{"inputs":[{"name":"u32"}],"output":{"name":"value"}}],[11,"from","","",0,{"inputs":[{"name":"string"}],"output":{"name":"value"}}],[11,"from","","",0,{"inputs":[{"name":"i64"}],"output":{"name":"value"}}],[11,"from","","",0,{"inputs":[{"name":"valueref"}],"output":{"name":"value"}}],[11,"from","","",0,{"inputs":[{"name":"f64"}],"output":{"name":"value"}}],[11,"eq","","",0,{"inputs":[{"name":"self"},{"name":"value"}],"output":{"name":"bool"}}],[11,"ne","","",0,{"inputs":[{"name":"self"},{"name":"value"}],"output":{"name":"bool"}}]],"paths":[[4,"Value"],[3,"SQLQuery"],[3,"SQLiteQueryBuilder"],[4,"SQLError"],[8,"QueryBuilder"],[8,"QueryFragment"]]}; +searchIndex["mentat_tolstoy"] = {"doc":"","items":[[0,"errors","mentat_tolstoy","",null,null],[4,"TolstoyError","mentat_tolstoy::errors","",null,null],[13,"BadServerResponse","","",0,null],[13,"DuplicateMetadata","","",0,null],[13,"TxProcessorUnfinished","","",0,null],[13,"TxIncorrectlyMapped","","",0,null],[13,"UnexpectedState","","",0,null],[13,"NotYetImplemented","","",0,null],[6,"Result","","",null,null],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"cause","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["fail"],"name":"option"}}],[11,"backtrace","","",0,{"inputs":[{"name":"self"}],"output":{"generics":["backtrace"],"name":"option"}}],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[0,"schema","mentat_tolstoy","",null,null],[5,"ensure_current_version","mentat_tolstoy::schema","",null,{"inputs":[{"name":"connection"}],"output":{"name":"result"}}],[7,"REMOTE_HEAD_KEY","","",null,null],[0,"metadata","mentat_tolstoy","",null,null],[3,"SyncMetadataClient","mentat_tolstoy::metadata","",null,null],[8,"HeadTrackable","","",null,null],[10,"remote_head","","",1,{"inputs":[{"name":"transaction"}],"output":{"generics":["uuid"],"name":"result"}}],[10,"set_remote_head","","",1,{"inputs":[{"name":"transaction"},{"name":"uuid"}],"output":{"name":"result"}}],[11,"remote_head","","",2,{"inputs":[{"name":"transaction"}],"output":{"generics":["uuid"],"name":"result"}}],[11,"set_remote_head","","",2,{"inputs":[{"name":"transaction"},{"name":"uuid"}],"output":{"name":"result"}}],[0,"tx_processor","mentat_tolstoy","",null,null],[3,"TxPart","mentat_tolstoy::tx_processor","",null,null],[12,"e","","",3,null],[12,"a","","",3,null],[12,"v","","",3,null],[12,"tx","","",3,null],[12,"added","","",3,null],[3,"Processor","","",null,null],[3,"DatomsIterator","","",null,null],[8,"TxReceiver","","",null,null],[10,"tx","","",4,{"inputs":[{"name":"self"},{"name":"entid"},{"name":"t"}],"output":{"name":"result"}}],[10,"done","","",4,{"inputs":[{"name":"self"}],"output":{"name":"result"}}],[11,"fmt","","",3,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"clone","","",3,{"inputs":[{"name":"self"}],"output":{"name":"txpart"}}],[11,"next","","",5,{"inputs":[{"name":"self"}],"output":{"name":"option"}}],[11,"process","","",6,{"inputs":[{"name":"transaction"},{"generics":["entid"],"name":"option"},{"name":"r"}],"output":{"name":"result"}}],[0,"syncer","mentat_tolstoy","",null,null],[3,"Syncer","mentat_tolstoy::syncer","",null,null],[5,"d","","",null,{"inputs":[{"name":"str"}],"output":null}],[11,"flow","","",7,{"inputs":[{"name":"connection"},{"name":"string"},{"name":"uuid"}],"output":{"name":"result"}}],[0,"tx_mapper","mentat_tolstoy","",null,null],[3,"TxMapper","mentat_tolstoy::tx_mapper","",null,null],[11,"set_bulk","","",8,{"inputs":[{"name":"transaction"},{"name":"hashmap"}],"output":{"name":"result"}}],[11,"get_or_set_uuid_for_tx","","",8,{"inputs":[{"name":"transaction"},{"name":"entid"}],"output":{"generics":["uuid"],"name":"result"}}],[11,"get_tx_for_uuid","","",8,{"inputs":[{"name":"transaction"},{"name":"uuid"}],"output":{"generics":["option"],"name":"result"}}],[11,"get","","",8,{"inputs":[{"name":"transaction"},{"name":"entid"}],"output":{"generics":["option"],"name":"result"}}],[14,"bail","mentat_tolstoy","",null,null]],"paths":[[4,"TolstoyError"],[8,"HeadTrackable"],[3,"SyncMetadataClient"],[3,"TxPart"],[8,"TxReceiver"],[3,"DatomsIterator"],[3,"Processor"],[3,"Syncer"],[3,"TxMapper"]]}; +initSearch(searchIndex); diff --git a/docs/apis/rust/0.7.0/src/edn/entities.rs.html b/docs/apis/rust/0.7.0/src/edn/entities.rs.html new file mode 100644 index 00000000..244d341d --- /dev/null +++ b/docs/apis/rust/0.7.0/src/edn/entities.rs.html @@ -0,0 +1,392 @@ + + + + + + + + + + entities.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+//! This module defines core types that support the transaction processor.
+
+use std::collections::BTreeMap;
+use std::fmt;
+
+use symbols::{
+    Keyword,
+    PlainSymbol,
+};
+
+/// A tempid, either an external tempid given in a transaction (usually as an `Value::Text`),
+/// or an internal tempid allocated by Mentat itself.
+#[derive(Clone, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub enum TempId {
+    External(String),
+    Internal(i64),
+}
+
+impl TempId {
+    pub fn into_external(self) -> Option<String> {
+        match self {
+            TempId::External(s) => Some(s),
+            TempId::Internal(_) => None,
+        }
+    }
+}
+
+impl fmt::Display for TempId {
+    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+        match self {
+            &TempId::External(ref s) => write!(f, "{}", s),
+            &TempId::Internal(x) => write!(f, "<tempid {}>", x),
+        }
+    }
+}
+
+#[derive(Clone, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub enum Entid {
+    Entid(i64),
+    Ident(Keyword),
+}
+
+impl Entid {
+    pub fn unreversed(&self) -> Option<Entid> {
+        match self {
+            &Entid::Entid(_) => None,
+            &Entid::Ident(ref a) => a.unreversed().map(Entid::Ident),
+        }
+    }
+}
+
+#[derive(Clone, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub struct LookupRef<V> {
+    pub a: AttributePlace,
+    // In theory we could allow nested lookup-refs.  In practice this would require us to process
+    // lookup-refs in multiple phases, like how we resolve tempids, which isn't worth the effort.
+    pub v: V, // An atom.
+}
+
+/// A "transaction function" that exposes some value determined by the current transaction.  The
+/// prototypical example is the current transaction ID, `(transaction-tx)`.
+///
+/// A natural next step might be to expose the current transaction instant `(transaction-instant)`,
+/// but that's more difficult: the transaction itself can set the transaction instant (with some
+/// restrictions), so the transaction function must be late-binding.  Right now, that's difficult to
+/// arrange in the transactor.
+///
+/// In the future, we might accept arguments; for example, perhaps we might expose `(ancestor
+/// (transaction-tx) n)` to find the n-th ancestor of the current transaction.  If we do accept
+/// arguments, then the special case of `(lookup-ref a v)` should be handled as part of the
+/// generalization.
+#[derive(Clone, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub struct TxFunction {
+    pub op: PlainSymbol,
+}
+
+pub type MapNotation<V> = BTreeMap<Entid, ValuePlace<V>>;
+
+#[derive(Clone, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub enum ValuePlace<V> {
+    // We never know at parse-time whether an integer or ident is really an entid, but we will often
+    // know when building entities programmatically.
+    Entid(Entid),
+    // We never know at parse-time whether a string is really a tempid, but we will often know when
+    // building entities programmatically.
+    TempId(TempId),
+    LookupRef(LookupRef<V>),
+    TxFunction(TxFunction),
+    Vector(Vec<ValuePlace<V>>),
+    Atom(V),
+    MapNotation(MapNotation<V>),
+}
+
+#[derive(Clone, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub enum EntityPlace<V> {
+    Entid(Entid),
+    TempId(TempId),
+    LookupRef(LookupRef<V>),
+    TxFunction(TxFunction),
+}
+
+#[derive(Clone, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub enum AttributePlace {
+    Entid(Entid),
+}
+
+#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub enum OpType {
+    Add,
+    Retract,
+}
+
+#[derive(Clone, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub enum Entity<V> {
+    // Like [:db/add|:db/retract e a v].
+    AddOrRetract {
+        op: OpType,
+        e: EntityPlace<V>,
+        a: AttributePlace,
+        v: ValuePlace<V>,
+    },
+    // Like {:db/id "tempid" a1 v1 a2 v2}.
+    MapNotation(MapNotation<V>),
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/edn/lib.rs.html b/docs/apis/rust/0.7.0/src/edn/lib.rs.html new file mode 100644 index 00000000..5ef1d8d3 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/edn/lib.rs.html @@ -0,0 +1,258 @@ + + + + + + + + + + lib.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+extern crate chrono;
+extern crate itertools;
+extern crate num;
+extern crate ordered_float;
+extern crate pretty;
+extern crate uuid;
+
+#[cfg(feature = "serde_support")]
+extern crate serde;
+
+#[cfg(feature = "serde_support")]
+#[macro_use]
+extern crate serde_derive;
+
+pub mod entities;
+// Intentionally not pub.
+mod namespaceable_name;
+pub mod query;
+pub mod symbols;
+pub mod types;
+pub mod pretty_print;
+pub mod utils;
+pub mod matcher;
+pub mod value_rc;
+pub use value_rc::{
+    Cloned,
+    FromRc,
+    ValueRc,
+};
+
+pub mod parse {
+    include!(concat!(env!("OUT_DIR"), "/edn.rs"));
+}
+
+// Re-export the types we use.
+pub use chrono::{DateTime, Utc};
+pub use num::BigInt;
+pub use ordered_float::OrderedFloat;
+pub use uuid::Uuid;
+
+// Export from our modules.
+pub use parse::ParseError;
+pub use uuid::ParseError as UuidParseError;
+pub use types::{
+    FromMicros,
+    Span,
+    SpannedValue,
+    ToMicros,
+    Value,
+    ValueAndSpan,
+};
+
+pub use symbols::{
+    Keyword,
+    NamespacedSymbol,
+    PlainSymbol,
+};
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/edn/matcher.rs.html b/docs/apis/rust/0.7.0/src/edn/matcher.rs.html new file mode 100644 index 00000000..63d916a1 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/edn/matcher.rs.html @@ -0,0 +1,1286 @@ + + + + + + + + + + matcher.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::collections::HashMap;
+use std::cell::RefCell;
+use itertools::diff_with;
+
+use symbols;
+use types::Value;
+
+/// A trait defining pattern matching rules for any given pattern of type `T`.
+trait PatternMatchingRules<'a, T> {
+    /// Return true if the given pattern matches an arbitrary value.
+    fn matches_any(pattern: &T) -> bool;
+
+    /// Return the placeholder name if the given pattern matches a placeholder.
+    fn matches_placeholder(pattern: &'a T) -> Option<(&'a String)>;
+}
+
+/// A default type implementing `PatternMatchingRules` specialized on
+/// EDN values using plain symbols as patterns. These patterns are:
+/// * `_` matches arbitrary sub-EDN;
+/// * `?name` matches sub-EDN, which must be identical each place `?name` appears;
+struct DefaultPatternMatchingRules;
+
+impl<'a> PatternMatchingRules<'a, Value> for DefaultPatternMatchingRules {
+    fn matches_any(pattern: &Value) -> bool {
+        match *pattern {
+            Value::PlainSymbol(symbols::PlainSymbol(ref s)) => s.starts_with('_'),
+            _ => false
+        }
+    }
+
+    fn matches_placeholder(pattern: &'a Value) -> Option<(&'a String)> {
+        match *pattern {
+            Value::PlainSymbol(symbols::PlainSymbol(ref s)) => if s.starts_with('?') { Some(s) } else { None },
+            _ => None
+        }
+    }
+}
+
+/// Pattern matcher for EDN values utilizing specified pattern matching rules.
+/// For example, using this with `DefaultPatternMatchingRules`:
+/// * `[_]` matches an arbitrary one-element vector;
+/// * `[_ _]` matches an arbitrary two-element vector;
+/// * `[?x ?x]` matches `[1 1]` and `[#{} #{}]` but not `[1 2]` or `[[] #{}]`;
+struct Matcher<'a> {
+    placeholders: RefCell<HashMap<&'a String, &'a Value>>
+}
+
+impl<'a> Matcher<'a> {
+    /// Creates a Matcher instance.
+    fn new() -> Matcher<'a> {
+        Matcher {
+            placeholders: RefCell::default()
+        }
+    }
+
+    /// Performs pattern matching between two EDN `Value` instances (`value`
+    /// and `pattern`) utilizing a specified pattern matching ruleset `T`.
+    /// Returns true if matching succeeds.
+    fn match_with_rules<T>(value: &'a Value, pattern: &'a Value) -> bool
+    where T: PatternMatchingRules<'a, Value> {
+        let matcher = Matcher::new();
+        matcher.match_internal::<T>(value, pattern)
+    }
+
+    /// Recursively traverses two EDN `Value` instances (`value` and `pattern`)
+    /// performing pattern matching. Note that the internal `placeholders` cache
+    /// might not be empty on invocation.
+    fn match_internal<T>(&self, value: &'a Value, pattern: &'a Value) -> bool
+    where T: PatternMatchingRules<'a, Value> {
+        use Value::*;
+
+        if T::matches_any(pattern) {
+            true
+        } else if let Some(symbol) = T::matches_placeholder(pattern) {
+            let mut placeholders = self.placeholders.borrow_mut();
+            value == *placeholders.entry(symbol).or_insert(value)
+        } else {
+            match (value, pattern) {
+                (&Vector(ref v), &Vector(ref p)) =>
+                    diff_with(v, p, |a, b| self.match_internal::<T>(a, b)).is_none(),
+                (&List(ref v), &List(ref p)) =>
+                    diff_with(v, p, |a, b| self.match_internal::<T>(a, b)).is_none(),
+                (&Set(ref v), &Set(ref p)) =>
+                    v.len() == p.len() &&
+                    v.iter().all(|a| p.iter().any(|b| self.match_internal::<T>(a, b))) &&
+                    p.iter().all(|b| v.iter().any(|a| self.match_internal::<T>(a, b))),
+                (&Map(ref v), &Map(ref p)) =>
+                    v.len() == p.len() &&
+                    v.iter().all(|a| p.iter().any(|b| self.match_internal::<T>(a.0, b.0) && self.match_internal::<T>(a.1, b.1))) &&
+                    p.iter().all(|b| v.iter().any(|a| self.match_internal::<T>(a.0, b.0) && self.match_internal::<T>(a.1, b.1))),
+                _ => value == pattern
+            }
+        }
+    }
+}
+
+impl Value {
+    /// Performs default pattern matching between this value and some `pattern`.
+    /// Returns true if matching succeeds.
+    pub fn matches(&self, pattern: &Value) -> bool {
+        Matcher::match_with_rules::<DefaultPatternMatchingRules>(self, pattern)
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use parse;
+
+    macro_rules! assert_match {
+        ( $pattern:tt, $value:tt, $expected:expr ) => {
+            let pattern = parse::value($pattern).unwrap().without_spans();
+            let value = parse::value($value).unwrap().without_spans();
+            assert_eq!(value.matches(&pattern), $expected);
+        };
+        ( $pattern:tt =~ $value:tt ) => {
+            assert_match!($pattern, $value, true);
+        };
+        ( $pattern:tt !~ $value:tt ) => {
+            assert_match!($pattern, $value, false);
+        }
+    }
+
+    #[test]
+    fn test_match_primitives() {
+        assert_match!("nil" =~ "nil");
+        assert_match!("true" =~ "true");
+        assert_match!("true" !~ "false");
+        assert_match!("1" =~ "1");
+        assert_match!("1" !~ "2");
+        assert_match!("1N" =~ "1N");
+        assert_match!("1N" !~ "2N");
+        assert_match!("1.0" =~ "1.0");
+        assert_match!("1.0" !~ "2.0");
+        assert_match!("\"a\"" =~ "\"a\"");
+        assert_match!("\"a\"" !~ "\"b\"");
+        assert_match!("foo" =~ "foo");
+        assert_match!("foo" !~ "bar");
+        assert_match!("foo/bar" !~ "foo");
+    }
+
+    #[test]
+    fn test_match_collections_sorted() {
+        assert_match!("[nil, true, 1, \"foo\", bar, :baz]" =~ "[nil, true, 1, \"foo\", bar, :baz]");
+        assert_match!("(nil, true, 1, \"foo\", bar, :baz)" =~ "(nil, true, 1, \"foo\", bar, :baz)");
+        assert_match!("#{nil, true, 1, \"foo\", bar, :baz}" =~ "#{nil, true, 1, \"foo\", bar, :baz}");
+        assert_match!("{nil true, 1 \"foo\", bar :baz}" =~ "{nil true, 1 \"foo\", bar :baz}");
+    }
+
+    #[test]
+    fn test_match_collections_unsorted() {
+        assert_match!("[nil, true, 1, \"foo\", bar, :baz]" !~ "[1, \"foo\", nil, true, bar, :baz]");
+        assert_match!("(nil, true, 1, \"foo\", bar, :baz)" !~ "(1, \"foo\", nil, true, bar, :baz)");
+        assert_match!("#{nil, true, 1, \"foo\", bar, :baz}" =~ "#{1, \"foo\", nil, true, bar, :baz}");
+        assert_match!("{nil true, 1 \"foo\", bar :baz}" =~ "{1 \"foo\", nil true, bar :baz}");
+    }
+
+    #[test]
+    fn test_match_maps_switched_key_values() {
+        assert_match!("{1 2, 3 4}" =~ "{1 2, 3 4}");
+        assert_match!("{2 1, 3 4}" !~ "{1 2, 3 4}");
+        assert_match!("{2 1, 4 3}" !~ "{1 2, 3 4}");
+        assert_match!("{1 2, 4 3}" !~ "{1 2, 3 4}");
+    }
+
+    #[test]
+    fn test_match_maps_ordered_collection_keys_and_values() {
+        assert_match!("{[1, 2] (3, 4)}" =~ "{[1, 2] (3, 4)}");
+        assert_match!("{[2, 1] (3, 4)}" !~ "{[1, 2] (3, 4)}");
+        assert_match!("{[2, 1] (4, 3)}" !~ "{[1, 2] (3, 4)}");
+        assert_match!("{[1, 2] (4, 3)}" !~ "{[1, 2] (3, 4)}");
+
+        assert_match!("{(3, 4) [1, 2]}" !~ "{[1, 2] (3, 4)}");
+        assert_match!("{(3, 4) [2, 1]}" !~ "{[1, 2] (3, 4)}");
+        assert_match!("{(4, 3) [2, 1]}" !~ "{[1, 2] (3, 4)}");
+        assert_match!("{(4, 3) [1, 2]}" !~ "{[1, 2] (3, 4)}");
+    }
+
+    #[test]
+    fn test_match_maps_unordered_collection_keys_and_values() {
+        assert_match!("{#{1, 2} #{3, 4}}" =~ "{#{1, 2} #{3, 4}}");
+        assert_match!("{#{2, 1} #{3, 4}}" =~ "{#{1, 2} #{3, 4}}");
+        assert_match!("{#{2, 1} #{4, 3}}" =~ "{#{1, 2} #{3, 4}}");
+        assert_match!("{#{1, 2} #{4, 3}}" =~ "{#{1, 2} #{3, 4}}");
+
+        assert_match!("{#{3, 4} #{1, 2}}" !~ "{#{1, 2} #{3, 4}}");
+        assert_match!("{#{3, 4} #{2, 1}}" !~ "{#{1, 2} #{3, 4}}");
+        assert_match!("{#{4, 3} #{2, 1}}" !~ "{#{1, 2} #{3, 4}}");
+        assert_match!("{#{4, 3} #{1, 2}}" !~ "{#{1, 2} #{3, 4}}");
+    }
+
+    #[test]
+    fn test_match_any_simple() {
+        assert_match!("_" =~ "nil");
+        assert_match!("_" =~ "true");
+        assert_match!("_" =~ "1");
+        assert_match!("_" =~ "1N");
+        assert_match!("_" =~ "1.0");
+        assert_match!("_" =~ "\"a\"");
+        assert_match!("_" =~ "_");
+        assert_match!("_" =~ "symbol");
+        assert_match!("_" =~ "ns/symbol");
+        assert_match!("_" =~ ":keyword");
+        assert_match!("_" =~ ":ns/keyword");
+        assert_match!("_" =~ "[nil, true, 1, \"foo\", bar, :baz]");
+        assert_match!("_" =~ "(nil, true, 1, \"foo\", bar, :baz)");
+        assert_match!("_" =~ "#{nil, true, 1, \"foo\", bar, :baz}");
+        assert_match!("_" =~ "{nil true, 1 \"foo\", bar :baz}");
+    }
+
+    #[test]
+    fn test_match_any_in_same_collection_type_simple() {
+        assert_match!("[_]" =~ "[1]");
+        assert_match!("(_)" =~ "(2)");
+        assert_match!("#{_}" =~ "#{3}");
+        assert_match!("{_ _}" =~ "{4 5}");
+    }
+
+    #[test]
+    fn test_match_any_in_different_collection_type_simple() {
+        assert_match!("[_]" !~ "(1)");
+        assert_match!("(_)" !~ "#{2}");
+        assert_match!("#{_}" !~ "[3]");
+        assert_match!("{_ _}" !~ "[4 5]");
+        assert_match!("{_ _}" !~ "(6 7)");
+        assert_match!("{_ _}" !~ "#{8 9}");
+    }
+
+    #[test]
+    fn test_match_any_in_vector_with_multiple_values() {
+        assert_match!("[_ 2]" =~ "[1 2]");
+        assert_match!("[1 _]" =~ "[1 2]");
+        assert_match!("[1 _ 3 4]" =~ "[1 2 3 4]");
+        assert_match!("[1 [2 [3 _]] 5 [_ 7]]" =~ "[1 [2 [3 4]] 5 [6 7]]");
+
+        assert_match!("[_]" =~ "[[foo bar]]");
+        assert_match!("[_]" =~ "[(foo bar)]");
+        assert_match!("[_]" =~ "[#{foo bar}]");
+        assert_match!("[_]" =~ "[{foo bar}]");
+
+        assert_match!("[_ 2]" !~ "[2 1]");
+        assert_match!("[1 _]" !~ "[2 1]");
+        assert_match!("[1 _ 3]" !~ "[2 1 3]");
+
+        assert_match!("[_ 2]" !~ "[3 4]");
+        assert_match!("[1 _]" !~ "[3 4]");
+    }
+
+    #[test]
+    fn test_match_multiple_any_in_vector_with_multiple_values() {
+        assert_match!("[1 _ _]" =~ "[1 2 3]");
+        assert_match!("[2 _ _]" !~ "[1 2 3]");
+        assert_match!("[3 _ _]" !~ "[1 2 3]");
+        assert_match!("[_ 1 _]" !~ "[1 2 3]");
+        assert_match!("[_ 2 _]" =~ "[1 2 3]");
+        assert_match!("[_ 3 _]" !~ "[1 2 3]");
+        assert_match!("[_ _ 1]" !~ "[1 2 3]");
+        assert_match!("[_ _ 2]" !~ "[1 2 3]");
+        assert_match!("[_ _ 3]" =~ "[1 2 3]");
+
+        assert_match!("[1 _ _]" !~ "[2 1 3]");
+        assert_match!("[2 _ _]" =~ "[2 1 3]");
+        assert_match!("[3 _ _]" !~ "[2 1 3]");
+        assert_match!("[_ 1 _]" =~ "[2 1 3]");
+        assert_match!("[_ 2 _]" !~ "[2 1 3]");
+        assert_match!("[_ 3 _]" !~ "[2 1 3]");
+        assert_match!("[_ _ 1]" !~ "[2 1 3]");
+        assert_match!("[_ _ 2]" !~ "[2 1 3]");
+        assert_match!("[_ _ 3]" =~ "[2 1 3]");
+    }
+
+    #[test]
+    fn test_match_any_in_list_with_multiple_values() {
+        assert_match!("(_ 2)" =~ "(1 2)");
+        assert_match!("(1 _)" =~ "(1 2)");
+        assert_match!("(1 _ 3 4)" =~ "(1 2 3 4)");
+        assert_match!("(1 (2 (3 _)) 5 (_ 7))" =~ "(1 (2 (3 4)) 5 (6 7))");
+
+        assert_match!("(_)" =~ "([foo bar])");
+        assert_match!("(_)" =~ "((foo bar))");
+        assert_match!("(_)" =~ "(#{foo bar})");
+        assert_match!("(_)" =~ "({foo bar})");
+
+        assert_match!("(_ 2)" !~ "(2 1)");
+        assert_match!("(1 _)" !~ "(2 1)");
+        assert_match!("(1 _ 3)" !~ "(2 1 3)");
+
+        assert_match!("(_ 2)" !~ "(3 4)");
+        assert_match!("(1 _)" !~ "(3 4)");
+    }
+
+    #[test]
+    fn test_match_multiple_any_in_list_with_multiple_values() {
+        assert_match!("(1 _ _)" =~ "(1 2 3)");
+        assert_match!("(2 _ _)" !~ "(1 2 3)");
+        assert_match!("(3 _ _)" !~ "(1 2 3)");
+        assert_match!("(_ 1 _)" !~ "(1 2 3)");
+        assert_match!("(_ 2 _)" =~ "(1 2 3)");
+        assert_match!("(_ 3 _)" !~ "(1 2 3)");
+        assert_match!("(_ _ 1)" !~ "(1 2 3)");
+        assert_match!("(_ _ 2)" !~ "(1 2 3)");
+        assert_match!("(_ _ 3)" =~ "(1 2 3)");
+
+        assert_match!("(1 _ _)" !~ "(2 1 3)");
+        assert_match!("(2 _ _)" =~ "(2 1 3)");
+        assert_match!("(3 _ _)" !~ "(2 1 3)");
+        assert_match!("(_ 1 _)" =~ "(2 1 3)");
+        assert_match!("(_ 2 _)" !~ "(2 1 3)");
+        assert_match!("(_ 3 _)" !~ "(2 1 3)");
+        assert_match!("(_ _ 1)" !~ "(2 1 3)");
+        assert_match!("(_ _ 2)" !~ "(2 1 3)");
+        assert_match!("(_ _ 3)" =~ "(2 1 3)");
+    }
+
+    #[test]
+    fn test_match_any_in_set_with_multiple_values() {
+        assert_match!("#{_ 2}" =~ "#{1 2}");
+        assert_match!("#{1 _}" =~ "#{1 2}");
+        assert_match!("#{1 _ 3 4}" =~ "#{1 2 3 4}");
+        assert_match!("#{1 #{2 #{3 _}} 5 #{_ 7}}" =~ "#{1 #{2 #{3 4}} 5 #{6 7}}");
+
+        assert_match!("#{_}" =~ "#{[foo bar]}");
+        assert_match!("#{_}" =~ "#{(foo bar)}");
+        assert_match!("#{_}" =~ "#{#{foo bar}}");
+        assert_match!("#{_}" =~ "#{{foo bar}}");
+
+        assert_match!("#{_ 2}" =~ "#{2 1}");
+        assert_match!("#{1 _}" =~ "#{2 1}");
+        assert_match!("#{1 _ 3}" =~ "#{2 1 3}");
+
+        assert_match!("#{_ 2}" !~ "#{3 4}");
+        assert_match!("#{1 _}" !~ "#{3 4}");
+    }
+
+    #[test]
+    fn test_match_multiple_any_in_set_with_multiple_values() {
+        // These are false because _ is a symbol and sets guarantee
+        // uniqueness of children. So pattern matching will fail because
+        // the pattern is a set of length 2, while the matched edn is a set
+        // of length 3. If _ were unique, all of these assertions would
+        // be true. Need to better handle pattern rules.
+
+        assert_match!("#{1 _ _}" !~ "#{1 2 3}");
+        assert_match!("#{2 _ _}" !~ "#{1 2 3}");
+        assert_match!("#{3 _ _}" !~ "#{1 2 3}");
+        assert_match!("#{_ 1 _}" !~ "#{1 2 3}");
+        assert_match!("#{_ 2 _}" !~ "#{1 2 3}");
+        assert_match!("#{_ 3 _}" !~ "#{1 2 3}");
+        assert_match!("#{_ _ 1}" !~ "#{1 2 3}");
+        assert_match!("#{_ _ 2}" !~ "#{1 2 3}");
+        assert_match!("#{_ _ 3}" !~ "#{1 2 3}");
+
+        assert_match!("#{1 _ _}" !~ "#{2 1 3}");
+        assert_match!("#{2 _ _}" !~ "#{2 1 3}");
+        assert_match!("#{3 _ _}" !~ "#{2 1 3}");
+        assert_match!("#{_ 1 _}" !~ "#{2 1 3}");
+        assert_match!("#{_ 2 _}" !~ "#{2 1 3}");
+        assert_match!("#{_ 3 _}" !~ "#{2 1 3}");
+        assert_match!("#{_ _ 1}" !~ "#{2 1 3}");
+        assert_match!("#{_ _ 2}" !~ "#{2 1 3}");
+        assert_match!("#{_ _ 3}" !~ "#{2 1 3}");
+    }
+
+    #[test]
+    fn test_match_any_in_map_with_multiple_values() {
+        assert_match!("{_ 2}" =~ "{1 2}");
+        assert_match!("{1 _}" =~ "{1 2}");
+        assert_match!("{1 _, 3 4}" =~ "{1 2, 3 4}");
+        assert_match!("{1 {2 {3 _}}, 5 {_ 7}}" =~ "{1 {2 {3 4}}, 5 {6 7}}");
+
+        assert_match!("{_ _}" =~ "{[foo bar] [baz boz]}");
+        assert_match!("{_ _}" =~ "{(foo bar) (baz boz)}");
+        assert_match!("{_ _}" =~ "{#{foo bar} #{baz boz}}");
+        assert_match!("{_ _}" =~ "{{foo bar} {baz boz}}");
+
+        assert_match!("{_ 2, 3 4}" =~ "{3 4, 1 2}");
+        assert_match!("{1 _, 3 4}" =~ "{3 4, 1 2}");
+        assert_match!("{_ _, 3 4}" =~ "{3 4, 1 2}");
+        assert_match!("{1 2, _ 4}" =~ "{3 4, 1 2}");
+        assert_match!("{1 2, 3 _}" =~ "{3 4, 1 2}");
+        assert_match!("{1 2, _ _}" =~ "{3 4, 1 2}");
+        assert_match!("{1 2, _ 4, 5 6}" =~ "{3 4, 1 2, 5 6}");
+        assert_match!("{1 2, 3 _, 5 6}" =~ "{3 4, 1 2, 5 6}");
+        assert_match!("{1 2, _ _, 5 6}" =~ "{3 4, 1 2, 5 6}");
+
+        assert_match!("{_ 2}" !~ "{3 4}");
+        assert_match!("{1 _}" !~ "{3 4}");
+    }
+
+    #[test]
+    fn test_match_multiple_any_in_map_with_multiple_values() {
+        // These are false because _ is a symbol and maps guarantee
+        // uniqueness of keys. So pattern matching will fail because
+        // the pattern is a map of length 2, while the matched edn is a map
+        // of length 3. If _ were unique, all of these assertions would
+        // be true. Need to better handle pattern rules.
+
+        assert_match!("{1 2, _ 4, _ 6}" !~ "{1 2, 3 4, 5 6}");
+        assert_match!("{3 4, _ 6, _ 2}" !~ "{1 2, 3 4, 5 6}");
+        assert_match!("{5 6, _ 2, _ 4}" !~ "{1 2, 3 4, 5 6}");
+
+        assert_match!("{1 2, _ _, _ _}" !~ "{1 2, 3 4, 5 6}");
+        assert_match!("{3 4, _ _, _ _}" !~ "{1 2, 3 4, 5 6}");
+        assert_match!("{5 6, _ _, _ _}" !~ "{1 2, 3 4, 5 6}");
+        assert_match!("{_ _, 1 2, _ _}" !~ "{1 2, 3 4, 5 6}");
+        assert_match!("{_ _, 3 4, _ _}" !~ "{1 2, 3 4, 5 6}");
+        assert_match!("{_ _, 5 6, _ _}" !~ "{1 2, 3 4, 5 6}");
+        assert_match!("{_ _, _ _, 1 2}" !~ "{1 2, 3 4, 5 6}");
+        assert_match!("{_ _, _ _, 3 4}" !~ "{1 2, 3 4, 5 6}");
+        assert_match!("{_ _, _ _, 5 6}" !~ "{1 2, 3 4, 5 6}");
+
+        assert_match!("{1 2, _ _, _ _}" !~ "{3 4, 1 2, 5 6}");
+        assert_match!("{3 4, _ _, _ _}" !~ "{3 4, 1 2, 5 6}");
+        assert_match!("{5 6, _ _, _ _}" !~ "{3 4, 1 2, 5 6}");
+        assert_match!("{_ _, 1 2, _ _}" !~ "{3 4, 1 2, 5 6}");
+        assert_match!("{_ _, 3 4, _ _}" !~ "{3 4, 1 2, 5 6}");
+        assert_match!("{_ _, 5 6, _ _}" !~ "{3 4, 1 2, 5 6}");
+        assert_match!("{_ _, _ _, 1 2}" !~ "{3 4, 1 2, 5 6}");
+        assert_match!("{_ _, _ _, 3 4}" !~ "{3 4, 1 2, 5 6}");
+        assert_match!("{_ _, _ _, 5 6}" !~ "{3 4, 1 2, 5 6}");
+    }
+
+    #[test]
+    fn test_match_placeholder_simple() {
+        assert_match!("?x" =~ "nil");
+        assert_match!("?x" =~ "true");
+        assert_match!("?x" =~ "1");
+        assert_match!("?x" =~ "1N");
+        assert_match!("?x" =~ "1.0");
+        assert_match!("?x" =~ "\"a\"");
+        assert_match!("?x" =~ "_");
+        assert_match!("?x" =~ "symbol");
+        assert_match!("?x" =~ "ns/symbol");
+        assert_match!("?x" =~ ":keyword");
+        assert_match!("?x" =~ ":ns/keyword");
+        assert_match!("?x" =~ "[nil, true, 1, \"foo\", bar, :baz]");
+        assert_match!("?x" =~ "(nil, true, 1, \"foo\", bar, :baz)");
+        assert_match!("?x" =~ "#{nil, true, 1, \"foo\", bar, :baz}");
+        assert_match!("?x" =~ "{nil true, 1 \"foo\", bar :baz}");
+    }
+
+    #[test]
+    fn test_match_placeholder_in_same_collection_type_simple() {
+        assert_match!("[?x]" =~ "[1]");
+        assert_match!("(?x)" =~ "(2)");
+        assert_match!("#{?x}" =~ "#{3}");
+        assert_match!("{?x ?x}" =~ "{4 4}");
+        assert_match!("{?x ?x}" !~ "{4 5}");
+        assert_match!("{?x ?y}" =~ "{4 4}");
+        assert_match!("{?x ?y}" =~ "{4 5}");
+    }
+
+    #[test]
+    fn test_match_placeholder_in_different_collection_type_simple() {
+        assert_match!("[?x]" !~ "(1)");
+        assert_match!("(?x)" !~ "#{2}");
+        assert_match!("#{?x}" !~ "[3]");
+        assert_match!("{?x ?x}" !~ "[4 5]");
+        assert_match!("{?x ?x}" !~ "(6 7)");
+        assert_match!("{?x ?x}" !~ "#{8 9}");
+    }
+
+    #[test]
+    fn test_match_placeholder_in_vector_with_multiple_values() {
+        assert_match!("[?x ?y]" =~ "[1 2]");
+        assert_match!("[?x ?y]" =~ "[1 1]");
+        assert_match!("[?x ?x]" !~ "[1 2]");
+        assert_match!("[?x ?x]" =~ "[1 1]");
+
+        assert_match!("[1 ?x 3 ?y]" =~ "[1 2 3 4]");
+        assert_match!("[1 ?x 3 ?y]" =~ "[1 2 3 2]");
+        assert_match!("[1 ?x 3 ?x]" !~ "[1 2 3 4]");
+        assert_match!("[1 ?x 3 ?x]" =~ "[1 2 3 2]");
+
+        assert_match!("[1 [2 [3 ?x]] 5 [?y 7]]" =~ "[1 [2 [3 4]] 5 [6 7]]");
+        assert_match!("[1 [2 [3 ?x]] 5 [?y 7]]" =~ "[1 [2 [3 4]] 5 [4 7]]");
+        assert_match!("[1 [2 [3 ?x]] 5 [?x 7]]" !~ "[1 [2 [3 4]] 5 [6 7]]");
+        assert_match!("[1 [2 [3 ?x]] 5 [?y 7]]" =~ "[1 [2 [3 4]] 5 [4 7]]");
+
+        assert_match!("[?x ?y ?x ?y]" =~ "[1 2 1 2]");
+        assert_match!("[?x ?y ?x ?y]" !~ "[1 2 2 1]");
+
+        assert_match!("[[?x ?y] [?x ?y]]" =~ "[[1 2] [1 2]]");
+        assert_match!("[[?x ?y] [?x ?y]]" !~ "[[1 2] [2 1]]");
+    }
+
+    #[test]
+    fn test_match_placeholder_in_list_with_multiple_values() {
+        assert_match!("(?x ?y)" =~ "(1 2)");
+        assert_match!("(?x ?y)" =~ "(1 1)");
+        assert_match!("(?x ?x)" !~ "(1 2)");
+        assert_match!("(?x ?x)" =~ "(1 1)");
+
+        assert_match!("(1 ?x 3 ?y)" =~ "(1 2 3 4)");
+        assert_match!("(1 ?x 3 ?y)" =~ "(1 2 3 2)");
+        assert_match!("(1 ?x 3 ?x)" !~ "(1 2 3 4)");
+        assert_match!("(1 ?x 3 ?x)" =~ "(1 2 3 2)");
+
+        assert_match!("(1 (2 (3 ?x)) 5 (?y 7))" =~ "(1 (2 (3 4)) 5 (6 7))");
+        assert_match!("(1 (2 (3 ?x)) 5 (?y 7))" =~ "(1 (2 (3 4)) 5 (4 7))");
+        assert_match!("(1 (2 (3 ?x)) 5 (?x 7))" !~ "(1 (2 (3 4)) 5 (6 7))");
+        assert_match!("(1 (2 (3 ?x)) 5 (?y 7))" =~ "(1 (2 (3 4)) 5 (4 7))");
+
+        assert_match!("(?x ?y ?x ?y)" =~ "(1 2 1 2)");
+        assert_match!("(?x ?y ?x ?y)" !~ "(1 2 2 1)");
+
+        assert_match!("((?x ?y) (?x ?y))" =~ "((1 2) (1 2))");
+        assert_match!("((?x ?y) (?x ?y))" !~ "((1 2) (2 1))");
+    }
+
+    #[test]
+    fn test_match_placeholder_in_set_with_multiple_values() {
+        assert_match!("#{?x ?y}" =~ "#{1 2}");
+        assert_match!("#{?x ?y}" !~ "#{1 1}");
+        assert_match!("#{?x ?x}" !~ "#{1 2}");
+        assert_match!("#{?x ?x}" =~ "#{1 1}");
+
+        assert_match!("#{1 ?x 3 ?y}" =~ "#{1 2 3 4}");
+        assert_match!("#{1 ?x 3 ?y}" !~ "#{1 2 3 2}");
+        assert_match!("#{1 ?x 3 ?x}" !~ "#{1 2 3 4}");
+        assert_match!("#{1 ?x 3 ?x}" =~ "#{1 2 3 2}");
+
+        assert_match!("#{1 #{2 #{3 ?x}} 5 #{?y 7}}" =~ "#{1 #{2 #{3 4}} 5 #{6 7}}");
+        assert_match!("#{1 #{2 #{3 ?x}} 5 #{?y 7}}" =~ "#{1 #{2 #{3 4}} 5 #{4 7}}");
+        assert_match!("#{1 #{2 #{3 ?x}} 5 #{?x 7}}" !~ "#{1 #{2 #{3 4}} 5 #{6 7}}");
+        assert_match!("#{1 #{2 #{3 ?x}} 5 #{?y 7}}" =~ "#{1 #{2 #{3 4}} 5 #{4 7}}");
+
+        assert_match!("#{?x ?y ?x ?y}" =~ "#{1 2 1 2}");
+        assert_match!("#{?x ?y ?x ?y}" =~ "#{1 2 2 1}");
+
+        assert_match!("#{#{?x ?y} #{?x ?y}}" =~ "#{#{1 2} #{1 2}}");
+        assert_match!("#{#{?x ?y} #{?x ?y}}" =~ "#{#{1 2} #{2 1}}");
+    }
+
+    #[test]
+    fn test_match_placeholder_in_map_with_multiple_values() {
+        assert_match!("{?x ?y}" =~ "{1 2}");
+        assert_match!("{?x ?y}" =~ "{1 1}");
+        assert_match!("{?x ?x}" !~ "{1 2}");
+        assert_match!("{?x ?x}" =~ "{1 1}");
+
+        assert_match!("{1 ?x, 3 ?y}" =~ "{1 2, 3 4}");
+        assert_match!("{1 ?x, 3 ?y}" =~ "{1 2, 3 2}");
+        assert_match!("{1 ?x, 3 ?x}" !~ "{1 2, 3 4}");
+        assert_match!("{1 ?x, 3 ?x}" =~ "{1 2, 3 2}");
+
+        assert_match!("{1 {2 {3 ?x}}, 5 {?y 7}}" =~ "{1 {2 {3 4}}, 5 {6 7}}");
+        assert_match!("{1 {2 {3 ?x}}, 5 {?y 7}}" =~ "{1 {2 {3 4}}, 5 {4 7}}");
+        assert_match!("{1 {2 {3 ?x}}, 5 {?x 7}}" !~ "{1 {2 {3 4}}, 5 {6 7}}");
+        assert_match!("{1 {2 {3 ?x}}, 5 {?y 7}}" =~ "{1 {2 {3 4}}, 5 {4 7}}");
+
+        assert_match!("{?x ?y, ?x ?y}" =~ "{1 2, 1 2}");
+        assert_match!("{?x ?y, ?x ?y}" !~ "{1 2, 2 1}");
+
+        assert_match!("{{?x ?y}, {?x ?y}}" =~ "{{1 2}, {1 2}}");
+        assert_match!("{{?x ?y}, {?x ?y}}" !~ "{{1 2}, {2 1}}");
+    }
+
+    #[test]
+    fn test_match_placeholder_in_different_value_types() {
+        assert_match!("{1 {2 [3 ?x]}, 5 (?y 7)}" =~ "{1 {2 [3 4]}, 5 (6 7)}");
+        assert_match!("{1 {2 [3 ?x]}, 5 (?y 7)}" =~ "{1 {2 [3 4]}, 5 (4 7)}");
+        assert_match!("{1 {2 [3 ?x]}, 5 (?x 7)}" !~ "{1 {2 [3 4]}, 5 (6 7)}");
+        assert_match!("{1 {2 [3 ?x]}, 5 (?y 7)}" =~ "{1 {2 [3 4]}, 5 (4 7)}");
+
+        assert_match!("{?x {?x [?x ?x]}, ?x (?x ?x)}" !~ "{1 {2 [3 4]}, 5 (6 7)}");
+        assert_match!("{?x {?x [?x ?x]}, ?x (?x ?x)}" =~ "{1 {1 [1 1]}, 1 (1 1)}");
+
+        assert_match!("[#{?x ?y} ?x]" =~ "[#{1 2} 1]");
+        assert_match!("[#{?x ?y} ?y]" =~ "[#{1 2} 2]");
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/edn/namespaceable_name.rs.html b/docs/apis/rust/0.7.0/src/edn/namespaceable_name.rs.html new file mode 100644 index 00000000..937b8548 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/edn/namespaceable_name.rs.html @@ -0,0 +1,732 @@ + + + + + + + + + + namespaceable_name.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::cmp::{
+    Ord,
+    Ordering,
+    PartialOrd,
+};
+
+use std::fmt;
+
+#[cfg(feature = "serde_support")]
+use serde::de::{
+    self,
+    Deserialize,
+    Deserializer
+};
+#[cfg(feature = "serde_support")]
+use serde::ser::{
+    Serialize,
+    Serializer,
+};
+
+// Data storage for both NamespaceableKeyword and NamespaceableSymbol.
+#[derive(Clone, Eq, Hash, PartialEq)]
+pub struct NamespaceableName {
+    // The bytes that make up the namespace followed directly by those
+    // that make up the name. If there is a namespace, a solidus ('/') is between
+    // the two parts.
+    components: String,
+
+    // The index (in bytes) into `components` of the dividing solidus — the character
+    // between the namespace and the name.
+    //
+    // If this is zero, it means that this is _not_ a namespaced value!
+    //
+    // Important: The following invariants around `boundary` must be maintained:
+    //
+    // 1. `boundary` must always be less than or equal to `components.len()`.
+    // 2. `boundary` must be a byte index that points to a character boundary,
+    //     and not point into the middle of a UTF-8 codepoint. That is,
+    //    `components.is_char_boundary(boundary)` must always be true.
+    //
+    // These invariants are enforced by `NamespaceableName::namespaced()`, and since
+    // we never mutate `NamespaceableName`s, that's the only place we need to
+    // worry about them.
+    boundary: usize,
+}
+
+impl NamespaceableName {
+    #[inline]
+    pub fn plain<T>(name: T) -> Self where T: Into<String> {
+        let n = name.into();
+        assert!(!n.is_empty(), "Symbols and keywords cannot be unnamed.");
+
+        NamespaceableName {
+            components: n,
+            boundary: 0,
+        }
+    }
+
+    #[inline]
+    pub fn namespaced<N, T>(namespace: N, name: T) -> Self where N: AsRef<str>, T: AsRef<str> {
+        let n = name.as_ref();
+        let ns = namespace.as_ref();
+
+        // Note: These invariants are not required for safety. That is, if we
+        // decide to allow these we can safely remove them.
+        assert!(!n.is_empty(), "Symbols and keywords cannot be unnamed.");
+        assert!(!ns.is_empty(), "Symbols and keywords cannot have an empty non-null namespace.");
+
+        let mut dest = String::with_capacity(n.len() + ns.len());
+
+        dest.push_str(ns);
+        dest.push('/');
+        dest.push_str(n);
+
+        let boundary = ns.len();
+
+        NamespaceableName {
+            components: dest,
+            boundary: boundary,
+        }
+    }
+
+    fn new<N, T>(namespace: Option<N>, name: T) -> Self where N: AsRef<str>, T: AsRef<str> {
+        if let Some(ns) = namespace {
+            Self::namespaced(ns, name)
+        } else {
+            Self::plain(name.as_ref())
+        }
+    }
+
+    pub fn is_namespaced(&self) -> bool {
+        self.boundary > 0
+    }
+
+    #[inline]
+    pub fn is_backward(&self) -> bool {
+        self.name().starts_with('_')
+    }
+
+    #[inline]
+    pub fn is_forward(&self) -> bool {
+        !self.is_backward()
+    }
+
+    pub fn to_reversed(&self) -> NamespaceableName {
+        let name = self.name();
+
+        if name.starts_with('_') {
+            Self::new(self.namespace(), &name[1..])
+        } else {
+            Self::new(self.namespace(), &format!("_{}", name))
+        }
+    }
+
+    #[inline]
+    pub fn namespace(&self) -> Option<&str> {
+        if self.boundary > 0 {
+            Some(&self.components[0..self.boundary])
+        } else {
+            None
+        }
+    }
+
+    #[inline]
+    pub fn name(&self) -> &str {
+        if self.boundary == 0 {
+            &self.components
+        } else {
+            &self.components[(self.boundary + 1)..]
+        }
+    }
+
+    #[inline]
+    pub fn components<'a>(&'a self) -> (&'a str, &'a str) {
+        if self.boundary > 0 {
+            (&self.components[0..self.boundary],
+             &self.components[(self.boundary + 1)..])
+        } else {
+            (&self.components[0..0],
+             &self.components)
+        }
+    }
+}
+
+// We order by namespace then by name.
+// Non-namespaced values always sort before.
+impl PartialOrd for NamespaceableName {
+    fn partial_cmp(&self, other: &NamespaceableName) -> Option<Ordering> {
+        match (self.boundary, other.boundary) {
+            (0, 0) => self.components.partial_cmp(&other.components),
+            (0, _) => Some(Ordering::Less),
+            (_, 0) => Some(Ordering::Greater),
+            (_, _) => {
+                // Just use a lexicographic ordering.
+                self.components().partial_cmp(&other.components())
+            },
+        }
+    }
+}
+
+impl Ord for NamespaceableName {
+    fn cmp(&self, other: &NamespaceableName) -> Ordering {
+        self.components().cmp(&other.components())
+    }
+}
+
+// We could derive this, but it's really hard to make sense of as-is.
+impl fmt::Debug for NamespaceableName {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        fmt.debug_struct("NamespaceableName")
+           .field("namespace", &self.namespace())
+           .field("name", &self.name())
+           .finish()
+    }
+}
+
+impl fmt::Display for NamespaceableName {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        fmt.write_str(&self.components)
+    }
+}
+
+// This is convoluted, but the basic idea is that since we don't want to rely on our input being
+// correct, we'll need to implement a custom serializer no matter what (e.g. we can't just
+// `derive(Deserialize)` since `unsafe` code depends on `self.boundary` being a valid index).
+//
+// We'd also like for users consuming our serialized data as e.g. JSON not to have to learn how we
+// store NamespaceableName internally, since it's very much an implementation detail.
+//
+// We achieve both of these by implemeting a type that can serialize in way that's both user-
+// friendly and automatic (e.g. `derive`d), and just pass all work off to it in our custom
+// implementation of Serialize and Deserialize.
+#[cfg(feature = "serde_support")]
+#[cfg_attr(feature = "serde_support", serde(rename = "NamespaceableName"))]
+#[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))]
+struct SerializedNamespaceableName<'a> {
+    namespace: Option<&'a str>,
+    name: &'a str,
+}
+
+#[cfg(feature = "serde_support")]
+impl<'de> Deserialize<'de> for NamespaceableName {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: Deserializer<'de> {
+        let separated = SerializedNamespaceableName::deserialize(deserializer)?;
+        if separated.name.len() == 0 {
+            return Err(de::Error::custom("Empty name in keyword or symbol"));
+        }
+        if let Some(ns) = separated.namespace {
+            if ns.len() == 0 {
+                Err(de::Error::custom("Empty but present namespace in keyword or symbol"))
+            } else {
+                Ok(NamespaceableName::namespaced(ns, separated.name))
+            }
+        } else {
+            Ok(NamespaceableName::plain(separated.name))
+        }
+    }
+}
+
+#[cfg(feature = "serde_support")]
+impl Serialize for NamespaceableName {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: Serializer {
+        let ser = SerializedNamespaceableName {
+            namespace: self.namespace(),
+            name: self.name(),
+        };
+        ser.serialize(serializer)
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use std::panic;
+
+    #[test]
+    fn test_new_invariants_maintained() {
+        assert!(panic::catch_unwind(|| NamespaceableName::namespaced("", "foo")).is_err(),
+                "Empty namespace should panic");
+        assert!(panic::catch_unwind(|| NamespaceableName::namespaced("foo", "")).is_err(),
+                "Empty name should panic");
+        assert!(panic::catch_unwind(|| NamespaceableName::namespaced("", "")).is_err(),
+                "Should panic if both fields are empty");
+    }
+
+    #[test]
+    fn test_basic() {
+        let s = NamespaceableName::namespaced("aaaaa", "b");
+        assert_eq!(s.namespace(), Some("aaaaa"));
+        assert_eq!(s.name(), "b");
+        assert_eq!(s.components(), ("aaaaa", "b"));
+
+        let s = NamespaceableName::namespaced("b", "aaaaa");
+        assert_eq!(s.namespace(), Some("b"));
+        assert_eq!(s.name(), "aaaaa");
+        assert_eq!(s.components(), ("b", "aaaaa"));
+    }
+
+    #[test]
+    fn test_order() {
+        let n0 = NamespaceableName::namespaced("a", "aa");
+        let n1 = NamespaceableName::namespaced("aa", "a");
+
+        let n2 = NamespaceableName::namespaced("a", "ab");
+        let n3 = NamespaceableName::namespaced("aa", "b");
+
+        let n4 = NamespaceableName::namespaced("b", "ab");
+        let n5 = NamespaceableName::namespaced("ba", "b");
+
+        let n6 = NamespaceableName::namespaced("z", "zz");
+
+        let mut arr = [
+            n5.clone(),
+            n6.clone(),
+            n0.clone(),
+            n3.clone(),
+            n2.clone(),
+            n1.clone(),
+            n4.clone()
+        ];
+
+        arr.sort();
+
+        assert_eq!(arr, [
+            n0.clone(),
+            n2.clone(),
+            n1.clone(),
+            n3.clone(),
+            n4.clone(),
+            n5.clone(),
+            n6.clone(),
+        ]);
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/edn/pretty_print.rs.html b/docs/apis/rust/0.7.0/src/edn/pretty_print.rs.html new file mode 100644 index 00000000..0acecadd --- /dev/null +++ b/docs/apis/rust/0.7.0/src/edn/pretty_print.rs.html @@ -0,0 +1,514 @@ + + + + + + + + + + pretty_print.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use chrono::{
+    SecondsFormat,
+};
+
+use itertools::Itertools;
+use pretty;
+
+use std::io;
+use std::borrow::Cow;
+
+use types::Value;
+
+impl Value {
+    /// Return a pretty string representation of this `Value`.
+    pub fn to_pretty(&self, width: usize) -> Result<String, io::Error> {
+        let mut out = Vec::new();
+        self.write_pretty(width, &mut out)?;
+        Ok(String::from_utf8_lossy(&out).into_owned())
+    }
+
+    /// Write a pretty representation of this `Value` to the given writer.
+    fn write_pretty<W>(&self, width: usize, out: &mut W) -> Result<(), io::Error> where W: io::Write {
+        self.as_doc(&pretty::BoxAllocator).1.render(width, out)
+    }
+
+    /// Bracket a collection of values.
+    ///
+    /// We aim for
+    /// [1 2 3]
+    /// and fall back if necessary to
+    /// [1,
+    ///  2,
+    ///  3].
+    fn bracket<'a, A, T, I>(&'a self, allocator: &'a A, open: T, vs: I, close: T) -> pretty::DocBuilder<'a, A>
+    where A: pretty::DocAllocator<'a>, T: Into<Cow<'a, str>>, I: IntoIterator<Item=&'a Value> {
+        let open = open.into();
+        let n = open.len();
+        let i = vs.into_iter().map(|v| v.as_doc(allocator)).intersperse(allocator.space());
+        allocator.text(open)
+            .append(allocator.concat(i).nest(n))
+            .append(allocator.text(close))
+            .group()
+    }
+
+    /// Recursively traverses this value and creates a pretty.rs document.
+    /// This pretty printing implementation is optimized for edn queries
+    /// readability and limited whitespace expansion.
+    fn as_doc<'a, A>(&'a self, pp: &'a A) -> pretty::DocBuilder<'a, A>
+        where A: pretty::DocAllocator<'a> {
+        match *self {
+            Value::Vector(ref vs) => self.bracket(pp, "[", vs, "]"),
+            Value::List(ref vs) => self.bracket(pp, "(", vs, ")"),
+            Value::Set(ref vs) => self.bracket(pp, "#{", vs, "}"),
+            Value::Map(ref vs) => {
+                let xs = vs.iter().rev().map(|(k, v)| k.as_doc(pp).append(pp.space()).append(v.as_doc(pp)).group()).intersperse(pp.space());
+                pp.text("{")
+                    .append(pp.concat(xs).nest(1))
+                    .append(pp.text("}"))
+                    .group()
+            }
+            Value::NamespacedSymbol(ref v) => pp.text(v.namespace()).append("/").append(v.name()),
+            Value::PlainSymbol(ref v) => pp.text(v.to_string()),
+            Value::Keyword(ref v) => pp.text(v.to_string()),
+            Value::Text(ref v) => pp.text("\"").append(v.as_ref()).append("\""),
+            Value::Uuid(ref u) => pp.text("#uuid \"").append(u.hyphenated().to_string()).append("\""),
+            Value::Instant(ref v) => pp.text("#inst \"").append(v.to_rfc3339_opts(SecondsFormat::AutoSi, true)).append("\""),
+            _ => pp.text(self.to_string())
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use parse;
+
+    #[test]
+    fn test_pp_io() {
+        let string = "$";
+        let data = parse::value(string).unwrap().without_spans();
+
+        assert_eq!(data.write_pretty(40, &mut Vec::new()).is_ok(), true);
+    }
+
+    #[test]
+    fn test_pp_types_empty() {
+        let string = "[ [ ] ( ) #{ } { }, \"\" ]";
+        let data = parse::value(string).unwrap().without_spans();
+
+        assert_eq!(data.to_pretty(40).unwrap(), "[[] () #{} {} \"\"]");
+    }
+
+    #[test]
+    fn test_vector() {
+        let string = "[1 2 3 4 5 6]";
+        let data = parse::value(string).unwrap().without_spans();
+
+        assert_eq!(data.to_pretty(20).unwrap(), "[1 2 3 4 5 6]");
+        assert_eq!(data.to_pretty(10).unwrap(), "\
+[1
+ 2
+ 3
+ 4
+ 5
+ 6]");
+    }
+
+    #[test]
+    fn test_map() {
+        let string = "{:a 1 :b 2 :c 3}";
+        let data = parse::value(string).unwrap().without_spans();
+
+        assert_eq!(data.to_pretty(20).unwrap(), "{:a 1 :b 2 :c 3}");
+        assert_eq!(data.to_pretty(10).unwrap(), "\
+{:a 1
+ :b 2
+ :c 3}");
+    }
+
+    #[test]
+    fn test_pp_types() {
+        let string = "[ 1 2 ( 3.14 ) #{ 4N } { foo/bar 42 :baz/boz 43 } [ ] :five :six/seven eight nine/ten true false nil #f NaN #f -Infinity #f +Infinity ]";
+        let data = parse::value(string).unwrap().without_spans();
+
+        assert_eq!(data.to_pretty(40).unwrap(), "\
+[1
+ 2
+ (3.14)
+ #{4N}
+ {:baz/boz 43 foo/bar 42}
+ []
+ :five
+ :six/seven
+ eight
+ nine/ten
+ true
+ false
+ nil
+ #f NaN
+ #f -Infinity
+ #f +Infinity]");
+    }
+
+    #[test]
+    fn test_pp_query1() {
+        let string = "[:find ?id ?bar ?baz :in $ :where [?id :session/keyword-foo ?symbol1 ?symbol2 \"some string\"] [?tx :db/tx ?ts]]";
+        let data = parse::value(string).unwrap().without_spans();
+
+        assert_eq!(data.to_pretty(40).unwrap(), "\
+[:find
+ ?id
+ ?bar
+ ?baz
+ :in
+ $
+ :where
+ [?id
+  :session/keyword-foo
+  ?symbol1
+  ?symbol2
+  \"some string\"]
+ [?tx :db/tx ?ts]]");
+    }
+
+    #[test]
+    fn test_pp_query2() {
+        let string = "[:find [?id ?bar ?baz] :in [$] :where [?id :session/keyword-foo ?symbol1 ?symbol2 \"some string\"] [?tx :db/tx ?ts] (not-join [?id] [?id :session/keyword-bar _])]";
+        let data = parse::value(string).unwrap().without_spans();
+
+        assert_eq!(data.to_pretty(40).unwrap(), "\
+[:find
+ [?id ?bar ?baz]
+ :in
+ [$]
+ :where
+ [?id
+  :session/keyword-foo
+  ?symbol1
+  ?symbol2
+  \"some string\"]
+ [?tx :db/tx ?ts]
+ (not-join
+  [?id]
+  [?id :session/keyword-bar _])]");
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/edn/query.rs.html b/docs/apis/rust/0.7.0/src/edn/query.rs.html new file mode 100644 index 00000000..87719bb5 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/edn/query.rs.html @@ -0,0 +1,2602 @@ + + + + + + + + + + query.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+///! This module defines some core types that support find expressions: sources,
+///! variables, expressions, etc.
+///! These are produced as 'fuel' by the query parser, consumed by the query
+///! translator and executor.
+///!
+///! Many of these types are defined as simple structs that are little more than
+///! a richer type alias: a variable, for example, is really just a fancy kind
+///! of string.
+///!
+///! At some point in the future, we might consider reducing copying and memory
+///! usage by recasting all of these string-holding structs and enums in terms
+///! of string references, with those references being slices of some parsed
+///! input query string, and valid for the lifetime of that string.
+///!
+///! For now, for the sake of simplicity, all of these strings are heap-allocated.
+///!
+///! Furthermore, we might cut out some of the chaff here: each time a 'tagged'
+///! type is used within an enum, we have an opportunity to simplify and use the
+///! inner type directly in conjunction with matching on the enum. Before diving
+///! deeply into this it's worth recognizing that this loss of 'sovereignty' is
+///! a tradeoff against well-typed function signatures and other such boundaries.
+
+use std::collections::{
+    BTreeSet,
+    HashSet,
+};
+
+use std;
+use std::fmt;
+use std::rc::{
+    Rc,
+};
+
+use ::{
+    BigInt,
+    DateTime,
+    OrderedFloat,
+    Uuid,
+    Utc,
+};
+
+use ::value_rc::{
+    FromRc,
+    ValueRc,
+};
+
+pub use ::{
+    Keyword,
+    PlainSymbol,
+};
+
+pub type SrcVarName = String;          // Do not include the required syntactic '$'.
+
+#[derive(Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
+pub struct Variable(pub Rc<PlainSymbol>);
+
+impl Variable {
+    pub fn as_str(&self) -> &str {
+        self.0.as_ref().0.as_str()
+    }
+
+    pub fn to_string(&self) -> String {
+        self.0.as_ref().0.clone()
+    }
+
+    pub fn name(&self) -> PlainSymbol {
+        self.0.as_ref().clone()
+    }
+
+    /// Return a new `Variable`, assuming that the provided string is a valid name.
+    pub fn from_valid_name(name: &str) -> Variable {
+        let s = PlainSymbol::plain(name);
+        assert!(s.is_var_symbol());
+        Variable(Rc::new(s))
+    }
+}
+
+pub trait FromValue<T> {
+    fn from_value(v: &::ValueAndSpan) -> Option<T>;
+}
+
+/// If the provided EDN value is a PlainSymbol beginning with '?', return
+/// it wrapped in a Variable. If not, return None.
+/// TODO: intern strings. #398.
+impl FromValue<Variable> for Variable {
+    fn from_value(v: &::ValueAndSpan) -> Option<Variable> {
+        if let ::SpannedValue::PlainSymbol(ref s) = v.inner {
+            Variable::from_symbol(s)
+        } else {
+            None
+        }
+    }
+}
+
+impl Variable {
+    pub fn from_rc(sym: Rc<PlainSymbol>) -> Option<Variable> {
+        if sym.is_var_symbol() {
+            Some(Variable(sym.clone()))
+        } else {
+            None
+        }
+    }
+
+    /// TODO: intern strings. #398.
+    pub fn from_symbol(sym: &PlainSymbol) -> Option<Variable> {
+        if sym.is_var_symbol() {
+            Some(Variable(Rc::new(sym.clone())))
+        } else {
+            None
+        }
+    }
+}
+
+impl fmt::Debug for Variable {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "var({})", self.0)
+    }
+}
+
+impl std::fmt::Display for Variable {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        write!(f, "{}", self.0)
+    }
+}
+
+#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
+pub struct QueryFunction(pub PlainSymbol);
+
+impl FromValue<QueryFunction> for QueryFunction {
+    fn from_value(v: &::ValueAndSpan) -> Option<QueryFunction> {
+        if let ::SpannedValue::PlainSymbol(ref s) = v.inner {
+            QueryFunction::from_symbol(s)
+        } else {
+            None
+        }
+    }
+}
+
+impl QueryFunction {
+    pub fn from_symbol(sym: &PlainSymbol) -> Option<QueryFunction> {
+        // TODO: validate the acceptable set of function names.
+        Some(QueryFunction(sym.clone()))
+    }
+}
+
+impl std::fmt::Display for QueryFunction {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        write!(f, "{}", self.0)
+    }
+}
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum Direction {
+    Ascending,
+    Descending,
+}
+
+/// An abstract declaration of ordering: direction and variable.
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub struct Order(pub Direction, pub Variable);   // Future: Element instead of Variable?
+
+#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
+pub enum SrcVar {
+    DefaultSrc,
+    NamedSrc(SrcVarName),
+}
+
+impl FromValue<SrcVar> for SrcVar {
+    fn from_value(v: &::ValueAndSpan) -> Option<SrcVar> {
+        if let ::SpannedValue::PlainSymbol(ref s) = v.inner {
+            SrcVar::from_symbol(s)
+        } else {
+            None
+        }
+    }
+}
+
+impl SrcVar {
+    pub fn from_symbol(sym: &PlainSymbol) -> Option<SrcVar> {
+        if sym.is_src_symbol() {
+            if sym.0 == "$" {
+                Some(SrcVar::DefaultSrc)
+            } else {
+                Some(SrcVar::NamedSrc(sym.name().to_string()))
+            }
+        } else {
+            None
+        }
+    }
+}
+
+/// These are the scalar values representable in EDN.
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum NonIntegerConstant {
+    Boolean(bool),
+    BigInteger(BigInt),
+    Float(OrderedFloat<f64>),
+    Text(ValueRc<String>),
+    Instant(DateTime<Utc>),
+    Uuid(Uuid),
+}
+
+impl<'a> From<&'a str> for NonIntegerConstant {
+    fn from(val: &'a str) -> NonIntegerConstant {
+        NonIntegerConstant::Text(ValueRc::new(val.to_string()))
+    }
+}
+
+impl From<String> for NonIntegerConstant {
+    fn from(val: String) -> NonIntegerConstant {
+        NonIntegerConstant::Text(ValueRc::new(val))
+    }
+}
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum FnArg {
+    Variable(Variable),
+    SrcVar(SrcVar),
+    EntidOrInteger(i64),
+    IdentOrKeyword(Keyword),
+    Constant(NonIntegerConstant),
+    // The collection values representable in EDN.  There's no advantage to destructuring up front,
+    // since consumers will need to handle arbitrarily nested EDN themselves anyway.
+    Vector(Vec<FnArg>),
+}
+
+impl FromValue<FnArg> for FnArg {
+    fn from_value(v: &::ValueAndSpan) -> Option<FnArg> {
+        use ::SpannedValue::*;
+        match v.inner {
+            Integer(x) =>
+                Some(FnArg::EntidOrInteger(x)),
+            PlainSymbol(ref x) if x.is_src_symbol() =>
+                SrcVar::from_symbol(x).map(FnArg::SrcVar),
+            PlainSymbol(ref x) if x.is_var_symbol() =>
+                Variable::from_symbol(x).map(FnArg::Variable),
+            PlainSymbol(_) => None,
+            Keyword(ref x) =>
+                Some(FnArg::IdentOrKeyword(x.clone())),
+            Instant(x) =>
+                Some(FnArg::Constant(NonIntegerConstant::Instant(x))),
+            Uuid(x) =>
+                Some(FnArg::Constant(NonIntegerConstant::Uuid(x))),
+            Boolean(x) =>
+                Some(FnArg::Constant(NonIntegerConstant::Boolean(x))),
+            Float(x) =>
+                Some(FnArg::Constant(NonIntegerConstant::Float(x))),
+            BigInteger(ref x) =>
+                Some(FnArg::Constant(NonIntegerConstant::BigInteger(x.clone()))),
+            Text(ref x) =>
+                // TODO: intern strings. #398.
+                Some(FnArg::Constant(x.clone().into())),
+            Nil |
+            NamespacedSymbol(_) |
+            Vector(_) |
+            List(_) |
+            Set(_) |
+            Map(_) => None,
+        }
+    }
+}
+
+// For display in column headings in the repl.
+impl std::fmt::Display for FnArg {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        match self {
+            &FnArg::Variable(ref var) => write!(f, "{}", var),
+            &FnArg::SrcVar(ref var) => {
+                if var == &SrcVar::DefaultSrc {
+                    write!(f, "$")
+                } else {
+                    write!(f, "{:?}", var)
+                }
+            },
+            &FnArg::EntidOrInteger(entid) => write!(f, "{}", entid),
+            &FnArg::IdentOrKeyword(ref kw) => write!(f, "{}", kw),
+            &FnArg::Constant(ref constant) => write!(f, "{:?}", constant),
+            &FnArg::Vector(ref vec) => write!(f, "{:?}", vec),
+        }
+    }
+}
+
+impl FnArg {
+    pub fn as_variable(&self) -> Option<&Variable> {
+        match self {
+            &FnArg::Variable(ref v) => Some(v),
+            _ => None,
+        }
+    }
+}
+
+/// e, a, tx can't be values -- no strings, no floats -- and so
+/// they can only be variables, entity IDs, ident keywords, or
+/// placeholders.
+/// This encoding allows us to represent integers that aren't
+/// entity IDs. That'll get filtered out in the context of the
+/// database.
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum PatternNonValuePlace {
+    Placeholder,
+    Variable(Variable),
+    Entid(i64),                       // Will always be +ve. See #190.
+    Ident(ValueRc<Keyword>),
+}
+
+impl From<Rc<Keyword>> for PatternNonValuePlace {
+    fn from(value: Rc<Keyword>) -> Self {
+        PatternNonValuePlace::Ident(ValueRc::from_rc(value))
+    }
+}
+
+impl From<Keyword> for PatternNonValuePlace {
+    fn from(value: Keyword) -> Self {
+        PatternNonValuePlace::Ident(ValueRc::new(value))
+    }
+}
+
+impl PatternNonValuePlace {
+    // I think we'll want move variants, so let's leave these here for now.
+    #[allow(dead_code)]
+    fn into_pattern_value_place(self) -> PatternValuePlace {
+        match self {
+            PatternNonValuePlace::Placeholder => PatternValuePlace::Placeholder,
+            PatternNonValuePlace::Variable(x) => PatternValuePlace::Variable(x),
+            PatternNonValuePlace::Entid(x)    => PatternValuePlace::EntidOrInteger(x),
+            PatternNonValuePlace::Ident(x)    => PatternValuePlace::IdentOrKeyword(x),
+        }
+    }
+
+    fn to_pattern_value_place(&self) -> PatternValuePlace {
+        match *self {
+            PatternNonValuePlace::Placeholder     => PatternValuePlace::Placeholder,
+            PatternNonValuePlace::Variable(ref x) => PatternValuePlace::Variable(x.clone()),
+            PatternNonValuePlace::Entid(x)        => PatternValuePlace::EntidOrInteger(x),
+            PatternNonValuePlace::Ident(ref x)    => PatternValuePlace::IdentOrKeyword(x.clone()),
+        }
+    }
+}
+
+impl FromValue<PatternNonValuePlace> for PatternNonValuePlace {
+    fn from_value(v: &::ValueAndSpan) -> Option<PatternNonValuePlace> {
+        match v.inner {
+            ::SpannedValue::Integer(x) => if x >= 0 {
+                Some(PatternNonValuePlace::Entid(x))
+            } else {
+                None
+            },
+            ::SpannedValue::PlainSymbol(ref x) => if x.0.as_str() == "_" {
+                Some(PatternNonValuePlace::Placeholder)
+            } else {
+                if let Some(v) = Variable::from_symbol(x) {
+                    Some(PatternNonValuePlace::Variable(v))
+                } else {
+                    None
+                }
+            },
+            ::SpannedValue::Keyword(ref x) =>
+                Some(x.clone().into()),
+            _ => None,
+        }
+    }
+}
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum IdentOrEntid {
+    Ident(Keyword),
+    Entid(i64),
+}
+
+/// The `v` part of a pattern can be much broader: it can represent
+/// integers that aren't entity IDs (particularly negative integers),
+/// strings, and all the rest. We group those under `Constant`.
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum PatternValuePlace {
+    Placeholder,
+    Variable(Variable),
+    EntidOrInteger(i64),
+    IdentOrKeyword(ValueRc<Keyword>),
+    Constant(NonIntegerConstant),
+}
+
+impl From<Rc<Keyword>> for PatternValuePlace {
+    fn from(value: Rc<Keyword>) -> Self {
+        PatternValuePlace::IdentOrKeyword(ValueRc::from_rc(value))
+    }
+}
+
+impl From<Keyword> for PatternValuePlace {
+    fn from(value: Keyword) -> Self {
+        PatternValuePlace::IdentOrKeyword(ValueRc::new(value))
+    }
+}
+
+impl FromValue<PatternValuePlace> for PatternValuePlace {
+    fn from_value(v: &::ValueAndSpan) -> Option<PatternValuePlace> {
+        match v.inner {
+            ::SpannedValue::Integer(x) =>
+                Some(PatternValuePlace::EntidOrInteger(x)),
+            ::SpannedValue::PlainSymbol(ref x) if x.0.as_str() == "_" =>
+                Some(PatternValuePlace::Placeholder),
+            ::SpannedValue::PlainSymbol(ref x) =>
+                Variable::from_symbol(x).map(PatternValuePlace::Variable),
+            ::SpannedValue::Keyword(ref x) if x.is_namespaced() =>
+                Some(x.clone().into()),
+            ::SpannedValue::Boolean(x) =>
+                Some(PatternValuePlace::Constant(NonIntegerConstant::Boolean(x))),
+            ::SpannedValue::Float(x) =>
+                Some(PatternValuePlace::Constant(NonIntegerConstant::Float(x))),
+            ::SpannedValue::BigInteger(ref x) =>
+                Some(PatternValuePlace::Constant(NonIntegerConstant::BigInteger(x.clone()))),
+            ::SpannedValue::Instant(x) =>
+                Some(PatternValuePlace::Constant(NonIntegerConstant::Instant(x))),
+            ::SpannedValue::Text(ref x) =>
+                // TODO: intern strings. #398.
+                Some(PatternValuePlace::Constant(x.clone().into())),
+            ::SpannedValue::Uuid(ref u) =>
+                Some(PatternValuePlace::Constant(NonIntegerConstant::Uuid(u.clone()))),
+
+            // These don't appear in queries.
+            ::SpannedValue::Nil => None,
+            ::SpannedValue::NamespacedSymbol(_) => None,
+            ::SpannedValue::Keyword(_) => None,                // … yet.
+            ::SpannedValue::Map(_) => None,
+            ::SpannedValue::List(_) => None,
+            ::SpannedValue::Set(_) => None,
+            ::SpannedValue::Vector(_) => None,
+        }
+    }
+}
+
+impl PatternValuePlace {
+    // I think we'll want move variants, so let's leave these here for now.
+    #[allow(dead_code)]
+    fn into_pattern_non_value_place(self) -> Option<PatternNonValuePlace> {
+        match self {
+            PatternValuePlace::Placeholder       => Some(PatternNonValuePlace::Placeholder),
+            PatternValuePlace::Variable(x)       => Some(PatternNonValuePlace::Variable(x)),
+            PatternValuePlace::EntidOrInteger(x) => if x >= 0 {
+                Some(PatternNonValuePlace::Entid(x))
+            } else {
+                None
+            },
+            PatternValuePlace::IdentOrKeyword(x) => Some(PatternNonValuePlace::Ident(x)),
+            PatternValuePlace::Constant(_)       => None,
+        }
+    }
+
+    fn to_pattern_non_value_place(&self) -> Option<PatternNonValuePlace> {
+        match *self {
+            PatternValuePlace::Placeholder           => Some(PatternNonValuePlace::Placeholder),
+            PatternValuePlace::Variable(ref x)       => Some(PatternNonValuePlace::Variable(x.clone())),
+            PatternValuePlace::EntidOrInteger(x)     => if x >= 0 {
+                Some(PatternNonValuePlace::Entid(x))
+            } else {
+                None
+            },
+            PatternValuePlace::IdentOrKeyword(ref x) => Some(PatternNonValuePlace::Ident(x.clone())),
+            PatternValuePlace::Constant(_)           => None,
+        }
+    }
+}
+
+// Not yet used.
+// pub enum PullDefaultValue {
+//     EntidOrInteger(i64),
+//     IdentOrKeyword(Rc<Keyword>),
+//     Constant(NonIntegerConstant),
+// }
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum PullConcreteAttribute {
+    Ident(Rc<Keyword>),
+    Entid(i64),
+}
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub struct NamedPullAttribute {
+    pub attribute: PullConcreteAttribute,
+    pub alias: Option<Rc<Keyword>>,
+}
+
+impl From<PullConcreteAttribute> for NamedPullAttribute {
+    fn from(a: PullConcreteAttribute) -> Self {
+        NamedPullAttribute {
+            attribute: a,
+            alias: None,
+        }
+    }
+}
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum PullAttributeSpec {
+    Wildcard,
+    Attribute(NamedPullAttribute),
+    // PullMapSpec(Vec<…>),
+    // LimitedAttribute(NamedPullAttribute, u64),  // Limit nil => Attribute instead.
+    // DefaultedAttribute(NamedPullAttribute, PullDefaultValue),
+}
+
+impl std::fmt::Display for PullConcreteAttribute {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        match self {
+            &PullConcreteAttribute::Ident(ref k) => {
+                write!(f, "{}", k)
+            },
+            &PullConcreteAttribute::Entid(i) => {
+                write!(f, "{}", i)
+            },
+        }
+    }
+}
+
+impl std::fmt::Display for NamedPullAttribute {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        if let &Some(ref alias) = &self.alias {
+            write!(f, "{} :as {}", self.attribute, alias)
+        } else {
+            write!(f, "{}", self.attribute)
+        }
+    }
+}
+
+
+impl std::fmt::Display for PullAttributeSpec {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        match self {
+            &PullAttributeSpec::Wildcard => {
+                write!(f, "*")
+            },
+            &PullAttributeSpec::Attribute(ref attr) => {
+                write!(f, "{}", attr)
+            },
+        }
+    }
+}
+
+
+#[derive(Debug, Eq, PartialEq)]
+pub struct Pull {
+    pub var: Variable,
+    pub patterns: Vec<PullAttributeSpec>,
+}
+
+#[derive(Debug, Eq, PartialEq)]
+pub struct Aggregate {
+    pub func: QueryFunction,
+    pub args: Vec<FnArg>,
+}
+
+#[derive(Debug, Eq, PartialEq)]
+pub enum Element {
+    Variable(Variable),
+    Aggregate(Aggregate),
+
+    /// In a query with a `max` or `min` aggregate, a corresponding variable
+    /// (indicated in the query with `(the ?var)`, is guaranteed to come from
+    /// the row that provided the max or min value. Queries with more than one
+    /// `max` or `min` cannot yield predictable behavior, and will err during
+    /// algebrizing.
+    Corresponding(Variable),
+    Pull(Pull),
+}
+
+impl Element {
+    /// Returns true if the element must yield only one value.
+    pub fn is_unit(&self) -> bool {
+        match self {
+            &Element::Variable(_) => false,
+            &Element::Pull(_) => false,
+            &Element::Aggregate(_) => true,
+            &Element::Corresponding(_) => true,
+        }
+    }
+}
+
+impl From<Variable> for Element {
+    fn from(x: Variable) -> Element {
+        Element::Variable(x)
+    }
+}
+
+impl std::fmt::Display for Element {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        match self {
+            &Element::Variable(ref var) => {
+                write!(f, "{}", var)
+            },
+            &Element::Pull(Pull { ref var, ref patterns }) => {
+                write!(f, "(pull {} [ ", var)?;
+                for p in patterns.iter() {
+                    write!(f, "{} ", p)?;
+                }
+                write!(f, "])")
+            },
+            &Element::Aggregate(ref agg) => {
+                match agg.args.len() {
+                    0 => write!(f, "({})", agg.func),
+                    1 => write!(f, "({} {})", agg.func, agg.args[0]),
+                    _ => write!(f, "({} {:?})", agg.func, agg.args),
+                }
+            },
+            &Element::Corresponding(ref var) => {
+                write!(f, "(the {})", var)
+            },
+        }
+    }
+}
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum Limit {
+    None,
+    Fixed(u64),
+    Variable(Variable),
+}
+
+/// A definition of the first part of a find query: the
+/// `[:find ?foo ?bar…]` bit.
+///
+/// There are four different kinds of find specs, allowing you to query for
+/// a single value, a collection of values from different entities, a single
+/// tuple (relation), or a collection of tuples.
+///
+/// Examples:
+///
+/// ```rust
+/// # use edn::query::{Element, FindSpec, Variable};
+///
+/// # fn main() {
+///
+///   let elements = vec![
+///     Element::Variable(Variable::from_valid_name("?foo")),
+///     Element::Variable(Variable::from_valid_name("?bar")),
+///   ];
+///   let rel = FindSpec::FindRel(elements);
+///
+///   if let FindSpec::FindRel(elements) = rel {
+///     assert_eq!(2, elements.len());
+///   }
+///
+/// # }
+/// ```
+///
+#[derive(Debug, Eq, PartialEq)]
+pub enum FindSpec {
+    /// Returns an array of arrays, represented as a single array with length a multiple of width.
+    FindRel(Vec<Element>),
+
+    /// Returns an array of scalars, usually homogeneous.
+    /// This is equivalent to mapping over the results of a `FindRel`,
+    /// returning the first value of each.
+    FindColl(Element),
+
+    /// Returns a single tuple: a heterogeneous array of scalars. Equivalent to
+    /// taking the first result from a `FindRel`.
+    FindTuple(Vec<Element>),
+
+    /// Returns a single scalar value. Equivalent to taking the first result
+    /// from a `FindColl`.
+    FindScalar(Element),
+}
+
+/// Returns true if the provided `FindSpec` returns at most one result.
+impl FindSpec {
+    pub fn is_unit_limited(&self) -> bool {
+        use self::FindSpec::*;
+        match self {
+            &FindScalar(..) => true,
+            &FindTuple(..)  => true,
+            &FindRel(..)    => false,
+            &FindColl(..)   => false,
+        }
+    }
+
+    pub fn expected_column_count(&self) -> usize {
+        use self::FindSpec::*;
+        match self {
+            &FindScalar(..) => 1,
+            &FindColl(..)   => 1,
+            &FindTuple(ref elems) | &FindRel(ref elems) => elems.len(),
+        }
+    }
+
+
+    /// Returns true if the provided `FindSpec` cares about distinct results.
+    ///
+    /// I use the words "cares about" because find is generally defined in terms of producing distinct
+    /// results at the Datalog level.
+    ///
+    /// Two of the find specs (scalar and tuple) produce only a single result. Those don't need to be
+    /// run with `SELECT DISTINCT`, because we're only consuming a single result. Those queries will be
+    /// run with `LIMIT 1`.
+    ///
+    /// Additionally, some projections cannot produce duplicate results: `[:find (max ?x) …]`, for
+    /// example.
+    ///
+    /// This function gives us the hook to add that logic when we're ready.
+    ///
+    /// Beyond this, `DISTINCT` is not always needed. For example, in some kinds of accumulation or
+    /// sampling projections we might not need to do it at the SQL level because we're consuming into
+    /// a dupe-eliminating data structure like a Set, or we know that a particular query cannot produce
+    /// duplicate results.
+    pub fn requires_distinct(&self) -> bool {
+        !self.is_unit_limited()
+    }
+
+    pub fn columns<'s>(&'s self) -> Box<Iterator<Item=&Element> + 's> {
+        use self::FindSpec::*;
+        match self {
+            &FindScalar(ref e) => Box::new(std::iter::once(e)),
+            &FindColl(ref e)   => Box::new(std::iter::once(e)),
+            &FindTuple(ref v)  => Box::new(v.iter()),
+            &FindRel(ref v)    => Box::new(v.iter()),
+        }
+    }
+}
+
+// Datomic accepts variable or placeholder.  DataScript accepts recursive bindings.  Mentat sticks
+// to the non-recursive form Datomic accepts, which is much simpler to process.
+#[derive(Clone, Debug, Eq, Hash, PartialEq)]
+pub enum VariableOrPlaceholder {
+    Placeholder,
+    Variable(Variable),
+}
+
+impl VariableOrPlaceholder {
+    pub fn into_var(self) -> Option<Variable> {
+        match self {
+            VariableOrPlaceholder::Placeholder => None,
+            VariableOrPlaceholder::Variable(var) => Some(var),
+        }
+    }
+
+    pub fn var(&self) -> Option<&Variable> {
+        match self {
+            &VariableOrPlaceholder::Placeholder => None,
+            &VariableOrPlaceholder::Variable(ref var) => Some(var),
+        }
+    }
+}
+
+#[derive(Clone,Debug,Eq,PartialEq)]
+pub enum Binding {
+    BindScalar(Variable),
+    BindColl(Variable),
+    BindRel(Vec<VariableOrPlaceholder>),
+    BindTuple(Vec<VariableOrPlaceholder>),
+}
+
+impl Binding {
+    /// Return each variable or `None`, in order.
+    pub fn variables(&self) -> Vec<Option<Variable>> {
+        match self {
+            &Binding::BindScalar(ref var) | &Binding::BindColl(ref var) => vec![Some(var.clone())],
+            &Binding::BindRel(ref vars) | &Binding::BindTuple(ref vars) => vars.iter().map(|x| x.var().cloned()).collect(),
+        }
+    }
+
+    /// Return `true` if no variables are bound, i.e., all binding entries are placeholders.
+    pub fn is_empty(&self) -> bool {
+        match self {
+            &Binding::BindScalar(_) | &Binding::BindColl(_) => false,
+            &Binding::BindRel(ref vars) | &Binding::BindTuple(ref vars) => vars.iter().all(|x| x.var().is_none()),
+        }
+    }
+
+    /// Return `true` if no variable is bound twice, i.e., each binding entry is either a
+    /// placeholder or unique.
+    ///
+    /// ```
+    /// use edn::query::{Binding,Variable,VariableOrPlaceholder};
+    /// use std::rc::Rc;
+    ///
+    /// let v = Variable::from_valid_name("?foo");
+    /// let vv = VariableOrPlaceholder::Variable(v);
+    /// let p = VariableOrPlaceholder::Placeholder;
+    ///
+    /// let e = Binding::BindTuple(vec![p.clone()]);
+    /// let b = Binding::BindTuple(vec![p.clone(), vv.clone()]);
+    /// let d = Binding::BindTuple(vec![vv.clone(), p, vv]);
+    /// assert!(b.is_valid());          // One var, one placeholder: OK.
+    /// assert!(!e.is_valid());         // Empty: not OK.
+    /// assert!(!d.is_valid());         // Duplicate var: not OK.
+    /// ```
+    pub fn is_valid(&self) -> bool {
+        match self {
+            &Binding::BindScalar(_) | &Binding::BindColl(_) => true,
+            &Binding::BindRel(ref vars) | &Binding::BindTuple(ref vars) => {
+                let mut acc = HashSet::<Variable>::new();
+                for var in vars {
+                    if let &VariableOrPlaceholder::Variable(ref var) = var {
+                        if !acc.insert(var.clone()) {
+                            // It's invalid if there was an equal var already present in the set --
+                            // i.e., we have a duplicate var.
+                            return false;
+                        }
+                    }
+                }
+                // We're not valid if every place is a placeholder!
+                !acc.is_empty()
+            }
+        }
+    }
+}
+
+// Note that the "implicit blank" rule applies.
+// A pattern with a reversed attribute — :foo/_bar — is reversed
+// at the point of parsing. These `Pattern` instances only represent
+// one direction.
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub struct Pattern {
+    pub source: Option<SrcVar>,
+    pub entity: PatternNonValuePlace,
+    pub attribute: PatternNonValuePlace,
+    pub value: PatternValuePlace,
+    pub tx: PatternNonValuePlace,
+}
+
+impl Pattern {
+    pub fn simple(e: PatternNonValuePlace,
+                  a: PatternNonValuePlace,
+                  v: PatternValuePlace) -> Option<Pattern> {
+        Pattern::new(None, e, a, v, PatternNonValuePlace::Placeholder)
+    }
+
+    pub fn new(src: Option<SrcVar>,
+               e: PatternNonValuePlace,
+               a: PatternNonValuePlace,
+               v: PatternValuePlace,
+               tx: PatternNonValuePlace) -> Option<Pattern> {
+        let aa = a.clone();       // Too tired of fighting borrow scope for now.
+        if let PatternNonValuePlace::Ident(ref k) = aa {
+            if k.is_backward() {
+                // e and v have different types; we must convert them.
+                // Not every parseable value is suitable for the entity field!
+                // As such, this is a failable constructor.
+                let e_v = e.to_pattern_value_place();
+                if let Some(v_e) = v.to_pattern_non_value_place() {
+                    return Some(Pattern {
+                        source: src,
+                        entity: v_e,
+                        attribute: k.to_reversed().into(),
+                        value: e_v,
+                        tx: tx,
+                    });
+                } else {
+                    return None;
+                }
+            }
+        }
+        Some(Pattern {
+            source: src,
+            entity: e,
+            attribute: a,
+            value: v,
+            tx: tx,
+        })
+    }
+}
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub struct Predicate {
+    pub operator: PlainSymbol,
+    pub args: Vec<FnArg>,
+}
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub struct WhereFn {
+    pub operator: PlainSymbol,
+    pub args: Vec<FnArg>,
+    pub binding: Binding,
+}
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum UnifyVars {
+    /// `Implicit` means the variables in an `or` or `not` are derived from the enclosed pattern.
+    /// DataScript regards these vars as 'free': these variables don't need to be bound by the
+    /// enclosing environment.
+    ///
+    /// Datomic's documentation implies that all implicit variables are required:
+    ///
+    /// > Datomic will attempt to push the or clause down until all necessary variables are bound,
+    /// > and will throw an exception if that is not possible.
+    ///
+    /// but that would render top-level `or` expressions (as used in Datomic's own examples!)
+    /// impossible, so we assume that this is an error in the documentation.
+    ///
+    /// All contained 'arms' in an `or` with implicit variables must bind the same vars.
+    Implicit,
+
+    /// `Explicit` means the variables in an `or-join` or `not-join` are explicitly listed,
+    /// specified with `required-vars` syntax.
+    ///
+    /// DataScript parses these as free, but allows (incorrectly) the use of more complicated
+    /// `rule-vars` syntax.
+    ///
+    /// Only the named variables will be unified with the enclosing query.
+    ///
+    /// Every 'arm' in an `or-join` must mention the entire set of explicit vars.
+    Explicit(BTreeSet<Variable>),
+}
+
+impl WhereClause {
+    pub fn is_pattern(&self) -> bool {
+        match self {
+            &WhereClause::Pattern(_) => true,
+            _ => false,
+        }
+    }
+}
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum OrWhereClause {
+    Clause(WhereClause),
+    And(Vec<WhereClause>),
+}
+
+impl OrWhereClause {
+    pub fn is_pattern_or_patterns(&self) -> bool {
+        match self {
+            &OrWhereClause::Clause(WhereClause::Pattern(_)) => true,
+            &OrWhereClause::And(ref clauses) => clauses.iter().all(|clause| clause.is_pattern()),
+            _ => false,
+        }
+    }
+}
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub struct OrJoin {
+    pub unify_vars: UnifyVars,
+    pub clauses: Vec<OrWhereClause>,
+
+    /// Caches the result of `collect_mentioned_variables`.
+    mentioned_vars: Option<BTreeSet<Variable>>,
+}
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub struct NotJoin {
+    pub unify_vars: UnifyVars,
+    pub clauses: Vec<WhereClause>,
+}
+
+impl NotJoin {
+    pub fn new(unify_vars: UnifyVars, clauses: Vec<WhereClause>) -> NotJoin {
+        NotJoin {
+            unify_vars: unify_vars,
+            clauses: clauses,
+        }
+    }
+}
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub struct TypeAnnotation {
+    pub value_type: Keyword,
+    pub variable: Variable,
+}
+
+#[allow(dead_code)]
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum WhereClause {
+    NotJoin(NotJoin),
+    OrJoin(OrJoin),
+    Pred(Predicate),
+    WhereFn(WhereFn),
+    RuleExpr,
+    Pattern(Pattern),
+    TypeAnnotation(TypeAnnotation),
+}
+
+#[allow(dead_code)]
+#[derive(Debug, Eq, PartialEq)]
+pub struct ParsedQuery {
+    pub find_spec: FindSpec,
+    pub default_source: SrcVar,
+    pub with: Vec<Variable>,
+    pub in_vars: Vec<Variable>,
+    pub in_sources: BTreeSet<SrcVar>,
+    pub limit: Limit,
+    pub where_clauses: Vec<WhereClause>,
+    pub order: Option<Vec<Order>>,
+}
+
+pub(crate) enum QueryPart {
+    FindSpec(FindSpec),
+    WithVars(Vec<Variable>),
+    InVars(Vec<Variable>),
+    Limit(Limit),
+    WhereClauses(Vec<WhereClause>),
+    Order(Vec<Order>),
+}
+
+/// A `ParsedQuery` represents a parsed but potentially invalid query to the query algebrizer.
+/// Such a query is syntactically valid but might be semantically invalid, for example because
+/// constraints on the set of variables are not respected.
+///
+/// We split `ParsedQuery` from `FindQuery` because it's not easy to generalize over containers
+/// (here, `Vec` and `BTreeSet`) in Rust.
+impl ParsedQuery {
+    pub(crate) fn from_parts(parts: Vec<QueryPart>) -> std::result::Result<ParsedQuery, &'static str> {
+        let mut find_spec: Option<FindSpec> = None;
+        let mut with: Option<Vec<Variable>> = None;
+        let mut in_vars: Option<Vec<Variable>> = None;
+        let mut limit: Option<Limit> = None;
+        let mut where_clauses: Option<Vec<WhereClause>> = None;
+        let mut order: Option<Vec<Order>> = None;
+
+        for part in parts.into_iter() {
+            match part {
+                QueryPart::FindSpec(x) => {
+                    if find_spec.is_some() {
+                        return Err("find query has repeated :find");
+                    }
+                    find_spec = Some(x)
+                },
+                QueryPart::WithVars(x) => {
+                    if with.is_some() {
+                        return Err("find query has repeated :with");
+                    }
+                    with = Some(x)
+                },
+                QueryPart::InVars(x) => {
+                    if in_vars.is_some() {
+                        return Err("find query has repeated :in");
+                    }
+                    in_vars = Some(x)
+                },
+                QueryPart::Limit(x) => {
+                    if limit.is_some() {
+                        return Err("find query has repeated :limit");
+                    }
+                    limit = Some(x)
+                },
+                QueryPart::WhereClauses(x) => {
+                    if where_clauses.is_some() {
+                        return Err("find query has repeated :where");
+                    }
+                    where_clauses = Some(x)
+                },
+                QueryPart::Order(x) => {
+                    if order.is_some() {
+                        return Err("find query has repeated :order");
+                    }
+                    order = Some(x)
+                },
+            }
+        }
+
+        Ok(ParsedQuery {
+            find_spec: find_spec.ok_or("expected :find")?,
+            default_source: SrcVar::DefaultSrc,
+            with: with.unwrap_or(vec![]),
+            in_vars: in_vars.unwrap_or(vec![]),
+            in_sources: BTreeSet::default(),
+            limit: limit.unwrap_or(Limit::None),
+            where_clauses: where_clauses.ok_or("expected :where")?,
+            order,
+        })
+    }
+}
+
+impl OrJoin {
+    pub fn new(unify_vars: UnifyVars, clauses: Vec<OrWhereClause>) -> OrJoin {
+        OrJoin {
+            unify_vars: unify_vars,
+            clauses: clauses,
+            mentioned_vars: None,
+        }
+    }
+
+    /// Return true if either the `OrJoin` is `UnifyVars::Implicit`, or if
+    /// every variable mentioned inside the join is also mentioned in the `UnifyVars` list.
+    pub fn is_fully_unified(&self) -> bool {
+        match &self.unify_vars {
+            &UnifyVars::Implicit => true,
+            &UnifyVars::Explicit(ref vars) => {
+                // We know that the join list must be a subset of the vars in the pattern, or
+                // it would have failed validation. That allows us to simply compare counts here.
+                // TODO: in debug mode, do a full intersection, and verify that our count check
+                // returns the same results.
+                // Use the cached list if we have one.
+                if let Some(ref mentioned) = self.mentioned_vars {
+                    vars.len() == mentioned.len()
+                } else {
+                    vars.len() == self.collect_mentioned_variables().len()
+                }
+            }
+        }
+    }
+}
+
+pub trait ContainsVariables {
+    fn accumulate_mentioned_variables(&self, acc: &mut BTreeSet<Variable>);
+    fn collect_mentioned_variables(&self) -> BTreeSet<Variable> {
+        let mut out = BTreeSet::new();
+        self.accumulate_mentioned_variables(&mut out);
+        out
+    }
+}
+
+impl ContainsVariables for WhereClause {
+    fn accumulate_mentioned_variables(&self, acc: &mut BTreeSet<Variable>) {
+        use self::WhereClause::*;
+        match self {
+            &OrJoin(ref o)         => o.accumulate_mentioned_variables(acc),
+            &Pred(ref p)           => p.accumulate_mentioned_variables(acc),
+            &Pattern(ref p)        => p.accumulate_mentioned_variables(acc),
+            &NotJoin(ref n)        => n.accumulate_mentioned_variables(acc),
+            &WhereFn(ref f)        => f.accumulate_mentioned_variables(acc),
+            &TypeAnnotation(ref a) => a.accumulate_mentioned_variables(acc),
+            &RuleExpr              => (),
+        }
+    }
+}
+
+impl ContainsVariables for OrWhereClause {
+    fn accumulate_mentioned_variables(&self, acc: &mut BTreeSet<Variable>) {
+        use self::OrWhereClause::*;
+        match self {
+            &And(ref clauses) => for clause in clauses { clause.accumulate_mentioned_variables(acc) },
+            &Clause(ref clause) => clause.accumulate_mentioned_variables(acc),
+        }
+    }
+}
+
+impl ContainsVariables for OrJoin {
+    fn accumulate_mentioned_variables(&self, acc: &mut BTreeSet<Variable>) {
+        for clause in &self.clauses {
+            clause.accumulate_mentioned_variables(acc);
+        }
+    }
+}
+
+impl OrJoin {
+    pub fn dismember(self) -> (Vec<OrWhereClause>, UnifyVars, BTreeSet<Variable>) {
+        let vars = match self.mentioned_vars {
+                       Some(m) => m,
+                       None => self.collect_mentioned_variables(),
+                   };
+        (self.clauses, self.unify_vars, vars)
+    }
+
+    pub fn mentioned_variables<'a>(&'a mut self) -> &'a BTreeSet<Variable> {
+        if self.mentioned_vars.is_none() {
+            let m = self.collect_mentioned_variables();
+            self.mentioned_vars = Some(m);
+        }
+
+        if let Some(ref mentioned) = self.mentioned_vars {
+            mentioned
+        } else {
+            unreachable!()
+        }
+    }
+}
+
+impl ContainsVariables for NotJoin {
+    fn accumulate_mentioned_variables(&self, acc: &mut BTreeSet<Variable>) {
+        for clause in &self.clauses {
+            clause.accumulate_mentioned_variables(acc);
+        }
+    }
+}
+
+impl ContainsVariables for Predicate {
+    fn accumulate_mentioned_variables(&self, acc: &mut BTreeSet<Variable>) {
+        for arg in &self.args {
+            if let &FnArg::Variable(ref v) = arg {
+                acc_ref(acc, v)
+            }
+        }
+    }
+}
+
+impl ContainsVariables for TypeAnnotation {
+    fn accumulate_mentioned_variables(&self, acc: &mut BTreeSet<Variable>) {
+        acc_ref(acc, &self.variable);
+    }
+}
+
+impl ContainsVariables for Binding {
+    fn accumulate_mentioned_variables(&self, acc: &mut BTreeSet<Variable>) {
+        match self {
+            &Binding::BindScalar(ref v) | &Binding::BindColl(ref v) => {
+                acc_ref(acc, v)
+            },
+            &Binding::BindRel(ref vs) | &Binding::BindTuple(ref vs) => {
+                for v in vs {
+                    if let &VariableOrPlaceholder::Variable(ref v) = v {
+                        acc_ref(acc, v);
+                    }
+                }
+            },
+        }
+    }
+}
+
+impl ContainsVariables for WhereFn {
+    fn accumulate_mentioned_variables(&self, acc: &mut BTreeSet<Variable>) {
+        for arg in &self.args {
+            if let &FnArg::Variable(ref v) = arg {
+                acc_ref(acc, v)
+            }
+        }
+        self.binding.accumulate_mentioned_variables(acc);
+    }
+}
+
+fn acc_ref<T: Clone + Ord>(acc: &mut BTreeSet<T>, v: &T) {
+    // Roll on, reference entries!
+    if !acc.contains(v) {
+        acc.insert(v.clone());
+    }
+}
+
+impl ContainsVariables for Pattern {
+    fn accumulate_mentioned_variables(&self, acc: &mut BTreeSet<Variable>) {
+        if let PatternNonValuePlace::Variable(ref v) = self.entity {
+            acc_ref(acc, v)
+        }
+        if let PatternNonValuePlace::Variable(ref v) = self.attribute {
+            acc_ref(acc, v)
+        }
+        if let PatternValuePlace::Variable(ref v) = self.value {
+            acc_ref(acc, v)
+        }
+        if let PatternNonValuePlace::Variable(ref v) = self.tx {
+            acc_ref(acc, v)
+        }
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/edn/symbols.rs.html b/docs/apis/rust/0.7.0/src/edn/symbols.rs.html new file mode 100644 index 00000000..73ef8e22 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/edn/symbols.rs.html @@ -0,0 +1,752 @@ + + + + + + + + + + symbols.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::fmt::{
+    Display,
+    Formatter,
+    Write,
+};
+
+use namespaceable_name::NamespaceableName;
+
+#[macro_export]
+macro_rules! ns_keyword {
+    ($ns: expr, $name: expr) => {{
+        $crate::Keyword::namespaced($ns, $name)
+    }}
+}
+
+/// A simplification of Clojure's Symbol.
+#[derive(Clone,Debug,Eq,Hash,Ord,PartialOrd,PartialEq)]
+pub struct PlainSymbol(pub String);
+
+#[derive(Clone,Debug,Eq,Hash,Ord,PartialOrd,PartialEq)]
+pub struct NamespacedSymbol(NamespaceableName);
+
+/// A keyword is a symbol, optionally with a namespace, that prints with a leading colon.
+/// This concept is imported from Clojure, as it features in EDN and the query
+/// syntax that we use.
+///
+/// Clojure's constraints are looser than ours, allowing empty namespaces or
+/// names:
+///
+/// ```clojure
+/// user=> (keyword "" "")
+/// :/
+/// user=> (keyword "foo" "")
+/// :foo/
+/// user=> (keyword "" "bar")
+/// :/bar
+/// ```
+///
+/// We think that's nonsense, so we only allow keywords like `:bar` and `:foo/bar`,
+/// with both namespace and main parts containing no whitespace and no colon or slash:
+///
+/// ```rust
+/// # use edn::symbols::Keyword;
+/// let bar     = Keyword::plain("bar");                         // :bar
+/// let foo_bar = Keyword::namespaced("foo", "bar");        // :foo/bar
+/// assert_eq!("bar", bar.name());
+/// assert_eq!(None, bar.namespace());
+/// assert_eq!("bar", foo_bar.name());
+/// assert_eq!(Some("foo"), foo_bar.namespace());
+/// ```
+///
+/// If you're not sure whether your input is well-formed, you should use a
+/// parser or a reader function first to validate. TODO: implement `read`.
+///
+/// Callers are expected to follow these rules:
+/// http://www.clojure.org/reference/reader#_symbols
+///
+/// Future: fast equality (interning?) for keywords.
+///
+#[derive(Clone,Debug,Eq,Hash,Ord,PartialOrd,PartialEq)]
+#[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))]
+pub struct Keyword(NamespaceableName);
+
+impl PlainSymbol {
+    pub fn plain<T>(name: T) -> Self where T: Into<String> {
+        let n = name.into();
+        assert!(!n.is_empty(), "Symbols cannot be unnamed.");
+
+        PlainSymbol(n)
+    }
+
+    /// Return the name of the symbol without any leading '?' or '$'.
+    ///
+    /// ```rust
+    /// # use edn::symbols::PlainSymbol;
+    /// assert_eq!("foo", PlainSymbol::plain("?foo").name());
+    /// assert_eq!("foo", PlainSymbol::plain("$foo").name());
+    /// assert_eq!("!foo", PlainSymbol::plain("!foo").name());
+    /// ```
+    pub fn name(&self) -> &str {
+        if self.is_src_symbol() || self.is_var_symbol() {
+            &self.0[1..]
+        } else {
+            &self.0
+        }
+    }
+
+    #[inline]
+    pub fn is_var_symbol(&self) -> bool {
+        self.0.starts_with('?')
+    }
+
+    #[inline]
+    pub fn is_src_symbol(&self) -> bool {
+        self.0.starts_with('$')
+    }
+}
+
+impl NamespacedSymbol {
+    pub fn namespaced<N, T>(namespace: N, name: T) -> Self where N: AsRef<str>, T: AsRef<str> {
+        let r = namespace.as_ref();
+        assert!(!r.is_empty(), "Namespaced symbols cannot have an empty non-null namespace.");
+        NamespacedSymbol(NamespaceableName::namespaced(r, name))
+    }
+
+    #[inline]
+    pub fn name(&self) -> &str {
+        self.0.name()
+    }
+
+    #[inline]
+    pub fn namespace(&self) -> &str {
+        self.0.namespace().unwrap()
+    }
+
+    #[inline]
+    pub fn components<'a>(&'a self) -> (&'a str, &'a str) {
+        self.0.components()
+    }
+}
+
+impl Keyword {
+    pub fn plain<T>(name: T) -> Self where T: Into<String> {
+        Keyword(NamespaceableName::plain(name))
+    }
+}
+
+impl Keyword {
+    /// Creates a new `Keyword`.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// # use edn::symbols::Keyword;
+    /// let keyword = Keyword::namespaced("foo", "bar");
+    /// assert_eq!(keyword.to_string(), ":foo/bar");
+    /// ```
+    ///
+    /// See also the `kw!` macro in the main `mentat` crate.
+    pub fn namespaced<N, T>(namespace: N, name: T) -> Self where N: AsRef<str>, T: AsRef<str> {
+        let r = namespace.as_ref();
+        assert!(!r.is_empty(), "Namespaced keywords cannot have an empty non-null namespace.");
+        Keyword(NamespaceableName::namespaced(r, name))
+    }
+
+    #[inline]
+    pub fn name(&self) -> &str {
+        self.0.name()
+    }
+
+    #[inline]
+    pub fn namespace(&self) -> Option<&str> {
+        self.0.namespace()
+    }
+
+    #[inline]
+    pub fn components<'a>(&'a self) -> (&'a str, &'a str) {
+        self.0.components()
+    }
+
+    /// Whether this `Keyword` should be interpreted in reverse order. For example,
+    /// the two following snippets are identical:
+    ///
+    /// ```edn
+    /// [?y :person/friend ?x]
+    /// [?x :person/hired ?y]
+    ///
+    /// [?y :person/friend ?x]
+    /// [?y :person/_hired ?x]
+    /// ```
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// # use edn::symbols::Keyword;
+    /// assert!(!Keyword::namespaced("foo", "bar").is_backward());
+    /// assert!(Keyword::namespaced("foo", "_bar").is_backward());
+    /// ```
+    #[inline]
+    pub fn is_backward(&self) -> bool {
+        self.0.is_backward()
+    }
+
+    /// Whether this `Keyword` should be interpreted in forward order.
+    /// See `symbols::Keyword::is_backward`.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// # use edn::symbols::Keyword;
+    /// assert!(Keyword::namespaced("foo", "bar").is_forward());
+    /// assert!(!Keyword::namespaced("foo", "_bar").is_forward());
+    /// ```
+    #[inline]
+    pub fn is_forward(&self) -> bool {
+        self.0.is_forward()
+    }
+
+    #[inline]
+    pub fn is_namespaced(&self) -> bool {
+        self.0.is_namespaced()
+    }
+
+    /// Returns a `Keyword` with the same namespace and a
+    /// 'backward' name. See `symbols::Keyword::is_backward`.
+    ///
+    /// Returns a forward name if passed a reversed keyword; i.e., this
+    /// function is its own inverse.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// # use edn::symbols::Keyword;
+    /// let nsk = Keyword::namespaced("foo", "bar");
+    /// assert!(!nsk.is_backward());
+    /// assert_eq!(":foo/bar", nsk.to_string());
+    ///
+    /// let reversed = nsk.to_reversed();
+    /// assert!(reversed.is_backward());
+    /// assert_eq!(":foo/_bar", reversed.to_string());
+    /// ```
+    pub fn to_reversed(&self) -> Keyword {
+        Keyword(self.0.to_reversed())
+    }
+
+    /// If this `Keyword` is 'backward' (see `symbols::Keyword::is_backward`),
+    /// return `Some('forward name')`; otherwise, return `None`.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// # use edn::symbols::Keyword;
+    /// let nsk = Keyword::namespaced("foo", "bar");
+    /// assert_eq!(None, nsk.unreversed());
+    ///
+    /// let reversed = nsk.to_reversed();
+    /// assert_eq!(Some(nsk), reversed.unreversed());
+    /// ```
+    pub fn unreversed(&self) -> Option<Keyword> {
+        if self.is_backward() {
+            Some(self.to_reversed())
+        } else {
+            None
+        }
+    }
+}
+
+//
+// Note that we don't currently do any escaping.
+//
+
+impl Display for PlainSymbol {
+    /// Print the symbol in EDN format.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// # use edn::symbols::PlainSymbol;
+    /// assert_eq!("baz", PlainSymbol::plain("baz").to_string());
+    /// ```
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        self.0.fmt(f)
+    }
+}
+
+impl Display for NamespacedSymbol {
+    /// Print the symbol in EDN format.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// # use edn::symbols::NamespacedSymbol;
+    /// assert_eq!("bar/baz", NamespacedSymbol::namespaced("bar", "baz").to_string());
+    /// ```
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        self.0.fmt(f)
+    }
+}
+
+impl Display for Keyword {
+    /// Print the keyword in EDN format.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// # use edn::symbols::Keyword;
+    /// assert_eq!(":baz", Keyword::plain("baz").to_string());
+    /// assert_eq!(":bar/baz", Keyword::namespaced("bar", "baz").to_string());
+    /// assert_eq!(":bar/_baz", Keyword::namespaced("bar", "baz").to_reversed().to_string());
+    /// assert_eq!(":bar/baz", Keyword::namespaced("bar", "baz").to_reversed().to_reversed().to_string());
+    /// ```
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        f.write_char(':')?;
+        self.0.fmt(f)
+    }
+}
+
+#[test]
+fn test_ns_keyword_macro() {
+    assert_eq!(ns_keyword!("test", "name").to_string(),
+               Keyword::namespaced("test", "name").to_string());
+    assert_eq!(ns_keyword!("ns", "_name").to_string(),
+               Keyword::namespaced("ns", "_name").to_string());
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/edn/types.rs.html b/docs/apis/rust/0.7.0/src/edn/types.rs.html new file mode 100644 index 00000000..b3f6a1f6 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/edn/types.rs.html @@ -0,0 +1,1658 @@ + + + + + + + + + + types.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![cfg_attr(feature = "cargo-clippy", allow(linkedlist))]
+
+use std::collections::{BTreeSet, BTreeMap, LinkedList};
+use std::cmp::{Ordering, Ord, PartialOrd};
+use std::fmt::{Display, Formatter};
+use std::f64;
+
+use chrono::{
+    DateTime,
+    SecondsFormat,
+    TimeZone,           // For Utc::timestamp. The compiler incorrectly complains that this is unused.
+    Utc,
+};
+use num::BigInt;
+use ordered_float::OrderedFloat;
+use uuid::Uuid;
+
+use symbols;
+
+/// Value represents one of the allowed values in an EDN string.
+#[derive(PartialEq, Eq, Hash, Clone, Debug)]
+pub enum Value {
+    Nil,
+    Boolean(bool),
+    Integer(i64),
+    Instant(DateTime<Utc>),
+    BigInteger(BigInt),
+    Float(OrderedFloat<f64>),
+    Text(String),
+    Uuid(Uuid),
+    PlainSymbol(symbols::PlainSymbol),
+    NamespacedSymbol(symbols::NamespacedSymbol),
+    Keyword(symbols::Keyword),
+    Vector(Vec<Value>),
+    // We're using a LinkedList here instead of a Vec or VecDeque because the
+    // LinkedList is faster for appending (which we do a lot of).
+    // See https://github.com/mozilla/mentat/issues/231
+    List(LinkedList<Value>),
+    // We're using BTree{Set, Map} rather than Hash{Set, Map} because the BTree variants
+    // implement Hash. The Hash variants don't in order to preserve O(n) hashing
+    // time, which is hard given recursive data structures.
+    // See https://internals.rust-lang.org/t/implementing-hash-for-hashset-hashmap/3817/1
+    Set(BTreeSet<Value>),
+    Map(BTreeMap<Value, Value>),
+}
+
+/// `SpannedValue` is the parallel to `Value` but used in `ValueAndSpan`.
+/// Container types have `ValueAndSpan` children.
+#[derive(PartialEq, Eq, Hash, Clone, Debug)]
+pub enum SpannedValue {
+    Nil,
+    Boolean(bool),
+    Integer(i64),
+    Instant(DateTime<Utc>),
+    BigInteger(BigInt),
+    Float(OrderedFloat<f64>),
+    Text(String),
+    Uuid(Uuid),
+    PlainSymbol(symbols::PlainSymbol),
+    NamespacedSymbol(symbols::NamespacedSymbol),
+    Keyword(symbols::Keyword),
+    Vector(Vec<ValueAndSpan>),
+    List(LinkedList<ValueAndSpan>),
+    Set(BTreeSet<ValueAndSpan>),
+    Map(BTreeMap<ValueAndSpan, ValueAndSpan>),
+}
+
+/// Span represents the current offset (start, end) into the input string.
+#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
+pub struct Span(pub u32, pub u32);
+
+impl Span {
+    pub fn new(start: usize, end: usize) -> Span {
+        Span(start as u32, end as u32)
+    }
+}
+
+/// A wrapper type around `SpannedValue` and `Span`, representing some EDN value
+/// and the parsing offset (start, end) in the original EDN string.
+#[derive(PartialEq, Eq, Hash, Clone, Debug)]
+pub struct ValueAndSpan {
+    pub inner: SpannedValue,
+    pub span: Span,
+}
+
+impl ValueAndSpan {
+    pub fn new<I>(spanned_value: SpannedValue, span: I) -> ValueAndSpan where I: Into<Option<Span>> {
+        ValueAndSpan {
+            inner: spanned_value,
+            span: span.into().unwrap_or(Span(0, 0)), // TODO: consider if this has implications.
+        }
+    }
+
+    pub fn into_atom(self) -> Option<ValueAndSpan> {
+        if self.inner.is_atom() {
+            Some(self)
+        } else {
+            None
+        }
+    }
+
+    pub fn is_atom(&self) -> bool {
+        self.inner.is_atom()
+    }
+
+    pub fn as_atom(&self) -> Option<&ValueAndSpan> {
+        if self.inner.is_atom() {
+            Some(self)
+        } else {
+            None
+        }
+    }
+
+    pub fn into_text(self) -> Option<String> {
+        self.inner.into_text()
+    }
+
+    pub fn as_text(&self) -> Option<&String> {
+        self.inner.as_text()
+    }
+}
+
+impl Value {
+    /// For debug use only!
+    ///
+    /// But right now, it's used in the bootstrapper.  We'll fix that soon.
+    pub fn with_spans(self) -> ValueAndSpan {
+        let s = self.to_pretty(120).unwrap();
+        use ::parse;
+        let with_spans = parse::value(&s).unwrap();
+        assert_eq!(self, with_spans.clone().without_spans());
+        with_spans
+    }
+}
+
+impl From<SpannedValue> for Value {
+    fn from(src: SpannedValue) -> Value {
+        match src {
+            SpannedValue::Nil => Value::Nil,
+            SpannedValue::Boolean(v) => Value::Boolean(v),
+            SpannedValue::Integer(v) => Value::Integer(v),
+            SpannedValue::Instant(v) => Value::Instant(v),
+            SpannedValue::BigInteger(v) => Value::BigInteger(v),
+            SpannedValue::Float(v) => Value::Float(v),
+            SpannedValue::Text(v) => Value::Text(v),
+            SpannedValue::Uuid(v) => Value::Uuid(v),
+            SpannedValue::PlainSymbol(v) => Value::PlainSymbol(v),
+            SpannedValue::NamespacedSymbol(v) => Value::NamespacedSymbol(v),
+            SpannedValue::Keyword(v) => Value::Keyword(v),
+            SpannedValue::Vector(v) => Value::Vector(v.into_iter().map(|x| x.without_spans()).collect()),
+            SpannedValue::List(v) => Value::List(v.into_iter().map(|x| x.without_spans()).collect()),
+            SpannedValue::Set(v) => Value::Set(v.into_iter().map(|x| x.without_spans()).collect()),
+            SpannedValue::Map(v) => Value::Map(v.into_iter().map(|(x, y)| (x.without_spans(), y.without_spans())).collect()),
+        }
+    }
+}
+
+impl From<ValueAndSpan> for Value {
+    fn from(src: ValueAndSpan) -> Value {
+        src.inner.into()
+    }
+}
+
+/// Creates `from_$TYPE` helper functions for Value and SpannedValue,
+/// like `from_float()` or `from_ordered_float()`.
+macro_rules! def_from {
+    ($name: ident, $out: ty, $kind: path, $t: ty, $( $transform: expr ),* ) => {
+        pub fn $name(src: $t) -> $out {
+            $( let src = $transform(src); )*
+            $kind(src)
+        }
+    }
+}
+
+/// Creates `from_$TYPE` helper functions for Value or SpannedValue,
+/// like `from_bigint()` where the conversion is optional.
+macro_rules! def_from_option {
+    ($name: ident, $out: ty, $kind: path, $t: ty, $( $transform: expr ),* ) => {
+        pub fn $name(src: $t) -> Option<$out> {
+            $( let src = $transform(src); )*
+            src.map($kind)
+        }
+    }
+}
+
+/// Creates `is_$TYPE` helper functions for Value or SpannedValue, like
+/// `is_big_integer()` or `is_text()`.
+macro_rules! def_is {
+    ($name: ident, $pat: pat) => {
+        pub fn $name(&self) -> bool {
+            match *self { $pat => true, _ => false }
+        }
+    }
+}
+
+/// Creates `as_$TYPE` helper functions for Value or SpannedValue, like
+/// `as_integer()`, which returns the underlying value representing the
+/// original variable wrapped in an Option, like `Option<i64>`.
+macro_rules! def_as {
+    ($name: ident, $kind: path, $t: ty, $( $transform: expr ),* ) => {
+        pub fn $name(&self) -> Option<$t> {
+            match *self { $kind(v) => { $( let v = $transform(v) )*; Some(v) }, _ => None }
+        }
+    }
+}
+
+/// Creates `as_$TYPE` helper functions for Value or SpannedValue, like
+/// `as_big_integer()`, which returns a reference to the underlying value
+/// representing the original variable wrapped in an Option, like `Option<&BigInt>`.
+macro_rules! def_as_ref {
+    ($name: ident, $kind: path, $t: ty) => {
+        pub fn $name(&self) -> Option<&$t> {
+            match *self { $kind(ref v) => Some(v), _ => None }
+        }
+    }
+}
+
+/// Creates `into_$TYPE` helper functions for Value or SpannedValue, like
+/// `into_big_integer()`, which consumes it returning underlying value
+/// representing the original variable wrapped in an Option, like `Option<BigInt>`.
+macro_rules! def_into {
+    ($name: ident, $kind: path, $t: ty, $( $transform: expr ),* ) => {
+        pub fn $name(self) -> Option<$t> {
+            match self { $kind(v) => { $( let v = $transform(v) )*; Some(v) }, _ => None }
+        }
+    }
+}
+
+/// Converts `name` into a plain or namespaced value symbol, depending on
+/// whether or not `namespace` is given.
+///
+/// # Examples
+///
+/// ```
+/// # use edn::types::to_symbol;
+/// # use edn::types::Value;
+/// # use edn::symbols;
+/// let value = to_symbol!("foo", "bar", Value);
+/// assert_eq!(value, Value::NamespacedSymbol(symbols::NamespacedSymbol::namespaced("foo", "bar")));
+///
+/// let value = to_symbol!(None, "baz", Value);
+/// assert_eq!(value, Value::PlainSymbol(symbols::PlainSymbol::plain("baz")));
+///
+/// let value = to_symbol!("foo", "bar", SpannedValue);
+/// assert_eq!(value.into(), to_symbol!("foo", "bar", Value));
+///
+/// let value = to_symbol!(None, "baz", SpannedValue);
+/// assert_eq!(value.into(), to_symbol!(None, "baz", Value));
+/// ```
+macro_rules! to_symbol {
+    ( $namespace:expr, $name:expr, $t:tt ) => {
+        $namespace.into().map_or_else(
+            || $t::PlainSymbol(symbols::PlainSymbol::plain($name)),
+            |ns| $t::NamespacedSymbol(symbols::NamespacedSymbol::namespaced(ns, $name)))
+    }
+}
+
+/// Converts `name` into a plain or namespaced value keyword, depending on
+/// whether or not `namespace` is given.
+///
+/// # Examples
+///
+/// ```
+/// # use edn::types::to_keyword;
+/// # use edn::types::Value;
+/// # use edn::symbols;
+/// let value = to_keyword!("foo", "bar", Value);
+/// assert_eq!(value, Value::Keyword(symbols::Keyword::namespaced("foo", "bar")));
+///
+/// let value = to_keyword!(None, "baz", Value);
+/// assert_eq!(value, Value::Keyword(symbols::Keyword::plain("baz")));
+///
+/// let value = to_keyword!("foo", "bar", SpannedValue);
+/// assert_eq!(value.into(), to_keyword!("foo", "bar", Value));
+///
+/// let value = to_keyword!(None, "baz", SpannedValue);
+/// assert_eq!(value.into(), to_keyword!(None, "baz", Value));
+/// ```
+macro_rules! to_keyword {
+    ( $namespace:expr, $name:expr, $t:tt ) => {
+        $namespace.into().map_or_else(
+            || $t::Keyword(symbols::Keyword::plain($name)),
+            |ns| $t::Keyword(symbols::Keyword::namespaced(ns, $name)))
+    }
+}
+
+/// Implements multiple is*, as*, into* and from* methods common to
+/// both Value and SpannedValue.
+macro_rules! def_common_value_methods {
+    ( $t:tt<$tchild:tt> ) => {
+        def_is!(is_nil, $t::Nil);
+        def_is!(is_boolean, $t::Boolean(_));
+        def_is!(is_integer, $t::Integer(_));
+        def_is!(is_instant, $t::Instant(_));
+        def_is!(is_big_integer, $t::BigInteger(_));
+        def_is!(is_float, $t::Float(_));
+        def_is!(is_text, $t::Text(_));
+        def_is!(is_uuid, $t::Uuid(_));
+        def_is!(is_symbol, $t::PlainSymbol(_));
+        def_is!(is_namespaced_symbol, $t::NamespacedSymbol(_));
+        def_is!(is_vector, $t::Vector(_));
+        def_is!(is_list, $t::List(_));
+        def_is!(is_set, $t::Set(_));
+        def_is!(is_map, $t::Map(_));
+
+        pub fn is_keyword(&self) -> bool {
+            match self {
+                &$t::Keyword(ref k) => !k.is_namespaced(),
+                _ => false,
+            }
+        }
+
+        pub fn is_namespaced_keyword(&self) -> bool {
+            match self {
+                &$t::Keyword(ref k) => k.is_namespaced(),
+                _ => false,
+            }
+        }
+
+        /// `as_nil` does not use the macro as it does not have an underlying
+        /// value, and returns `Option<()>`.
+        pub fn as_nil(&self) -> Option<()> {
+            match *self { $t::Nil => Some(()), _ => None }
+        }
+
+        def_as!(as_boolean, $t::Boolean, bool,);
+        def_as!(as_integer, $t::Integer, i64,);
+        def_as!(as_instant, $t::Instant, DateTime<Utc>,);
+        def_as!(as_float, $t::Float, f64, |v: OrderedFloat<f64>| v.into_inner());
+
+        def_as_ref!(as_big_integer, $t::BigInteger, BigInt);
+        def_as_ref!(as_ordered_float, $t::Float, OrderedFloat<f64>);
+        def_as_ref!(as_text, $t::Text, String);
+        def_as_ref!(as_uuid, $t::Uuid, Uuid);
+        def_as_ref!(as_symbol, $t::PlainSymbol, symbols::PlainSymbol);
+        def_as_ref!(as_namespaced_symbol, $t::NamespacedSymbol, symbols::NamespacedSymbol);
+
+        pub fn as_keyword(&self) -> Option<&symbols::Keyword> {
+            match self {
+                &$t::Keyword(ref k) => Some(k),
+                _ => None,
+            }
+        }
+
+        pub fn as_plain_keyword(&self) -> Option<&symbols::Keyword> {
+            match self {
+                &$t::Keyword(ref k) if !k.is_namespaced() => Some(k),
+                _ => None,
+            }
+        }
+
+        pub fn as_namespaced_keyword(&self) -> Option<&symbols::Keyword> {
+            match self {
+                &$t::Keyword(ref k) if k.is_namespaced() => Some(k),
+                _ => None,
+            }
+        }
+
+        def_as_ref!(as_vector, $t::Vector, Vec<$tchild>);
+        def_as_ref!(as_list, $t::List, LinkedList<$tchild>);
+        def_as_ref!(as_set, $t::Set, BTreeSet<$tchild>);
+        def_as_ref!(as_map, $t::Map, BTreeMap<$tchild, $tchild>);
+
+        def_into!(into_boolean, $t::Boolean, bool,);
+        def_into!(into_integer, $t::Integer, i64,);
+        def_into!(into_instant, $t::Instant, DateTime<Utc>,);
+        def_into!(into_big_integer, $t::BigInteger, BigInt,);
+        def_into!(into_ordered_float, $t::Float, OrderedFloat<f64>,);
+        def_into!(into_float, $t::Float, f64, |v: OrderedFloat<f64>| v.into_inner());
+        def_into!(into_text, $t::Text, String,);
+        def_into!(into_uuid, $t::Uuid, Uuid,);
+        def_into!(into_symbol, $t::PlainSymbol, symbols::PlainSymbol,);
+        def_into!(into_namespaced_symbol, $t::NamespacedSymbol, symbols::NamespacedSymbol,);
+
+        pub fn into_keyword(self) -> Option<symbols::Keyword> {
+            match self {
+                $t::Keyword(k) => Some(k),
+                _ => None,
+            }
+        }
+
+        pub fn into_plain_keyword(self) -> Option<symbols::Keyword> {
+            match self {
+                $t::Keyword(k) => {
+                    if !k.is_namespaced() {
+                        Some(k)
+                    } else {
+                        None
+                    }
+                },
+                _ => None,
+            }
+        }
+
+        pub fn into_namespaced_keyword(self) -> Option<symbols::Keyword> {
+            match self {
+                $t::Keyword(k) => {
+                    if k.is_namespaced() {
+                        Some(k)
+                    } else {
+                        None
+                    }
+                },
+                _ => None,
+            }
+        }
+
+
+        def_into!(into_vector, $t::Vector, Vec<$tchild>,);
+        def_into!(into_list, $t::List, LinkedList<$tchild>,);
+        def_into!(into_set, $t::Set, BTreeSet<$tchild>,);
+        def_into!(into_map, $t::Map, BTreeMap<$tchild, $tchild>,);
+
+        def_from_option!(from_bigint, $t, $t::BigInteger, &str, |src: &str| src.parse::<BigInt>().ok());
+        def_from!(from_float, $t, $t::Float, f64, |src: f64| OrderedFloat::from(src));
+        def_from!(from_ordered_float, $t, $t::Float, OrderedFloat<f64>,);
+
+        pub fn from_symbol<'a, T: Into<Option<&'a str>>>(namespace: T, name: &str) -> $t {
+            to_symbol!(namespace, name, $t)
+        }
+
+        pub fn from_keyword<'a, T: Into<Option<&'a str>>>(namespace: T, name: &str) -> $t {
+            to_keyword!(namespace, name, $t)
+        }
+
+        fn precedence(&self) -> i32 {
+            match *self {
+                $t::Nil => 0,
+                $t::Boolean(_) => 1,
+                $t::Integer(_) => 2,
+                $t::BigInteger(_) => 3,
+                $t::Float(_) => 4,
+                $t::Instant(_) => 5,
+                $t::Text(_) => 6,
+                $t::Uuid(_) => 7,
+                $t::PlainSymbol(_) => 8,
+                $t::NamespacedSymbol(_) => 9,
+                $t::Keyword(ref k) if !k.is_namespaced() => 10,
+                $t::Keyword(_) => 11,
+                $t::Vector(_) => 12,
+                $t::List(_) => 13,
+                $t::Set(_) => 14,
+                $t::Map(_) => 15,
+            }
+        }
+
+        pub fn is_collection(&self) -> bool {
+            match *self {
+                $t::Nil => false,
+                $t::Boolean(_) => false,
+                $t::Integer(_) => false,
+                $t::Instant(_) => false,
+                $t::BigInteger(_) => false,
+                $t::Float(_) => false,
+                $t::Text(_) => false,
+                $t::Uuid(_) => false,
+                $t::PlainSymbol(_) => false,
+                $t::NamespacedSymbol(_) => false,
+                $t::Keyword(_) => false,
+                $t::Vector(_) => true,
+                $t::List(_) => true,
+                $t::Set(_) => true,
+                $t::Map(_) => true,
+            }
+        }
+
+        pub fn is_atom(&self) -> bool {
+            !self.is_collection()
+        }
+
+        pub fn into_atom(self) -> Option<$t> {
+            if self.is_atom() {
+                Some(self)
+            } else {
+                None
+            }
+        }
+    }
+}
+
+/// Compares Value or SpannedValue instances and returns Ordering.
+/// Used in `Ord` implementations.
+macro_rules! def_common_value_ord {
+    ( $t:tt, $value:expr, $other:expr ) => {
+        match ($value, $other) {
+            (&$t::Nil, &$t::Nil) => Ordering::Equal,
+            (&$t::Boolean(a), &$t::Boolean(b)) => b.cmp(&a),
+            (&$t::Integer(a), &$t::Integer(b)) => b.cmp(&a),
+            (&$t::Instant(a), &$t::Instant(b)) => b.cmp(&a),
+            (&$t::BigInteger(ref a), &$t::BigInteger(ref b)) => b.cmp(a),
+            (&$t::Float(ref a), &$t::Float(ref b)) => b.cmp(a),
+            (&$t::Text(ref a), &$t::Text(ref b)) => b.cmp(a),
+            (&$t::Uuid(ref a), &$t::Uuid(ref b)) => b.cmp(a),
+            (&$t::PlainSymbol(ref a), &$t::PlainSymbol(ref b)) => b.cmp(a),
+            (&$t::NamespacedSymbol(ref a), &$t::NamespacedSymbol(ref b)) => b.cmp(a),
+            (&$t::Keyword(ref a), &$t::Keyword(ref b)) => b.cmp(a),
+            (&$t::Vector(ref a), &$t::Vector(ref b)) => b.cmp(a),
+            (&$t::List(ref a), &$t::List(ref b)) => b.cmp(a),
+            (&$t::Set(ref a), &$t::Set(ref b)) => b.cmp(a),
+            (&$t::Map(ref a), &$t::Map(ref b)) => b.cmp(a),
+            _ => $value.precedence().cmp(&$other.precedence())
+        }
+    }
+}
+
+/// Converts a Value or SpannedValue to string, given a formatter.
+// TODO: Make sure float syntax is correct, handle NaN and escaping.
+// See https://github.com/mozilla/mentat/issues/232
+macro_rules! def_common_value_display {
+    ( $t:tt, $value:expr, $f:expr ) => {
+        match *$value {
+            $t::Nil => write!($f, "nil"),
+            $t::Boolean(v) => write!($f, "{}", v),
+            $t::Integer(v) => write!($f, "{}", v),
+            $t::Instant(v) => write!($f, "#inst \"{}\"", v.to_rfc3339_opts(SecondsFormat::AutoSi, true)),
+            $t::BigInteger(ref v) => write!($f, "{}N", v),
+            // TODO: make sure float syntax is correct.
+            $t::Float(ref v) => {
+                if *v == OrderedFloat(f64::INFINITY) {
+                    write!($f, "#f +Infinity")
+                } else if *v == OrderedFloat(f64::NEG_INFINITY) {
+                    write!($f, "#f -Infinity")
+                } else if *v == OrderedFloat(f64::NAN) {
+                    write!($f, "#f NaN")
+                } else {
+                    write!($f, "{}", v)
+                }
+            }
+            // TODO: EDN escaping.
+            $t::Text(ref v) => write!($f, "\"{}\"", v),
+            $t::Uuid(ref u) => write!($f, "#uuid \"{}\"", u.hyphenated().to_string()),
+            $t::PlainSymbol(ref v) => v.fmt($f),
+            $t::NamespacedSymbol(ref v) => v.fmt($f),
+            $t::Keyword(ref v) => v.fmt($f),
+            $t::Vector(ref v) => {
+                write!($f, "[")?;
+                for x in v {
+                    write!($f, " {}", x)?;
+                }
+                write!($f, " ]")
+            }
+            $t::List(ref v) => {
+                write!($f, "(")?;
+                for x in v {
+                    write!($f, " {}", x)?;
+                }
+                write!($f, " )")
+            }
+            $t::Set(ref v) => {
+                write!($f, "#{{")?;
+                for x in v {
+                    write!($f, " {}", x)?;
+                }
+                write!($f, " }}")
+            }
+            $t::Map(ref v) => {
+                write!($f, "{{")?;
+                for (key, val) in v {
+                    write!($f, " {} {}", key, val)?;
+                }
+                write!($f, " }}")
+            }
+        }
+    }
+}
+
+macro_rules! def_common_value_impl {
+    ( $t:tt<$tchild:tt> ) => {
+        impl $t {
+            def_common_value_methods!($t<$tchild>);
+        }
+
+        impl PartialOrd for $t {
+            fn partial_cmp(&self, other: &$t) -> Option<Ordering> {
+                Some(self.cmp(other))
+            }
+        }
+
+        impl Ord for $t {
+            fn cmp(&self, other: &$t) -> Ordering {
+                def_common_value_ord!($t, self, other)
+            }
+        }
+
+        impl Display for $t {
+            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+                def_common_value_display!($t, self, f)
+            }
+        }
+    }
+}
+
+def_common_value_impl!(Value<Value>);
+def_common_value_impl!(SpannedValue<ValueAndSpan>);
+
+impl ValueAndSpan {
+    pub fn without_spans(self) -> Value {
+        self.inner.into()
+    }
+}
+
+impl PartialOrd for ValueAndSpan {
+    fn partial_cmp(&self, other: &ValueAndSpan) -> Option<Ordering> {
+        Some(self.cmp(other))
+    }
+}
+
+impl Ord for ValueAndSpan {
+    fn cmp(&self, other: &ValueAndSpan) -> Ordering {
+        self.inner.cmp(&other.inner)
+    }
+}
+
+impl Display for ValueAndSpan {
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        self.inner.fmt(f)
+    }
+}
+
+pub trait FromMicros {
+    fn from_micros(ts: i64) -> Self;
+}
+
+impl FromMicros for DateTime<Utc> {
+    fn from_micros(ts: i64) -> Self {
+        Utc.timestamp(ts / 1_000_000, ((ts % 1_000_000).abs() as u32) * 1_000)
+    }
+}
+
+pub trait ToMicros {
+    fn to_micros(&self) -> i64;
+}
+
+impl ToMicros for DateTime<Utc> {
+    fn to_micros(&self) -> i64 {
+        let major: i64 = self.timestamp() * 1_000_000;
+        let minor: i64 = self.timestamp_subsec_micros() as i64;
+        major + minor
+    }
+}
+
+#[cfg(test)]
+mod test {
+    extern crate chrono;
+    extern crate ordered_float;
+    extern crate num;
+
+    use super::*;
+
+    use std::collections::{BTreeSet, BTreeMap, LinkedList};
+    use std::cmp::{Ordering};
+    use std::iter::FromIterator;
+    use std::f64;
+
+    use parse;
+
+    use chrono::{
+        DateTime,
+        Utc,
+    };
+    use num::BigInt;
+    use ordered_float::OrderedFloat;
+
+    #[test]
+    fn test_micros_roundtrip() {
+        let ts_micros: i64 = 1493399581314000;
+        let dt = DateTime::<Utc>::from_micros(ts_micros);
+        assert_eq!(dt.to_micros(), ts_micros);
+    }
+
+    #[test]
+    fn test_value_from() {
+        assert_eq!(Value::from_float(42f64), Value::Float(OrderedFloat::from(42f64)));
+        assert_eq!(Value::from_ordered_float(OrderedFloat::from(42f64)), Value::Float(OrderedFloat::from(42f64)));
+        assert_eq!(Value::from_bigint("42").unwrap(), Value::BigInteger(BigInt::from(42)));
+    }
+
+    #[test]
+    fn test_print_edn() {
+        assert_eq!("1234N", Value::from_bigint("1234").unwrap().to_string());
+
+        let string = "[ 1 2 ( 3.14 ) #{ 4N } { foo/bar 42 :baz/boz 43 } [ ] :five :six/seven eight nine/ten true false nil #f NaN #f -Infinity #f +Infinity ]";
+
+        let data = Value::Vector(vec![
+            Value::Integer(1),
+            Value::Integer(2),
+            Value::List(LinkedList::from_iter(vec![
+                Value::from_float(3.14)
+            ])),
+            Value::Set(BTreeSet::from_iter(vec![
+                Value::from_bigint("4").unwrap()
+            ])),
+            Value::Map(BTreeMap::from_iter(vec![
+                (Value::from_symbol("foo", "bar"), Value::Integer(42)),
+                (Value::from_keyword("baz", "boz"), Value::Integer(43))
+            ])),
+            Value::Vector(vec![]),
+            Value::from_keyword(None, "five"),
+            Value::from_keyword("six", "seven"),
+            Value::from_symbol(None, "eight"),
+            Value::from_symbol("nine", "ten"),
+            Value::Boolean(true),
+            Value::Boolean(false),
+            Value::Nil,
+            Value::from_float(f64::NAN),
+            Value::from_float(f64::NEG_INFINITY),
+            Value::from_float(f64::INFINITY),
+        ]);
+
+        assert_eq!(string, data.to_string());
+        assert_eq!(string, parse::value(&data.to_string()).unwrap().to_string());
+        assert_eq!(string, parse::value(&data.to_string()).unwrap().without_spans().to_string());
+    }
+
+    #[test]
+    fn test_ord() {
+        // TODO: Check we follow the equality rules at the bottom of https://github.com/edn-format/edn
+        assert_eq!(Value::Nil.cmp(&Value::Nil), Ordering::Equal);
+        assert_eq!(Value::Boolean(false).cmp(&Value::Boolean(true)), Ordering::Greater);
+        assert_eq!(Value::Integer(1).cmp(&Value::Integer(2)), Ordering::Greater);
+        assert_eq!(Value::from_bigint("1").cmp(&Value::from_bigint("2")), Ordering::Greater);
+        assert_eq!(Value::from_float(1f64).cmp(&Value::from_float(2f64)), Ordering::Greater);
+        assert_eq!(Value::Text("1".to_string()).cmp(&Value::Text("2".to_string())), Ordering::Greater);
+        assert_eq!(Value::from_symbol("a", "b").cmp(&Value::from_symbol("c", "d")), Ordering::Greater);
+        assert_eq!(Value::from_symbol(None, "a").cmp(&Value::from_symbol(None, "b")), Ordering::Greater);
+        assert_eq!(Value::from_keyword(":a", ":b").cmp(&Value::from_keyword(":c", ":d")), Ordering::Greater);
+        assert_eq!(Value::from_keyword(None, ":a").cmp(&Value::from_keyword(None, ":b")), Ordering::Greater);
+        assert_eq!(Value::Vector(vec![]).cmp(&Value::Vector(vec![])), Ordering::Equal);
+        assert_eq!(Value::List(LinkedList::new()).cmp(&Value::List(LinkedList::new())), Ordering::Equal);
+        assert_eq!(Value::Set(BTreeSet::new()).cmp(&Value::Set(BTreeSet::new())), Ordering::Equal);
+        assert_eq!(Value::Map(BTreeMap::new()).cmp(&Value::Map(BTreeMap::new())), Ordering::Equal);
+    }
+
+    #[test]
+    fn test_keyword_as() {
+        let namespaced = symbols::Keyword::namespaced("foo", "bar");
+        let plain = symbols::Keyword::plain("bar");
+        let n_v = Value::Keyword(namespaced);
+        let p_v = Value::Keyword(plain);
+
+        assert!(n_v.as_keyword().is_some());
+        assert!(n_v.as_plain_keyword().is_none());
+        assert!(n_v.as_namespaced_keyword().is_some());
+
+        assert!(p_v.as_keyword().is_some());
+        assert!(p_v.as_plain_keyword().is_some());
+        assert!(p_v.as_namespaced_keyword().is_none());
+
+        assert!(n_v.clone().into_keyword().is_some());
+        assert!(n_v.clone().into_plain_keyword().is_none());
+        assert!(n_v.clone().into_namespaced_keyword().is_some());
+
+        assert!(p_v.clone().into_keyword().is_some());
+        assert!(p_v.clone().into_plain_keyword().is_some());
+        assert!(p_v.clone().into_namespaced_keyword().is_none());
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/edn/utils.rs.html b/docs/apis/rust/0.7.0/src/edn/utils.rs.html new file mode 100644 index 00000000..38964dc7 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/edn/utils.rs.html @@ -0,0 +1,186 @@ + + + + + + + + + + utils.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+use types::Value;
+
+/// Merge the EDN `Value::Map` instance `right` into `left`.  Returns `None` if either `left` or
+/// `right` is not a `Value::Map`.
+///
+/// Keys present in `right` overwrite keys present in `left`.  See also
+/// https://clojuredocs.org/clojure.core/merge.
+///
+/// TODO: implement `merge` for [Value], following the `concat`/`SliceConcatExt` pattern.
+pub fn merge(left: &Value, right: &Value) -> Option<Value> {
+    match (left, right) {
+        (&Value::Map(ref l), &Value::Map(ref r)) => {
+            let mut result = l.clone();
+            result.extend(r.clone().into_iter());
+            Some(Value::Map(result))
+        }
+        _ => None
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/edn/value_rc.rs.html b/docs/apis/rust/0.7.0/src/edn/value_rc.rs.html new file mode 100644 index 00000000..4ccb7abd --- /dev/null +++ b/docs/apis/rust/0.7.0/src/edn/value_rc.rs.html @@ -0,0 +1,338 @@ + + + + + + + + + + value_rc.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use ::std::rc::{
+    Rc,
+};
+
+use ::std::sync::{
+    Arc,
+};
+
+pub trait FromRc<T> {
+    fn from_rc(val: Rc<T>) -> Self;
+    fn from_arc(val: Arc<T>) -> Self;
+}
+
+impl<T> FromRc<T> for Rc<T> where T: Sized + Clone {
+    fn from_rc(val: Rc<T>) -> Self {
+        val.clone()
+    }
+
+    fn from_arc(val: Arc<T>) -> Self {
+        match ::std::sync::Arc::<T>::try_unwrap(val) {
+            Ok(v) => Self::new(v),
+            Err(r) => Self::new(r.cloned()),
+        }
+    }
+}
+
+impl<T> FromRc<T> for Arc<T> where T: Sized + Clone {
+    fn from_rc(val: Rc<T>) -> Self {
+        match ::std::rc::Rc::<T>::try_unwrap(val) {
+            Ok(v) => Self::new(v),
+            Err(r) => Self::new(r.cloned()),
+        }
+    }
+
+    fn from_arc(val: Arc<T>) -> Self {
+        val.clone()
+    }
+}
+
+impl<T> FromRc<T> for Box<T> where T: Sized + Clone {
+    fn from_rc(val: Rc<T>) -> Self {
+        match ::std::rc::Rc::<T>::try_unwrap(val) {
+            Ok(v) => Self::new(v),
+            Err(r) => Self::new(r.cloned()),
+        }
+    }
+
+    fn from_arc(val: Arc<T>) -> Self {
+        match ::std::sync::Arc::<T>::try_unwrap(val) {
+            Ok(v) => Self::new(v),
+            Err(r) => Self::new(r.cloned()),
+        }
+    }
+}
+
+// We do this a lot for errors.
+pub trait Cloned<T> {
+    fn cloned(&self) -> T;
+    fn to_value_rc(&self) -> ValueRc<T>;
+}
+
+impl<T: Clone> Cloned<T> for Rc<T> where T: Sized + Clone {
+    fn cloned(&self) -> T {
+        (*self.as_ref()).clone()
+    }
+
+    fn to_value_rc(&self) -> ValueRc<T> {
+        ValueRc::from_rc(self.clone())
+    }
+}
+
+impl<T: Clone> Cloned<T> for Arc<T> where T: Sized + Clone {
+    fn cloned(&self) -> T {
+        (*self.as_ref()).clone()
+    }
+
+    fn to_value_rc(&self) -> ValueRc<T> {
+        ValueRc::from_arc(self.clone())
+    }
+}
+
+impl<T: Clone> Cloned<T> for Box<T> where T: Sized + Clone {
+    fn cloned(&self) -> T {
+        self.as_ref().clone()
+    }
+
+    fn to_value_rc(&self) -> ValueRc<T> {
+        ValueRc::new(self.cloned())
+    }
+}
+
+///
+/// This type alias exists to allow us to use different boxing mechanisms for values.
+/// This type must implement `FromRc` and `Cloned`, and a `From` implementation must exist for
+/// `TypedValue`.
+///
+pub type ValueRc<T> = Arc<T>;
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat/conn.rs.html b/docs/apis/rust/0.7.0/src/mentat/conn.rs.html new file mode 100644 index 00000000..88eb93da --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat/conn.rs.html @@ -0,0 +1,2590 @@ + + + + + + + + + + conn.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+use std::borrow::{
+    Borrow,
+};
+
+use std::collections::{
+    BTreeMap,
+};
+
+use std::fs::{
+    File,
+};
+
+use std::io::{
+    Read,
+};
+
+use std::path::{
+    Path,
+};
+
+use std::sync::{
+    Arc,
+    Mutex,
+};
+
+use rusqlite;
+use rusqlite::{
+    TransactionBehavior,
+};
+
+use edn;
+
+use mentat_core::{
+    Attribute,
+    Entid,
+    HasSchema,
+    KnownEntid,
+    Keyword,
+    Schema,
+    StructuredMap,
+    TypedValue,
+    ValueRc,
+    ValueType,
+};
+
+use mentat_core::intern_set::InternSet;
+
+use mentat_db::cache::{
+    InProgressCacheTransactWatcher,
+    InProgressSQLiteAttributeCache,
+    SQLiteAttributeCache,
+};
+
+use mentat_db::db;
+use mentat_db::{
+    transact,
+    transact_terms,
+    InProgressObserverTransactWatcher,
+    PartitionMap,
+    TransactableValue,
+    TransactWatcher,
+    TxObservationService,
+    TxObserver,
+    TxReport,
+};
+
+use mentat_db::internal_types::TermWithTempIds;
+
+use mentat_query_pull::{
+    pull_attributes_for_entities,
+    pull_attributes_for_entity,
+};
+
+use edn::entities::{
+    TempId,
+    OpType,
+};
+
+use entity_builder::{
+    InProgressBuilder,
+    TermBuilder,
+};
+
+use errors::{
+    Result,
+    MentatError,
+};
+
+use query::{
+    Known,
+    PreparedResult,
+    QueryExplanation,
+    QueryInputs,
+    QueryOutput,
+    lookup_value_for_attribute,
+    lookup_values_for_attribute,
+    q_explain,
+    q_once,
+    q_prepare,
+    q_uncached,
+};
+
+/// Connection metadata required to query from, or apply transactions to, a Mentat store.
+///
+/// Owned data for the volatile parts (generation and partition map), and `Arc` for the infrequently
+/// changing parts (schema) that we want to share across threads.
+///
+/// See https://github.com/mozilla/mentat/wiki/Thoughts:-modeling-db-conn-in-Rust.
+pub struct Metadata {
+    pub generation: u64,
+    pub partition_map: PartitionMap,
+    pub schema: Arc<Schema>,
+    pub attribute_cache: SQLiteAttributeCache,
+}
+
+impl Metadata {
+    // Intentionally not public.
+    fn new(generation: u64, partition_map: PartitionMap, schema: Arc<Schema>, cache: SQLiteAttributeCache) -> Metadata {
+        Metadata {
+            generation: generation,
+            partition_map: partition_map,
+            schema: schema,
+            attribute_cache: cache,
+        }
+    }
+}
+
+/// A mutable, safe reference to the current Mentat store.
+pub struct Conn {
+    /// `Mutex` since all reads and writes need to be exclusive.  Internally, owned data for the
+    /// volatile parts (generation and partition map), and `Arc` for the infrequently changing parts
+    /// (schema, cache) that we want to share across threads.  A consuming thread may use a shared
+    /// reference after the `Conn`'s `Metadata` has moved on.
+    ///
+    /// The motivating case is multiple query threads taking references to the current schema to
+    /// perform long-running queries while a single writer thread moves the metadata -- partition
+    /// map and schema -- forward.
+    ///
+    /// We want the attribute cache to be isolated across transactions, updated within
+    /// `InProgress` writes, and updated in the `Conn` on commit. To achieve this we
+    /// store the cache itself in an `Arc` inside `SQLiteAttributeCache`, so that `.get_mut()`
+    /// gives us copy-on-write semantics.
+    /// We store that cached `Arc` here in a `Mutex`, so that the main copy can be carefully
+    /// replaced on commit.
+    metadata: Mutex<Metadata>,
+
+    // TODO: maintain set of change listeners or handles to transaction report queues. #298.
+
+    // TODO: maintain cache of query plans that could be shared across threads and invalidated when
+    // the schema changes. #315.
+    pub(crate) tx_observer_service: Mutex<TxObservationService>,
+}
+
+pub trait Queryable {
+    fn q_explain<T>(&self, query: &str, inputs: T) -> Result<QueryExplanation>
+        where T: Into<Option<QueryInputs>>;
+    fn q_once<T>(&self, query: &str, inputs: T) -> Result<QueryOutput>
+        where T: Into<Option<QueryInputs>>;
+    fn q_prepare<T>(&self, query: &str, inputs: T) -> PreparedResult
+        where T: Into<Option<QueryInputs>>;
+    fn lookup_values_for_attribute<E>(&self, entity: E, attribute: &edn::Keyword) -> Result<Vec<TypedValue>>
+        where E: Into<Entid>;
+    fn lookup_value_for_attribute<E>(&self, entity: E, attribute: &edn::Keyword) -> Result<Option<TypedValue>>
+        where E: Into<Entid>;
+}
+
+pub trait Pullable {
+    fn pull_attributes_for_entities<E, A>(&self, entities: E, attributes: A) -> Result<BTreeMap<Entid, ValueRc<StructuredMap>>>
+    where E: IntoIterator<Item=Entid>,
+          A: IntoIterator<Item=Entid>;
+    fn pull_attributes_for_entity<A>(&self, entity: Entid, attributes: A) -> Result<StructuredMap>
+    where A: IntoIterator<Item=Entid>;
+}
+
+pub trait Syncable {
+    fn sync(&mut self, server_uri: &String, user_uuid: &String) -> Result<()>;
+}
+
+/// Represents an in-progress, not yet committed, set of changes to the store.
+/// Call `commit` to commit your changes, or `rollback` to discard them.
+/// A transaction is held open until you do so.
+/// Your changes will be implicitly dropped along with this struct.
+pub struct InProgress<'a, 'c> {
+    transaction: rusqlite::Transaction<'c>,
+    mutex: &'a Mutex<Metadata>,
+    generation: u64,
+    partition_map: PartitionMap,
+    pub(crate) schema: Schema,
+    pub(crate) cache: InProgressSQLiteAttributeCache,
+    use_caching: bool,
+    tx_observer: &'a Mutex<TxObservationService>,
+    tx_observer_watcher: InProgressObserverTransactWatcher,
+}
+
+/// Represents an in-progress set of reads to the store. Just like `InProgress`,
+/// which is read-write, but only allows for reads.
+pub struct InProgressRead<'a, 'c>(InProgress<'a, 'c>);
+
+impl<'a, 'c> Queryable for InProgressRead<'a, 'c> {
+    fn q_once<T>(&self, query: &str, inputs: T) -> Result<QueryOutput>
+        where T: Into<Option<QueryInputs>> {
+        self.0.q_once(query, inputs)
+    }
+
+    fn q_prepare<T>(&self, query: &str, inputs: T) -> PreparedResult
+        where T: Into<Option<QueryInputs>> {
+        self.0.q_prepare(query, inputs)
+    }
+
+    fn q_explain<T>(&self, query: &str, inputs: T) -> Result<QueryExplanation>
+        where T: Into<Option<QueryInputs>> {
+        self.0.q_explain(query, inputs)
+    }
+
+    fn lookup_values_for_attribute<E>(&self, entity: E, attribute: &edn::Keyword) -> Result<Vec<TypedValue>>
+        where E: Into<Entid> {
+        self.0.lookup_values_for_attribute(entity, attribute)
+    }
+
+    fn lookup_value_for_attribute<E>(&self, entity: E, attribute: &edn::Keyword) -> Result<Option<TypedValue>>
+        where E: Into<Entid> {
+        self.0.lookup_value_for_attribute(entity, attribute)
+    }
+}
+
+impl<'a, 'c> Pullable for InProgressRead<'a, 'c> {
+    fn pull_attributes_for_entities<E, A>(&self, entities: E, attributes: A) -> Result<BTreeMap<Entid, ValueRc<StructuredMap>>>
+    where E: IntoIterator<Item=Entid>,
+          A: IntoIterator<Item=Entid> {
+        self.0.pull_attributes_for_entities(entities, attributes)
+    }
+
+    fn pull_attributes_for_entity<A>(&self, entity: Entid, attributes: A) -> Result<StructuredMap>
+    where A: IntoIterator<Item=Entid> {
+        self.0.pull_attributes_for_entity(entity, attributes)
+    }
+}
+
+impl<'a, 'c> Queryable for InProgress<'a, 'c> {
+    fn q_once<T>(&self, query: &str, inputs: T) -> Result<QueryOutput>
+        where T: Into<Option<QueryInputs>> {
+
+        if self.use_caching {
+            let known = Known::new(&self.schema, Some(&self.cache));
+            q_once(&*(self.transaction),
+                   known,
+                   query,
+                   inputs)
+        } else {
+            q_uncached(&*(self.transaction),
+                       &self.schema,
+                       query,
+                       inputs)
+        }
+    }
+
+    fn q_prepare<T>(&self, query: &str, inputs: T) -> PreparedResult
+        where T: Into<Option<QueryInputs>> {
+
+        let known = Known::new(&self.schema, Some(&self.cache));
+        q_prepare(&*(self.transaction),
+                  known,
+                  query,
+                  inputs)
+    }
+
+    fn q_explain<T>(&self, query: &str, inputs: T) -> Result<QueryExplanation>
+        where T: Into<Option<QueryInputs>> {
+
+        let known = Known::new(&self.schema, Some(&self.cache));
+        q_explain(&*(self.transaction),
+                  known,
+                  query,
+                  inputs)
+    }
+
+    fn lookup_values_for_attribute<E>(&self, entity: E, attribute: &edn::Keyword) -> Result<Vec<TypedValue>>
+        where E: Into<Entid> {
+        let known = Known::new(&self.schema, Some(&self.cache));
+        lookup_values_for_attribute(&*(self.transaction), known, entity, attribute)
+    }
+
+    fn lookup_value_for_attribute<E>(&self, entity: E, attribute: &edn::Keyword) -> Result<Option<TypedValue>>
+        where E: Into<Entid> {
+        let known = Known::new(&self.schema, Some(&self.cache));
+        lookup_value_for_attribute(&*(self.transaction), known, entity, attribute)
+    }
+}
+
+impl<'a, 'c> Pullable for InProgress<'a, 'c> {
+    fn pull_attributes_for_entities<E, A>(&self, entities: E, attributes: A) -> Result<BTreeMap<Entid, ValueRc<StructuredMap>>>
+    where E: IntoIterator<Item=Entid>,
+          A: IntoIterator<Item=Entid> {
+        pull_attributes_for_entities(&self.schema, &*(self.transaction), entities, attributes)
+            .map_err(|e| e.into())
+    }
+
+    fn pull_attributes_for_entity<A>(&self, entity: Entid, attributes: A) -> Result<StructuredMap>
+    where A: IntoIterator<Item=Entid> {
+        pull_attributes_for_entity(&self.schema, &*(self.transaction), entity, attributes)
+            .map_err(|e| e.into())
+    }
+}
+
+impl<'a, 'c> HasSchema for InProgressRead<'a, 'c> {
+    fn entid_for_type(&self, t: ValueType) -> Option<KnownEntid> {
+        self.0.entid_for_type(t)
+    }
+
+    fn get_ident<T>(&self, x: T) -> Option<&Keyword> where T: Into<Entid> {
+        self.0.get_ident(x)
+    }
+
+    fn get_entid(&self, x: &Keyword) -> Option<KnownEntid> {
+        self.0.get_entid(x)
+    }
+
+    fn attribute_for_entid<T>(&self, x: T) -> Option<&Attribute> where T: Into<Entid> {
+        self.0.attribute_for_entid(x)
+    }
+
+    fn attribute_for_ident(&self, ident: &Keyword) -> Option<(&Attribute, KnownEntid)> {
+        self.0.attribute_for_ident(ident)
+    }
+
+    /// Return true if the provided entid identifies an attribute in this schema.
+    fn is_attribute<T>(&self, x: T) -> bool where T: Into<Entid> {
+        self.0.is_attribute(x)
+    }
+
+    /// Return true if the provided ident identifies an attribute in this schema.
+    fn identifies_attribute(&self, x: &Keyword) -> bool {
+        self.0.identifies_attribute(x)
+    }
+
+    fn component_attributes(&self) -> &[Entid] {
+        self.0.component_attributes()
+    }
+}
+
+impl<'a, 'c> HasSchema for InProgress<'a, 'c> {
+    fn entid_for_type(&self, t: ValueType) -> Option<KnownEntid> {
+        self.schema.entid_for_type(t)
+    }
+
+    fn get_ident<T>(&self, x: T) -> Option<&Keyword> where T: Into<Entid> {
+        self.schema.get_ident(x)
+    }
+
+    fn get_entid(&self, x: &Keyword) -> Option<KnownEntid> {
+        self.schema.get_entid(x)
+    }
+
+    fn attribute_for_entid<T>(&self, x: T) -> Option<&Attribute> where T: Into<Entid> {
+        self.schema.attribute_for_entid(x)
+    }
+
+    fn attribute_for_ident(&self, ident: &Keyword) -> Option<(&Attribute, KnownEntid)> {
+        self.schema.attribute_for_ident(ident)
+    }
+
+    /// Return true if the provided entid identifies an attribute in this schema.
+    fn is_attribute<T>(&self, x: T) -> bool where T: Into<Entid> {
+        self.schema.is_attribute(x)
+    }
+
+    /// Return true if the provided ident identifies an attribute in this schema.
+    fn identifies_attribute(&self, x: &Keyword) -> bool {
+        self.schema.identifies_attribute(x)
+    }
+
+    fn component_attributes(&self) -> &[Entid] {
+        self.schema.component_attributes()
+    }
+}
+
+
+impl<'a, 'c> InProgress<'a, 'c> {
+    pub fn builder(self) -> InProgressBuilder<'a, 'c> {
+        InProgressBuilder::new(self)
+    }
+
+    /// Choose whether to use in-memory caches for running queries.
+    pub fn use_caching(&mut self, yesno: bool) {
+        self.use_caching = yesno;
+    }
+
+    /// If you only have a reference to an `InProgress`, you can't use the easy builder.
+    /// This exists so you can make your own.
+    pub fn transact_builder(&mut self, builder: TermBuilder) -> Result<TxReport> {
+        builder.build()
+               .and_then(|(terms, tempid_set)| {
+                    self.transact_terms(terms, tempid_set)
+               })
+    }
+
+    pub fn transact_terms<I>(&mut self, terms: I, tempid_set: InternSet<TempId>) -> Result<TxReport> where I: IntoIterator<Item=TermWithTempIds> {
+        let w = InProgressTransactWatcher::new(
+                &mut self.tx_observer_watcher,
+                self.cache.transact_watcher());
+        let (report, next_partition_map, next_schema, _watcher) =
+            transact_terms(&self.transaction,
+                           self.partition_map.clone(),
+                           &self.schema,
+                           &self.schema,
+                           w,
+                           terms,
+                           tempid_set)?;
+        self.partition_map = next_partition_map;
+        if let Some(schema) = next_schema {
+            self.schema = schema;
+        }
+        Ok(report)
+    }
+
+    pub fn transact_entities<I, V: TransactableValue>(&mut self, entities: I) -> Result<TxReport> where I: IntoIterator<Item=edn::entities::Entity<V>> {
+        // We clone the partition map here, rather than trying to use a Cell or using a mutable
+        // reference, for two reasons:
+        // 1. `transact` allocates new IDs in partitions before and while doing work that might
+        //    fail! We don't want to mutate this map on failure, so we can't just use &mut.
+        // 2. Even if we could roll that back, we end up putting this `PartitionMap` into our
+        //    `Metadata` on return. If we used `Cell` or other mechanisms, we'd be using
+        //    `Default::default` in those situations to extract the partition map, and so there
+        //    would still be some cost.
+        let w = InProgressTransactWatcher::new(
+                &mut self.tx_observer_watcher,
+                self.cache.transact_watcher());
+        let (report, next_partition_map, next_schema, _watcher) =
+            transact(&self.transaction,
+                     self.partition_map.clone(),
+                     &self.schema,
+                     &self.schema,
+                     w,
+                     entities)?;
+        self.partition_map = next_partition_map;
+        if let Some(schema) = next_schema {
+            self.schema = schema;
+        }
+        Ok(report)
+    }
+
+    pub fn transact<B>(&mut self, transaction: B) -> Result<TxReport> where B: Borrow<str> {
+        let entities = edn::parse::entities(transaction.borrow())?;
+        self.transact_entities(entities)
+    }
+
+    pub fn import<P>(&mut self, path: P) -> Result<TxReport>
+    where P: AsRef<Path> {
+        let mut file = File::open(path)?;
+        let mut text: String = String::new();
+        file.read_to_string(&mut text)?;
+        self.transact(text.as_str())
+    }
+
+    pub fn rollback(self) -> Result<()> {
+        self.transaction.rollback().map_err(|e| e.into())
+    }
+
+    pub fn commit(self) -> Result<()> {
+        // The mutex is taken during this entire method.
+        let mut metadata = self.mutex.lock().unwrap();
+
+        if self.generation != metadata.generation {
+            // Somebody else wrote!
+            // Retrying is tracked by https://github.com/mozilla/mentat/issues/357.
+            // This should not occur -- an attempt to take a competing IMMEDIATE transaction
+            // will fail with `SQLITE_BUSY`, causing this function to abort.
+            bail!(MentatError::UnexpectedLostTransactRace);
+        }
+
+        // Commit the SQLite transaction while we hold the mutex.
+        self.transaction.commit()?;
+
+        metadata.generation += 1;
+        metadata.partition_map = self.partition_map;
+
+        // Update the conn's cache if we made any changes.
+        self.cache.commit_to(&mut metadata.attribute_cache);
+
+        if self.schema != *(metadata.schema) {
+            metadata.schema = Arc::new(self.schema);
+
+            // TODO: rebuild vocabularies and notify consumers that they've changed -- it's possible
+            // that a change has arrived over the wire and invalidated some local module.
+            // TODO: consider making vocabulary lookup lazy -- we won't need it much of the time.
+        }
+
+        let txes = self.tx_observer_watcher.txes;
+        self.tx_observer.lock().unwrap().in_progress_did_commit(txes);
+
+        Ok(())
+    }
+
+    pub fn cache(&mut self,
+                 attribute: &Keyword,
+                 cache_direction: CacheDirection,
+                 cache_action: CacheAction) -> Result<()> {
+        let attribute_entid: Entid = self.schema
+                                         .attribute_for_ident(&attribute)
+                                         .ok_or_else(|| MentatError::UnknownAttribute(attribute.to_string()))?.1.into();
+
+        match cache_action {
+            CacheAction::Register => {
+                match cache_direction {
+                    CacheDirection::Both => self.cache.register(&self.schema, &self.transaction, attribute_entid),
+                    CacheDirection::Forward => self.cache.register_forward(&self.schema, &self.transaction, attribute_entid),
+                    CacheDirection::Reverse => self.cache.register_reverse(&self.schema, &self.transaction, attribute_entid),
+                }.map_err(|e| e.into())
+            },
+            CacheAction::Deregister => {
+                self.cache.unregister(attribute_entid);
+                Ok(())
+            },
+        }
+    }
+}
+
+struct InProgressTransactWatcher<'a, 'o> {
+    cache_watcher: InProgressCacheTransactWatcher<'a>,
+    observer_watcher: &'o mut InProgressObserverTransactWatcher,
+    tx_id: Option<Entid>,
+}
+
+impl<'a, 'o> InProgressTransactWatcher<'a, 'o> {
+    fn new(observer_watcher: &'o mut InProgressObserverTransactWatcher, cache_watcher: InProgressCacheTransactWatcher<'a>) -> Self {
+        InProgressTransactWatcher {
+            cache_watcher: cache_watcher,
+            observer_watcher: observer_watcher,
+            tx_id: None,
+        }
+    }
+}
+
+impl<'a, 'o> TransactWatcher for InProgressTransactWatcher<'a, 'o> {
+    fn datom(&mut self, op: OpType, e: Entid, a: Entid, v: &TypedValue) {
+        self.cache_watcher.datom(op.clone(), e.clone(), a.clone(), v);
+        self.observer_watcher.datom(op.clone(), e.clone(), a.clone(), v);
+    }
+
+    fn done(&mut self, t: &Entid, schema: &Schema) -> ::mentat_db::errors::Result<()> {
+        self.cache_watcher.done(t, schema)?;
+        self.observer_watcher.done(t, schema)?;
+        self.tx_id = Some(t.clone());
+        Ok(())
+    }
+}
+
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
+pub enum CacheDirection {
+    Forward,
+    Reverse,
+    Both,
+}
+
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
+pub enum CacheAction {
+    Register,
+    Deregister,
+}
+
+impl Conn {
+    // Intentionally not public.
+    fn new(partition_map: PartitionMap, schema: Schema) -> Conn {
+        Conn {
+            metadata: Mutex::new(Metadata::new(0, partition_map, Arc::new(schema), Default::default())),
+            tx_observer_service: Mutex::new(TxObservationService::new()),
+        }
+    }
+
+    /// Prepare the provided SQLite handle for use as a Mentat store. Creates tables but
+    /// _does not_ write the bootstrap schema. This constructor should only be used by
+    /// consumers that expect to populate raw transaction data themselves.
+
+    pub(crate) fn empty(sqlite: &mut rusqlite::Connection) -> Result<Conn> {
+        let (tx, db) = db::create_empty_current_version(sqlite)?;
+        tx.commit()?;
+        Ok(Conn::new(db.partition_map, db.schema))
+    }
+
+
+    pub fn connect(sqlite: &mut rusqlite::Connection) -> Result<Conn> {
+        let db = db::ensure_current_version(sqlite)?;
+        Ok(Conn::new(db.partition_map, db.schema))
+    }
+
+    /// Yield a clone of the current `Schema` instance.
+    pub fn current_schema(&self) -> Arc<Schema> {
+        // We always unwrap the mutex lock: if it's poisoned, this will propogate panics to all
+        // accessing threads.  This is perhaps not reasonable; we expect the mutex to be held for
+        // very short intervals, but a panic during a critical update section is possible, since the
+        // lock encapsulates committing a SQL transaction.
+        //
+        // That being said, in the future we will provide an interface to take the mutex, providing
+        // maximum flexibility for Mentat consumers.
+        //
+        // This approach might need to change when we support interrupting query threads (#297), and
+        // will definitely need to change if we support interrupting transactor threads.
+        //
+        // Improving this is tracked by https://github.com/mozilla/mentat/issues/356.
+        self.metadata.lock().unwrap().schema.clone()
+    }
+
+    pub fn current_cache(&self) -> SQLiteAttributeCache {
+        self.metadata.lock().unwrap().attribute_cache.clone()
+    }
+
+    /// Query the Mentat store, using the given connection and the current metadata.
+    pub fn q_once<T>(&self,
+                     sqlite: &rusqlite::Connection,
+                     query: &str,
+                     inputs: T) -> Result<QueryOutput>
+        where T: Into<Option<QueryInputs>> {
+
+        // Doesn't clone, unlike `current_schema`.
+        let metadata = self.metadata.lock().unwrap();
+        let known = Known::new(&*metadata.schema, Some(&metadata.attribute_cache));
+        q_once(sqlite,
+               known,
+               query,
+               inputs)
+    }
+
+    /// Query the Mentat store, using the given connection and the current metadata,
+    /// but without using the cache.
+    pub fn q_uncached<T>(&self,
+                         sqlite: &rusqlite::Connection,
+                         query: &str,
+                         inputs: T) -> Result<QueryOutput>
+        where T: Into<Option<QueryInputs>> {
+
+        let metadata = self.metadata.lock().unwrap();
+        q_uncached(sqlite,
+                   &*metadata.schema,        // Doesn't clone, unlike `current_schema`.
+                   query,
+                   inputs)
+    }
+
+    pub fn q_prepare<'sqlite, 'query, T>(&self,
+                        sqlite: &'sqlite rusqlite::Connection,
+                        query: &'query str,
+                        inputs: T) -> PreparedResult<'sqlite>
+        where T: Into<Option<QueryInputs>> {
+
+        let metadata = self.metadata.lock().unwrap();
+        let known = Known::new(&*metadata.schema, Some(&metadata.attribute_cache));
+        q_prepare(sqlite,
+                  known,
+                  query,
+                  inputs)
+    }
+
+    pub fn q_explain<T>(&self,
+                        sqlite: &rusqlite::Connection,
+                        query: &str,
+                        inputs: T) -> Result<QueryExplanation>
+        where T: Into<Option<QueryInputs>>
+    {
+        let metadata = self.metadata.lock().unwrap();
+        let known = Known::new(&*metadata.schema, Some(&metadata.attribute_cache));
+        q_explain(sqlite,
+                  known,
+                  query,
+                  inputs)
+    }
+
+    pub fn pull_attributes_for_entities<E, A>(&self,
+                                              sqlite: &rusqlite::Connection,
+                                              entities: E,
+                                              attributes: A) -> Result<BTreeMap<Entid, ValueRc<StructuredMap>>>
+        where E: IntoIterator<Item=Entid>,
+              A: IntoIterator<Item=Entid> {
+        let metadata = self.metadata.lock().unwrap();
+        let schema = &*metadata.schema;
+        pull_attributes_for_entities(schema, sqlite, entities, attributes)
+            .map_err(|e| e.into())
+    }
+
+    pub fn pull_attributes_for_entity<A>(&self,
+                                         sqlite: &rusqlite::Connection,
+                                         entity: Entid,
+                                         attributes: A) -> Result<StructuredMap>
+        where A: IntoIterator<Item=Entid> {
+        let metadata = self.metadata.lock().unwrap();
+        let schema = &*metadata.schema;
+        pull_attributes_for_entity(schema, sqlite, entity, attributes)
+            .map_err(|e| e.into())
+    }
+
+    pub fn lookup_values_for_attribute(&self,
+                                       sqlite: &rusqlite::Connection,
+                                       entity: Entid,
+                                       attribute: &edn::Keyword) -> Result<Vec<TypedValue>> {
+        let metadata = self.metadata.lock().unwrap();
+        let known = Known::new(&*metadata.schema, Some(&metadata.attribute_cache));
+        lookup_values_for_attribute(sqlite, known, entity, attribute)
+    }
+
+    pub fn lookup_value_for_attribute(&self,
+                                      sqlite: &rusqlite::Connection,
+                                      entity: Entid,
+                                      attribute: &edn::Keyword) -> Result<Option<TypedValue>> {
+        let metadata = self.metadata.lock().unwrap();
+        let known = Known::new(&*metadata.schema, Some(&metadata.attribute_cache));
+        lookup_value_for_attribute(sqlite, known, entity, attribute)
+    }
+
+    /// Take a SQLite transaction.
+    fn begin_transaction_with_behavior<'m, 'conn>(&'m mut self, sqlite: &'conn mut rusqlite::Connection, behavior: TransactionBehavior) -> Result<InProgress<'m, 'conn>> {
+        let tx = sqlite.transaction_with_behavior(behavior)?;
+        let (current_generation, current_partition_map, current_schema, cache_cow) =
+        {
+            // The mutex is taken during this block.
+            let ref current: Metadata = *self.metadata.lock().unwrap();
+            (current.generation,
+             // Expensive, but the partition map is updated after every committed transaction.
+             current.partition_map.clone(),
+             // Cheap.
+             current.schema.clone(),
+             current.attribute_cache.clone())
+        };
+
+        Ok(InProgress {
+            mutex: &self.metadata,
+            transaction: tx,
+            generation: current_generation,
+            partition_map: current_partition_map,
+            schema: (*current_schema).clone(),
+            cache: InProgressSQLiteAttributeCache::from_cache(cache_cow),
+            use_caching: true,
+            tx_observer: &self.tx_observer_service,
+            tx_observer_watcher: InProgressObserverTransactWatcher::new(),
+        })
+    }
+
+    // Helper to avoid passing connections around.
+    // Make both args mutable so that we can't have parallel access.
+    pub fn begin_read<'m, 'conn>(&'m mut self, sqlite: &'conn mut rusqlite::Connection) -> Result<InProgressRead<'m, 'conn>> {
+        self.begin_transaction_with_behavior(sqlite, TransactionBehavior::Deferred)
+            .map(InProgressRead)
+    }
+
+    pub fn begin_uncached_read<'m, 'conn>(&'m mut self, sqlite: &'conn mut rusqlite::Connection) -> Result<InProgressRead<'m, 'conn>> {
+        self.begin_transaction_with_behavior(sqlite, TransactionBehavior::Deferred)
+            .map(|mut ip| {
+                ip.use_caching(false);
+                InProgressRead(ip)
+            })
+    }
+
+    /// IMMEDIATE means 'start the transaction now, but don't exclude readers'. It prevents other
+    /// connections from taking immediate or exclusive transactions. This is appropriate for our
+    /// writes and `InProgress`: it means we are ready to write whenever we want to, and nobody else
+    /// can start a transaction that's not `DEFERRED`, but we don't need exclusivity yet.
+    pub fn begin_transaction<'m, 'conn>(&'m mut self, sqlite: &'conn mut rusqlite::Connection) -> Result<InProgress<'m, 'conn>> {
+        self.begin_transaction_with_behavior(sqlite, TransactionBehavior::Immediate)
+    }
+
+    /// Transact entities against the Mentat store, using the given connection and the current
+    /// metadata.
+    pub fn transact<B>(&mut self,
+                    sqlite: &mut rusqlite::Connection,
+                    transaction: B) -> Result<TxReport> where B: Borrow<str> {
+        // Parse outside the SQL transaction. This is a tradeoff: we are limiting the scope of the
+        // transaction, and indeed we don't even create a SQL transaction if the provided input is
+        // invalid, but it means SQLite errors won't be found until the parse is complete, and if
+        // there's a race for the database (don't do that!) we are less likely to win it.
+        let entities = edn::parse::entities(transaction.borrow())?;
+
+        let mut in_progress = self.begin_transaction(sqlite)?;
+        let report = in_progress.transact_entities(entities)?;
+        in_progress.commit()?;
+
+        Ok(report)
+    }
+
+    /// Adds or removes the values of a given attribute to an in-memory cache.
+    /// The attribute should be a namespaced string: e.g., `:foo/bar`.
+    /// `cache_action` determines if the attribute should be added or removed from the cache.
+    /// CacheAction::Add is idempotent - each attribute is only added once.
+    /// CacheAction::Remove throws an error if the attribute does not currently exist in the cache.
+    pub fn cache(&mut self,
+                 sqlite: &mut rusqlite::Connection,
+                 schema: &Schema,
+                 attribute: &Keyword,
+                 cache_direction: CacheDirection,
+                 cache_action: CacheAction) -> Result<()> {
+        let mut metadata = self.metadata.lock().unwrap();
+        let attribute_entid: Entid;
+
+        // Immutable borrow of metadata.
+        {
+            attribute_entid = metadata.schema
+                                      .attribute_for_ident(&attribute)
+                                      .ok_or_else(|| MentatError::UnknownAttribute(attribute.to_string()))?.1.into();
+        }
+
+        let cache = &mut metadata.attribute_cache;
+        match cache_action {
+            CacheAction::Register => {
+                match cache_direction {
+                    CacheDirection::Both => cache.register(schema, sqlite, attribute_entid),
+                    CacheDirection::Forward => cache.register_forward(schema, sqlite, attribute_entid),
+                    CacheDirection::Reverse => cache.register_reverse(schema, sqlite, attribute_entid),
+                }.map_err(|e| e.into())
+            },
+            CacheAction::Deregister => {
+                cache.unregister(attribute_entid);
+                Ok(())
+            },
+        }
+    }
+
+    pub fn register_observer(&mut self, key: String, observer: Arc<TxObserver>) {
+        self.tx_observer_service.lock().unwrap().register(key, observer);
+    }
+
+    pub fn unregister_observer(&mut self, key: &String) {
+        self.tx_observer_service.lock().unwrap().deregister(key);
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    extern crate time;
+    extern crate mentat_parser_utils;
+
+    use std::time::{
+        Instant,
+    };
+
+    use mentat_core::{
+        CachedAttributes,
+        Binding,
+        TypedValue,
+    };
+
+    use ::query::{
+        Variable,
+    };
+
+    use ::{
+        IntoResult,
+        QueryInputs,
+        QueryResults,
+    };
+
+    use mentat_db::USER0;
+
+    #[test]
+    fn test_transact_does_not_collide_existing_entids() {
+        let mut sqlite = db::new_connection("").unwrap();
+        let mut conn = Conn::connect(&mut sqlite).unwrap();
+
+        // Let's find out the next ID that'll be allocated. We're going to try to collide with it
+        // a bit later.
+        let next = conn.metadata.lock().expect("metadata")
+                       .partition_map[":db.part/user"].index;
+        let t = format!("[[:db/add {} :db.schema/attribute \"tempid\"]]", next + 1);
+
+        match conn.transact(&mut sqlite, t.as_str()).expect_err("expected transact error").downcast() {
+            Ok(::mentat_db::DbError::UnrecognizedEntid(e)) => {
+                assert_eq!(e, next + 1);
+            },
+            x => panic!("expected db error, got {:?}", x),
+        }
+
+        // Transact two more tempids.
+        let t = "[[:db/add \"one\" :db.schema/attribute \"more\"]]";
+        let report = conn.transact(&mut sqlite, t)
+                         .expect("transact succeeded");
+        assert_eq!(report.tempids["more"], next);
+        assert_eq!(report.tempids["one"], next + 1);
+    }
+
+    #[test]
+    fn test_transact_does_not_collide_new_entids() {
+        let mut sqlite = db::new_connection("").unwrap();
+        let mut conn = Conn::connect(&mut sqlite).unwrap();
+
+        // Let's find out the next ID that'll be allocated. We're going to try to collide with it.
+        let next = conn.metadata.lock().expect("metadata").partition_map[":db.part/user"].index;
+
+        // If this were to be resolved, we'd get [:db/add 65537 :db.schema/attribute 65537], but
+        // we should reject this, because the first ID was provided by the user!
+        let t = format!("[[:db/add {} :db.schema/attribute \"tempid\"]]", next);
+
+        match conn.transact(&mut sqlite, t.as_str()).expect_err("expected transact error").downcast() {
+            Ok(::mentat_db::DbError::UnrecognizedEntid(e)) => {
+                // All this, despite this being the ID we were about to allocate!
+                assert_eq!(e, next);
+            },
+            x => panic!("expected db error, got {:?}", x),
+        }
+
+        // And if we subsequently transact in a way that allocates one ID, we _will_ use that one.
+        // Note that `10` is a bootstrapped entid; we use it here as a known-good value.
+        let t = "[[:db/add 10 :db.schema/attribute \"temp\"]]";
+        let report = conn.transact(&mut sqlite, t)
+                         .expect("transact succeeded");
+        assert_eq!(report.tempids["temp"], next);
+    }
+
+    /// Return the entid that will be allocated to the next transacted tempid.
+    fn get_next_entid(conn: &Conn) -> i64 {
+        let partition_map = &conn.metadata.lock().unwrap().partition_map;
+        partition_map.get(":db.part/user").unwrap().index
+    }
+
+    #[test]
+    fn test_compound_transact() {
+        let mut sqlite = db::new_connection("").unwrap();
+        let mut conn = Conn::connect(&mut sqlite).unwrap();
+
+        let tempid_offset = get_next_entid(&conn);
+
+        let t = "[[:db/add \"one\" :db/ident :a/keyword1] \
+                  [:db/add \"two\" :db/ident :a/keyword2]]";
+
+        // This can refer to `t`, 'cos they occur in separate txes.
+        let t2 = "[{:db.schema/attribute \"three\", :db/ident :a/keyword1}]";
+
+        // Scoped borrow of `conn`.
+        {
+            let mut in_progress = conn.begin_transaction(&mut sqlite).expect("begun successfully");
+            let report = in_progress.transact(t).expect("transacted successfully");
+            let one = report.tempids.get("one").expect("found one").clone();
+            let two = report.tempids.get("two").expect("found two").clone();
+            assert!(one != two);
+            assert!(one == tempid_offset || one == tempid_offset + 1);
+            assert!(two == tempid_offset || two == tempid_offset + 1);
+
+            println!("RES: {:?}", in_progress.q_once("[:find ?v :where [?x :db/ident ?v]]", None).unwrap());
+
+            let during = in_progress.q_once("[:find ?x . :where [?x :db/ident :a/keyword1]]", None)
+                                    .expect("query succeeded");
+            assert_eq!(during.results, QueryResults::Scalar(Some(TypedValue::Ref(one).into())));
+
+            let report = in_progress.transact(t2).expect("t2 succeeded");
+            in_progress.commit().expect("commit succeeded");
+            let three = report.tempids.get("three").expect("found three").clone();
+            assert!(one != three);
+            assert!(two != three);
+        }
+
+        // The DB part table changed.
+        let tempid_offset_after = get_next_entid(&conn);
+        assert_eq!(tempid_offset + 3, tempid_offset_after);
+    }
+
+    #[test]
+    fn test_simple_prepared_query() {
+        let mut c = db::new_connection("").expect("Couldn't open conn.");
+        let mut conn = Conn::connect(&mut c).expect("Couldn't open DB.");
+        conn.transact(&mut c, r#"[
+            [:db/add "s" :db/ident :foo/boolean]
+            [:db/add "s" :db/valueType :db.type/boolean]
+            [:db/add "s" :db/cardinality :db.cardinality/one]
+        ]"#).expect("successful transaction");
+
+        let report = conn.transact(&mut c, r#"[
+            [:db/add "u" :foo/boolean true]
+            [:db/add "p" :foo/boolean false]
+        ]"#).expect("successful transaction");
+        let yes = report.tempids.get("u").expect("found it").clone();
+
+        let vv = Variable::from_valid_name("?v");
+
+        let values = QueryInputs::with_value_sequence(vec![(vv, true.into())]);
+
+        let read = conn.begin_read(&mut c).expect("read");
+
+        // N.B., you might choose to algebrize _without_ validating that the
+        // types are known. In this query we know that `?v` must be a boolean,
+        // and so we can kinda generate our own required input types!
+        let mut prepared = read.q_prepare(r#"[:find [?x ...]
+                                              :in ?v
+                                              :where [?x :foo/boolean ?v]]"#,
+                                          values).expect("prepare succeeded");
+
+        let yeses = prepared.run(None).expect("result");
+        assert_eq!(yeses.results, QueryResults::Coll(vec![TypedValue::Ref(yes).into()]));
+
+        let yeses_again = prepared.run(None).expect("result");
+        assert_eq!(yeses_again.results, QueryResults::Coll(vec![TypedValue::Ref(yes).into()]));
+    }
+
+    #[test]
+    fn test_compound_rollback() {
+        let mut sqlite = db::new_connection("").unwrap();
+        let mut conn = Conn::connect(&mut sqlite).unwrap();
+
+        let tempid_offset = get_next_entid(&conn);
+
+        // Nothing in the store => USER0 should be our starting point.
+        assert_eq!(tempid_offset, USER0);
+
+        let t = "[[:db/add \"one\" :db/ident :a/keyword1] \
+                  [:db/add \"two\" :db/ident :a/keyword2]]";
+
+        // Scoped borrow of `sqlite`.
+        {
+            let mut in_progress = conn.begin_transaction(&mut sqlite).expect("begun successfully");
+            let report = in_progress.transact(t).expect("transacted successfully");
+
+            let one = report.tempids.get("one").expect("found it").clone();
+            let two = report.tempids.get("two").expect("found it").clone();
+
+            // The IDs are contiguous, starting at the previous part index.
+            assert!(one != two);
+            assert!(one == tempid_offset || one == tempid_offset + 1);
+            assert!(two == tempid_offset || two == tempid_offset + 1);
+
+            // Inside the InProgress we can see our changes.
+            let during = in_progress.q_once("[:find ?x . :where [?x :db/ident :a/keyword1]]", None)
+                                    .expect("query succeeded");
+
+            assert_eq!(during.results, QueryResults::Scalar(Some(TypedValue::Ref(one).into())));
+
+            // And we can do direct lookup, too.
+            let kw = in_progress.lookup_value_for_attribute(one, &edn::Keyword::namespaced("db", "ident"))
+                                .expect("lookup succeeded");
+            assert_eq!(kw, Some(TypedValue::Keyword(edn::Keyword::namespaced("a", "keyword1").into())));
+
+            in_progress.rollback()
+                       .expect("rollback succeeded");
+        }
+
+        let after = conn.q_once(&mut sqlite, "[:find ?x . :where [?x :db/ident :a/keyword1]]", None)
+                        .expect("query succeeded");
+        assert_eq!(after.results, QueryResults::Scalar(None));
+
+        // The DB part table is unchanged.
+        let tempid_offset_after = get_next_entid(&conn);
+        assert_eq!(tempid_offset, tempid_offset_after);
+    }
+
+    #[test]
+    fn test_transact_errors() {
+        let mut sqlite = db::new_connection("").unwrap();
+        let mut conn = Conn::connect(&mut sqlite).unwrap();
+
+        // Good: empty transaction.
+        let report = conn.transact(&mut sqlite, "[]").unwrap();
+        assert_eq!(report.tx_id, 0x10000000 + 1);
+
+        // Bad EDN: missing closing ']'.
+        let report = conn.transact(&mut sqlite, "[[:db/add \"t\" :db/ident :a/keyword]");
+        match report.expect_err("expected transact to fail for bad edn").downcast() {
+            Ok(edn::ParseError { .. }) => { },
+            Err(x) => panic!("expected EDN parse error, got {:?}", x),
+        }
+
+        // Good EDN.
+        let report = conn.transact(&mut sqlite, "[[:db/add \"t\" :db/ident :a/keyword]]").unwrap();
+        assert_eq!(report.tx_id, 0x10000000 + 2);
+
+        // Bad transaction data: missing leading :db/add.
+        let report = conn.transact(&mut sqlite, "[[\"t\" :db/ident :b/keyword]]");
+        match report.expect_err("expected transact error").downcast() {
+            Ok(edn::ParseError { .. }) => { },
+            Err(x) => panic!("expected EDN parse error, got {:?}", x),
+        }
+
+        // Good transaction data.
+        let report = conn.transact(&mut sqlite, "[[:db/add \"u\" :db/ident :b/keyword]]").unwrap();
+        assert_eq!(report.tx_id, 0x10000000 + 3);
+
+        // Bad transaction based on state of store: conflicting upsert.
+        let report = conn.transact(&mut sqlite, "[[:db/add \"u\" :db/ident :a/keyword]
+                                                  [:db/add \"u\" :db/ident :b/keyword]]");
+        match report.expect_err("expected transact error").downcast() {
+            Ok(::mentat_db::DbError::SchemaConstraintViolation(_)) => { },
+            x => panic!("expected schema constraint violation, got {:?}", x),
+        }
+    }
+
+    #[test]
+    fn test_add_to_cache_failure_no_attribute() {
+        let mut sqlite = db::new_connection("").unwrap();
+        let mut conn = Conn::connect(&mut sqlite).unwrap();
+        let _report = conn.transact(&mut sqlite, r#"[
+            {  :db/ident       :foo/bar
+               :db/valueType   :db.type/long },
+            {  :db/ident       :foo/baz
+               :db/valueType   :db.type/boolean }]"#).unwrap();
+
+        let kw = kw!(:foo/bat);
+        let schema = conn.current_schema();
+        let res = conn.cache(&mut sqlite, &schema, &kw, CacheDirection::Forward, CacheAction::Register);
+        match res.expect_err("expected cache to fail").downcast() {
+            Ok(MentatError::UnknownAttribute(msg)) => assert_eq!(msg, ":foo/bat"),
+            x => panic!("expected UnknownAttribute error, got {:?}", x),
+        }
+    }
+
+    // TODO expand tests to cover lookup_value_for_attribute comparing with and without caching
+    #[test]
+    fn test_lookup_attribute_with_caching() {
+
+        let mut sqlite = db::new_connection("").unwrap();
+        let mut conn = Conn::connect(&mut sqlite).unwrap();
+        let _report = conn.transact(&mut sqlite, r#"[
+            {  :db/ident       :foo/bar
+               :db/valueType   :db.type/long },
+            {  :db/ident       :foo/baz
+               :db/valueType   :db.type/boolean }]"#).expect("transaction expected to succeed");
+
+        {
+            let mut in_progress = conn.begin_transaction(&mut sqlite).expect("transaction");
+            for _ in 1..100 {
+                let _report = in_progress.transact(r#"[
+            {  :foo/bar        100
+               :foo/baz        false },
+            {  :foo/bar        200
+               :foo/baz        true },
+            {  :foo/bar        100
+               :foo/baz        false },
+            {  :foo/bar        300
+               :foo/baz        true },
+            {  :foo/bar        400
+               :foo/baz        false },
+            {  :foo/bar        500
+               :foo/baz        true }]"#).expect("transaction expected to succeed");
+            }
+            in_progress.commit().expect("Committed");
+        }
+
+        let entities = conn.q_once(&sqlite, r#"[:find ?e . :where [?e :foo/bar 400]]"#, None).expect("Expected query to work").into_scalar().expect("expected rel results");
+        let first = entities.expect("expected a result");
+        let entid = match first {
+            Binding::Scalar(TypedValue::Ref(entid)) => entid,
+            x => panic!("expected Some(Ref), got {:?}", x),
+        };
+
+        let kw = kw!(:foo/bar);
+        let start = Instant::now();
+        let uncached_val = conn.lookup_value_for_attribute(&sqlite, entid, &kw).expect("Expected value on lookup");
+        let finish = Instant::now();
+        let uncached_elapsed_time = finish.duration_since(start);
+        println!("Uncached time: {:?}", uncached_elapsed_time);
+
+        let schema = conn.current_schema();
+        conn.cache(&mut sqlite, &schema, &kw, CacheDirection::Forward, CacheAction::Register).expect("expected caching to work");
+
+        for _ in 1..5 {
+            let start = Instant::now();
+            let cached_val = conn.lookup_value_for_attribute(&sqlite, entid, &kw).expect("Expected value on lookup");
+            let finish = Instant::now();
+            let cached_elapsed_time = finish.duration_since(start);
+            assert_eq!(cached_val, uncached_val);
+
+            println!("Cached time: {:?}", cached_elapsed_time);
+            assert!(cached_elapsed_time < uncached_elapsed_time);
+        }
+    }
+
+    #[test]
+    fn test_cache_usage() {
+        let mut sqlite = db::new_connection("").unwrap();
+        let mut conn = Conn::connect(&mut sqlite).unwrap();
+
+        let db_ident = (*conn.current_schema()).get_entid(&kw!(:db/ident)).expect("db_ident").0;
+        let db_type = (*conn.current_schema()).get_entid(&kw!(:db/valueType)).expect("db_ident").0;
+        println!("db/ident is {}", db_ident);
+        println!("db/type is {}", db_type);
+        let query = format!("[:find ?ident . :where [?e {} :db/doc][?e {} ?type][?type {} ?ident]]",
+                            db_ident, db_type, db_ident);
+
+        println!("Query is {}", query);
+
+        assert!(!conn.current_cache().is_attribute_cached_forward(db_ident));
+
+        {
+            let mut ip = conn.begin_transaction(&mut sqlite).expect("began");
+
+            let ident = ip.q_once(query.as_str(), None).into_scalar_result().expect("query");
+            assert_eq!(ident, Some(TypedValue::typed_ns_keyword("db.type", "string").into()));
+
+            let start = time::PreciseTime::now();
+            ip.q_once(query.as_str(), None).into_scalar_result().expect("query");
+            let end = time::PreciseTime::now();
+            println!("Uncached took {}µs", start.to(end).num_microseconds().unwrap());
+
+            ip.cache(&kw!(:db/ident), CacheDirection::Forward, CacheAction::Register).expect("registered");
+            ip.cache(&kw!(:db/valueType), CacheDirection::Forward, CacheAction::Register).expect("registered");
+
+            assert!(ip.cache.is_attribute_cached_forward(db_ident));
+
+            let ident = ip.q_once(query.as_str(), None).into_scalar_result().expect("query");
+            assert_eq!(ident, Some(TypedValue::typed_ns_keyword("db.type", "string").into()));
+
+            let start = time::PreciseTime::now();
+            ip.q_once(query.as_str(), None).into_scalar_result().expect("query");
+            let end = time::PreciseTime::now();
+            println!("Cached took {}µs", start.to(end).num_microseconds().unwrap());
+
+            // If we roll back the change, our caching operations are also rolled back.
+            ip.rollback().expect("rolled back");
+        }
+
+        assert!(!conn.current_cache().is_attribute_cached_forward(db_ident));
+
+        {
+            let mut ip = conn.begin_transaction(&mut sqlite).expect("began");
+
+            let ident = ip.q_once(query.as_str(), None).into_scalar_result().expect("query");
+            assert_eq!(ident, Some(TypedValue::typed_ns_keyword("db.type", "string").into()));
+            ip.cache(&kw!(:db/ident), CacheDirection::Forward, CacheAction::Register).expect("registered");
+            ip.cache(&kw!(:db/valueType), CacheDirection::Forward, CacheAction::Register).expect("registered");
+
+            assert!(ip.cache.is_attribute_cached_forward(db_ident));
+
+            ip.commit().expect("rolled back");
+        }
+
+        assert!(conn.current_cache().is_attribute_cached_forward(db_ident));
+        assert!(conn.current_cache().is_attribute_cached_forward(db_type));
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat/entity_builder.rs.html b/docs/apis/rust/0.7.0/src/mentat/entity_builder.rs.html new file mode 100644 index 00000000..dcb8124c --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat/entity_builder.rs.html @@ -0,0 +1,1186 @@ + + + + + + + + + + entity_builder.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![macro_use]
+
+// We have a little bit of a dilemma in Mentat.
+// The public data format for transacting is, fundamentally, a big string: EDN.
+// The internal data format for transacting is required to encode the complexities of
+// processing that format: temporary IDs, lookup refs, input spans, etc.
+//
+// See edn::entities::Entity and all of its child enums to see how complex this gets.
+//
+// A programmatic consumer doesn't want to build something that looks like:
+//
+//     Entity::AddOrRetract {
+//         op: OpType::Add,
+//         e: EntidOrLookupRefOrTempId::LookupRef(LookupRef {
+//             a: Entid::Ident(Keyword::namespaced("test", "a1")),
+//             v: Value::Text("v1".into()),
+//         }),
+//         a: Entid::Ident(kw!(:test/a)),
+//         v: AtomOrLookupRefOrVectorOrMapNotation::Atom(ValueAndSpan::new(SpannedValue::Text("v".into()), Span(44, 47))),
+//     }));
+//
+// but neither do they want to pay the cost of parsing
+//
+//    [[:test/a1 "v1"] :test/a "v"]
+//
+// at runtime.
+//
+// It's tempting to think that we can do something 'easy' here -- to skip the hard work of transacting
+// tempids, for example -- but to do so will hobble the system for little payoff. It's also worth
+// remembering that the transactor does significant validation work, which we don't want to
+// reimplement here.
+//
+// The win we seek is to make it easier to _write_ these inputs without significantly restricting
+// what can be said.
+//
+// There are two ways we could go from here.
+//
+// The first is to expose tx parsing as a macro: parse that string at compile time into the
+// equivalent `Entity` data structure. That's fine for completely static input data.
+//
+// The second is to expose a declarative, programmatic builder pattern for constructing entities.
+//
+// We probably need both, but this file provides the latter. Unfortunately, Entity -- the input to
+// the transactor -- is intimately tied to EDN and to spanned values.
+
+use mentat_core::{
+    HasSchema,
+    KnownEntid,
+    Keyword,
+    TypedValue,
+};
+
+use mentat_core::intern_set::InternSet;
+use mentat_core::util::Either;
+
+use mentat_db::{
+    TxReport,
+};
+
+use mentat_db::internal_types::{
+    KnownEntidOr,
+    TempIdHandle,
+    Term,
+    TermWithTempIds,
+    TypedValueOr,
+};
+
+use edn::entities::{
+    OpType,
+    TempId,
+};
+
+use conn::{
+    InProgress,
+};
+
+use errors::{
+    MentatError,
+    Result,
+};
+
+pub type Terms = (Vec<TermWithTempIds>, InternSet<TempId>);
+
+pub struct TermBuilder {
+    tempids: InternSet<TempId>,
+    terms: Vec<TermWithTempIds>,
+}
+
+pub struct EntityBuilder<T: BuildTerms + Sized> {
+    builder: T,
+    entity: KnownEntidOr<TempIdHandle>,
+}
+
+pub trait BuildTerms where Self: Sized {
+    fn named_tempid(&mut self, name: String) -> TempIdHandle;
+    fn describe_tempid(self, name: &str) -> EntityBuilder<Self>;
+    fn describe<E>(self, entity: E) -> EntityBuilder<Self> where E: IntoThing<KnownEntidOr<TempIdHandle>>;
+    fn add<E, V>(&mut self, e: E, a: KnownEntid, v: V) -> Result<()>
+    where E: IntoThing<KnownEntidOr<TempIdHandle>>,
+          V: IntoThing<TypedValueOr<TempIdHandle>>;
+    fn retract<E, V>(&mut self, e: E, a: KnownEntid, v: V) -> Result<()>
+    where E: IntoThing<KnownEntidOr<TempIdHandle>>,
+          V: IntoThing<TypedValueOr<TempIdHandle>>;
+}
+
+impl BuildTerms for TermBuilder {
+    fn named_tempid(&mut self, name: String) -> TempIdHandle {
+        self.tempids.intern(TempId::External(name))
+    }
+
+    fn describe_tempid(mut self, name: &str) -> EntityBuilder<Self> {
+        let e = self.named_tempid(name.into());
+        self.describe(e)
+    }
+
+    fn describe<E>(self, entity: E) -> EntityBuilder<Self> where E: IntoThing<KnownEntidOr<TempIdHandle>> {
+        EntityBuilder {
+            builder: self,
+            entity: entity.into_thing(),
+        }
+    }
+
+    fn add<E, V>(&mut self, e: E, a: KnownEntid, v: V) -> Result<()>
+    where E: IntoThing<KnownEntidOr<TempIdHandle>>,
+          V: IntoThing<TypedValueOr<TempIdHandle>> {
+        let e = e.into_thing();
+        let v = v.into_thing();
+        self.terms.push(Term::AddOrRetract(OpType::Add, e, a.into(), v));
+        Ok(())
+    }
+
+    fn retract<E, V>(&mut self, e: E, a: KnownEntid, v: V) -> Result<()>
+    where E: IntoThing<KnownEntidOr<TempIdHandle>>,
+          V: IntoThing<TypedValueOr<TempIdHandle>> {
+        let e = e.into_thing();
+        let v = v.into_thing();
+        self.terms.push(Term::AddOrRetract(OpType::Retract, e, a.into(), v));
+        Ok(())
+    }
+}
+
+impl TermBuilder {
+    pub fn build(self) -> Result<Terms> {
+        Ok((self.terms, self.tempids))
+    }
+
+    pub fn new() -> TermBuilder {
+        TermBuilder {
+            tempids: InternSet::new(),
+            terms: vec![],
+        }
+    }
+
+    pub fn is_empty(&self) -> bool {
+        self.terms.is_empty()
+    }
+
+    #[allow(dead_code)]
+    pub fn numbered_tempid(&mut self, id: i64) -> TempIdHandle {
+        self.tempids.intern(TempId::Internal(id))
+    }
+}
+
+impl<T> EntityBuilder<T> where T: BuildTerms {
+    pub fn finish(self) -> (T, KnownEntidOr<TempIdHandle>) {
+        (self.builder, self.entity)
+    }
+
+    pub fn add<V>(&mut self, a: KnownEntid, v: V) -> Result<()>
+    where V: IntoThing<TypedValueOr<TempIdHandle>> {
+        self.builder.add(self.entity.clone(), a, v)
+    }
+
+    pub fn retract<V>(&mut self, a: KnownEntid, v: V) -> Result<()>
+    where V: IntoThing<TypedValueOr<TempIdHandle>> {
+        self.builder.retract(self.entity.clone(), a, v)
+    }
+}
+
+pub struct InProgressBuilder<'a, 'c> {
+    in_progress: InProgress<'a, 'c>,
+    builder: TermBuilder,
+}
+
+impl<'a, 'c> InProgressBuilder<'a, 'c> {
+    pub fn new(in_progress: InProgress<'a, 'c>) -> Self {
+        InProgressBuilder {
+            in_progress: in_progress,
+            builder: TermBuilder::new(),
+        }
+    }
+
+    /// Build the terms from this builder and transact them against the current
+    /// `InProgress`. This method _always_ returns the `InProgress` -- failure doesn't
+    /// imply an automatic rollback.
+    pub fn transact(self) -> (InProgress<'a, 'c>, Result<TxReport>)  {
+        let mut in_progress = self.in_progress;
+        let result = self.builder
+                         .build()
+                         .and_then(|(terms, tempid_set)| {
+                             in_progress.transact_terms(terms, tempid_set)
+                         });
+        (in_progress, result)
+    }
+
+    /// Transact the contents of the builder and commit the `InProgress`. If any
+    /// step fails, roll back. Return the `TxReport`.
+    pub fn commit(self) -> Result<TxReport> {
+        let mut in_progress = self.in_progress;
+        in_progress.transact_builder(self.builder)
+                   .and_then(|report| {
+                        in_progress.commit()?;
+                        Ok(report)
+                   })
+    }
+}
+
+impl<'a, 'c> BuildTerms for InProgressBuilder<'a, 'c> {
+    fn named_tempid(&mut self, name: String) -> TempIdHandle {
+        self.builder.named_tempid(name)
+    }
+
+    fn describe_tempid(mut self, name: &str) -> EntityBuilder<InProgressBuilder<'a, 'c>> {
+        let e = self.builder.named_tempid(name.into());
+        self.describe(e)
+    }
+
+    fn describe<E>(self, entity: E) -> EntityBuilder<InProgressBuilder<'a, 'c>> where E: IntoThing<KnownEntidOr<TempIdHandle>> {
+        EntityBuilder {
+            builder: self,
+            entity: entity.into_thing(),
+        }
+    }
+
+    fn add<E, V>(&mut self, e: E, a: KnownEntid, v: V) -> Result<()>
+    where E: IntoThing<KnownEntidOr<TempIdHandle>>,
+          V: IntoThing<TypedValueOr<TempIdHandle>> {
+        self.builder.add(e, a, v)
+    }
+
+    fn retract<E, V>(&mut self, e: E, a: KnownEntid, v: V) -> Result<()>
+    where E: IntoThing<KnownEntidOr<TempIdHandle>>,
+          V: IntoThing<TypedValueOr<TempIdHandle>> {
+        self.builder.retract(e, a, v)
+    }
+}
+
+impl<'a, 'c> InProgressBuilder<'a, 'c> {
+    pub fn add_kw<E, V>(&mut self, e: E, a: &Keyword, v: V) -> Result<()>
+    where E: IntoThing<KnownEntidOr<TempIdHandle>>,
+          V: IntoThing<TypedValueOr<TempIdHandle>> {
+        let (attribute, value) = self.extract_kw_value(a, v.into_thing())?;
+        self.add(e, attribute, value)
+    }
+
+    pub fn retract_kw<E, V>(&mut self, e: E, a: &Keyword, v: V) -> Result<()>
+    where E: IntoThing<KnownEntidOr<TempIdHandle>>,
+          V: IntoThing<TypedValueOr<TempIdHandle>> {
+        let (attribute, value) = self.extract_kw_value(a, v.into_thing())?;
+        self.retract(e, attribute, value)
+    }
+
+    fn extract_kw_value(&mut self, a: &Keyword, v: TypedValueOr<TempIdHandle>) -> Result<(KnownEntid, TypedValueOr<TempIdHandle>)> {
+        let attribute: KnownEntid;
+        if let Some((attr, aa)) = self.in_progress.attribute_for_ident(a) {
+            if let Either::Left(ref tv) = v {
+                let provided = tv.value_type();
+                let expected = attr.value_type;
+                if provided != expected {
+                    bail!(MentatError::ValueTypeMismatch(provided, expected));
+                }
+            }
+            attribute = aa;
+        } else {
+            bail!(MentatError::UnknownAttribute(a.to_string()));
+        }
+        Ok((attribute, v))
+    }
+}
+
+impl<'a, 'c> EntityBuilder<InProgressBuilder<'a, 'c>> {
+    pub fn add_kw<V>(&mut self, a: &Keyword, v: V) -> Result<()>
+    where V: IntoThing<TypedValueOr<TempIdHandle>> {
+        self.builder.add_kw(self.entity.clone(), a, v)
+    }
+
+    pub fn retract_kw<V>(&mut self, a: &Keyword, v: V) -> Result<()>
+    where V: IntoThing<TypedValueOr<TempIdHandle>> {
+        self.builder.retract_kw(self.entity.clone(), a, v)
+    }
+
+    /// Build the terms from this builder and transact them against the current
+    /// `InProgress`. This method _always_ returns the `InProgress` -- failure doesn't
+    /// imply an automatic rollback.
+    pub fn transact(self) -> (InProgress<'a, 'c>, Result<TxReport>)  {
+        self.finish().0.transact()
+    }
+
+    /// Transact the contents of the builder and commit the `InProgress`. If any
+    /// step fails, roll back. Return the `TxReport`.
+    pub fn commit(self) -> Result<TxReport> {
+        self.finish().0.commit()
+    }
+}
+
+// Can't implement Into for Rc<T>.
+pub trait IntoThing<T>: Sized {
+    fn into_thing(self) -> T;
+}
+
+pub trait FromThing<T> {
+    fn from_thing(v: T) -> Self;
+}
+
+impl<T> FromThing<T> for T {
+    fn from_thing(v: T) -> T {
+        v
+    }
+}
+
+impl<I, F> IntoThing<I> for F where I: FromThing<F> {
+    fn into_thing(self) -> I {
+        I::from_thing(self)
+    }
+}
+
+impl<'a> FromThing<&'a TempIdHandle> for TypedValueOr<TempIdHandle> {
+    fn from_thing(v: &'a TempIdHandle) -> Self {
+        Either::Right(v.clone())
+    }
+}
+
+impl FromThing<TempIdHandle> for TypedValueOr<TempIdHandle> {
+    fn from_thing(v: TempIdHandle) -> Self {
+        Either::Right(v)
+    }
+}
+
+impl FromThing<TypedValue> for TypedValueOr<TempIdHandle> {
+    fn from_thing(v: TypedValue) -> Self {
+        Either::Left(v)
+    }
+}
+
+impl FromThing<TempIdHandle> for KnownEntidOr<TempIdHandle> {
+    fn from_thing(v: TempIdHandle) -> Self {
+        Either::Right(v)
+    }
+}
+
+impl<'a> FromThing<&'a KnownEntid> for KnownEntidOr<TempIdHandle> {
+    fn from_thing(v: &'a KnownEntid) -> Self {
+        Either::Left(v.clone())
+    }
+}
+
+impl FromThing<KnownEntid> for KnownEntidOr<TempIdHandle> {
+    fn from_thing(v: KnownEntid) -> Self {
+        Either::Left(v)
+    }
+}
+
+impl FromThing<KnownEntid> for TypedValueOr<TempIdHandle> {
+    fn from_thing(v: KnownEntid) -> Self {
+        Either::Left(v.into())
+    }
+}
+
+#[cfg(test)]
+mod testing {
+    extern crate mentat_db;
+
+    // For matching inside a test.
+    use mentat_db::DbError;
+
+    use ::{
+        Conn,
+        Entid,
+        HasSchema,
+        Queryable,
+        TypedValue,
+        TxReport,
+    };
+
+    use super::*;
+
+    // In reality we expect the store to hand these out safely.
+    fn fake_known_entid(e: Entid) -> KnownEntid {
+        KnownEntid(e)
+    }
+
+    #[test]
+    fn test_entity_builder_bogus_entids() {
+        let mut builder = TermBuilder::new();
+        let e = builder.named_tempid("x".into());
+        let a1 = fake_known_entid(37);    // :db/doc
+        let a2 = fake_known_entid(999);
+        let v = TypedValue::typed_string("Some attribute");
+        let ve = fake_known_entid(12345);
+
+        builder.add(e.clone(), a1, v).expect("add succeeded");
+        builder.add(e.clone(), a2, e.clone()).expect("add succeeded, even though it's meaningless");
+        builder.add(e.clone(), a2, ve).expect("add succeeded, even though it's meaningless");
+        let (terms, tempids) = builder.build().expect("build succeeded");
+
+        assert_eq!(tempids.len(), 1);
+        assert_eq!(terms.len(), 3);     // TODO: check the contents?
+
+        // Now try to add them to a real store.
+        let mut sqlite = mentat_db::db::new_connection("").unwrap();
+        let mut conn = Conn::connect(&mut sqlite).unwrap();
+        let mut in_progress = conn.begin_transaction(&mut sqlite).expect("begun successfully");
+
+        // This should fail: unrecognized entid.
+        if let Ok(DbError::UnrecognizedEntid(e)) = in_progress.transact_terms(terms, tempids).expect_err("expected transact to fail").downcast() {
+            assert_eq!(e, 999);
+        } else {
+            panic!("Should have rejected the entid.");
+        }
+    }
+
+    #[test]
+    fn test_in_progress_builder() {
+        let mut sqlite = mentat_db::db::new_connection("").unwrap();
+        let mut conn = Conn::connect(&mut sqlite).unwrap();
+
+        // Give ourselves a schema to work with!
+        conn.transact(&mut sqlite, r#"[
+            [:db/add "o" :db/ident :foo/one]
+            [:db/add "o" :db/valueType :db.type/long]
+            [:db/add "o" :db/cardinality :db.cardinality/one]
+            [:db/add "m" :db/ident :foo/many]
+            [:db/add "m" :db/valueType :db.type/string]
+            [:db/add "m" :db/cardinality :db.cardinality/many]
+            [:db/add "r" :db/ident :foo/ref]
+            [:db/add "r" :db/valueType :db.type/ref]
+            [:db/add "r" :db/cardinality :db.cardinality/one]
+        ]"#).unwrap();
+
+        let in_progress = conn.begin_transaction(&mut sqlite).expect("begun successfully");
+
+        // We can use this or not!
+        let a_many = in_progress.get_entid(&kw!(:foo/many)).expect(":foo/many");
+
+        let mut builder = in_progress.builder();
+        let e_x = builder.named_tempid("x".into());
+        let v_many_1 = TypedValue::typed_string("Some text");
+        let v_many_2 = TypedValue::typed_string("Other text");
+        builder.add_kw(e_x.clone(), &kw!(:foo/many), v_many_1).expect("add succeeded");
+        builder.add(e_x.clone(), a_many, v_many_2).expect("add succeeded");
+        builder.commit().expect("commit succeeded");
+    }
+
+    #[test]
+    fn test_entity_builder() {
+        let mut sqlite = mentat_db::db::new_connection("").unwrap();
+        let mut conn = Conn::connect(&mut sqlite).unwrap();
+
+        let foo_one = kw!(:foo/one);
+        let foo_many = kw!(:foo/many);
+        let foo_ref = kw!(:foo/ref);
+        let report: TxReport;
+
+        // Give ourselves a schema to work with!
+        // Scoped borrow of conn.
+        {
+            conn.transact(&mut sqlite, r#"[
+                [:db/add "o" :db/ident :foo/one]
+                [:db/add "o" :db/valueType :db.type/long]
+                [:db/add "o" :db/cardinality :db.cardinality/one]
+                [:db/add "m" :db/ident :foo/many]
+                [:db/add "m" :db/valueType :db.type/string]
+                [:db/add "m" :db/cardinality :db.cardinality/many]
+                [:db/add "r" :db/ident :foo/ref]
+                [:db/add "r" :db/valueType :db.type/ref]
+                [:db/add "r" :db/cardinality :db.cardinality/one]
+            ]"#).unwrap();
+
+            let mut in_progress = conn.begin_transaction(&mut sqlite).expect("begun successfully");
+
+            // Scoped borrow of in_progress.
+            {
+                let mut builder = TermBuilder::new();
+                let e_x = builder.named_tempid("x".into());
+                let e_y = builder.named_tempid("y".into());
+                let a_ref = in_progress.get_entid(&foo_ref).expect(":foo/ref");
+                let a_one = in_progress.get_entid(&foo_one).expect(":foo/one");
+                let a_many = in_progress.get_entid(&foo_many).expect(":foo/many");
+                let v_many_1 = TypedValue::typed_string("Some text");
+                let v_many_2 = TypedValue::typed_string("Other text");
+                let v_long: TypedValue = 123.into();
+
+                builder.add(e_x.clone(), a_many, v_many_1).expect("add succeeded");
+                builder.add(e_x.clone(), a_many, v_many_2).expect("add succeeded");
+                builder.add(e_y.clone(), a_ref, e_x.clone()).expect("add succeeded");
+                builder.add(e_x.clone(), a_one, v_long).expect("add succeeded");
+
+                let (terms, tempids) = builder.build().expect("build succeeded");
+
+                assert_eq!(tempids.len(), 2);
+                assert_eq!(terms.len(), 4);
+
+                report = in_progress.transact_terms(terms, tempids).expect("add succeeded");
+                let x = report.tempids.get("x").expect("our tempid has an ID");
+                let y = report.tempids.get("y").expect("our tempid has an ID");
+                assert_eq!(in_progress.lookup_value_for_attribute(*y, &foo_ref).expect("lookup succeeded"),
+                           Some(TypedValue::Ref(*x)));
+                assert_eq!(in_progress.lookup_value_for_attribute(*x, &foo_one).expect("lookup succeeded"),
+                           Some(TypedValue::Long(123)));
+            }
+
+            in_progress.commit().expect("commit succeeded");
+        }
+
+        // It's all still there after the commit.
+        let x = report.tempids.get("x").expect("our tempid has an ID");
+        let y = report.tempids.get("y").expect("our tempid has an ID");
+        assert_eq!(conn.lookup_value_for_attribute(&mut sqlite, *y, &foo_ref).expect("lookup succeeded"),
+                   Some(TypedValue::Ref(*x)));
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat/errors.rs.html b/docs/apis/rust/0.7.0/src/mentat/errors.rs.html new file mode 100644 index 00000000..4c24c798 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat/errors.rs.html @@ -0,0 +1,268 @@ + + + + + + + + + + errors.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+use std; // To refer to std::result::Result.
+
+use std::collections::BTreeSet;
+
+use failure::Error;
+
+use mentat_core::{
+    Attribute,
+    ValueType,
+};
+
+use mentat_query;
+
+pub type Result<T> = std::result::Result<T, Error>;
+
+#[macro_export]
+macro_rules! bail {
+    ($e:expr) => (
+        return Err($e.into());
+    )
+}
+
+#[derive(Debug, Fail)]
+pub enum MentatError {
+    #[fail(display = "path {} already exists", _0)]
+    PathAlreadyExists(String),
+
+    #[fail(display = "variables {:?} unbound at query execution time", _0)]
+    UnboundVariables(BTreeSet<String>),
+
+    #[fail(display = "invalid argument name: '{}'", _0)]
+    InvalidArgumentName(String),
+
+    #[fail(display = "unknown attribute: '{}'", _0)]
+    UnknownAttribute(String),
+
+    #[fail(display = "invalid vocabulary version")]
+    InvalidVocabularyVersion,
+
+    #[fail(display = "vocabulary {}/{} already has attribute {}, and the requested definition differs", _0, _1, _2)]
+    ConflictingAttributeDefinitions(String, ::vocabulary::Version, String, Attribute, Attribute),
+
+    #[fail(display = "existing vocabulary {} too new: wanted {}, got {}", _0, _1, _2)]
+    ExistingVocabularyTooNew(String, ::vocabulary::Version, ::vocabulary::Version),
+
+    #[fail(display = "core schema: wanted {}, got {:?}", _0, _1)]
+    UnexpectedCoreSchema(::vocabulary::Version, Option<::vocabulary::Version>),
+
+    #[fail(display = "Lost the transact() race!")]
+    UnexpectedLostTransactRace,
+
+    #[fail(display = "missing core attribute {}", _0)]
+    MissingCoreVocabulary(mentat_query::Keyword),
+
+    #[fail(display = "schema changed since query was prepared")]
+    PreparedQuerySchemaMismatch,
+
+    #[fail(display = "provided value of type {} doesn't match attribute value type {}", _0, _1)]
+    ValueTypeMismatch(ValueType, ValueType),
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat/ident.rs.html b/docs/apis/rust/0.7.0/src/mentat/ident.rs.html new file mode 100644 index 00000000..1cf29790 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat/ident.rs.html @@ -0,0 +1,174 @@ + + + + + + + + + + ident.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+extern crate edn;
+
+use edn::symbols::Keyword;
+
+pub type EntId = u32;            // TODO: u64? Not all DB values will be representable in a u32.
+
+/// The ability to transform entity identifiers (entids) into keyword names (idents).
+pub trait ToIdent {
+    fn ident(&self, entid: EntId) -> Option<Keyword>;
+}
+
+/// The ability to transform idents into the corresponding entid.
+pub trait ToEntId {
+    fn entid(&self, ident: &Keyword) -> Option<EntId>;
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat/lib.rs.html b/docs/apis/rust/0.7.0/src/mentat/lib.rs.html new file mode 100644 index 00000000..bab136c2 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat/lib.rs.html @@ -0,0 +1,468 @@ + + + + + + + + + + lib.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![recursion_limit="128"]
+
+#[macro_use]
+extern crate failure_derive;
+extern crate failure;
+
+#[macro_use]
+extern crate lazy_static;
+
+extern crate rusqlite;
+
+extern crate uuid;
+
+pub extern crate edn;
+extern crate mentat_core;
+extern crate mentat_db;
+extern crate mentat_query;
+extern crate mentat_query_algebrizer;
+extern crate mentat_query_projector;
+extern crate mentat_query_pull;
+extern crate mentat_query_translator;
+extern crate mentat_sql;
+extern crate mentat_tolstoy;
+
+pub use mentat_core::{
+    Attribute,
+    Entid,
+    DateTime,
+    HasSchema,
+    KnownEntid,
+    Keyword,
+    Schema,
+    Binding,
+    TypedValue,
+    Uuid,
+    Utc,
+    ValueType,
+};
+
+pub use mentat_query::{
+    FindSpec,
+};
+
+pub use mentat_db::{
+    CORE_SCHEMA_VERSION,
+    DB_SCHEMA_CORE,
+    AttributeSet,
+    TxObserver,
+    TxReport,
+    new_connection,
+};
+
+#[cfg(feature = "sqlcipher")]
+pub use mentat_db::{
+    new_connection_with_key,
+    change_encryption_key,
+};
+
+/// Produce the appropriate `Variable` for the provided valid ?-prefixed name.
+/// This lives here because we can't re-export macros:
+/// https://github.com/rust-lang/rust/issues/29638.
+#[macro_export]
+macro_rules! var {
+    ( ? $var:ident ) => {
+        $crate::Variable::from_valid_name(concat!("?", stringify!($var)))
+    };
+}
+
+/// Produce the appropriate `Keyword` for the provided namespace and name.
+/// This lives here because we can't re-export macros:
+/// https://github.com/rust-lang/rust/issues/29638.
+#[macro_export]
+macro_rules! kw {
+    ( : $n:ident ) => {
+        $crate::Keyword::plain(
+            stringify!($n)
+        )
+    };
+
+    ( : $ns:ident / $n:ident ) => {
+        $crate::Keyword::namespaced(
+            stringify!($ns),
+            stringify!($n)
+        )
+    };
+
+    ( : $ns:ident$(. $nss:ident)+ / $n:ident ) => {
+        $crate::Keyword::namespaced(
+            concat!(stringify!($ns) $(, ".", stringify!($nss))+),
+            stringify!($n)
+        )
+    };
+}
+
+#[macro_use]
+pub mod errors;
+pub mod conn;
+pub mod entity_builder;
+pub mod ident;
+pub mod query;
+pub mod query_builder;
+pub mod store;
+pub mod vocabulary;
+
+pub use query::{
+    IntoResult,
+    PlainSymbol,
+    QueryExecutionResult,
+    QueryExplanation,
+    QueryInputs,
+    QueryOutput,
+    QueryPlanStep,
+    QueryResults,
+    RelResult,
+    Variable,
+    q_once,
+};
+
+pub use query_builder::{
+    QueryBuilder,
+};
+
+pub use conn::{
+    CacheAction,
+    CacheDirection,
+    Conn,
+    InProgress,
+    Metadata,
+    Pullable,
+    Queryable,
+    Syncable,
+};
+
+pub use store::{
+    Store,
+};
+
+#[cfg(test)]
+mod tests {
+    use edn::symbols::Keyword;
+    use super::*;
+
+    #[test]
+    fn can_import_edn() {
+        assert_eq!(":foo", &Keyword::plain("foo").to_string());
+    }
+
+    #[test]
+    fn test_kw() {
+        assert_eq!(kw!(:foo/bar), Keyword::namespaced("foo", "bar"));
+        assert_eq!(kw!(:org.mozilla.foo/bar_baz), Keyword::namespaced("org.mozilla.foo", "bar_baz"));
+    }
+
+    #[test]
+    fn test_var() {
+        let foo_baz = var!(?foo_baz);
+        let vu = var!(?);
+        assert_eq!(foo_baz, Variable::from_valid_name("?foo_baz"));
+        assert_eq!(vu, Variable::from_valid_name("?vü"));
+        assert_eq!(foo_baz.as_str(), "?foo_baz");
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat/query.rs.html b/docs/apis/rust/0.7.0/src/mentat/query.rs.html new file mode 100644 index 00000000..807bbc95 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat/query.rs.html @@ -0,0 +1,1050 @@ + + + + + + + + + + query.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use rusqlite;
+use rusqlite::types::ToSql;
+
+use std::rc::Rc;
+
+use mentat_core::{
+    Binding,
+    Entid,
+    HasSchema,
+    KnownEntid,
+    Schema,
+    TypedValue,
+};
+
+use mentat_query_algebrizer::{
+    AlgebraicQuery,
+    EmptyBecause,
+    FindQuery,
+    algebrize_with_inputs,
+    parse_find_string,
+};
+
+pub use mentat_query_algebrizer::{
+    QueryInputs,
+};
+
+pub use mentat_query::{
+    Keyword,
+    PlainSymbol,
+    Variable,
+};
+
+use mentat_query::{
+    Element,
+    FindSpec,
+    Pattern,
+    PatternNonValuePlace,
+    PatternValuePlace,
+    WhereClause,
+};
+
+use mentat_query_projector::{
+    ConstantProjector,
+    Projector,
+};
+
+use mentat_sql::{
+    SQLQuery,
+};
+
+use mentat_query_translator::{
+    ProjectedSelect,
+    query_to_select,
+};
+
+pub use mentat_query_algebrizer::{
+    Known,
+};
+
+pub use mentat_query_projector::{
+    QueryOutput,        // Includes the columns/find spec.
+    QueryResults,       // The results themselves.
+    RelResult,
+};
+
+use errors::{
+    MentatError,
+    Result,
+};
+
+pub type QueryExecutionResult = Result<QueryOutput>;
+pub type PreparedResult<'sqlite> = Result<PreparedQuery<'sqlite>>;
+
+pub enum PreparedQuery<'sqlite> {
+    Empty {
+        find_spec: Rc<FindSpec>,
+    },
+    Constant {
+        select: ConstantProjector,
+    },
+    Bound {
+        statement: rusqlite::Statement<'sqlite>,
+        schema: Schema,
+        connection: &'sqlite rusqlite::Connection,
+        args: Vec<(String, Rc<rusqlite::types::Value>)>,
+        projector: Box<Projector>,
+    },
+}
+
+impl<'sqlite> PreparedQuery<'sqlite> {
+    pub fn run<T>(&mut self, _inputs: T) -> QueryExecutionResult where T: Into<Option<QueryInputs>> {
+        match self {
+            &mut PreparedQuery::Empty { ref find_spec } => {
+                Ok(QueryOutput::empty(find_spec))
+            },
+            &mut PreparedQuery::Constant { ref select } => {
+                select.project_without_rows().map_err(|e| e.into())
+            },
+            &mut PreparedQuery::Bound { ref mut statement, ref schema, ref connection, ref args, ref projector } => {
+                let rows = run_statement(statement, args)?;
+                projector.project(schema, connection, rows)
+                         .map_err(|e| e.into())
+            }
+        }
+    }
+}
+
+pub trait IntoResult {
+    fn into_scalar_result(self) -> Result<Option<Binding>>;
+    fn into_coll_result(self) -> Result<Vec<Binding>>;
+    fn into_tuple_result(self) -> Result<Option<Vec<Binding>>>;
+    fn into_rel_result(self) -> Result<RelResult<Binding>>;
+}
+
+impl IntoResult for QueryExecutionResult {
+    fn into_scalar_result(self) -> Result<Option<Binding>> {
+        self?.into_scalar().map_err(|e| e.into())
+    }
+
+    fn into_coll_result(self) -> Result<Vec<Binding>> {
+        self?.into_coll().map_err(|e| e.into())
+    }
+
+    fn into_tuple_result(self) -> Result<Option<Vec<Binding>>> {
+        self?.into_tuple().map_err(|e| e.into())
+    }
+
+    fn into_rel_result(self) -> Result<RelResult<Binding>> {
+        self?.into_rel().map_err(|e| e.into())
+    }
+}
+
+/// A struct describing information about how Mentat would execute a query.
+pub enum QueryExplanation {
+    /// A query known in advance to be empty, and why we believe that.
+    KnownEmpty(EmptyBecause),
+
+    /// A query known in advance to return a constant value.
+    KnownConstant,
+
+    /// A query that takes actual work to execute.
+    ExecutionPlan {
+        /// The translated query and any bindings.
+        query: SQLQuery,
+        /// The output of SQLite's `EXPLAIN QUERY PLAN`.
+        steps: Vec<QueryPlanStep>,
+    },
+}
+
+/// A single row in the output of SQLite's `EXPLAIN QUERY PLAN`.
+/// See https://www.sqlite.org/eqp.html for an explanation of each field.
+pub struct QueryPlanStep {
+    pub select_id: i32,
+    pub order: i32,
+    pub from: i32,
+    pub detail: String,
+}
+
+fn algebrize_query<T>
+(known: Known,
+ query: FindQuery,
+ inputs: T) -> Result<AlgebraicQuery>
+    where T: Into<Option<QueryInputs>>
+{
+    let algebrized = algebrize_with_inputs(known, query, 0, inputs.into().unwrap_or(QueryInputs::default()))?;
+    let unbound = algebrized.unbound_variables();
+    // Because we are running once, we can check that all of our `:in` variables are bound at this point.
+    // If they aren't, the user has made an error -- perhaps writing the wrong variable in `:in`, or
+    // not binding in the `QueryInput`.
+    if !unbound.is_empty() {
+        bail!(MentatError::UnboundVariables(unbound.into_iter().map(|v| v.to_string()).collect()));
+    }
+    Ok(algebrized)
+}
+
+fn fetch_values<'sqlite>
+(sqlite: &'sqlite rusqlite::Connection,
+ known: Known,
+ entity: Entid,
+ attribute: Entid,
+ only_one: bool) -> QueryExecutionResult {
+    let v = Variable::from_valid_name("?v");
+
+    // This should never fail.
+    // TODO: it should be possible to algebrize with variable entity and attribute,
+    // particularly with known type, allowing the use of prepared statements.
+    let pattern = Pattern::simple(PatternNonValuePlace::Entid(entity),
+                                  PatternNonValuePlace::Entid(attribute),
+                                  PatternValuePlace::Variable(v.clone()))
+                        .unwrap();
+
+    let element = Element::Variable(v);
+    let spec = if only_one { FindSpec::FindScalar(element) } else { FindSpec::FindColl(element) };
+    let query = FindQuery::simple(spec,
+                                  vec![WhereClause::Pattern(pattern)]);
+
+    let algebrized = algebrize_query(known, query, None)?;
+
+    run_algebrized_query(known, sqlite, algebrized)
+}
+
+fn lookup_attribute(schema: &Schema, attribute: &Keyword) -> Result<KnownEntid> {
+    schema.get_entid(attribute)
+          .ok_or_else(|| MentatError::UnknownAttribute(attribute.name().into()).into())
+}
+
+/// Return a single value for the provided entity and attribute.
+/// If the attribute is multi-valued, an arbitrary value is returned.
+/// If no value is present for that entity, `None` is returned.
+/// If `attribute` isn't an attribute, `None` is returned.
+pub fn lookup_value<'sqlite, 'schema, 'cache, E, A>
+(sqlite: &'sqlite rusqlite::Connection,
+ known: Known,
+ entity: E,
+ attribute: A) -> Result<Option<TypedValue>>
+ where E: Into<Entid>,
+       A: Into<Entid> {
+    let entid = entity.into();
+    let attrid = attribute.into();
+
+    if known.is_attribute_cached_forward(attrid) {
+        Ok(known.get_value_for_entid(known.schema, attrid, entid).cloned())
+    } else {
+        fetch_values(sqlite, known, entid, attrid, true)
+            .into_scalar_result()
+            // Safe to unwrap: we never retrieve structure.
+            .map(|r| r.map(|v| v.val().unwrap()))
+    }
+}
+
+pub fn lookup_values<'sqlite, E, A>
+(sqlite: &'sqlite rusqlite::Connection,
+ known: Known,
+ entity: E,
+ attribute: A) -> Result<Vec<TypedValue>>
+ where E: Into<Entid>,
+       A: Into<Entid> {
+    let entid = entity.into();
+    let attrid = attribute.into();
+
+    if known.is_attribute_cached_forward(attrid) {
+        Ok(known.get_values_for_entid(known.schema, attrid, entid)
+                .cloned()
+                .unwrap_or_else(|| vec![]))
+    } else {
+        fetch_values(sqlite, known, entid, attrid, false)
+            .into_coll_result()
+            // Safe to unwrap: we never retrieve structure.
+            .map(|v| v.into_iter().map(|x| x.val().unwrap()).collect())
+    }
+}
+
+/// Return a single value for the provided entity and attribute.
+/// If the attribute is multi-valued, an arbitrary value is returned.
+/// If no value is present for that entity, `None` is returned.
+/// If `attribute` doesn't name an attribute, an error is returned.
+pub fn lookup_value_for_attribute<'sqlite, 'attribute, E>
+(sqlite: &'sqlite rusqlite::Connection,
+ known: Known,
+ entity: E,
+ attribute: &'attribute Keyword) -> Result<Option<TypedValue>>
+ where E: Into<Entid> {
+    let attribute = lookup_attribute(known.schema, attribute)?;
+    lookup_value(sqlite, known, entity.into(), attribute)
+}
+
+pub fn lookup_values_for_attribute<'sqlite, 'attribute, E>
+(sqlite: &'sqlite rusqlite::Connection,
+ known: Known,
+ entity: E,
+ attribute: &'attribute Keyword) -> Result<Vec<TypedValue>>
+ where E: Into<Entid> {
+    let attribute = lookup_attribute(known.schema, attribute)?;
+    lookup_values(sqlite, known, entity.into(), attribute)
+}
+
+fn run_statement<'sqlite, 'stmt, 'bound>
+(statement: &'stmt mut rusqlite::Statement<'sqlite>,
+ bindings: &'bound [(String, Rc<rusqlite::types::Value>)]) -> Result<rusqlite::Rows<'stmt>> {
+
+    let rows = if bindings.is_empty() {
+        statement.query(&[])?
+    } else {
+        let refs: Vec<(&str, &ToSql)> =
+            bindings.iter()
+                    .map(|&(ref k, ref v)| (k.as_str(), v.as_ref() as &ToSql))
+                    .collect();
+        statement.query_named(&refs)?
+    };
+    Ok(rows)
+}
+
+fn run_sql_query<'sqlite, 'sql, 'bound, T, F>
+(sqlite: &'sqlite rusqlite::Connection,
+ sql: &'sql str,
+ bindings: &'bound [(String, Rc<rusqlite::types::Value>)],
+ mut mapper: F) -> Result<Vec<T>>
+    where F: FnMut(&rusqlite::Row) -> T
+{
+    let mut statement = sqlite.prepare(sql)?;
+    let mut rows = run_statement(&mut statement, &bindings)?;
+    let mut result = vec![];
+    while let Some(row_or_error) = rows.next() {
+        result.push(mapper(&row_or_error?));
+    }
+    Ok(result)
+}
+
+fn algebrize_query_str<'query, T>
+(known: Known,
+ query: &'query str,
+ inputs: T) -> Result<AlgebraicQuery>
+    where T: Into<Option<QueryInputs>> {
+    let parsed = parse_find_string(query)?;
+    algebrize_query(known, parsed, inputs)
+}
+
+fn run_algebrized_query<'sqlite>
+(known: Known,
+ sqlite: &'sqlite rusqlite::Connection,
+ algebrized: AlgebraicQuery) -> QueryExecutionResult {
+    assert!(algebrized.unbound_variables().is_empty(),
+            "Unbound variables should be checked by now");
+    if algebrized.is_known_empty() {
+        // We don't need to do any SQL work at all.
+        return Ok(QueryOutput::empty(&algebrized.find_spec));
+    }
+
+    let select = query_to_select(known.schema, algebrized)?;
+    match select {
+        ProjectedSelect::Constant(constant) => {
+            constant.project_without_rows()
+                    .map_err(|e| e.into())
+        },
+        ProjectedSelect::Query { query, projector } => {
+            let SQLQuery { sql, args } = query.to_sql_query()?;
+
+            let mut statement = sqlite.prepare(sql.as_str())?;
+            let rows = run_statement(&mut statement, &args)?;
+
+            projector.project(known.schema, sqlite, rows).map_err(|e| e.into())
+        },
+    }
+}
+
+/// Take an EDN query string, a reference to an open SQLite connection, a Mentat schema, and an
+/// optional collection of input bindings (which should be keyed by `"?varname"`), and execute the
+/// query immediately, blocking the current thread.
+/// Returns a structure that corresponds to the kind of input query, populated with `TypedValue`
+/// instances.
+/// The caller is responsible for ensuring that the SQLite connection has an open transaction if
+/// isolation is required.
+pub fn q_once<'sqlite, 'query, T>
+(sqlite: &'sqlite rusqlite::Connection,
+ known: Known,
+ query: &'query str,
+ inputs: T) -> QueryExecutionResult
+        where T: Into<Option<QueryInputs>>
+{
+    let algebrized = algebrize_query_str(known, query, inputs)?;
+    run_algebrized_query(known, sqlite, algebrized)
+}
+
+/// Just like `q_once`, but doesn't use any cached values.
+pub fn q_uncached<'sqlite, 'schema, 'query, T>
+(sqlite: &'sqlite rusqlite::Connection,
+ schema: &'schema Schema,
+ query: &'query str,
+ inputs: T) -> QueryExecutionResult
+        where T: Into<Option<QueryInputs>>
+{
+    let known = Known::for_schema(schema);
+    let algebrized = algebrize_query_str(known, query, inputs)?;
+
+    run_algebrized_query(known, sqlite, algebrized)
+}
+
+pub fn q_prepare<'sqlite, 'schema, 'cache, 'query, T>
+(sqlite: &'sqlite rusqlite::Connection,
+ known: Known<'schema, 'cache>,
+ query: &'query str,
+ inputs: T) -> PreparedResult<'sqlite>
+        where T: Into<Option<QueryInputs>>
+{
+    let algebrized = algebrize_query_str(known, query, inputs)?;
+
+    let unbound = algebrized.unbound_variables();
+    if !unbound.is_empty() {
+        // TODO: Allow binding variables at execution time, not just
+        // preparation time.
+        bail!(MentatError::UnboundVariables(unbound.into_iter().map(|v| v.to_string()).collect()));
+    }
+
+    if algebrized.is_known_empty() {
+        // We don't need to do any SQL work at all.
+        return Ok(PreparedQuery::Empty {
+            find_spec: algebrized.find_spec,
+        });
+    }
+
+    let select = query_to_select(known.schema, algebrized)?;
+    match select {
+        ProjectedSelect::Constant(constant) => {
+            Ok(PreparedQuery::Constant {
+                select: constant,
+            })
+        },
+        ProjectedSelect::Query { query, projector } => {
+            let SQLQuery { sql, args } = query.to_sql_query()?;
+            let statement = sqlite.prepare(sql.as_str())?;
+
+            Ok(PreparedQuery::Bound {
+                statement,
+                schema: known.schema.clone(),
+                connection: sqlite,
+                args,
+                projector: projector
+            })
+        },
+    }
+}
+
+pub fn q_explain<'sqlite, 'query, T>
+(sqlite: &'sqlite rusqlite::Connection,
+ known: Known,
+ query: &'query str,
+ inputs: T) -> Result<QueryExplanation>
+        where T: Into<Option<QueryInputs>>
+{
+    let algebrized = algebrize_query_str(known, query, inputs)?;
+    if algebrized.is_known_empty() {
+        return Ok(QueryExplanation::KnownEmpty(algebrized.cc.empty_because.unwrap()));
+    }
+    match query_to_select(known.schema, algebrized)? {
+        ProjectedSelect::Constant(_constant) => Ok(QueryExplanation::KnownConstant),
+        ProjectedSelect::Query { query, projector: _projector } => {
+            let query = query.to_sql_query()?;
+
+            let plan_sql = format!("EXPLAIN QUERY PLAN {}", query.sql);
+
+            let steps = run_sql_query(sqlite, &plan_sql, &query.args, |row| {
+                QueryPlanStep {
+                    select_id: row.get(0),
+                    order: row.get(1),
+                    from: row.get(2),
+                    detail: row.get(3)
+                }
+            })?;
+
+            Ok(QueryExplanation::ExecutionPlan { query, steps })
+        },
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat/query_builder.rs.html b/docs/apis/rust/0.7.0/src/mentat/query_builder.rs.html new file mode 100644 index 00000000..52c210c8 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat/query_builder.rs.html @@ -0,0 +1,922 @@ + + + + + + + + + + query_builder.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![macro_use]
+use std::collections::{
+    BTreeMap,
+};
+
+use mentat_core::{
+    DateTime,
+    Entid,
+    Keyword,
+    Binding,
+    TypedValue,
+    Utc,
+    ValueType,
+};
+
+use ::{
+    HasSchema,
+    Queryable,
+    QueryInputs,
+    QueryOutput,
+    RelResult,
+    Store,
+    Variable,
+};
+
+use errors::{
+    MentatError,
+    Result,
+};
+
+pub struct QueryBuilder<'a> {
+    query: String,
+    values: BTreeMap<Variable, TypedValue>,
+    types: BTreeMap<Variable, ValueType>,
+    store: &'a mut Store,
+}
+
+impl<'a> QueryBuilder<'a> {
+    pub fn new<T>(store: &'a mut Store, query: T) -> QueryBuilder where T: Into<String> {
+        QueryBuilder { query: query.into(), values: BTreeMap::new(), types: BTreeMap::new(), store }
+    }
+
+    pub fn bind_value<T>(&mut self, var: &str, value: T) -> &mut Self where T: Into<TypedValue> {
+        self.values.insert(Variable::from_valid_name(var), value.into());
+        self
+    }
+
+    pub fn bind_ref_from_kw(&mut self, var: &str, value: Keyword) -> Result<&mut Self> {
+        let entid = self.store.conn().current_schema().get_entid(&value).ok_or(MentatError::UnknownAttribute(value.to_string()))?;
+        self.values.insert(Variable::from_valid_name(var), TypedValue::Ref(entid.into()));
+        Ok(self)
+    }
+
+    pub fn bind_ref<T>(&mut self, var: &str, value: T) -> &mut Self where T: Into<Entid> {
+       self.values.insert(Variable::from_valid_name(var), TypedValue::Ref(value.into()));
+       self
+    }
+
+    pub fn bind_long(&mut self, var: &str, value: i64) -> &mut Self {
+       self.values.insert(Variable::from_valid_name(var), TypedValue::Long(value));
+       self
+    }
+
+    pub fn bind_instant(&mut self, var: &str, value: i64) -> &mut Self {
+       self.values.insert(Variable::from_valid_name(var), TypedValue::instant(value));
+
+       self
+    }
+
+    pub fn bind_date_time(&mut self, var: &str, value: DateTime<Utc>) -> &mut Self {
+       self.values.insert(Variable::from_valid_name(var), TypedValue::Instant(value));
+       self
+    }
+
+    pub fn bind_type(&mut self, var: &str, value_type: ValueType) -> &mut Self {
+        self.types.insert(Variable::from_valid_name(var), value_type);
+        self
+    }
+
+    pub fn execute(&mut self) -> Result<QueryOutput> {
+        let values = ::std::mem::replace(&mut self.values, Default::default());
+        let types = ::std::mem::replace(&mut self.types, Default::default());
+        let query_inputs = QueryInputs::new(types, values)?;
+        let read = self.store.begin_read()?;
+        read.q_once(&self.query, query_inputs)
+    }
+
+    pub fn execute_scalar(&mut self) -> Result<Option<Binding>> {
+        let results = self.execute()?;
+        results.into_scalar().map_err(|e| e.into())
+    }
+
+    pub fn execute_coll(&mut self) -> Result<Vec<Binding>> {
+        let results = self.execute()?;
+        results.into_coll().map_err(|e| e.into())
+    }
+
+    pub fn execute_tuple(&mut self) -> Result<Option<Vec<Binding>>> {
+        let results = self.execute()?;
+        results.into_tuple().map_err(|e| e.into())
+    }
+
+    pub fn execute_rel(&mut self) -> Result<RelResult<Binding>> {
+        let results = self.execute()?;
+        results.into_rel().map_err(|e| e.into())
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::{
+        QueryBuilder,
+        TypedValue,
+        Store,
+    };
+
+    #[test]
+    fn test_scalar_query() {
+        let mut store = Store::open("").expect("store connection");
+        store.transact(r#"[
+            [:db/add "s" :db/ident :foo/boolean]
+            [:db/add "s" :db/valueType :db.type/boolean]
+            [:db/add "s" :db/cardinality :db.cardinality/one]
+        ]"#).expect("successful transaction");
+
+        let report = store.transact(r#"[
+            [:db/add "u" :foo/boolean true]
+            [:db/add "p" :foo/boolean false]
+        ]"#).expect("successful transaction");
+
+        let yes = report.tempids.get("u").expect("found it").clone();
+
+        let entid = QueryBuilder::new(&mut store, r#"[:find ?x .
+                                                      :in ?v
+                                                      :where [?x :foo/boolean ?v]]"#)
+                              .bind_value("?v", true)
+                              .execute_scalar().expect("ScalarResult")
+                              .map_or(None, |t| t.into_entid());
+        assert_eq!(entid, Some(yes));
+    }
+
+    #[test]
+    fn test_coll_query() {
+        let mut store = Store::open("").expect("store connection");
+        store.transact(r#"[
+            [:db/add "s" :db/ident :foo/boolean]
+            [:db/add "s" :db/valueType :db.type/boolean]
+            [:db/add "s" :db/cardinality :db.cardinality/one]
+            [:db/add "t" :db/ident :foo/long]
+            [:db/add "t" :db/valueType :db.type/long]
+            [:db/add "t" :db/cardinality :db.cardinality/one]
+        ]"#).expect("successful transaction");
+
+        let report = store.transact(r#"[
+            [:db/add "l" :foo/boolean true]
+            [:db/add "l" :foo/long 25]
+            [:db/add "m" :foo/boolean false]
+            [:db/add "m" :foo/long 26]
+            [:db/add "n" :foo/boolean true]
+            [:db/add "n" :foo/long 27]
+            [:db/add "p" :foo/boolean false]
+            [:db/add "p" :foo/long 24]
+            [:db/add "u" :foo/boolean true]
+            [:db/add "u" :foo/long 23]
+        ]"#).expect("successful transaction");
+
+        let u_yes = report.tempids.get("u").expect("found it").clone();
+        let l_yes = report.tempids.get("l").expect("found it").clone();
+        let n_yes = report.tempids.get("n").expect("found it").clone();
+
+        let entids: Vec<i64> = QueryBuilder::new(&mut store, r#"[:find [?x ...]
+                                                                 :in ?v
+                                                                 :where [?x :foo/boolean ?v]]"#)
+                              .bind_value("?v", true)
+                              .execute_coll().expect("CollResult")
+                              .into_iter()
+                              .map(|v| v.into_entid().expect("val"))
+                              .collect();
+
+        assert_eq!(entids, vec![l_yes, n_yes, u_yes]);
+    }
+
+    #[test]
+    fn test_coll_query_by_row() {
+        let mut store = Store::open("").expect("store connection");
+        store.transact(r#"[
+            [:db/add "s" :db/ident :foo/boolean]
+            [:db/add "s" :db/valueType :db.type/boolean]
+            [:db/add "s" :db/cardinality :db.cardinality/one]
+            [:db/add "t" :db/ident :foo/long]
+            [:db/add "t" :db/valueType :db.type/long]
+            [:db/add "t" :db/cardinality :db.cardinality/one]
+        ]"#).expect("successful transaction");
+
+        let report = store.transact(r#"[
+            [:db/add "l" :foo/boolean true]
+            [:db/add "l" :foo/long 25]
+            [:db/add "m" :foo/boolean false]
+            [:db/add "m" :foo/long 26]
+            [:db/add "n" :foo/boolean true]
+            [:db/add "n" :foo/long 27]
+            [:db/add "p" :foo/boolean false]
+            [:db/add "p" :foo/long 24]
+            [:db/add "u" :foo/boolean true]
+            [:db/add "u" :foo/long 23]
+        ]"#).expect("successful transaction");
+
+        let n_yes = report.tempids.get("n").expect("found it").clone();
+
+        let results = QueryBuilder::new(&mut store, r#"[:find [?x ...]
+                                                        :in ?v
+                                                        :where [?x :foo/boolean ?v]]"#)
+                              .bind_value("?v", true)
+                              .execute_coll().expect("CollResult");
+        let entid = results.get(1).map_or(None, |t| t.to_owned().into_entid()).expect("entid");
+
+        assert_eq!(entid, n_yes);
+    }
+
+    #[test]
+    fn test_tuple_query_result_by_column() {
+        let mut store = Store::open("").expect("store connection");
+        store.transact(r#"[
+            [:db/add "s" :db/ident :foo/boolean]
+            [:db/add "s" :db/valueType :db.type/boolean]
+            [:db/add "s" :db/cardinality :db.cardinality/one]
+            [:db/add "t" :db/ident :foo/long]
+            [:db/add "t" :db/valueType :db.type/long]
+            [:db/add "t" :db/cardinality :db.cardinality/one]
+        ]"#).expect("successful transaction");
+
+        let report = store.transact(r#"[
+            [:db/add "l" :foo/boolean true]
+            [:db/add "l" :foo/long 25]
+            [:db/add "m" :foo/boolean false]
+            [:db/add "m" :foo/long 26]
+            [:db/add "n" :foo/boolean true]
+            [:db/add "n" :foo/long 27]
+            [:db/add "p" :foo/boolean false]
+            [:db/add "p" :foo/long 24]
+            [:db/add "u" :foo/boolean true]
+            [:db/add "u" :foo/long 23]
+        ]"#).expect("successful transaction");
+
+        let n_yes = report.tempids.get("n").expect("found it").clone();
+
+        let results = QueryBuilder::new(&mut store, r#"[:find [?x, ?i]
+                                                        :in ?v ?i
+                                                        :where [?x :foo/boolean ?v]
+                                                               [?x :foo/long ?i]]"#)
+                              .bind_value("?v", true)
+                              .bind_long("?i", 27)
+                              .execute_tuple().expect("TupleResult").expect("Vec<TypedValue>");
+        let entid = results.get(0).map_or(None, |t| t.to_owned().into_entid()).expect("entid");
+        let long_val = results.get(1).map_or(None, |t| t.to_owned().into_long()).expect("long");
+
+        assert_eq!(entid, n_yes);
+        assert_eq!(long_val, 27);
+    }
+
+    #[test]
+    fn test_tuple_query_result_by_iter() {
+        let mut store = Store::open("").expect("store connection");
+        store.transact(r#"[
+            [:db/add "s" :db/ident :foo/boolean]
+            [:db/add "s" :db/valueType :db.type/boolean]
+            [:db/add "s" :db/cardinality :db.cardinality/one]
+            [:db/add "t" :db/ident :foo/long]
+            [:db/add "t" :db/valueType :db.type/long]
+            [:db/add "t" :db/cardinality :db.cardinality/one]
+        ]"#).expect("successful transaction");
+
+        let report = store.transact(r#"[
+            [:db/add "l" :foo/boolean true]
+            [:db/add "l" :foo/long 25]
+            [:db/add "m" :foo/boolean false]
+            [:db/add "m" :foo/long 26]
+            [:db/add "n" :foo/boolean true]
+            [:db/add "n" :foo/long 27]
+            [:db/add "p" :foo/boolean false]
+            [:db/add "p" :foo/long 24]
+            [:db/add "u" :foo/boolean true]
+            [:db/add "u" :foo/long 23]
+        ]"#).expect("successful transaction");
+
+        let n_yes = report.tempids.get("n").expect("found it").clone();
+
+        let results: Vec<_> = QueryBuilder::new(&mut store, r#"[:find [?x, ?i]
+                                                                :in ?v ?i
+                                                                :where [?x :foo/boolean ?v]
+                                                                       [?x :foo/long ?i]]"#)
+                              .bind_value("?v", true)
+                              .bind_long("?i", 27)
+                              .execute_tuple().expect("TupleResult").unwrap_or(vec![]);
+        let entid = TypedValue::Ref(n_yes.clone()).into();
+        let long_val = TypedValue::Long(27).into();
+
+        assert_eq!(results, vec![entid, long_val]);
+    }
+
+    #[test]
+    fn test_rel_query_result() {
+        let mut store = Store::open("").expect("store connection");
+        store.transact(r#"[
+            [:db/add "s" :db/ident :foo/boolean]
+            [:db/add "s" :db/valueType :db.type/boolean]
+            [:db/add "s" :db/cardinality :db.cardinality/one]
+            [:db/add "t" :db/ident :foo/long]
+            [:db/add "t" :db/valueType :db.type/long]
+            [:db/add "t" :db/cardinality :db.cardinality/one]
+        ]"#).expect("successful transaction");
+
+        let report = store.transact(r#"[
+            [:db/add "l" :foo/boolean true]
+            [:db/add "l" :foo/long 25]
+            [:db/add "m" :foo/boolean false]
+            [:db/add "m" :foo/long 26]
+            [:db/add "n" :foo/boolean true]
+            [:db/add "n" :foo/long 27]
+        ]"#).expect("successful transaction");
+
+        let l_yes = report.tempids.get("l").expect("found it").clone();
+        let m_yes = report.tempids.get("m").expect("found it").clone();
+        let n_yes = report.tempids.get("n").expect("found it").clone();
+
+        #[derive(Debug, PartialEq)]
+        struct Res {
+            entid: i64,
+            boolean: bool,
+            long_val: i64,
+        };
+
+        let mut results: Vec<Res> = QueryBuilder::new(&mut store, r#"[:find ?x ?v ?i
+                                                                      :where [?x :foo/boolean ?v]
+                                                                             [?x :foo/long ?i]]"#)
+                              .execute_rel().expect("RelResult")
+                              .into_iter()
+                              .map(|row| {
+                                  Res {
+                                      entid: row.get(0).map_or(None, |t| t.to_owned().into_entid()).expect("entid"),
+                                      boolean: row.get(1).map_or(None, |t| t.to_owned().into_boolean()).expect("boolean"),
+                                      long_val: row.get(2).map_or(None, |t| t.to_owned().into_long()).expect("long"),
+                                  }
+                              })
+                              .collect();
+
+        let res1 = results.pop().expect("res");
+        assert_eq!(res1, Res { entid: n_yes, boolean: true, long_val: 27 });
+        let res2 = results.pop().expect("res");
+        assert_eq!(res2, Res { entid: m_yes, boolean: false, long_val: 26 });
+        let res3 = results.pop().expect("res");
+        assert_eq!(res3, Res { entid: l_yes, boolean: true, long_val: 25 });
+        assert_eq!(results.pop(), None);
+    }
+
+    #[test]
+    fn test_bind_ref() {
+        let mut store = Store::open("").expect("store connection");
+        store.transact(r#"[
+            [:db/add "s" :db/ident :foo/boolean]
+            [:db/add "s" :db/valueType :db.type/boolean]
+            [:db/add "s" :db/cardinality :db.cardinality/one]
+            [:db/add "t" :db/ident :foo/long]
+            [:db/add "t" :db/valueType :db.type/long]
+            [:db/add "t" :db/cardinality :db.cardinality/one]
+        ]"#).expect("successful transaction");
+
+        let report = store.transact(r#"[
+            [:db/add "l" :foo/boolean true]
+            [:db/add "l" :foo/long 25]
+            [:db/add "m" :foo/boolean false]
+            [:db/add "m" :foo/long 26]
+            [:db/add "n" :foo/boolean true]
+            [:db/add "n" :foo/long 27]
+        ]"#).expect("successful transaction");
+
+        let l_yes = report.tempids.get("l").expect("found it").clone();
+
+        let results = QueryBuilder::new(&mut store, r#"[:find [?v ?i]
+                                                        :in ?x
+                                                        :where [?x :foo/boolean ?v]
+                                                               [?x :foo/long ?i]]"#)
+                              .bind_ref("?x", l_yes)
+                              .execute_tuple().expect("TupleResult")
+                              .unwrap_or(vec![]);
+        assert_eq!(results.get(0).map_or(None, |t| t.to_owned().into_boolean()).expect("boolean"), true);
+        assert_eq!(results.get(1).map_or(None, |t| t.to_owned().into_long()).expect("long"), 25);
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat/store.rs.html b/docs/apis/rust/0.7.0/src/mentat/store.rs.html new file mode 100644 index 00000000..be175b70 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat/store.rs.html @@ -0,0 +1,1520 @@ + + + + + + + + + + store.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+use std::collections::{
+    BTreeMap,
+};
+
+use std::path::{
+    Path,
+};
+
+use std::sync::{
+    Arc,
+};
+
+use rusqlite;
+
+use edn;
+
+use mentat_core::{
+    Entid,
+    Keyword,
+    StructuredMap,
+    TypedValue,
+    ValueRc,
+};
+use mentat_db::{
+    TxObserver,
+    TxReport,
+};
+
+use mentat_tolstoy::Syncer;
+
+use uuid::Uuid;
+
+use conn::{
+    CacheAction,
+    CacheDirection,
+    Conn,
+    InProgress,
+    InProgressRead,
+    Pullable,
+    Queryable,
+    Syncable
+};
+
+use errors::*;
+
+use query::{
+    PreparedResult,
+    QueryExplanation,
+    QueryInputs,
+    QueryOutput,
+};
+
+/// A convenience wrapper around a single SQLite connection and a Conn. This is suitable
+/// for applications that don't require complex connection management.
+pub struct Store {
+    conn: Conn,
+    sqlite: rusqlite::Connection,
+}
+
+impl Store {
+    /// Open a store at the supplied path, ensuring that it includes the bootstrap schema.
+    pub fn open(path: &str) -> Result<Store> {
+        let mut connection = ::new_connection(path)?;
+        let conn = Conn::connect(&mut connection)?;
+        Ok(Store {
+            conn: conn,
+            sqlite: connection,
+        })
+    }
+
+    /// Returns a totally blank store with no bootstrap schema. Use `open` instead.
+    pub fn open_empty(path: &str) -> Result<Store> {
+        if !path.is_empty() {
+            if Path::new(path).exists() {
+                bail!(MentatError::PathAlreadyExists(path.to_string()));
+            }
+        }
+
+        let mut connection = ::new_connection(path)?;
+        let conn = Conn::empty(&mut connection)?;
+        Ok(Store {
+            conn: conn,
+            sqlite: connection,
+        })
+    }
+
+    pub fn transact(&mut self, transaction: &str) -> Result<TxReport> {
+        let mut ip = self.begin_transaction()?;
+        let report = ip.transact(transaction)?;
+        ip.commit()?;
+        Ok(report)
+    }
+}
+
+#[cfg(feature = "sqlcipher")]
+impl Store {
+    /// Variant of `open` that allows a key (for encryption/decryption) to be
+    /// supplied. Fails unless linked against sqlcipher (or something else that
+    /// supports the Sqlite Encryption Extension).
+    pub fn open_with_key(path: &str, encryption_key: &str) -> Result<Store> {
+        let mut connection = ::new_connection_with_key(path, encryption_key)?;
+        let conn = Conn::connect(&mut connection)?;
+        Ok(Store {
+            conn: conn,
+            sqlite: connection,
+        })
+    }
+
+    /// Variant of `open_empty` that allows a key (for encryption/decryption) to
+    /// be supplied. Fails unless linked against sqlcipher (or something else
+    /// that supports the Sqlite Encryption Extension).
+    pub fn open_empty_with_key(path: &str, encryption_key: &str) -> Result<Store> {
+        if !path.is_empty() {
+            if Path::new(path).exists() {
+                bail!(MentatError::PathAlreadyExists(path.to_string()));
+            }
+        }
+
+        let mut connection = ::new_connection_with_key(path, encryption_key)?;
+        let conn = Conn::empty(&mut connection)?;
+        Ok(Store {
+            conn: conn,
+            sqlite: connection,
+        })
+    }
+
+    /// Change the key for a database that was opened using `open_with_key` or
+    /// `open_empty_with_key` (using `PRAGMA rekey`). Fails unless linked
+    /// against sqlcipher (or something else that supports the Sqlite Encryption
+    /// Extension).
+    pub fn change_encryption_key(&mut self, new_encryption_key: &str) -> Result<()> {
+        ::change_encryption_key(&self.sqlite, new_encryption_key)?;
+        Ok(())
+    }
+}
+
+impl Store {
+    /// Intended for use from tests.
+    pub fn sqlite_mut(&mut self) -> &mut rusqlite::Connection {
+        &mut self.sqlite
+    }
+
+    #[cfg(test)]
+    pub fn is_registered_as_observer(&self, key: &String) -> bool {
+        self.conn.tx_observer_service.lock().unwrap().is_registered(key)
+    }
+}
+
+impl Store {
+    pub fn dismantle(self) -> (rusqlite::Connection, Conn) {
+        (self.sqlite, self.conn)
+    }
+
+    pub fn conn(&self) -> &Conn {
+        &self.conn
+    }
+
+    pub fn begin_read<'m>(&'m mut self) -> Result<InProgressRead<'m, 'm>> {
+        self.conn.begin_read(&mut self.sqlite)
+    }
+
+    pub fn begin_transaction<'m>(&'m mut self) -> Result<InProgress<'m, 'm>> {
+        self.conn.begin_transaction(&mut self.sqlite)
+    }
+
+    pub fn cache(&mut self, attr: &Keyword, direction: CacheDirection) -> Result<()> {
+        let schema = &self.conn.current_schema();
+        self.conn.cache(&mut self.sqlite,
+                        schema,
+                        attr,
+                        direction,
+                        CacheAction::Register)
+    }
+
+    pub fn register_observer(&mut self, key: String, observer: Arc<TxObserver>) {
+        self.conn.register_observer(key, observer);
+    }
+
+    pub fn unregister_observer(&mut self, key: &String) {
+        self.conn.unregister_observer(key);
+    }
+}
+
+impl Queryable for Store {
+    fn q_once<T>(&self, query: &str, inputs: T) -> Result<QueryOutput>
+        where T: Into<Option<QueryInputs>> {
+        self.conn.q_once(&self.sqlite, query, inputs)
+    }
+
+    fn q_prepare<T>(&self, query: &str, inputs: T) -> PreparedResult
+        where T: Into<Option<QueryInputs>> {
+        self.conn.q_prepare(&self.sqlite, query, inputs)
+    }
+
+    fn q_explain<T>(&self, query: &str, inputs: T) -> Result<QueryExplanation>
+        where T: Into<Option<QueryInputs>> {
+        self.conn.q_explain(&self.sqlite, query, inputs)
+    }
+
+    fn lookup_values_for_attribute<E>(&self, entity: E, attribute: &edn::Keyword) -> Result<Vec<TypedValue>>
+        where E: Into<Entid> {
+        self.conn.lookup_values_for_attribute(&self.sqlite, entity.into(), attribute)
+    }
+
+    fn lookup_value_for_attribute<E>(&self, entity: E, attribute: &edn::Keyword) -> Result<Option<TypedValue>>
+        where E: Into<Entid> {
+        self.conn.lookup_value_for_attribute(&self.sqlite, entity.into(), attribute)
+    }
+}
+
+impl Pullable for Store {
+    fn pull_attributes_for_entities<E, A>(&self, entities: E, attributes: A) -> Result<BTreeMap<Entid, ValueRc<StructuredMap>>>
+    where E: IntoIterator<Item=Entid>,
+          A: IntoIterator<Item=Entid> {
+        self.conn.pull_attributes_for_entities(&self.sqlite, entities, attributes)
+    }
+
+    fn pull_attributes_for_entity<A>(&self, entity: Entid, attributes: A) -> Result<StructuredMap>
+    where A: IntoIterator<Item=Entid> {
+        self.conn.pull_attributes_for_entity(&self.sqlite, entity, attributes)
+    }
+}
+
+impl Syncable for Store {
+    fn sync(&mut self, server_uri: &String, user_uuid: &String) -> Result<()> {
+        let uuid = Uuid::parse_str(&user_uuid)?;
+        Ok(Syncer::flow(&mut self.sqlite, server_uri, &uuid)?)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    extern crate time;
+    extern crate mentat_parser_utils;
+
+    use std::collections::{
+        BTreeSet,
+    };
+    use std::path::{
+        PathBuf,
+    };
+    use std::sync::mpsc;
+    use std::sync::{
+        Mutex,
+    };
+    use std::time::{
+        Duration,
+    };
+
+    use mentat_db::cache::{
+        SQLiteAttributeCache,
+    };
+
+    use mentat_core::{
+        CachedAttributes,
+        HasSchema,
+        TypedValue,
+        ValueType,
+    };
+
+    use ::entity_builder::{
+        BuildTerms,
+    };
+
+    use ::query::{
+        PreparedQuery,
+    };
+
+    use ::{
+        QueryInputs,
+    };
+
+    use ::vocabulary::{
+        AttributeBuilder,
+        Definition,
+        VersionedStore,
+    };
+
+    use ::vocabulary::attribute::{
+        Unique,
+    };
+
+    fn fixture_path(rest: &str) -> PathBuf {
+        let fixtures = Path::new("fixtures/");
+        fixtures.join(Path::new(rest))
+    }
+
+    #[test]
+    fn test_prepared_query_with_cache() {
+        let mut store = Store::open("").expect("opened");
+        let mut in_progress = store.begin_transaction().expect("began");
+        in_progress.import(fixture_path("cities.schema")).expect("transacted schema");
+        in_progress.import(fixture_path("all_seattle.edn")).expect("transacted data");
+        in_progress.cache(&kw!(:neighborhood/district), CacheDirection::Forward, CacheAction::Register).expect("cache done");
+        in_progress.cache(&kw!(:district/name), CacheDirection::Forward, CacheAction::Register).expect("cache done");
+        in_progress.cache(&kw!(:neighborhood/name), CacheDirection::Reverse, CacheAction::Register).expect("cache done");
+
+        let query = r#"[:find ?district
+                        :in ?hood
+                        :where
+                        [?neighborhood :neighborhood/name ?hood]
+                        [?neighborhood :neighborhood/district ?d]
+                        [?d :district/name ?district]]"#;
+        let hood = "Beacon Hill";
+        let inputs = QueryInputs::with_value_sequence(vec![(var!(?hood), TypedValue::typed_string(hood).into())]);
+        let mut prepared = in_progress.q_prepare(query, inputs)
+                                      .expect("prepared");
+        match &prepared {
+            &PreparedQuery::Constant { select: ref _select } => {},
+            _ => panic!(),
+        };
+
+
+        let start = time::PreciseTime::now();
+        let results = prepared.run(None).expect("results");
+        let end = time::PreciseTime::now();
+        println!("Prepared cache execution took {}µs", start.to(end).num_microseconds().unwrap());
+        assert_eq!(results.into_rel().expect("result"),
+                   vec![vec![TypedValue::typed_string("Greater Duwamish")]].into());
+    }
+
+    trait StoreCache {
+        fn get_entid_for_value(&self, attr: Entid, val: &TypedValue) -> Option<Entid>;
+        fn is_attribute_cached_reverse(&self, attr: Entid) -> bool;
+        fn is_attribute_cached_forward(&self, attr: Entid) -> bool;
+    }
+
+    impl StoreCache for Store {
+        fn get_entid_for_value(&self, attr: Entid, val: &TypedValue) -> Option<Entid> {
+            let cache = self.conn.current_cache();
+            cache.get_entid_for_value(attr, val)
+        }
+
+        fn is_attribute_cached_forward(&self, attr: Entid) -> bool {
+            self.conn.current_cache().is_attribute_cached_forward(attr)
+        }
+
+        fn is_attribute_cached_reverse(&self, attr: Entid) -> bool {
+            self.conn.current_cache().is_attribute_cached_reverse(attr)
+        }
+    }
+
+    #[test]
+    fn test_cache_mutation() {
+        let mut store = Store::open("").expect("opened");
+
+        {
+            let mut in_progress = store.begin_transaction().expect("begun");
+            in_progress.transact(r#"[
+                {  :db/ident       :foo/bar
+                   :db/cardinality :db.cardinality/one
+                   :db/index       true
+                   :db/unique      :db.unique/identity
+                   :db/valueType   :db.type/long },
+                {  :db/ident       :foo/baz
+                   :db/cardinality :db.cardinality/one
+                   :db/valueType   :db.type/boolean }
+                {  :db/ident       :foo/x
+                   :db/cardinality :db.cardinality/many
+                   :db/valueType   :db.type/long }]"#).expect("transact");
+
+            // Cache one….
+            in_progress.cache(&kw!(:foo/bar), CacheDirection::Reverse, CacheAction::Register).expect("cache done");
+            in_progress.commit().expect("commit");
+        }
+
+        let foo_bar = store.conn.current_schema().get_entid(&kw!(:foo/bar)).expect("foo/bar").0;
+        let foo_baz = store.conn.current_schema().get_entid(&kw!(:foo/baz)).expect("foo/baz").0;
+        let foo_x = store.conn.current_schema().get_entid(&kw!(:foo/x)).expect("foo/x").0;
+
+        // … and cache the others via the store.
+        store.cache(&kw!(:foo/baz), CacheDirection::Both).expect("cache done");
+        store.cache(&kw!(:foo/x), CacheDirection::Forward).expect("cache done");
+        {
+            assert!(store.is_attribute_cached_reverse(foo_bar));
+            assert!(store.is_attribute_cached_forward(foo_baz));
+            assert!(store.is_attribute_cached_reverse(foo_baz));
+            assert!(store.is_attribute_cached_forward(foo_x));
+        }
+
+        // Add some data.
+        {
+            let mut in_progress = store.begin_transaction().expect("begun");
+
+            {
+                assert!(in_progress.cache.is_attribute_cached_reverse(foo_bar));
+                assert!(in_progress.cache.is_attribute_cached_forward(foo_baz));
+                assert!(in_progress.cache.is_attribute_cached_reverse(foo_baz));
+                assert!(in_progress.cache.is_attribute_cached_forward(foo_x));
+
+                assert!(in_progress.cache.overlay.is_attribute_cached_reverse(foo_bar));
+                assert!(in_progress.cache.overlay.is_attribute_cached_forward(foo_baz));
+                assert!(in_progress.cache.overlay.is_attribute_cached_reverse(foo_baz));
+                assert!(in_progress.cache.overlay.is_attribute_cached_forward(foo_x));
+            }
+
+            in_progress.transact(r#"[
+                {:foo/bar 15, :foo/baz false, :foo/x [1, 2, 3]}
+                {:foo/bar 99, :foo/baz true}
+                {:foo/bar -2, :foo/baz true}
+                ]"#).expect("transact");
+
+            // Data is in the cache.
+            let first = in_progress.cache.get_entid_for_value(foo_bar, &TypedValue::Long(15)).expect("id");
+            assert_eq!(in_progress.cache.get_value_for_entid(&in_progress.schema, foo_baz, first).expect("val"), &TypedValue::Boolean(false));
+
+            // All three values for :foo/x.
+            let all_three: BTreeSet<TypedValue> = in_progress.cache
+                                                             .get_values_for_entid(&in_progress.schema, foo_x, first)
+                                                             .expect("val")
+                                                             .iter().cloned().collect();
+            assert_eq!(all_three, vec![1, 2, 3].into_iter().map(TypedValue::Long).collect());
+
+            in_progress.commit().expect("commit");
+        }
+
+        // Data is still in the cache.
+        {
+            let first = store.get_entid_for_value(foo_bar, &TypedValue::Long(15)).expect("id");
+            let cache: SQLiteAttributeCache = store.conn.current_cache();
+            assert_eq!(cache.get_value_for_entid(&store.conn.current_schema(), foo_baz, first).expect("val"), &TypedValue::Boolean(false));
+
+            let all_three: BTreeSet<TypedValue> = cache.get_values_for_entid(&store.conn.current_schema(), foo_x, first)
+                                                       .expect("val")
+                                                       .iter().cloned().collect();
+            assert_eq!(all_three, vec![1, 2, 3].into_iter().map(TypedValue::Long).collect());
+        }
+
+        // We can remove data and the cache reflects it, immediately and after commit.
+        {
+            let mut in_progress = store.begin_transaction().expect("began");
+            let first = in_progress.cache.get_entid_for_value(foo_bar, &TypedValue::Long(15)).expect("id");
+            in_progress.transact(format!("[[:db/retract {} :foo/x 2]]", first).as_str()).expect("transact");
+
+            let only_two: BTreeSet<TypedValue> = in_progress.cache
+                                                            .get_values_for_entid(&in_progress.schema, foo_x, first)
+                                                            .expect("val")
+                                                            .iter().cloned().collect();
+            assert_eq!(only_two, vec![1, 3].into_iter().map(TypedValue::Long).collect());
+
+            // Rollback: unchanged.
+        }
+        {
+            let first = store.get_entid_for_value(foo_bar, &TypedValue::Long(15)).expect("id");
+            let cache: SQLiteAttributeCache = store.conn.current_cache();
+            assert_eq!(cache.get_value_for_entid(&store.conn.current_schema(), foo_baz, first).expect("val"), &TypedValue::Boolean(false));
+
+            let all_three: BTreeSet<TypedValue> = cache.get_values_for_entid(&store.conn.current_schema(), foo_x, first)
+                                                       .expect("val")
+                                                       .iter().cloned().collect();
+            assert_eq!(all_three, vec![1, 2, 3].into_iter().map(TypedValue::Long).collect());
+        }
+
+        // Try again, but this time commit.
+        {
+            let mut in_progress = store.begin_transaction().expect("began");
+            let first = in_progress.cache.get_entid_for_value(foo_bar, &TypedValue::Long(15)).expect("id");
+            in_progress.transact(format!("[[:db/retract {} :foo/x 2]]", first).as_str()).expect("transact");
+            in_progress.commit().expect("committed");
+        }
+        {
+            let first = store.get_entid_for_value(foo_bar, &TypedValue::Long(15)).expect("id");
+            let cache: SQLiteAttributeCache = store.conn.current_cache();
+            assert_eq!(cache.get_value_for_entid(&store.conn.current_schema(), foo_baz, first).expect("val"), &TypedValue::Boolean(false));
+
+            let only_two: BTreeSet<TypedValue> = cache.get_values_for_entid(&store.conn.current_schema(), foo_x, first)
+                                                      .expect("val")
+                                                      .iter().cloned().collect();
+            assert_eq!(only_two, vec![1, 3].into_iter().map(TypedValue::Long).collect());
+        }
+    }
+
+    fn test_register_observer() {
+        let mut conn = Store::open("").unwrap();
+
+        let key = "Test Observer".to_string();
+        let tx_observer = TxObserver::new(BTreeSet::new(), move |_obs_key, _batch| {});
+
+        conn.register_observer(key.clone(), Arc::new(tx_observer));
+        assert!(conn.is_registered_as_observer(&key));
+    }
+
+    #[test]
+    fn test_deregister_observer() {
+        let mut conn = Store::open("").unwrap();
+
+        let key = "Test Observer".to_string();
+
+        let tx_observer = TxObserver::new(BTreeSet::new(), move |_obs_key, _batch| {});
+
+        conn.register_observer(key.clone(), Arc::new(tx_observer));
+        assert!(conn.is_registered_as_observer(&key));
+
+        conn.unregister_observer(&key);
+
+        assert!(!conn.is_registered_as_observer(&key));
+    }
+
+    fn add_schema(conn: &mut Store) {
+        // transact some schema
+        let mut in_progress = conn.begin_transaction().expect("expected in progress");
+        in_progress.ensure_vocabulary(&Definition::new(
+            kw!(:todo/items),
+            1,
+            vec![
+                (kw!(:todo/uuid),
+                AttributeBuilder::helpful()
+                    .value_type(ValueType::Uuid)
+                    .multival(false)
+                    .unique(Unique::Value)
+                    .index(true)
+                    .build()),
+                (kw!(:todo/name),
+                AttributeBuilder::helpful()
+                    .value_type(ValueType::String)
+                    .multival(false)
+                    .fulltext(true)
+                    .build()),
+                (kw!(:todo/completion_date),
+                AttributeBuilder::helpful()
+                    .value_type(ValueType::Instant)
+                    .multival(false)
+                    .build()),
+                (kw!(:label/name),
+                AttributeBuilder::helpful()
+                    .value_type(ValueType::String)
+                    .multival(false)
+                    .unique(Unique::Value)
+                    .fulltext(true)
+                    .index(true)
+                    .build()),
+                (kw!(:label/color),
+                AttributeBuilder::helpful()
+                    .value_type(ValueType::String)
+                    .multival(false)
+                    .build()),
+            ],
+        )).expect("expected vocubulary");
+        in_progress.commit().expect("Expected vocabulary committed");
+    }
+
+    #[derive(Default, Debug)]
+    struct ObserverOutput {
+        txids: Vec<i64>,
+        changes: Vec<BTreeSet<i64>>,
+        called_key: Option<String>,
+    }
+
+    #[test]
+    fn test_observer_notified_on_registered_change() {
+        let mut conn = Store::open("").unwrap();
+        add_schema(&mut conn);
+
+        let name_entid: Entid = conn.conn().current_schema().get_entid(&kw!(:todo/name)).expect("entid to exist for name").into();
+        let date_entid: Entid = conn.conn().current_schema().get_entid(&kw!(:todo/completion_date)).expect("entid to exist for completion_date").into();
+        let mut registered_attrs = BTreeSet::new();
+        registered_attrs.insert(name_entid.clone());
+        registered_attrs.insert(date_entid.clone());
+
+        let key = "Test Observing".to_string();
+
+        let output = Arc::new(Mutex::new(ObserverOutput::default()));
+
+        let mut_output = Arc::downgrade(&output);
+        let (tx, rx): (mpsc::Sender<()>, mpsc::Receiver<()>) = mpsc::channel();
+        // because the TxObserver is in an Arc and is therefore Sync, we have to wrap the Sender in a Mutex to also
+        // make it Sync.
+        let thread_tx = Mutex::new(tx);
+        let tx_observer = Arc::new(TxObserver::new(registered_attrs, move |obs_key, batch| {
+            if let Some(out) = mut_output.upgrade() {
+                let mut o = out.lock().unwrap();
+                o.called_key = Some(obs_key.to_string());
+                for (tx_id, changes) in batch.into_iter() {
+                    o.txids.push(*tx_id);
+                    o.changes.push(changes.clone());
+                }
+                o.txids.sort();
+            }
+            thread_tx.lock().unwrap().send(()).unwrap();
+        }));
+
+        conn.register_observer(key.clone(), Arc::clone(&tx_observer));
+        assert!(conn.is_registered_as_observer(&key));
+
+        let mut tx_ids = Vec::new();
+        let mut changesets = Vec::new();
+        let db_tx_instant_entid: Entid = conn.conn().current_schema().get_entid(&kw!(:db/txInstant)).expect("entid to exist for :db/txInstant").into();
+        let uuid_entid: Entid = conn.conn().current_schema().get_entid(&kw!(:todo/uuid)).expect("entid to exist for name").into();
+        {
+            let mut in_progress = conn.begin_transaction().expect("expected transaction");
+            for i in 0..3 {
+                let mut changeset = BTreeSet::new();
+                changeset.insert(db_tx_instant_entid.clone());
+                let name = format!("todo{}", i);
+                let uuid = Uuid::new_v4();
+                let mut builder = in_progress.builder().describe_tempid(&name);
+                builder.add_kw(&kw!(:todo/uuid), TypedValue::Uuid(uuid)).expect("Expected added uuid");
+                changeset.insert(uuid_entid.clone());
+                builder.add_kw(&kw!(:todo/name), TypedValue::typed_string(&name)).expect("Expected added name");
+                changeset.insert(name_entid.clone());
+                if i % 2 == 0 {
+                    builder.add_kw(&kw!(:todo/completion_date), TypedValue::current_instant()).expect("Expected added date");
+                    changeset.insert(date_entid.clone());
+                }
+                let (ip, r) = builder.transact();
+                let report = r.expect("expected a report");
+                tx_ids.push(report.tx_id.clone());
+                changesets.push(changeset);
+                in_progress = ip;
+            }
+            let mut builder = in_progress.builder().describe_tempid("Label");
+            builder.add_kw(&kw!(:label/name), TypedValue::typed_string("Label 1")).expect("Expected added name");
+            builder.add_kw(&kw!(:label/color), TypedValue::typed_string("blue")).expect("Expected added color");
+            builder.commit().expect("expect transaction to occur");
+        }
+
+        let delay = Duration::from_millis(100);
+        let _ = rx.recv_timeout(delay);
+
+        let out = Arc::try_unwrap(output).expect("unwrapped");
+        let o = out.into_inner().expect("Expected an Output");
+        assert_eq!(o.called_key, Some(key.clone()));
+        assert_eq!(o.txids, tx_ids);
+        assert_eq!(o.changes, changesets);
+    }
+
+    #[test]
+    fn test_observer_not_notified_on_unregistered_change() {
+        let mut conn = Store::open("").unwrap();
+        add_schema(&mut conn);
+
+        let name_entid: Entid = conn.conn().current_schema().get_entid(&kw!(:todo/name)).expect("entid to exist for name").into();
+        let date_entid: Entid = conn.conn().current_schema().get_entid(&kw!(:todo/completion_date)).expect("entid to exist for completion_date").into();
+        let mut registered_attrs = BTreeSet::new();
+        registered_attrs.insert(name_entid.clone());
+        registered_attrs.insert(date_entid.clone());
+
+        let key = "Test Observing".to_string();
+
+        let output = Arc::new(Mutex::new(ObserverOutput::default()));
+
+        let mut_output = Arc::downgrade(&output);
+        let (tx, rx): (mpsc::Sender<()>, mpsc::Receiver<()>) = mpsc::channel();
+        let thread_tx = Mutex::new(tx);
+        let tx_observer = Arc::new(TxObserver::new(registered_attrs, move |obs_key, batch| {
+            if let Some(out) = mut_output.upgrade() {
+                let mut o = out.lock().unwrap();
+                o.called_key = Some(obs_key.to_string());
+                for (tx_id, changes) in batch.into_iter() {
+                    o.txids.push(*tx_id);
+                    o.changes.push(changes.clone());
+                }
+                o.txids.sort();
+            }
+            thread_tx.lock().unwrap().send(()).unwrap();
+        }));
+
+        conn.register_observer(key.clone(), Arc::clone(&tx_observer));
+        assert!(conn.is_registered_as_observer(&key));
+
+        let tx_ids = Vec::<Entid>::new();
+        let changesets = Vec::<BTreeSet<Entid>>::new();
+        {
+            let mut in_progress = conn.begin_transaction().expect("expected transaction");
+            for i in 0..3 {
+                let name = format!("label{}", i);
+                let mut builder = in_progress.builder().describe_tempid(&name);
+                builder.add_kw(&kw!(:label/name), TypedValue::typed_string(&name)).expect("Expected added name");
+                builder.add_kw(&kw!(:label/color), TypedValue::typed_string("blue")).expect("Expected added color");
+                let (ip, _) = builder.transact();
+                in_progress = ip;
+            }
+        }
+
+        let delay = Duration::from_millis(100);
+        let _ = rx.recv_timeout(delay);
+
+        let out = Arc::try_unwrap(output).expect("unwrapped");
+        let o = out.into_inner().expect("Expected an Output");
+        assert_eq!(o.called_key, None);
+        assert_eq!(o.txids, tx_ids);
+        assert_eq!(o.changes, changesets);
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat/vocabulary.rs.html b/docs/apis/rust/0.7.0/src/mentat/vocabulary.rs.html new file mode 100644 index 00000000..afa89490 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat/vocabulary.rs.html @@ -0,0 +1,2044 @@ + + + + + + + + + + vocabulary.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+
+//! This module exposes an interface for programmatic management of vocabularies.
+//!
+//! A vocabulary is defined by a name, a version number, and a collection of attribute definitions.
+//!
+//! Operations on vocabularies can include migrations between versions. These are defined
+//! programmatically as a pair of functions, `pre` and `post`, that are invoked prior to
+//! an upgrade.
+//!
+//! A Mentat store exposes, via the `HasSchema` trait, operations to read
+//! vocabularies by name or in bulk.
+//!
+//! An in-progress transaction (`InProgress`) further exposes a trait,
+//! `VersionedStore`, which allows for a vocabulary definition to be
+//! checked for existence in the store, and transacted if needed.
+//!
+//! Typical use is the following:
+//!
+//! ```
+//! #[macro_use(kw)]
+//! extern crate mentat;
+//!
+//! use mentat::{
+//!     Store,
+//!     ValueType,
+//! };
+//!
+//! use mentat::vocabulary;
+//! use mentat::vocabulary::{
+//!     Definition,
+//!     HasVocabularies,
+//!     VersionedStore,
+//!     VocabularyOutcome,
+//! };
+//!
+//! fn main() {
+//!     let mut store = Store::open("").expect("connected");
+//!
+//!     {
+//!         // Read the list of installed vocabularies.
+//!         let reader = store.begin_read().expect("began read");
+//!         let vocabularies = reader.read_vocabularies().expect("read");
+//!         for (name, vocabulary) in vocabularies.iter() {
+//!             println!("Vocab {} is at version {}.", name, vocabulary.version);
+//!             for &(ref name, ref attr) in vocabulary.attributes().iter() {
+//!                 println!("  >> {} ({})", name, attr.value_type);
+//!             }
+//!         }
+//!     }
+//!
+//!     {
+//!         let mut in_progress = store.begin_transaction().expect("began transaction");
+//!
+//!         // Make sure the core vocabulary exists.
+//!         in_progress.verify_core_schema().expect("verified");
+//!
+//!         // Make sure our vocabulary is installed, and install if necessary.
+//!         in_progress.ensure_vocabulary(&Definition {
+//!             name: kw!(:example/links),
+//!             version: 1,
+//!             attributes: vec![
+//!                 (kw!(:link/title),
+//!                  vocabulary::AttributeBuilder::helpful()
+//!                    .value_type(ValueType::String)
+//!                    .multival(false)
+//!                    .fulltext(true)
+//!                    .build()),
+//!             ],
+//!             pre: Definition::no_op,
+//!             post: Definition::no_op,
+//!         }).expect("ensured");
+//!
+//!         // Now we can do stuff.
+//!         in_progress.transact("[{:link/title \"Title\"}]").expect("transacts");
+//!         in_progress.commit().expect("commits");
+//!     }
+//! }
+//! ```
+//!
+//! A similar approach is taken using the
+//! [VocabularyProvider](mentat::vocabulary::VocabularyProvider) trait to handle migrations across
+//! multiple vocabularies.
+
+use std::collections::BTreeMap;
+
+pub use mentat_core::attribute;
+
+use mentat_core::attribute::{
+    Unique,
+};
+
+use mentat_core::{
+    KnownEntid,
+};
+
+use ::{
+    CORE_SCHEMA_VERSION,
+    Attribute,
+    Entid,
+    HasSchema,
+    IntoResult,
+    Keyword,
+    Binding,
+    TypedValue,
+    ValueType,
+};
+
+use ::conn::{
+    InProgress,
+    Queryable,
+};
+
+use ::errors::{
+    MentatError,
+    Result,
+};
+
+use ::entity_builder::{
+    BuildTerms,
+    TermBuilder,
+    Terms,
+};
+
+/// AttributeBuilder is how you build vocabulary definitions to apply to a store.
+pub use mentat_db::AttributeBuilder;
+
+pub type Version = u32;
+pub type Datom = (Entid, Entid, TypedValue);
+
+/// A definition of an attribute that is independent of a particular store.
+///
+/// `Attribute` instances not only aren't named, but don't even have entids.
+///
+/// We need two kinds of structure: an abstract definition of a vocabulary in terms of names,
+/// and a concrete instance of a vocabulary in a particular store.
+///
+/// `Definition` is the former, and `Vocabulary` is the latter.
+///
+/// Note that, because it's possible to 'flesh out' a vocabulary with attributes without bumping
+/// its version number, we need to track the attributes that the application cares about — it's
+/// not enough to know the name and version. Indeed, we even care about the details of each attribute,
+/// because that's how we'll detect errors.
+///
+/// `Definition` includes two additional fields: functions to run if this vocabulary is being
+/// upgraded. `pre` and `post` are run before and after the definition is transacted against the
+/// store. Each is called with the existing `Vocabulary` instance so that they can do version
+/// checks or employ more fine-grained logic.
+#[derive(Clone)]
+pub struct Definition {
+    pub name: Keyword,
+    pub version: Version,
+    pub attributes: Vec<(Keyword, Attribute)>,
+    pub pre: fn(&mut InProgress, &Vocabulary) -> Result<()>,
+    pub post: fn(&mut InProgress, &Vocabulary) -> Result<()>,
+}
+
+/// ```
+/// #[macro_use(kw)]
+/// extern crate mentat;
+///
+/// use mentat::{
+///     HasSchema,
+///     IntoResult,
+///     Queryable,
+///     Store,
+///     TypedValue,
+///     ValueType,
+/// };
+///
+/// use mentat::entity_builder::{
+///     BuildTerms,
+///     TermBuilder,
+/// };
+///
+/// use mentat::vocabulary;
+/// use mentat::vocabulary::{
+///     AttributeBuilder,
+///     Definition,
+///     HasVocabularies,
+///     VersionedStore,
+/// };
+///
+/// fn main() {
+///     let mut store = Store::open("").expect("connected");
+///     let mut in_progress = store.begin_transaction().expect("began transaction");
+///
+///     // Make sure the core vocabulary exists.
+///     in_progress.verify_core_schema().expect("verified");
+///
+///     // Make sure our vocabulary is installed, and install if necessary.
+///     in_progress.ensure_vocabulary(&Definition {
+///         name: kw!(:example/links),
+///         version: 2,
+///         attributes: vec![
+///             (kw!(:link/title),
+///              AttributeBuilder::helpful()
+///                .value_type(ValueType::String)
+///                .multival(false)
+///                .fulltext(true)
+///                .build()),
+///         ],
+///         pre: |ip, from| {
+///             // Version one allowed multiple titles; version two
+///             // doesn't. Retract any duplicates we find.
+///             if from.version < 2 {
+///                 let link_title = ip.get_entid(&kw!(:link/title)).unwrap();
+///
+///                 let results = ip.q_once(r#"
+///                     [:find ?e ?t2
+///                      :where [?e :link/title ?t1]
+///                             [?e :link/title ?t2]
+///                             [(unpermute ?t1 ?t2)]]
+///                 "#, None).into_rel_result()?;
+///
+///                 if !results.is_empty() {
+///                     let mut builder = TermBuilder::new();
+///                     for row in results.into_iter() {
+///                         let mut r = row.into_iter();
+///                         let e = r.next().and_then(|e| e.into_known_entid()).expect("entity");
+///                         let obsolete = r.next().expect("value").val().expect("typed value");
+///                         builder.retract(e, link_title, obsolete)?;
+///                     }
+///                     ip.transact_builder(builder)?;
+///                 }
+///             }
+///             Ok(())
+///         },
+///         post: |_ip, from| {
+///             println!("We migrated :example/links from version {}", from.version);
+///             Ok(())
+///         },
+///     }).expect("ensured");
+///
+///     // Now we can do stuff.
+///     in_progress.transact("[{:link/title \"Title\"}]").expect("transacts");
+///     in_progress.commit().expect("commits");
+/// }
+/// ```
+impl Definition {
+    pub fn no_op(_ip: &mut InProgress, _from: &Vocabulary) -> Result<()> {
+        Ok(())
+    }
+
+    pub fn new<N, A>(name: N, version: Version, attributes: A) -> Definition
+    where N: Into<Keyword>,
+          A: Into<Vec<(Keyword, Attribute)>> {
+        Definition {
+            name: name.into(),
+            version: version,
+            attributes: attributes.into(),
+            pre: Definition::no_op,
+            post: Definition::no_op,
+        }
+    }
+
+    /// Called with an in-progress transaction and the previous vocabulary version
+    /// if the definition's version is later than that of the vocabulary in the store.
+    fn pre(&self, ip: &mut InProgress, from: &Vocabulary) -> Result<()> {
+        (self.pre)(ip, from)
+    }
+
+    /// Called with an in-progress transaction and the previous vocabulary version
+    /// if the definition's version is later than that of the vocabulary in the store.
+    fn post(&self, ip: &mut InProgress, from: &Vocabulary) -> Result<()> {
+        (self.post)(ip, from)
+    }
+}
+
+/// A definition of a vocabulary as retrieved from a particular store.
+///
+/// A `Vocabulary` is just like `Definition`, but concrete: its name and attributes are identified
+/// by `Entid`, not `Keyword`.
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub struct Vocabulary {
+    pub entity: Entid,
+    pub version: Version,
+    attributes: Vec<(Entid, Attribute)>,
+}
+
+impl Vocabulary {
+    pub fn attributes(&self) -> &Vec<(Entid, Attribute)> {
+        &self.attributes
+    }
+}
+
+/// A collection of named `Vocabulary` instances, as retrieved from the store.
+#[derive(Debug, Default, Clone)]
+pub struct Vocabularies(pub BTreeMap<Keyword, Vocabulary>);   // N.B., this has a copy of the attributes in Schema!
+
+impl Vocabularies {
+    pub fn len(&self) -> usize {
+        self.0.len()
+    }
+
+    pub fn get(&self, name: &Keyword) -> Option<&Vocabulary> {
+        self.0.get(name)
+    }
+
+    pub fn iter(&self) -> ::std::collections::btree_map::Iter<Keyword, Vocabulary> {
+        self.0.iter()
+    }
+}
+
+lazy_static! {
+    static ref DB_SCHEMA_CORE: Keyword = {
+        kw!(:db.schema/core)
+    };
+    static ref DB_SCHEMA_ATTRIBUTE: Keyword = {
+        kw!(:db.schema/attribute)
+    };
+    static ref DB_SCHEMA_VERSION: Keyword = {
+        kw!(:db.schema/version)
+    };
+    static ref DB_IDENT: Keyword = {
+        kw!(:db/ident)
+    };
+    static ref DB_UNIQUE: Keyword = {
+        kw!(:db/unique)
+    };
+    static ref DB_UNIQUE_VALUE: Keyword = {
+        kw!(:db.unique/value)
+    };
+    static ref DB_UNIQUE_IDENTITY: Keyword = {
+        kw!(:db.unique/identity)
+    };
+    static ref DB_IS_COMPONENT: Keyword = {
+        Keyword::namespaced("db", "isComponent")
+    };
+    static ref DB_VALUE_TYPE: Keyword = {
+        Keyword::namespaced("db", "valueType")
+    };
+    static ref DB_INDEX: Keyword = {
+        kw!(:db/index)
+    };
+    static ref DB_FULLTEXT: Keyword = {
+        kw!(:db/fulltext)
+    };
+    static ref DB_CARDINALITY: Keyword = {
+        kw!(:db/cardinality)
+    };
+    static ref DB_CARDINALITY_ONE: Keyword = {
+        kw!(:db.cardinality/one)
+    };
+    static ref DB_CARDINALITY_MANY: Keyword = {
+        kw!(:db.cardinality/many)
+    };
+
+    static ref DB_NO_HISTORY: Keyword = {
+        Keyword::namespaced("db", "noHistory")
+    };
+}
+
+trait HasCoreSchema {
+    /// Return the entity ID for a type. On failure, return `MissingCoreVocabulary`.
+    fn core_type(&self, t: ValueType) -> Result<KnownEntid>;
+
+    /// Return the entity ID for an ident. On failure, return `MissingCoreVocabulary`.
+    fn core_entid(&self, ident: &Keyword) -> Result<KnownEntid>;
+
+    /// Return the entity ID for an attribute's keyword. On failure, return
+    /// `MissingCoreVocabulary`.
+    fn core_attribute(&self, ident: &Keyword) -> Result<KnownEntid>;
+}
+
+impl<T> HasCoreSchema for T where T: HasSchema {
+    fn core_type(&self, t: ValueType) -> Result<KnownEntid> {
+        self.entid_for_type(t)
+            .ok_or_else(|| MentatError::MissingCoreVocabulary(DB_SCHEMA_VERSION.clone()).into())
+    }
+
+    fn core_entid(&self, ident: &Keyword) -> Result<KnownEntid> {
+        self.get_entid(ident)
+            .ok_or_else(|| MentatError::MissingCoreVocabulary(DB_SCHEMA_VERSION.clone()).into())
+    }
+
+    fn core_attribute(&self, ident: &Keyword) -> Result<KnownEntid> {
+        self.attribute_for_ident(ident)
+            .ok_or_else(|| MentatError::MissingCoreVocabulary(DB_SCHEMA_VERSION.clone()).into())
+            .map(|(_, e)| e)
+    }
+}
+
+impl Definition {
+    fn description_for_attributes<'s, T, R>(&'s self, attributes: &[R], via: &T, diff: Option<BTreeMap<Keyword, Attribute>>) -> Result<Terms>
+     where T: HasCoreSchema,
+           R: ::std::borrow::Borrow<(Keyword, Attribute)> {
+
+        // The attributes we'll need to describe this vocabulary.
+        let a_version = via.core_attribute(&DB_SCHEMA_VERSION)?;
+        let a_ident = via.core_attribute(&DB_IDENT)?;
+        let a_attr = via.core_attribute(&DB_SCHEMA_ATTRIBUTE)?;
+
+        let a_cardinality = via.core_attribute(&DB_CARDINALITY)?;
+        let a_fulltext = via.core_attribute(&DB_FULLTEXT)?;
+        let a_index = via.core_attribute(&DB_INDEX)?;
+        let a_is_component = via.core_attribute(&DB_IS_COMPONENT)?;
+        let a_value_type = via.core_attribute(&DB_VALUE_TYPE)?;
+        let a_unique = via.core_attribute(&DB_UNIQUE)?;
+
+        let a_no_history = via.core_attribute(&DB_NO_HISTORY)?;
+
+        let v_cardinality_many = via.core_entid(&DB_CARDINALITY_MANY)?;
+        let v_cardinality_one = via.core_entid(&DB_CARDINALITY_ONE)?;
+        let v_unique_identity = via.core_entid(&DB_UNIQUE_IDENTITY)?;
+        let v_unique_value = via.core_entid(&DB_UNIQUE_VALUE)?;
+
+        // The properties of the vocabulary itself.
+        let name: TypedValue = self.name.clone().into();
+        let version: TypedValue = TypedValue::Long(self.version as i64);
+
+        // Describe the vocabulary.
+        let mut entity = TermBuilder::new().describe_tempid("s");
+        entity.add(a_version, version)?;
+        entity.add(a_ident, name)?;
+        let (mut builder, schema) = entity.finish();
+
+        // Describe each of its attributes.
+        // This is a lot like Schema::to_edn_value; at some point we should tidy this up.
+        for ref r in attributes.iter() {
+            let &(ref kw, ref attr) = r.borrow();
+
+            let tempid = builder.named_tempid(kw.to_string());
+            let name: TypedValue = kw.clone().into();
+            builder.add(tempid.clone(), a_ident, name)?;
+            builder.add(schema.clone(), a_attr, tempid.clone())?;
+
+            let value_type = via.core_type(attr.value_type)?;
+            builder.add(tempid.clone(), a_value_type, value_type)?;
+
+            let c = if attr.multival {
+                v_cardinality_many
+            } else {
+                v_cardinality_one
+            };
+            builder.add(tempid.clone(), a_cardinality, c)?;
+
+            // These are all unconditional because we use attribute descriptions to _alter_, not
+            // just to _add_, and so absence is distinct from negation!
+            builder.add(tempid.clone(), a_index, TypedValue::Boolean(attr.index))?;
+            builder.add(tempid.clone(), a_fulltext, TypedValue::Boolean(attr.fulltext))?;
+            builder.add(tempid.clone(), a_is_component, TypedValue::Boolean(attr.component))?;
+            builder.add(tempid.clone(), a_no_history, TypedValue::Boolean(attr.no_history))?;
+
+            if let Some(u) = attr.unique {
+                let uu = match u {
+                    Unique::Identity => v_unique_identity,
+                    Unique::Value => v_unique_value,
+                };
+                builder.add(tempid.clone(), a_unique, uu)?;
+            } else {
+                 let existing_unique =
+                    if let Some(ref diff) = diff {
+                        diff.get(kw).and_then(|a| a.unique)
+                    } else {
+                        None
+                    };
+                 match existing_unique {
+                    None => {
+                        // Nothing to do.
+                    },
+                    Some(Unique::Identity) => {
+                        builder.retract(tempid.clone(), a_unique, v_unique_identity.clone())?;
+                    },
+                    Some(Unique::Value) => {
+                        builder.retract(tempid.clone(), a_unique, v_unique_value.clone())?;
+                    },
+                 }
+            }
+        }
+
+        builder.build()
+    }
+
+    /// Return a sequence of terms that describes this vocabulary definition and its attributes.
+    fn description_diff<T>(&self, via: &T, from: &Vocabulary) -> Result<Terms> where T: HasSchema {
+        let relevant = self.attributes.iter()
+                           .filter_map(|&(ref keyword, _)|
+                               // Look up the keyword to see if it's currently in use.
+                               via.get_entid(keyword)
+
+                               // If so, map it to the existing attribute.
+                                  .and_then(|e| from.find(e).cloned())
+
+                               // Collect enough that we can do lookups.
+                                  .map(|e| (keyword.clone(), e)))
+                           .collect();
+        self.description_for_attributes(self.attributes.as_slice(), via, Some(relevant))
+    }
+
+    /// Return a sequence of terms that describes this vocabulary definition and its attributes.
+    fn description<T>(&self, via: &T) -> Result<Terms> where T: HasSchema {
+        self.description_for_attributes(self.attributes.as_slice(), via, None)
+    }
+}
+
+/// This enum captures the various relationships between a particular vocabulary pair — one
+/// `Definition` and one `Vocabulary`, if present.
+#[derive(Debug, Eq, PartialEq)]
+pub enum VocabularyCheck<'definition> {
+    /// The provided definition is not already present in the store.
+    NotPresent,
+
+    /// The provided definition is present in the store, and all of its attributes exist.
+    Present,
+
+    /// The provided definition is present in the store with an earlier version number.
+    PresentButNeedsUpdate { older_version: Vocabulary },
+
+    /// The provided definition is present in the store with a more recent version number.
+    PresentButTooNew { newer_version: Vocabulary },
+
+    /// The provided definition is present in the store, but some of its attributes are not.
+    PresentButMissingAttributes { attributes: Vec<&'definition (Keyword, Attribute)> },
+}
+
+/// This enum captures the outcome of attempting to ensure that a vocabulary definition is present
+/// and up-to-date in the store.
+#[derive(Debug, Eq, PartialEq)]
+pub enum VocabularyOutcome {
+    /// The vocabulary was absent and has been installed.
+    Installed,
+
+    /// The vocabulary was present with this version, but some attributes were absent.
+    /// They have been installed.
+    InstalledMissingAttributes,
+
+    /// The vocabulary was present, at the correct version, and all attributes were present.
+    Existed,
+
+    /// The vocabulary was present, at an older version, and it has been upgraded. Any
+    /// missing attributes were installed.
+    Upgraded,
+}
+
+/// This trait captures the ability to retrieve and describe stored vocabularies.
+pub trait HasVocabularies {
+    fn read_vocabularies(&self) -> Result<Vocabularies>;
+    fn read_vocabulary_named(&self, name: &Keyword) -> Result<Option<Vocabulary>>;
+}
+
+/// This trait captures the ability of a store to check and install/upgrade vocabularies.
+pub trait VersionedStore: HasVocabularies + HasSchema {
+    /// Check whether the vocabulary described by the provided metadata is present in the store.
+    fn check_vocabulary<'definition>(&self, definition: &'definition Definition) -> Result<VocabularyCheck<'definition>> {
+        if let Some(vocabulary) = self.read_vocabulary_named(&definition.name)? {
+            // The name is present.
+            // Check the version.
+            if vocabulary.version == definition.version {
+                // Same version. Check that all of our attributes are present.
+                let mut missing: Vec<&'definition (Keyword, Attribute)> = vec![];
+                for pair in definition.attributes.iter() {
+                    if let Some(entid) = self.get_entid(&pair.0) {
+                        if let Some(existing) = vocabulary.find(entid) {
+                            if *existing == pair.1 {
+                                // Same. Phew.
+                                continue;
+                            } else {
+                                // We have two vocabularies with the same name, same version, and
+                                // different definitions for an attribute. That's a coding error.
+                                // We can't accept this vocabulary.
+                                bail!(MentatError::ConflictingAttributeDefinitions(
+                                          definition.name.to_string(),
+                                          definition.version,
+                                          pair.0.to_string(),
+                                          existing.clone(),
+                                          pair.1.clone())
+                                );
+                            }
+                        }
+                    }
+                    // It's missing. Collect it.
+                    missing.push(pair);
+                }
+                if missing.is_empty() {
+                    Ok(VocabularyCheck::Present)
+                } else {
+                    Ok(VocabularyCheck::PresentButMissingAttributes { attributes: missing })
+                }
+            } else if vocabulary.version < definition.version {
+                // Ours is newer. Upgrade.
+                Ok(VocabularyCheck::PresentButNeedsUpdate { older_version: vocabulary })
+            } else {
+                // The vocabulary in the store is newer. We are outdated.
+                Ok(VocabularyCheck::PresentButTooNew { newer_version: vocabulary })
+            }
+        } else {
+            // The vocabulary isn't present in the store. Install it.
+            Ok(VocabularyCheck::NotPresent)
+        }
+    }
+
+    /// Check whether the provided vocabulary is present in the store. If it isn't, make it so.
+    fn ensure_vocabulary(&mut self, definition: &Definition) -> Result<VocabularyOutcome>;
+
+    /// Check whether the provided vocabularies are present in the store at the correct
+    /// version and with all defined attributes. If any are not, invoke the `pre`
+    /// function on the provided `VocabularySource`, install or upgrade the necessary vocabularies,
+    /// then invoke `post`. Returns `Ok` if all of these steps succeed.
+    ///
+    /// Use this function instead of calling `ensure_vocabulary` if you need to have pre/post
+    /// functions invoked when vocabulary changes are necessary.
+    fn ensure_vocabularies(&mut self, vocabularies: &mut VocabularySource) -> Result<BTreeMap<Keyword, VocabularyOutcome>>;
+
+    /// Make sure that our expectations of the core vocabulary — basic types and attributes — are met.
+    fn verify_core_schema(&self) -> Result<()> {
+        if let Some(core) = self.read_vocabulary_named(&DB_SCHEMA_CORE)? {
+            if core.version != CORE_SCHEMA_VERSION {
+                bail!(MentatError::UnexpectedCoreSchema(CORE_SCHEMA_VERSION, Some(core.version)));
+            }
+
+            // TODO: check things other than the version.
+        } else {
+            // This would be seriously messed up.
+            bail!(MentatError::UnexpectedCoreSchema(CORE_SCHEMA_VERSION, None));
+        }
+        Ok(())
+    }
+}
+
+/// `VocabularyStatus` is passed to `pre` function when attempting to add or upgrade vocabularies
+/// via `ensure_vocabularies`. This is how you can find the status and versions of existing
+/// vocabularies — you can retrieve the requested definition and the resulting `VocabularyCheck`
+/// by name.
+pub trait VocabularyStatus {
+    fn get(&self, name: &Keyword) -> Option<(&Definition, &VocabularyCheck)>;
+    fn version(&self, name: &Keyword) -> Option<Version>;
+}
+
+#[derive(Default)]
+struct CheckedVocabularies<'a> {
+    items: BTreeMap<Keyword, (&'a Definition, VocabularyCheck<'a>)>,
+}
+
+impl<'a> CheckedVocabularies<'a> {
+    fn add(&mut self, definition: &'a Definition, check: VocabularyCheck<'a>) {
+        self.items.insert(definition.name.clone(), (definition, check));
+    }
+
+    fn is_empty(&self) -> bool {
+        self.items.is_empty()
+    }
+}
+
+impl<'a> VocabularyStatus for CheckedVocabularies<'a> {
+    fn get(&self, name: &Keyword) -> Option<(&Definition, &VocabularyCheck)> {
+        self.items.get(name).map(|&(ref d, ref c)| (*d, c))
+    }
+
+    fn version(&self, name: &Keyword) -> Option<Version> {
+        self.items.get(name).map(|&(d, _)| d.version)
+    }
+}
+
+trait VocabularyMechanics {
+    fn install_vocabulary(&mut self, definition: &Definition) -> Result<VocabularyOutcome>;
+    fn install_attributes_for<'definition>(&mut self, definition: &'definition Definition, attributes: Vec<&'definition (Keyword, Attribute)>) -> Result<VocabularyOutcome>;
+    fn upgrade_vocabulary(&mut self, definition: &Definition, from_version: Vocabulary) -> Result<VocabularyOutcome>;
+}
+
+impl Vocabulary {
+    // TODO: don't do linear search!
+    fn find<T>(&self, entid: T) -> Option<&Attribute> where T: Into<Entid> {
+        let to_find = entid.into();
+        self.attributes.iter().find(|&&(e, _)| e == to_find).map(|&(_, ref a)| a)
+    }
+}
+
+impl<'a, 'c> VersionedStore for InProgress<'a, 'c> {
+    fn ensure_vocabulary(&mut self, definition: &Definition) -> Result<VocabularyOutcome> {
+        match self.check_vocabulary(definition)? {
+            VocabularyCheck::Present => Ok(VocabularyOutcome::Existed),
+            VocabularyCheck::NotPresent => self.install_vocabulary(definition),
+            VocabularyCheck::PresentButNeedsUpdate { older_version } => self.upgrade_vocabulary(definition, older_version),
+            VocabularyCheck::PresentButMissingAttributes { attributes } => self.install_attributes_for(definition, attributes),
+            VocabularyCheck::PresentButTooNew { newer_version } => Err(MentatError::ExistingVocabularyTooNew(definition.name.to_string(), newer_version.version, definition.version).into()),
+        }
+    }
+
+    fn ensure_vocabularies(&mut self, vocabularies: &mut VocabularySource) -> Result<BTreeMap<Keyword, VocabularyOutcome>> {
+        let definitions = vocabularies.definitions();
+
+        let mut update  = Vec::new();
+        let mut missing = Vec::new();
+        let mut out = BTreeMap::new();
+
+        let mut work = CheckedVocabularies::default();
+
+        for definition in definitions.iter() {
+            match self.check_vocabulary(definition)? {
+                VocabularyCheck::Present => {
+                    out.insert(definition.name.clone(), VocabularyOutcome::Existed);
+                },
+                VocabularyCheck::PresentButTooNew { newer_version } => {
+                    bail!(MentatError::ExistingVocabularyTooNew(definition.name.to_string(), newer_version.version, definition.version));
+                },
+
+                c @ VocabularyCheck::NotPresent |
+                c @ VocabularyCheck::PresentButNeedsUpdate { older_version: _ } |
+                c @ VocabularyCheck::PresentButMissingAttributes { attributes: _ } => {
+                    work.add(definition, c);
+                },
+            }
+        }
+
+        if work.is_empty() {
+            return Ok(out);
+        }
+
+        // If any work needs to be done, run pre/post.
+        vocabularies.pre(self, &work)?;
+
+        for (name, (definition, check)) in work.items.into_iter() {
+            match check {
+                VocabularyCheck::NotPresent => {
+                    // Install it directly.
+                    out.insert(name, self.install_vocabulary(definition)?);
+                },
+                VocabularyCheck::PresentButNeedsUpdate { older_version } => {
+                    // Save this: we'll do it later.
+                    update.push((definition, older_version));
+                },
+                VocabularyCheck::PresentButMissingAttributes { attributes } => {
+                    // Save this: we'll do it later.
+                    missing.push((definition, attributes));
+                },
+                VocabularyCheck::Present |
+                VocabularyCheck::PresentButTooNew { newer_version: _ } => {
+                    unreachable!();
+                }
+            }
+        }
+
+        for (d, v) in update {
+            out.insert(d.name.clone(), self.upgrade_vocabulary(d, v)?);
+        }
+        for (d, a) in missing {
+            out.insert(d.name.clone(), self.install_attributes_for(d, a)?);
+        }
+
+        vocabularies.post(self)?;
+        Ok(out)
+    }
+}
+
+/// Implement `VocabularySource` to have full programmatic control over how a set of `Definition`s
+/// are checked against and transacted into a store.
+pub trait VocabularySource {
+    /// Called to obtain the list of `Definition`s to install. This will be called before `pre`.
+    fn definitions(&mut self) -> Vec<Definition>;
+
+    /// Called before the supplied `Definition`s are transacted. Do not commit the `InProgress`.
+    /// If this function returns `Err`, the entire vocabulary operation will fail.
+    fn pre(&mut self, _in_progress: &mut InProgress, _checks: &VocabularyStatus) -> Result<()> {
+        Ok(())
+    }
+
+    /// Called after the supplied `Definition`s are transacted. Do not commit the `InProgress`.
+    /// If this function returns `Err`, the entire vocabulary operation will fail.
+    fn post(&mut self, _in_progress: &mut InProgress) -> Result<()> {
+        Ok(())
+    }
+}
+
+/// A convenience struct to package simple `pre` and `post` functions with a collection of
+/// vocabulary `Definition`s.
+pub struct SimpleVocabularySource {
+    pub definitions: Vec<Definition>,
+    pub pre: Option<fn(&mut InProgress) -> Result<()>>,
+    pub post: Option<fn(&mut InProgress) -> Result<()>>,
+}
+
+impl SimpleVocabularySource {
+    pub fn new(definitions: Vec<Definition>,
+               pre: Option<fn(&mut InProgress) -> Result<()>>,
+               post: Option<fn(&mut InProgress) -> Result<()>>) -> SimpleVocabularySource {
+        SimpleVocabularySource {
+            pre: pre,
+            post: post,
+            definitions: definitions,
+        }
+    }
+
+    pub fn with_definitions(definitions: Vec<Definition>) -> SimpleVocabularySource {
+        Self::new(definitions, None, None)
+    }
+}
+
+impl VocabularySource for SimpleVocabularySource {
+    fn pre(&mut self, in_progress: &mut InProgress, _checks: &VocabularyStatus) -> Result<()> {
+        self.pre.map(|pre| (pre)(in_progress)).unwrap_or(Ok(()))
+    }
+
+    fn post(&mut self, in_progress: &mut InProgress) -> Result<()> {
+        self.post.map(|pre| (pre)(in_progress)).unwrap_or(Ok(()))
+    }
+
+    fn definitions(&mut self) -> Vec<Definition> {
+        self.definitions.clone()
+    }
+}
+
+impl<'a, 'c> VocabularyMechanics for InProgress<'a, 'c> {
+    /// Turn the vocabulary into datoms, transact them, and on success return the outcome.
+    fn install_vocabulary(&mut self, definition: &Definition) -> Result<VocabularyOutcome> {
+        let (terms, tempids) = definition.description(self)?;
+        self.transact_terms(terms, tempids)?;
+        Ok(VocabularyOutcome::Installed)
+    }
+
+    fn install_attributes_for<'definition>(&mut self, definition: &'definition Definition, attributes: Vec<&'definition (Keyword, Attribute)>) -> Result<VocabularyOutcome> {
+        let (terms, tempids) = definition.description_for_attributes(&attributes, self, None)?;
+        self.transact_terms(terms, tempids)?;
+        Ok(VocabularyOutcome::InstalledMissingAttributes)
+    }
+
+    /// Turn the declarative parts of the vocabulary into alterations. Run the 'pre' steps.
+    /// Transact the changes. Run the 'post' steps. Return the result and the new `InProgress`!
+    fn upgrade_vocabulary(&mut self, definition: &Definition, from_version: Vocabulary) -> Result<VocabularyOutcome> {
+        // It's sufficient for us to generate the datom form of each attribute and transact that.
+        // We trust that the vocabulary will implement a 'pre' function that cleans up data for any
+        // failable conversion (e.g., cardinality-many to cardinality-one).
+
+        definition.pre(self, &from_version)?;
+
+        // TODO: don't do work for attributes that are unchanged. Here we rely on the transactor
+        // to elide duplicate datoms.
+        let (terms, tempids) = definition.description_diff(self, &from_version)?;
+        self.transact_terms(terms, tempids)?;
+
+        definition.post(self, &from_version)?;
+        Ok(VocabularyOutcome::Upgraded)
+    }
+}
+
+impl<T> HasVocabularies for T where T: HasSchema + Queryable {
+    fn read_vocabulary_named(&self, name: &Keyword) -> Result<Option<Vocabulary>> {
+        if let Some(entid) = self.get_entid(name) {
+            match self.lookup_value_for_attribute(entid, &DB_SCHEMA_VERSION)? {
+                None => Ok(None),
+                Some(TypedValue::Long(version))
+                    if version > 0 && (version < u32::max_value() as i64) => {
+                        let version = version as u32;
+                        let attributes = self.lookup_values_for_attribute(entid, &DB_SCHEMA_ATTRIBUTE)?
+                                             .into_iter()
+                                             .filter_map(|a| {
+                                                 if let TypedValue::Ref(a) = a {
+                                                     self.attribute_for_entid(a)
+                                                         .cloned()
+                                                         .map(|attr| (a, attr))
+                                                 } else {
+                                                     None
+                                                 }
+                                             })
+                                             .collect();
+                        Ok(Some(Vocabulary {
+                            entity: entid.into(),
+                            version: version,
+                            attributes: attributes,
+                        }))
+                    },
+                Some(_) => bail!(MentatError::InvalidVocabularyVersion),
+            }
+        } else {
+            Ok(None)
+        }
+    }
+
+    fn read_vocabularies(&self) -> Result<Vocabularies> {
+        // This would be way easier with pull expressions. #110.
+        let versions: BTreeMap<Entid, u32> =
+            self.q_once(r#"[:find ?vocab ?version
+                            :where [?vocab :db.schema/version ?version]]"#, None)
+                .into_rel_result()?
+                .into_iter()
+                .filter_map(|v|
+                    match (&v[0], &v[1]) {
+                        (&Binding::Scalar(TypedValue::Ref(vocab)),
+                         &Binding::Scalar(TypedValue::Long(version)))
+                        if version > 0 && (version < u32::max_value() as i64) => Some((vocab, version as u32)),
+                        (_, _) => None,
+                    })
+                .collect();
+
+        let mut attributes = BTreeMap::<Entid, Vec<(Entid, Attribute)>>::new();
+        let pairs =
+            self.q_once("[:find ?vocab ?attr :where [?vocab :db.schema/attribute ?attr]]", None)
+                .into_rel_result()?
+                .into_iter()
+                .filter_map(|v| {
+                    match (&v[0], &v[1]) {
+                        (&Binding::Scalar(TypedValue::Ref(vocab)),
+                         &Binding::Scalar(TypedValue::Ref(attr))) => Some((vocab, attr)),
+                        (_, _) => None,
+                    }
+                    });
+
+        // TODO: validate that attributes.keys is a subset of versions.keys.
+        for (vocab, attr) in pairs {
+            if let Some(attribute) = self.attribute_for_entid(attr).cloned() {
+                attributes.entry(vocab).or_insert(Vec::new()).push((attr, attribute));
+            }
+        }
+
+        // TODO: return more errors?
+
+        // We walk versions first in order to support vocabularies with no attributes.
+        Ok(Vocabularies(versions.into_iter().filter_map(|(vocab, version)| {
+            // Get the name.
+            self.get_ident(vocab).cloned()
+                .map(|name| {
+                    let attrs = attributes.remove(&vocab).unwrap_or(vec![]);
+                    (name.clone(), Vocabulary {
+                        entity: vocab,
+                        version: version,
+                        attributes: attrs,
+                    })
+                })
+        }).collect()))
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use ::{
+        Store,
+    };
+
+    use super::{
+        HasVocabularies,
+    };
+
+    #[test]
+    fn test_read_vocabularies() {
+        let mut store = Store::open("").expect("opened");
+        let vocabularies = store.begin_read().expect("in progress")
+                                .read_vocabularies().expect("OK");
+        assert_eq!(vocabularies.len(), 1);
+        let core = vocabularies.get(&kw!(:db.schema/core)).expect("exists");
+        assert_eq!(core.version, 1);
+    }
+
+    #[test]
+    fn test_core_schema() {
+        let mut store = Store::open("").expect("opened");
+        let in_progress = store.begin_transaction().expect("in progress");
+        let vocab = in_progress.read_vocabularies().expect("vocabulary");
+        assert_eq!(1, vocab.len());
+        assert_eq!(1, vocab.get(&kw!(:db.schema/core)).expect("core vocab").version);
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_cli/command_parser.rs.html b/docs/apis/rust/0.7.0/src/mentat_cli/command_parser.rs.html new file mode 100644 index 00000000..56c40354 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_cli/command_parser.rs.html @@ -0,0 +1,1658 @@ + + + + + + + + + + command_parser.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+
+// Copyright 2017 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use combine::{
+    Parser,
+    any,
+    eof,
+    look_ahead,
+    many1,
+    satisfy,
+    sep_end_by,
+    token,
+};
+
+use combine::char::{
+    space,
+    spaces,
+    string,
+};
+
+use combine::combinator::{
+    choice,
+    try,
+};
+
+use CliError;
+
+use edn;
+
+use failure::{
+    Compat,
+    Error,
+};
+
+use mentat::{
+    CacheDirection,
+};
+
+#[macro_export]
+macro_rules! bail {
+    ($e:expr) => (
+        return Err($e.into());
+    )
+}
+
+pub static COMMAND_CACHE: &'static str = &"cache";
+pub static COMMAND_CLOSE: &'static str = &"close";
+pub static COMMAND_EXIT_LONG: &'static str = &"exit";
+pub static COMMAND_EXIT_SHORT: &'static str = &"e";
+pub static COMMAND_HELP: &'static str = &"help";
+pub static COMMAND_IMPORT_LONG: &'static str = &"import";
+pub static COMMAND_IMPORT_SHORT: &'static str = &"i";
+pub static COMMAND_OPEN: &'static str = &"open";
+pub static COMMAND_OPEN_EMPTY: &'static str = &"empty";
+pub static COMMAND_OPEN_ENCRYPTED: &'static str = &"open_encrypted";
+pub static COMMAND_OPEN_EMPTY_ENCRYPTED: &'static str = &"empty_encrypted";
+pub static COMMAND_QUERY_LONG: &'static str = &"query";
+pub static COMMAND_QUERY_SHORT: &'static str = &"q";
+pub static COMMAND_QUERY_EXPLAIN_LONG: &'static str = &"explain_query";
+pub static COMMAND_QUERY_EXPLAIN_SHORT: &'static str = &"eq";
+pub static COMMAND_QUERY_PREPARED_LONG: &'static str = &"query_prepared";
+pub static COMMAND_SCHEMA: &'static str = &"schema";
+pub static COMMAND_SYNC: &'static str = &"sync";
+pub static COMMAND_TIMER_LONG: &'static str = &"timer";
+pub static COMMAND_TRANSACT_LONG: &'static str = &"transact";
+pub static COMMAND_TRANSACT_SHORT: &'static str = &"t";
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum Command {
+    Cache(String, CacheDirection),
+    Close,
+    Exit,
+    Help(Vec<String>),
+    Import(String),
+    Open(String),
+    OpenEmpty(String),
+    OpenEncrypted(String, String),
+    OpenEmptyEncrypted(String, String),
+    Query(String),
+    QueryExplain(String),
+    QueryPrepared(String),
+    Schema,
+    Sync(Vec<String>),
+    Timer(bool),
+    Transact(String),
+}
+
+impl Command {
+    /// is_complete returns true if no more input is required for the command to be successfully executed.
+    /// false is returned if the command is not considered valid.
+    /// Defaults to true for all commands except Query and Transact.
+    /// TODO: for query and transact commands, they will be considered complete if a parsable EDN has been entered as an argument
+    pub fn is_complete(&self) -> bool {
+        match self {
+            &Command::Query(ref args) |
+            &Command::QueryExplain(ref args) |
+            &Command::QueryPrepared(ref args) |
+            &Command::Transact(ref args)
+            => {
+                edn::parse::value(&args).is_ok()
+            },
+            &Command::Cache(_, _) |
+            &Command::Close |
+            &Command::Exit |
+            &Command::Help(_) |
+            &Command::Import(_) |
+            &Command::Open(_) |
+            &Command::OpenEmpty(_) |
+            &Command::OpenEncrypted(_, _) |
+            &Command::OpenEmptyEncrypted(_, _) |
+            &Command::Timer(_) |
+            &Command::Schema |
+            &Command::Sync(_)
+            => true,
+        }
+    }
+
+    pub fn is_timed(&self) -> bool {
+        match self {
+            &Command::Import(_) |
+            &Command::Query(_) |
+            &Command::QueryPrepared(_) |
+            &Command::Transact(_)
+            => true,
+
+            &Command::Cache(_, _) |
+            &Command::Close |
+            &Command::Exit |
+            &Command::Help(_) |
+            &Command::Open(_) |
+            &Command::OpenEmpty(_) |
+            &Command::OpenEncrypted(_, _) |
+            &Command::OpenEmptyEncrypted(_, _) |
+            &Command::QueryExplain(_) |
+            &Command::Timer(_) |
+            &Command::Schema |
+            &Command::Sync(_)
+            => false,
+        }
+    }
+
+    pub fn output(&self) -> String {
+        match self {
+            &Command::Cache(ref attr, ref direction) => {
+                format!(".{} {} {:?}", COMMAND_CACHE, attr, direction)
+            },
+            &Command::Close => {
+                format!(".{}", COMMAND_CLOSE)
+            },
+            &Command::Exit => {
+                format!(".{}", COMMAND_EXIT_LONG)
+            },
+            &Command::Help(ref args) => {
+                format!(".{} {:?}", COMMAND_HELP, args)
+            },
+            &Command::Import(ref args) => {
+               format!(".{} {}", COMMAND_IMPORT_LONG, args)
+            },
+            &Command::Open(ref args) => {
+                format!(".{} {}", COMMAND_OPEN, args)
+            },
+            &Command::OpenEmpty(ref args) => {
+                format!(".{} {}", COMMAND_OPEN_EMPTY, args)
+            },
+            &Command::OpenEncrypted(ref db, ref key) => {
+                format!(".{} {} {}", COMMAND_OPEN_ENCRYPTED, db, key)
+            },
+            &Command::OpenEmptyEncrypted(ref db, ref key) => {
+                format!(".{} {} {}", COMMAND_OPEN_EMPTY_ENCRYPTED, db, key)
+            },
+            &Command::Query(ref args) => {
+                format!(".{} {}", COMMAND_QUERY_LONG, args)
+            },
+            &Command::QueryExplain(ref args) => {
+                format!(".{} {}", COMMAND_QUERY_EXPLAIN_LONG, args)
+            },
+            &Command::QueryPrepared(ref args) => {
+                format!(".{} {}", COMMAND_QUERY_PREPARED_LONG, args)
+            },
+            &Command::Schema => {
+                format!(".{}", COMMAND_SCHEMA)
+            },
+            &Command::Sync(ref args) => {
+                format!(".{} {:?}", COMMAND_SYNC, args)
+            },
+            &Command::Timer(on) => {
+                format!(".{} {}", COMMAND_TIMER_LONG, on)
+            },
+            &Command::Transact(ref args) => {
+                format!(".{} {}", COMMAND_TRANSACT_LONG, args)
+            },
+        }
+    }
+}
+
+pub fn command(s: &str) -> Result<Command, Error> {
+    let path = || many1::<String, _>(satisfy(|c: char| !c.is_whitespace()));
+    let argument = || many1::<String, _>(satisfy(|c: char| !c.is_whitespace()));
+    let arguments = || sep_end_by::<Vec<_>, _, _>(many1(satisfy(|c: char| !c.is_whitespace())), many1::<Vec<_>, _>(space())).expected("arguments");
+
+    // Helpers.
+    let direction_parser = || string("forward")
+                                .map(|_| CacheDirection::Forward)
+                           .or(string("reverse").map(|_| CacheDirection::Reverse))
+                           .or(string("both").map(|_| CacheDirection::Both));
+
+    let edn_arg_parser = || spaces()
+                            .with(look_ahead(string("[").or(string("{")))
+                                .with(many1::<Vec<_>, _>(try(any())))
+                                .and_then(|args| -> Result<String, Compat<Error>> {
+                                    Ok(args.iter().collect())
+                                })
+                            );
+
+    let no_arg_parser = || arguments()
+                        .skip(spaces())
+                        .skip(eof());
+
+    let opener = |command, num_args| {
+        string(command)
+            .with(spaces())
+            .with(arguments())
+            .map(move |args| {
+                if args.len() < num_args {
+                    bail!(CliError::CommandParse("Missing required argument".to_string()));
+                }
+                if args.len() > num_args {
+                    bail!(CliError::CommandParse(format!("Unrecognized argument {:?}", args[num_args])));
+                }
+                Ok(args)
+            })
+    };
+
+    // Commands.
+    let cache_parser = string(COMMAND_CACHE)
+                    .with(spaces())
+                    .with(argument().skip(spaces()).and(direction_parser())
+                    .map(|(arg, direction)| {
+                        Ok(Command::Cache(arg, direction))
+                    }));
+
+
+    let close_parser = string(COMMAND_CLOSE)
+                    .with(no_arg_parser())
+                    .map(|args| {
+                        if !args.is_empty() {
+                            bail!(CliError::CommandParse(format!("Unrecognized argument {:?}", args[0])) );
+                        }
+                        Ok(Command::Close)
+                    });
+
+    let exit_parser = try(string(COMMAND_EXIT_LONG)).or(try(string(COMMAND_EXIT_SHORT)))
+                    .with(no_arg_parser())
+                    .map(|args| {
+                        if !args.is_empty() {
+                            bail!(CliError::CommandParse(format!("Unrecognized argument {:?}", args[0])) );
+                        }
+                        Ok(Command::Exit)
+                    });
+
+    let explain_query_parser = try(string(COMMAND_QUERY_EXPLAIN_LONG))
+                           .or(try(string(COMMAND_QUERY_EXPLAIN_SHORT)))
+                        .with(edn_arg_parser())
+                        .map(|x| {
+                            Ok(Command::QueryExplain(x))
+                        });
+
+    let help_parser = string(COMMAND_HELP)
+                    .with(spaces())
+                    .with(arguments())
+                    .map(|args| {
+                        Ok(Command::Help(args.clone()))
+                    });
+
+    let import_parser = try(string(COMMAND_IMPORT_LONG)).or(try(string(COMMAND_IMPORT_SHORT)))
+                    .with(spaces())
+                    .with(path())
+                    .map(|x| {
+                        Ok(Command::Import(x))
+                    });
+
+    let open_parser = opener(COMMAND_OPEN, 1).map(|args_res|
+        args_res.map(|args| Command::Open(args[0].clone())));
+
+    let open_empty_parser = opener(COMMAND_OPEN_EMPTY, 1).map(|args_res|
+        args_res.map(|args| Command::OpenEmpty(args[0].clone())));
+
+    let open_encrypted_parser = opener(COMMAND_OPEN_ENCRYPTED, 2).map(|args_res|
+        args_res.map(|args| Command::OpenEncrypted(args[0].clone(), args[1].clone())));
+
+    let open_empty_encrypted_parser = opener(COMMAND_OPEN_EMPTY_ENCRYPTED, 2).map(|args_res|
+        args_res.map(|args| Command::OpenEmptyEncrypted(args[0].clone(), args[1].clone())));
+
+    let query_parser = try(string(COMMAND_QUERY_LONG)).or(try(string(COMMAND_QUERY_SHORT)))
+                        .with(edn_arg_parser())
+                        .map(|x| {
+                            Ok(Command::Query(x))
+                        });
+
+    let query_prepared_parser = string(COMMAND_QUERY_PREPARED_LONG)
+                        .with(edn_arg_parser())
+                        .map(|x| {
+                            Ok(Command::QueryPrepared(x))
+                        });
+
+    let schema_parser = string(COMMAND_SCHEMA)
+                    .with(no_arg_parser())
+                    .map(|args| {
+                        if !args.is_empty() {
+                            bail!(CliError::CommandParse(format!("Unrecognized argument {:?}", args[0])) );
+                        }
+                        Ok(Command::Schema)
+                    });
+
+    let sync_parser = string(COMMAND_SYNC)
+                    .with(spaces())
+                    .with(arguments())
+                    .map(|args| {
+                        if args.len() < 1 {
+                            bail!(CliError::CommandParse("Missing required argument".to_string()));
+                        }
+                        if args.len() > 2 {
+                            bail!(CliError::CommandParse(format!("Unrecognized argument {:?}", args[2])));
+                        }
+                        Ok(Command::Sync(args.clone()))
+                    });
+
+    let timer_parser = string(COMMAND_TIMER_LONG)
+                    .with(spaces())
+                    .with(string("on").map(|_| true).or(string("off").map(|_| false)))
+                    .map(|args| {
+                        Ok(Command::Timer(args))
+                    });
+
+    let transact_parser = try(string(COMMAND_TRANSACT_LONG)).or(try(string(COMMAND_TRANSACT_SHORT)))
+                    .with(edn_arg_parser())
+                    .map(|x| {
+                        Ok(Command::Transact(x))
+                    });
+
+    spaces()
+    .skip(token('.'))
+    .with(choice::<[&mut Parser<Input = _, Output = Result<Command, Error>>; 16], _>
+          ([&mut try(help_parser),
+            &mut try(import_parser),
+            &mut try(timer_parser),
+            &mut try(cache_parser),
+            &mut try(open_encrypted_parser),
+            &mut try(open_empty_encrypted_parser),
+            &mut try(open_parser),
+            &mut try(open_empty_parser),
+            &mut try(close_parser),
+            &mut try(explain_query_parser),
+            &mut try(exit_parser),
+            &mut try(query_prepared_parser),
+            &mut try(query_parser),
+            &mut try(schema_parser),
+            &mut try(sync_parser),
+            &mut try(transact_parser)]))
+        .parse(s)
+        .unwrap_or((Err(CliError::CommandParse(format!("Invalid command {:?}", s)).into()), "")).0
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_help_parser_multiple_args() {
+        let input = ".help command1 command2";
+        let cmd = command(&input).expect("Expected help command");
+        match cmd {
+            Command::Help(args) => {
+                assert_eq!(args, vec!["command1", "command2"]);
+            },
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_help_parser_dot_arg() {
+        let input = ".help .command1";
+        let cmd = command(&input).expect("Expected help command");
+        match cmd {
+            Command::Help(args) => {
+                assert_eq!(args, vec![".command1"]);
+            },
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_help_parser_no_args() {
+        let input = ".help";
+        let cmd = command(&input).expect("Expected help command");
+        match cmd {
+            Command::Help(args) => {
+                let empty: Vec<String> = vec![];
+                assert_eq!(args, empty);
+            },
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_help_parser_no_args_trailing_whitespace() {
+        let input = ".help ";
+        let cmd = command(&input).expect("Expected help command");
+        match cmd {
+            Command::Help(args) => {
+                let empty: Vec<String> = vec![];
+                assert_eq!(args, empty);
+            },
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_open_parser_multiple_args() {
+        let input = ".open database1 database2";
+        let err = command(&input).expect_err("Expected an error");
+        assert_eq!(err.to_string(), "Unrecognized argument \"database2\"");
+    }
+
+    #[test]
+    fn test_open_parser_single_arg() {
+        let input = ".open database1";
+        let cmd = command(&input).expect("Expected open command");
+        match cmd {
+            Command::Open(arg) => {
+                assert_eq!(arg, "database1".to_string());
+            },
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_open_parser_path_arg() {
+        let input = ".open /path/to/my.db";
+        let cmd = command(&input).expect("Expected open command");
+        match cmd {
+            Command::Open(arg) => {
+                assert_eq!(arg, "/path/to/my.db".to_string());
+            },
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_open_encrypted_parser() {
+        let input = ".open_encrypted /path/to/my.db hunter2";
+        let cmd = command(&input).expect("Expected open_encrypted command");
+        match cmd {
+            Command::OpenEncrypted(path, key) => {
+                assert_eq!(path, "/path/to/my.db".to_string());
+                assert_eq!(key, "hunter2".to_string());
+            },
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_empty_encrypted_parser() {
+        let input = ".empty_encrypted /path/to/my.db hunter2";
+        let cmd = command(&input).expect("Expected empty_encrypted command");
+        match cmd {
+            Command::OpenEmptyEncrypted(path, key) => {
+                assert_eq!(path, "/path/to/my.db".to_string());
+                assert_eq!(key, "hunter2".to_string());
+            },
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_open_encrypted_parser_missing_key() {
+        let input = ".open_encrypted path/to/db.db";
+        let err = command(&input).expect_err("Expected an error");
+        assert_eq!(err.to_string(), "Missing required argument");
+    }
+
+    #[test]
+    fn test_empty_encrypted_parser_missing_key() {
+        let input = ".empty_encrypted path/to/db.db";
+        let err = command(&input).expect_err("Expected an error");
+        assert_eq!(err.to_string(), "Missing required argument");
+    }
+
+    #[test]
+    fn test_sync_parser_path_arg() {
+        let input = ".sync https://example.com/api/ 316ea470-ce35-4adf-9c61-e0de6e289c59";
+        let cmd = command(&input).expect("Expected open command");
+        match cmd {
+            Command::Sync(args) => {
+                assert_eq!(args[0], "https://example.com/api/".to_string());
+                assert_eq!(args[1], "316ea470-ce35-4adf-9c61-e0de6e289c59".to_string());
+            },
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_open_parser_file_arg() {
+        let input = ".open my.db";
+        let cmd = command(&input).expect("Expected open command");
+        match cmd {
+            Command::Open(arg) => {
+                assert_eq!(arg, "my.db".to_string());
+            },
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_open_parser_no_args() {
+        let input = ".open";
+        let err = command(&input).expect_err("Expected an error");
+        assert_eq!(err.to_string(), "Missing required argument");
+    }
+
+    #[test]
+    fn test_open_parser_no_args_trailing_whitespace() {
+        let input = ".open ";
+        let err = command(&input).expect_err("Expected an error");
+        assert_eq!(err.to_string(), "Missing required argument");
+    }
+
+    #[test]
+    fn test_close_parser_with_args() {
+        let input = ".close arg1";
+        let err = command(&input).expect_err("Expected an error");
+        assert_eq!(err.to_string(), format!("Invalid command {:?}", input));
+    }
+
+    #[test]
+    fn test_close_parser_no_args() {
+        let input = ".close";
+        let cmd = command(&input).expect("Expected close command");
+        match cmd {
+            Command::Close => assert!(true),
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_close_parser_no_args_trailing_whitespace() {
+        let input = ".close ";
+        let cmd = command(&input).expect("Expected close command");
+        match cmd {
+            Command::Close => assert!(true),
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_exit_parser_with_args() {
+        let input = ".exit arg1";
+        let err = command(&input).expect_err("Expected an error");
+        assert_eq!(err.to_string(), format!("Invalid command {:?}", input));
+    }
+
+    #[test]
+    fn test_exit_parser_no_args() {
+        let input = ".exit";
+        let cmd = command(&input).expect("Expected exit command");
+        match cmd {
+            Command::Exit => assert!(true),
+                        _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_exit_parser_no_args_trailing_whitespace() {
+        let input = ".exit ";
+        let cmd = command(&input).expect("Expected exit command");
+        match cmd {
+            Command::Exit => assert!(true),
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_exit_parser_short_command() {
+        let input = ".e";
+        let cmd = command(&input).expect("Expected exit command");
+        match cmd {
+            Command::Exit => assert!(true),
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_schema_parser_with_args() {
+        let input = ".schema arg1";
+        let err = command(&input).expect_err("Expected an error");
+        assert_eq!(err.to_string(), format!("Invalid command {:?}", input));
+    }
+
+    #[test]
+    fn test_schema_parser_no_args() {
+        let input = ".schema";
+        let cmd = command(&input).expect("Expected schema command");
+        match cmd {
+            Command::Schema => assert!(true),
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_schema_parser_no_args_trailing_whitespace() {
+        let input = ".schema ";
+        let cmd = command(&input).expect("Expected schema command");
+        match cmd {
+            Command::Schema => assert!(true),
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_query_parser_complete_edn() {
+        let input = ".q [:find ?x :where [?x foo/bar ?y]]";
+        let cmd = command(&input).expect("Expected query command");
+        match cmd {
+            Command::Query(edn) => assert_eq!(edn, "[:find ?x :where [?x foo/bar ?y]]"),
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_query_parser_alt_query_command() {
+        let input = ".query [:find ?x :where [?x foo/bar ?y]]";
+        let cmd = command(&input).expect("Expected query command");
+        match cmd {
+            Command::Query(edn) => assert_eq!(edn, "[:find ?x :where [?x foo/bar ?y]]"),
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_query_parser_incomplete_edn() {
+        let input = ".q [:find ?x\r\n";
+        let cmd = command(&input).expect("Expected query command");
+        match cmd {
+            Command::Query(edn) => assert_eq!(edn, "[:find ?x\r\n"),
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_query_parser_empty_edn() {
+        let input = ".q {}";
+        let cmd = command(&input).expect("Expected query command");
+        match cmd {
+            Command::Query(edn) => assert_eq!(edn, "{}"),
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_query_parser_no_edn() {
+        let input = ".q ";
+        let err = command(&input).expect_err("Expected an error");
+        assert_eq!(err.to_string(), format!("Invalid command {:?}", input));
+    }
+
+    #[test]
+    fn test_query_parser_invalid_start_char() {
+        let input = ".q :find ?x";
+        let err = command(&input).expect_err("Expected an error");
+        assert_eq!(err.to_string(), format!("Invalid command {:?}", input));
+    }
+
+    #[test]
+    fn test_import_parser() {
+        let input = ".import /foo/bar/";
+        let cmd = command(&input).expect("Expected import command");
+        match cmd {
+            Command::Import(path) => assert_eq!(path, "/foo/bar/"),
+            _ => panic!("Wrong command!")
+        }
+    }
+
+    #[test]
+    fn test_transact_parser_complete_edn() {
+        let input = ".t [[:db/add \"s\" :db/ident :foo/uuid] [:db/add \"r\" :db/ident :bar/uuid]]";
+        let cmd = command(&input).expect("Expected transact command");
+        match cmd {
+            Command::Transact(edn) => assert_eq!(edn, "[[:db/add \"s\" :db/ident :foo/uuid] [:db/add \"r\" :db/ident :bar/uuid]]"),
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_transact_parser_alt_command() {
+        let input = ".transact [[:db/add \"s\" :db/ident :foo/uuid] [:db/add \"r\" :db/ident :bar/uuid]]";
+        let cmd = command(&input).expect("Expected transact command");
+        match cmd {
+            Command::Transact(edn) => assert_eq!(edn, "[[:db/add \"s\" :db/ident :foo/uuid] [:db/add \"r\" :db/ident :bar/uuid]]"),
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_transact_parser_incomplete_edn() {
+        let input = ".t {\r\n";
+        let cmd = command(&input).expect("Expected transact command");
+        match cmd {
+            Command::Transact(edn) => assert_eq!(edn, "{\r\n"),
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_transact_parser_empty_edn() {
+        let input = ".t {}";
+        let cmd = command(&input).expect("Expected transact command");
+        match cmd {
+            Command::Transact(edn) => assert_eq!(edn, "{}"),
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_transact_parser_no_edn() {
+        let input = ".t ";
+        let err = command(&input).expect_err("Expected an error");
+        assert_eq!(err.to_string(), format!("Invalid command {:?}", input));
+    }
+
+    #[test]
+    fn test_transact_parser_invalid_start_char() {
+        let input = ".t :db/add \"s\" :db/ident :foo/uuid";
+        let err = command(&input).expect_err("Expected an error");
+        assert_eq!(err.to_string(), format!("Invalid command {:?}", input));
+    }
+
+    #[test]
+    fn test_parser_preceeding_trailing_whitespace() {
+        let input = " .close ";
+        let cmd = command(&input).expect("Expected close command");
+        match cmd {
+            Command::Close => assert!(true),
+            _ => assert!(false)
+        }
+    }
+
+    #[test]
+    fn test_command_parser_no_dot() {
+        let input = "help command1 command2";
+        let err = command(&input).expect_err("Expected an error");
+        assert_eq!(err.to_string(), format!("Invalid command {:?}", input));
+    }
+
+    #[test]
+    fn test_command_parser_invalid_cmd() {
+        let input = ".foo command1";
+        let err = command(&input).expect_err("Expected an error");
+        assert_eq!(err.to_string(), format!("Invalid command {:?}", input));
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_cli/input.rs.html b/docs/apis/rust/0.7.0/src/mentat_cli/input.rs.html new file mode 100644 index 00000000..91b8681d --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_cli/input.rs.html @@ -0,0 +1,548 @@ + + + + + + + + + + input.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+
+// Copyright 2017 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::io::stdin;
+
+use linefeed::{
+    DefaultTerminal,
+    Reader,
+    ReadResult,
+    Signal,
+};
+
+use termion::{
+    color,
+};
+
+use self::InputResult::*;
+
+use command_parser::{
+    Command,
+    command,
+};
+
+use failure::Error;
+
+/// Starting prompt
+const DEFAULT_PROMPT: &'static str = "mentat=> ";
+/// Prompt when further input is being read
+// TODO: Should this actually reflect the current open brace?
+const MORE_PROMPT: &'static str = "mentat.> ";
+
+/// Possible results from reading input from `InputReader`
+#[derive(Clone, Debug)]
+pub enum InputResult {
+    /// mentat command as input; (name, rest of line)
+    MetaCommand(Command),
+    /// An empty line
+    Empty,
+    /// Needs more input
+    More,
+    /// End of file reached
+    Eof,
+}
+
+/// Reads input from `stdin`
+pub struct InputReader {
+    buffer: String,
+    reader: Option<Reader<DefaultTerminal>>,
+    in_process_cmd: Option<Command>,
+}
+
+enum UserAction {
+    // We've received some text that we should interpret as a new command, or
+    // as part of the current command.
+    TextInput(String),
+    // We were interrupted, if we have a current command we should clear it,
+    // otherwise we should exit. Currently can only be generated by reading from
+    // a terminal (and not by reading from stdin).
+    Interrupt,
+    // We hit the end of the file, there was an error getting user input, or
+    // something else happened that means we should exit.
+    Quit,
+}
+
+impl InputReader {
+    /// Constructs a new `InputReader` reading from `stdin`.
+    pub fn new() -> InputReader {
+        let r = match Reader::new("mentat") {
+            Ok(mut r) => {
+                // Handle SIGINT (Ctrl-C)
+                r.set_report_signal(Signal::Interrupt, true);
+                r.set_word_break_chars(" \t\n!\"#$%&'(){}*+,-./:;<=>?@[\\]^`");
+                Some(r)
+            },
+            Err(_) => None,
+        };
+
+        InputReader{
+            buffer: String::new(),
+            reader: r,
+            in_process_cmd: None,
+        }
+    }
+
+    /// Returns whether the `InputReader` is reading from a TTY.
+    pub fn is_tty(&self) -> bool {
+        self.reader.is_some()
+    }
+
+    /// Reads a single command, item, or statement from `stdin`.
+    /// Returns `More` if further input is required for a complete result.
+    /// In this case, the input received so far is buffered internally.
+    pub fn read_input(&mut self) -> Result<InputResult, Error> {
+        let prompt = if self.in_process_cmd.is_some() { MORE_PROMPT } else { DEFAULT_PROMPT };
+        let prompt = format!("{blue}{prompt}{reset}",
+                             blue = color::Fg(::BLUE),
+                             prompt = prompt,
+                             reset = color::Fg(color::Reset));
+        let line = match self.read_line(prompt.as_str()) {
+            UserAction::TextInput(s) => s,
+            UserAction::Interrupt if self.in_process_cmd.is_some() => {
+                self.in_process_cmd = None;
+                self.buffer.clear();
+                // Move to the next line, so that our next prompt isn't on top
+                // of the previous.
+                println!();
+                String::new()
+            },
+            _ => return Ok(Eof),
+        };
+
+        if !self.buffer.is_empty() {
+            self.buffer.push('\n');
+        }
+
+        self.buffer.push_str(&line);
+
+        if self.buffer.is_empty() {
+            return Ok(Empty);
+        }
+
+        // if we have a command in process (i.e. an incomplete query or transaction),
+        // then we already know which type of command it is and so we don't need to parse the
+        // command again, only the content, which we do later.
+        // Therefore, we add the newly read in line to the existing command args.
+        // If there is no in process command, we parse the read in line as a new command.
+        let cmd = match &self.in_process_cmd {
+            &Some(Command::QueryPrepared(ref args)) => {
+                Ok(Command::QueryPrepared(args.clone() + " " + &line))
+            },
+            &Some(Command::Query(ref args)) => {
+                Ok(Command::Query(args.clone() + " " + &line))
+            },
+            &Some(Command::Transact(ref args)) => {
+                Ok(Command::Transact(args.clone() + " " + &line))
+            },
+            _ => {
+                command(&self.buffer)
+            },
+        };
+
+        match cmd {
+            Ok(cmd) => {
+                match cmd {
+                    Command::Query(_) |
+                    Command::QueryPrepared(_) |
+                    Command::Transact(_) |
+                    Command::QueryExplain(_) if !cmd.is_complete() => {
+                        // A query or transact is complete if it contains a valid EDN.
+                        // if the command is not complete, ask for more from the REPL and remember
+                        // which type of command we've found here.
+                        self.in_process_cmd = Some(cmd);
+                        Ok(More)
+                    },
+                    _ => {
+                        let entry = self.buffer.clone();
+                        self.buffer.clear();
+                        self.add_history(entry);
+                        self.in_process_cmd = None;
+                        Ok(InputResult::MetaCommand(cmd))
+                    }
+                }
+            },
+            Err(e) => {
+                let entry = self.buffer.clone();
+                self.buffer.clear();
+                self.add_history(entry);
+                self.in_process_cmd = None;
+                Err(e)
+            },
+        }
+    }
+
+    fn read_line(&mut self, prompt: &str) -> UserAction {
+        match self.reader {
+            Some(ref mut r) => {
+                r.set_prompt(prompt);
+                r.read_line().ok().map_or(UserAction::Quit, |line|
+                    match line {
+                        ReadResult::Input(s) => UserAction::TextInput(s),
+                        ReadResult::Signal(Signal::Interrupt) =>
+                            UserAction::Interrupt,
+                        _ => UserAction::Quit,
+                    })
+
+            },
+            None => self.read_stdin()
+        }
+    }
+
+    fn read_stdin(&self) -> UserAction {
+        let mut s = String::new();
+
+        match stdin().read_line(&mut s) {
+            Ok(0) | Err(_) => UserAction::Quit,
+            Ok(_) => UserAction::TextInput(s)
+        }
+    }
+
+    fn add_history(&mut self, line: String) {
+        if let Some(ref mut r) = self.reader {
+            r.add_history(line);
+        }
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_cli/lib.rs.html b/docs/apis/rust/0.7.0/src/mentat_cli/lib.rs.html new file mode 100644 index 00000000..a43c7af3 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_cli/lib.rs.html @@ -0,0 +1,434 @@ + + + + + + + + + + lib.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+
+// Copyright 2017 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![crate_name = "mentat_cli"]
+
+#[macro_use] extern crate failure_derive;
+#[macro_use] extern crate log;
+#[macro_use] extern crate lazy_static;
+
+extern crate combine;
+extern crate env_logger;
+extern crate failure;
+extern crate getopts;
+extern crate linefeed;
+extern crate rusqlite;
+extern crate tabwriter;
+extern crate termion;
+extern crate time;
+
+extern crate mentat;
+extern crate edn;
+extern crate mentat_query;
+extern crate mentat_core;
+extern crate mentat_db;
+
+use getopts::Options;
+
+use termion::{
+    color,
+};
+
+static BLUE: color::Rgb = color::Rgb(0x99, 0xaa, 0xFF);
+static GREEN: color::Rgb = color::Rgb(0x77, 0xFF, 0x99);
+
+pub mod command_parser;
+pub mod input;
+pub mod repl;
+
+#[derive(Debug, Fail)]
+pub enum CliError {
+    #[fail(display = "{}", _0)]
+    CommandParse(String),
+}
+
+pub fn run() -> i32 {
+    env_logger::init();
+
+    let args = std::env::args().collect::<Vec<_>>();
+    let mut opts = Options::new();
+
+    opts.optopt("d", "", "The path to a database to open", "DATABASE");
+    if cfg!(feature = "sqlcipher") {
+        opts.optopt("k", "key", "The key to use to open the database (only available when using sqlcipher)", "KEY");
+    }
+    opts.optflag("h", "help", "Print this help message and exit");
+    opts.optmulti("q", "query", "Execute a query on startup. Queries are executed after any transacts.", "QUERY");
+    opts.optmulti("t", "transact", "Execute a transact on startup. Transacts are executed before queries.", "TRANSACT");
+    opts.optmulti("i", "import", "Execute an import on startup. Imports are executed before queries.", "PATH");
+    opts.optflag("v", "version", "Print version and exit");
+
+    let matches = match opts.parse(&args[1..]) {
+        Ok(m) => m,
+        Err(e) => {
+            println!("{}: {}", args[0], e);
+            return 1;
+        }
+    };
+
+    if matches.opt_present("version") {
+        print_version();
+        return 0;
+    }
+
+    if matches.opt_present("help") {
+        print_usage(&args[0], &opts);
+        return 0;
+    }
+
+    // It's still possible to pass this in even if it's not a documented flag above.
+    let key = match cfg!(feature = "sqlcipher") {
+        true => matches.opt_str("key"),
+        false => None,
+    };
+
+    let mut last_arg: Option<&str> = None;
+
+    let cmds:Vec<command_parser::Command> = args.iter().filter_map(|arg| {
+        match last_arg {
+            Some("-d") => {
+                last_arg = None;
+                if let &Some(ref k) = &key {
+                    Some(command_parser::Command::OpenEncrypted(arg.clone(), k.clone()))
+                } else {
+                    Some(command_parser::Command::Open(arg.clone()))
+                }
+            },
+            Some("-q") => {
+                last_arg = None;
+                Some(command_parser::Command::Query(arg.clone()))
+            },
+            Some("-i") => {
+                last_arg = None;
+                Some(command_parser::Command::Import(arg.clone()))
+            },
+            Some("-t") => {
+                last_arg = None;
+                Some(command_parser::Command::Transact(arg.clone()))
+            },
+            Some(_) |
+            None => {
+                last_arg = Some(&arg);
+                None
+            },
+        }
+    }).collect();
+
+    let repl = repl::Repl::new();
+    if repl.is_ok() {
+        repl.unwrap().run(Some(cmds));
+
+    } else {
+        println!("{}", repl.err().unwrap());
+    }
+
+    0
+}
+
+/// Returns a version string.
+pub fn version() -> &'static str {
+    env!("CARGO_PKG_VERSION")
+}
+
+fn print_usage(arg0: &str, opts: &Options) {
+    print!("{}", opts.usage(&format!(
+        "Usage: {} [OPTIONS] [FILE]", arg0)));
+}
+
+fn print_version() {
+    println!("mentat {}", version());
+}
+
+
+#[cfg(test)]
+mod tests {
+    #[test]
+    fn it_works() {
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_cli/repl.rs.html b/docs/apis/rust/0.7.0/src/mentat_cli/repl.rs.html new file mode 100644 index 00000000..93324d0a --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_cli/repl.rs.html @@ -0,0 +1,1384 @@ + + + + + + + + + + repl.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+
+// Copyright 2017 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::io::Write;
+use std::process;
+
+use failure::{
+    err_msg,
+    Error,
+};
+
+use tabwriter::TabWriter;
+
+use termion::{
+    color,
+    style,
+};
+
+use time::{
+    Duration,
+    PreciseTime,
+};
+
+use mentat_core::{
+    StructuredMap,
+};
+
+use mentat::{
+    CacheDirection,
+    Keyword,
+    Queryable,
+    QueryExplanation,
+    QueryOutput,
+    QueryResults,
+    Store,
+    Binding,
+    Syncable,
+    TxReport,
+    TypedValue,
+};
+
+use command_parser::{
+    Command,
+};
+
+use command_parser::{
+    COMMAND_CACHE,
+    COMMAND_EXIT_LONG,
+    COMMAND_EXIT_SHORT,
+    COMMAND_HELP,
+    COMMAND_IMPORT_LONG,
+    COMMAND_OPEN,
+    COMMAND_OPEN_EMPTY,
+    COMMAND_QUERY_LONG,
+    COMMAND_QUERY_SHORT,
+    COMMAND_QUERY_EXPLAIN_LONG,
+    COMMAND_QUERY_EXPLAIN_SHORT,
+    COMMAND_QUERY_PREPARED_LONG,
+    COMMAND_SCHEMA,
+    COMMAND_SYNC,
+    COMMAND_TIMER_LONG,
+    COMMAND_TRANSACT_LONG,
+    COMMAND_TRANSACT_SHORT,
+};
+
+// These are still defined when this feature is disabled (so that we can
+// give decent error messages when a user tries open_encrypted when
+// we weren't compiled with sqlcipher), but they're unused, since we
+// omit them from help message (since they wouldn't work).
+#[cfg(feature = "sqlcipher")]
+use command_parser::{
+    COMMAND_OPEN_EMPTY_ENCRYPTED,
+    COMMAND_OPEN_ENCRYPTED,
+};
+
+use input::InputReader;
+use input::InputResult::{
+    Empty,
+    Eof,
+    MetaCommand,
+    More,
+};
+
+lazy_static! {
+    static ref HELP_COMMANDS: Vec<(&'static str, &'static str)> = {
+        vec![
+            (COMMAND_HELP, "Show this message."),
+
+            (COMMAND_EXIT_LONG, "Close the current database and exit the REPL."),
+            (COMMAND_EXIT_SHORT, "Shortcut for `.exit`. Close the current database and exit the REPL."),
+
+            (COMMAND_OPEN, "Open a database at path."),
+            (COMMAND_OPEN_EMPTY, "Open an empty database at path."),
+
+            #[cfg(feature = "sqlcipher")]
+            (COMMAND_OPEN_ENCRYPTED, "Open an encrypted database at path using the provided key."),
+            #[cfg(feature = "sqlcipher")]
+            (COMMAND_OPEN_EMPTY_ENCRYPTED, "Open an empty encrypted database at path using the provided key."),
+
+            (COMMAND_SCHEMA, "Output the schema for the current open database."),
+
+            (COMMAND_IMPORT_LONG, "Transact the contents of a file against the current open database."),
+
+            (COMMAND_QUERY_LONG, "Execute a query against the current open database."),
+            (COMMAND_QUERY_SHORT, "Shortcut for `.query`. Execute a query against the current open database."),
+
+            (COMMAND_QUERY_PREPARED_LONG, "Prepare a query against the current open database, then run it, timed."),
+
+            (COMMAND_TRANSACT_LONG, "Execute a transact against the current open database."),
+            (COMMAND_TRANSACT_SHORT, "Shortcut for `.transact`. Execute a transact against the current open database."),
+
+            (COMMAND_QUERY_EXPLAIN_LONG, "Show the SQL and query plan that would be executed for a given query."),
+            (COMMAND_QUERY_EXPLAIN_SHORT, "Shortcut for `.explain_query`. Show the SQL and query plan that would be executed for a given query."),
+
+            (COMMAND_TIMER_LONG, "Enable or disable timing of query and transact operations."),
+
+            (COMMAND_CACHE, "Cache an attribute. Usage: `.cache :foo/bar reverse`"),
+            (COMMAND_SYNC, "Synchronize the database against a Sync Server URL for a provided user UUID."),
+        ]
+    };
+}
+
+fn eprint_out(s: &str) {
+    eprint!("{green}{s}{reset}", green = color::Fg(::GREEN), s = s, reset = color::Fg(color::Reset));
+}
+
+fn parse_namespaced_keyword(input: &str) -> Option<Keyword> {
+    let splits = [':', '/'];
+    let mut i = input.split(&splits[..]);
+    match (i.next(), i.next(), i.next(), i.next()) {
+        (Some(""), Some(namespace), Some(name), None) => {
+            Some(Keyword::namespaced(namespace, name))
+        },
+        _ => None,
+    }
+}
+
+fn format_time(duration: Duration) {
+    let m_nanos = duration.num_nanoseconds();
+    if let Some(nanos) = m_nanos {
+        if nanos < 1_000 {
+            eprintln!("{bold}{nanos}{reset}ns",
+                      bold = style::Bold,
+                      nanos = nanos,
+                      reset = style::Reset);
+            return;
+        }
+    }
+
+    let m_micros = duration.num_microseconds();
+    if let Some(micros) = m_micros {
+        if micros < 1_000 {
+            eprintln!("{bold}{micros}{reset}µs",
+                      bold = style::Bold,
+                      micros = micros,
+                      reset = style::Reset);
+            return;
+        }
+
+        if micros < 1_000_000 {
+            // Print as millis.
+            let millis = (micros as f64) / 1000f64;
+            eprintln!("{bold}{millis}{reset}ms",
+                        bold = style::Bold,
+                        millis = millis,
+                        reset = style::Reset);
+            return;
+        }
+    }
+
+    let millis = duration.num_milliseconds();
+    let seconds = (millis as f64) / 1000f64;
+    eprintln!("{bold}{seconds}{reset}s",
+              bold = style::Bold,
+              seconds = seconds,
+              reset = style::Reset);
+}
+
+/// Executes input and maintains state of persistent items.
+pub struct Repl {
+    path: String,
+    store: Store,
+    timer_on: bool,
+}
+
+impl Repl {
+    pub fn db_name(&self) -> String {
+        if self.path.is_empty() {
+            "in-memory db".to_string()
+        } else {
+            self.path.clone()
+        }
+    }
+
+    /// Constructs a new `Repl`.
+    pub fn new() -> Result<Repl, String> {
+        let store = Store::open("").map_err(|e| e.to_string())?;
+        Ok(Repl {
+            path: "".to_string(),
+            store: store,
+            timer_on: false,
+        })
+    }
+
+    /// Runs the REPL interactively.
+    pub fn run(&mut self, startup_commands: Option<Vec<Command>>) {
+        let mut input = InputReader::new();
+
+        if let Some(cmds) = startup_commands {
+            for command in cmds.iter() {
+                println!("{}", command.output());
+                self.handle_command(command.clone());
+            }
+        }
+
+        loop {
+            let res = input.read_input();
+
+            match res {
+                Ok(MetaCommand(cmd)) => {
+                    debug!("read command: {:?}", cmd);
+                    self.handle_command(cmd);
+                },
+                Ok(Empty) |
+                Ok(More) => (),
+                Ok(Eof) => {
+                    if input.is_tty() {
+                        println!();
+                    }
+                    break;
+                },
+                Err(e) => eprintln!("{}", e.to_string()),
+            }
+        }
+    }
+
+    fn cache(&mut self, attr: String, direction: CacheDirection) {
+        if let Some(kw) = parse_namespaced_keyword(attr.as_str()) {
+            match self.store.cache(&kw, direction) {
+                Result::Ok(_) => (),
+                Result::Err(e) => eprintln!("Couldn't cache attribute: {}", e),
+            };
+        } else {
+            eprintln!("Invalid attribute {}", attr);
+        }
+    }
+
+    /// Runs a single command input.
+    fn handle_command(&mut self, cmd: Command) {
+        let should_print_times = self.timer_on && cmd.is_timed();
+
+        let mut start = PreciseTime::now();
+        let mut end: Option<PreciseTime> = None;
+
+        match cmd {
+            Command::Cache(attr, direction) => {
+                self.cache(attr, direction);
+            },
+            Command::Close => {
+                self.close();
+            },
+            Command::Exit => {
+                self.close();
+                eprintln!("Exiting…");
+                process::exit(0);
+            },
+            Command::Help(args) => {
+                self.help_command(args);
+            },
+            Command::Import(path) => {
+                self.execute_import(path);
+            },
+            Command::Open(db) => {
+                match self.open(db) {
+                    Ok(_) => println!("Database {:?} opened", self.db_name()),
+                    Err(e) => eprintln!("{}", e.to_string()),
+                };
+            },
+            Command::OpenEmpty(db) => {
+                match self.open_empty(db) {
+                    Ok(_) => println!("Empty database {:?} opened", self.db_name()),
+                    Err(e) => eprintln!("{}", e.to_string()),
+                };
+            },
+            Command::OpenEncrypted(db, encryption_key) => {
+                match self.open_with_key(db, &encryption_key) {
+                    Ok(_) => println!("Database {:?} opened with key {:?}", self.db_name(), encryption_key),
+                    Err(e) => eprintln!("{}", e.to_string()),
+                }
+            },
+            Command::OpenEmptyEncrypted(db, encryption_key) => {
+                match self.open_empty_with_key(db, &encryption_key) {
+                    Ok(_) => println!("Empty database {:?} opened with key {:?}", self.db_name(), encryption_key),
+                    Err(e) => eprintln!("{}", e.to_string()),
+                }
+            },
+            Command::Query(query) => {
+                self.store
+                    .q_once(query.as_str(), None)
+                    .map_err(|e| e.into())
+                    .and_then(|o| {
+                        end = Some(PreciseTime::now());
+                        self.print_results(o)
+                    })
+                    .map_err(|err| {
+                        eprintln!("{:?}.", err);
+                    })
+                    .ok();
+            },
+            Command::QueryExplain(query) => {
+                self.explain_query(query);
+            },
+            Command::QueryPrepared(query) => {
+                self.store
+                    .q_prepare(query.as_str(), None)
+                    .and_then(|mut p| {
+                        let prepare_end = PreciseTime::now();
+                        if should_print_times {
+                            eprint_out("Prepare time");
+                            eprint!(": ");
+                            format_time(start.to(prepare_end));
+                        }
+                        // This is a hack.
+                        start = PreciseTime::now();
+                        let r = p.run(None);
+                        end = Some(PreciseTime::now());
+                        return r;
+                    })
+                    .map(|o| self.print_results(o))
+                    .map_err(|err| {
+                        eprintln!("{:?}.", err);
+                    })
+                    .ok();
+            },
+            Command::Schema => {
+                let edn = self.store.conn().current_schema().to_edn_value();
+                match edn.to_pretty(120) {
+                    Ok(s) => println!("{}", s),
+                    Err(e) => eprintln!("{}", e)
+                };
+            },
+            Command::Sync(args) => {
+                match self.store.sync(&args[0], &args[1]) {
+                    Ok(_) => println!("Synced!"),
+                    Err(e) => eprintln!("{:?}", e)
+                };
+            }
+            Command::Timer(on) => {
+                self.toggle_timer(on);
+            },
+            Command::Transact(transaction) => {
+                self.execute_transact(transaction);
+            },
+        }
+
+        let end = end.unwrap_or_else(PreciseTime::now);
+        if should_print_times {
+            eprint_out("Run time");
+            eprint!(": ");
+            format_time(start.to(end));
+        }
+    }
+
+    fn execute_import<T>(&mut self, path: T)
+    where T: Into<String> {
+        use ::std::io::Read;
+        let path = path.into();
+        let mut content: String = "".to_string();
+        match ::std::fs::File::open(path.clone()).and_then(|mut f| f.read_to_string(&mut content)) {
+            Ok(_) => self.execute_transact(content),
+            Err(e) => eprintln!("Error reading file {}: {}", path, e)
+        }
+    }
+
+    fn open_common(
+        &mut self,
+        empty: bool,
+        path: String,
+        encryption_key: Option<&str>
+    ) -> ::mentat::errors::Result<()> {
+        if self.path.is_empty() || path != self.path {
+            let next = match encryption_key {
+                #[cfg(not(feature = "sqlcipher"))]
+                Some(_) => return Err(err_msg(".open_encrypted and .empty_encrypted require the sqlcipher Mentat feature")),
+                #[cfg(feature = "sqlcipher")]
+                Some(k) => {
+                    if empty {
+                        Store::open_empty_with_key(path.as_str(), k)?
+                    } else {
+                        Store::open_with_key(path.as_str(), k)?
+                    }
+                },
+                _ => {
+                    if empty {
+                        Store::open_empty(path.as_str())?
+                    } else {
+                        Store::open(path.as_str())?
+                    }
+                }
+            };
+            self.path = path;
+            self.store = next;
+        }
+
+        Ok(())
+    }
+
+    fn open<T>(&mut self, path: T) -> ::mentat::errors::Result<()> where T: Into<String> {
+        self.open_common(false, path.into(), None)
+    }
+
+    fn open_empty<T>(&mut self, path: T)
+    -> ::mentat::errors::Result<()> where T: Into<String> {
+        self.open_common(true, path.into(), None)
+    }
+
+    fn open_with_key<T, U>(&mut self, path: T, encryption_key: U)
+    -> ::mentat::errors::Result<()> where T: Into<String>, U: AsRef<str> {
+        self.open_common(false, path.into(), Some(encryption_key.as_ref()))
+    }
+
+    fn open_empty_with_key<T, U>(&mut self, path: T, encryption_key: U)
+    -> ::mentat::errors::Result<()> where T: Into<String>, U: AsRef<str> {
+        self.open_common(true, path.into(), Some(encryption_key.as_ref()))
+    }
+
+    // Close the current store by opening a new in-memory store in its place.
+    fn close(&mut self) {
+        let old_db_name = self.db_name();
+        match self.open("") {
+            Ok(_) => println!("Database {:?} closed.", old_db_name),
+            Err(e) => eprintln!("{}", e),
+        };
+    }
+
+    fn toggle_timer(&mut self, on: bool) {
+        self.timer_on = on;
+    }
+
+    fn help_command(&self, args: Vec<String>) {
+        let stdout = ::std::io::stdout();
+        let mut output = TabWriter::new(stdout.lock());
+        if args.is_empty() {
+            for &(cmd, msg) in HELP_COMMANDS.iter() {
+                write!(output, ".{}\t", cmd).unwrap();
+                writeln!(output, "{}", msg).unwrap();
+            }
+        } else {
+            for mut arg in args {
+                if arg.chars().nth(0).unwrap() == '.' {
+                    arg.remove(0);
+                }
+                if let Some(&(cmd, msg)) = HELP_COMMANDS.iter()
+                                                       .filter(|&&(c, _)| c == arg.as_str())
+                                                       .next() {
+                    write!(output, ".{}\t", cmd).unwrap();
+                    writeln!(output, "{}", msg).unwrap();
+                } else {
+                    eprintln!("Unrecognised command {}", arg);
+                    return;
+                }
+            }
+        }
+        writeln!(output, "").unwrap();
+        output.flush().unwrap();
+    }
+
+    fn print_results(&self, query_output: QueryOutput) -> Result<(), Error> {
+        let stdout = ::std::io::stdout();
+        let mut output = TabWriter::new(stdout.lock());
+
+        // Print the column headers.
+        for e in query_output.spec.columns() {
+            write!(output, "| {}\t", e)?;
+        }
+        writeln!(output, "|")?;
+        for _ in 0..query_output.spec.expected_column_count() {
+            write!(output, "---\t")?;
+        }
+        writeln!(output, "")?;
+
+        match query_output.results {
+            QueryResults::Scalar(v) => {
+                if let Some(val) = v {
+                    writeln!(output, "| {}\t |", &self.binding_as_string(&val))?;
+                }
+            },
+
+            QueryResults::Tuple(vv) => {
+                if let Some(vals) = vv {
+                    for val in vals {
+                        write!(output, "| {}\t", self.binding_as_string(&val))?;
+                    }
+                    writeln!(output, "|")?;
+                }
+            },
+
+            QueryResults::Coll(vv) => {
+                for val in vv {
+                    writeln!(output, "| {}\t|", self.binding_as_string(&val))?;
+                }
+            },
+
+            QueryResults::Rel(vvv) => {
+                for vv in vvv {
+                    for v in vv {
+                        write!(output, "| {}\t", self.binding_as_string(&v))?;
+                    }
+                    writeln!(output, "|")?;
+                }
+            },
+        }
+        for _ in 0..query_output.spec.expected_column_count() {
+            write!(output, "---\t")?;
+        }
+        writeln!(output, "")?;
+        output.flush()?;
+        Ok(())
+    }
+
+    pub fn explain_query(&self, query: String) {
+        match self.store.q_explain(query.as_str(), None) {
+            Result::Err(err) =>
+                println!("{:?}.", err),
+            Result::Ok(QueryExplanation::KnownConstant) =>
+                println!("Query is known constant!"),
+            Result::Ok(QueryExplanation::KnownEmpty(empty_because)) =>
+                println!("Query is known empty: {:?}", empty_because),
+            Result::Ok(QueryExplanation::ExecutionPlan { query, steps }) => {
+                println!("SQL: {}", query.sql);
+                if !query.args.is_empty() {
+                    println!("  Bindings:");
+                    for (arg_name, value) in query.args {
+                        println!("    {} = {:?}", arg_name, *value)
+                    }
+                }
+
+                println!("Plan: select id | order | from | detail");
+                // Compute the number of columns we need for order, select id, and from,
+                // so that longer query plans don't become misaligned.
+                let (max_select_id, max_order, max_from) = steps.iter().fold((0, 0, 0), |acc, step|
+                    (acc.0.max(step.select_id), acc.1.max(step.order), acc.2.max(step.from)));
+                // This is less efficient than computing it via the logarithm base 10,
+                // but it's clearer and doesn't have require special casing "0"
+                let max_select_digits = max_select_id.to_string().len();
+                let max_order_digits = max_order.to_string().len();
+                let max_from_digits = max_from.to_string().len();
+                for step in steps {
+                    // Note: > is right align.
+                    println!("  {:>sel_cols$}|{:>ord_cols$}|{:>from_cols$}|{}",
+                             step.select_id, step.order, step.from, step.detail,
+                             sel_cols = max_select_digits,
+                             ord_cols = max_order_digits,
+                             from_cols = max_from_digits);
+                }
+            }
+        };
+    }
+
+    pub fn execute_transact(&mut self, transaction: String) {
+        match self.transact(transaction) {
+            Result::Ok(report) => println!("{:?}", report),
+            Result::Err(err) => eprintln!("Error: {:?}.", err),
+        }
+    }
+
+    fn transact(&mut self, transaction: String) -> ::mentat::errors::Result<TxReport> {
+        let mut tx = self.store.begin_transaction()?;
+        let report = tx.transact(transaction)?;
+        tx.commit()?;
+        Ok(report)
+    }
+
+    fn binding_as_string(&self, value: &Binding) -> String {
+        use self::Binding::*;
+        match value {
+            &Scalar(ref v) => self.value_as_string(v),
+            &Map(ref v) => self.map_as_string(v),
+            &Vec(ref v) => self.vec_as_string(v),
+        }
+    }
+
+    fn vec_as_string(&self, value: &Vec<Binding>) -> String {
+        let mut out: String = "[".to_string();
+        let vals: Vec<String> = value.iter()
+                                     .map(|v| self.binding_as_string(v))
+                                     .collect();
+
+        out.push_str(vals.join(", ").as_str());
+        out.push_str("]");
+        out
+    }
+
+    fn map_as_string(&self, value: &StructuredMap) -> String {
+        let mut out: String = "{".to_string();
+        let mut first = true;
+        for (k, v) in value.0.iter() {
+            if !first {
+                out.push_str(", ");
+                first = true;
+            }
+            out.push_str(&k.to_string());
+            out.push_str(" ");
+            out.push_str(self.binding_as_string(v).as_str());
+        }
+        out.push_str("}");
+        out
+    }
+
+    fn value_as_string(&self, value: &TypedValue) -> String {
+        use self::TypedValue::*;
+        match value {
+            &Boolean(b) => if b { "true".to_string() } else { "false".to_string() },
+            &Double(d) => format!("{}", d),
+            &Instant(ref i) => format!("{}", i),
+            &Keyword(ref k) => format!("{}", k),
+            &Long(l) => format!("{}", l),
+            &Ref(r) => format!("{}", r),
+            &String(ref s) => format!("{:?}", s.to_string()),
+            &Uuid(ref u) => format!("{}", u),
+        }
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_core/cache.rs.html b/docs/apis/rust/0.7.0/src/mentat_core/cache.rs.html new file mode 100644 index 00000000..6461548c --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_core/cache.rs.html @@ -0,0 +1,206 @@ + + + + + + + + + + cache.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+/// Cache traits.
+
+use failure;
+
+use std::collections::{
+    BTreeSet,
+};
+
+use ::{
+    Entid,
+    Schema,
+    TypedValue,
+};
+
+pub trait CachedAttributes {
+    fn is_attribute_cached_reverse(&self, entid: Entid) -> bool;
+    fn is_attribute_cached_forward(&self, entid: Entid) -> bool;
+    fn has_cached_attributes(&self) -> bool;
+
+    fn get_values_for_entid(&self, schema: &Schema, attribute: Entid, entid: Entid) -> Option<&Vec<TypedValue>>;
+    fn get_value_for_entid(&self, schema: &Schema, attribute: Entid, entid: Entid) -> Option<&TypedValue>;
+
+    /// Reverse lookup.
+    fn get_entid_for_value(&self, attribute: Entid, value: &TypedValue) -> Option<Entid>;
+    fn get_entids_for_value(&self, attribute: Entid, value: &TypedValue) -> Option<&BTreeSet<Entid>>;
+}
+
+pub trait UpdateableCache<Error=failure::Error> {
+    fn update<I>(&mut self, schema: &Schema, retractions: I, assertions: I) -> Result<(), Error>
+    where I: Iterator<Item=(Entid, Entid, TypedValue)>;
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_core/counter.rs.html b/docs/apis/rust/0.7.0/src/mentat_core/counter.rs.html new file mode 100644 index 00000000..aa980e71 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_core/counter.rs.html @@ -0,0 +1,246 @@ + + + + + + + + + + counter.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::cell::Cell;
+use std::rc::Rc;
+
+#[derive(Clone)]
+pub struct RcCounter {
+    c: Rc<Cell<usize>>,
+}
+
+/// A simple shared counter.
+impl RcCounter {
+    pub fn with_initial(value: usize) -> Self {
+        RcCounter { c: Rc::new(Cell::new(value)) }
+    }
+
+    pub fn new() -> Self {
+        RcCounter { c: Rc::new(Cell::new(0)) }
+    }
+
+    /// Return the next value in the sequence.
+    ///
+    /// ```
+    /// use mentat_core::counter::RcCounter;
+    ///
+    /// let c = RcCounter::with_initial(3);
+    /// assert_eq!(c.next(), 3);
+    /// assert_eq!(c.next(), 4);
+    /// let d = c.clone();
+    /// assert_eq!(d.next(), 5);
+    /// assert_eq!(c.next(), 6);
+    /// ```
+    pub fn next(&self) -> usize {
+        let current = self.c.get();
+        self.c.replace(current + 1)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::RcCounter;
+
+    #[test]
+    fn test_rc_counter() {
+        let c = RcCounter::new();
+        assert_eq!(c.next(), 0);
+        assert_eq!(c.next(), 1);
+
+        let d = c.clone();
+        assert_eq!(d.next(), 2);
+        assert_eq!(c.next(), 3);
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_core/intern_set.rs.html b/docs/apis/rust/0.7.0/src/mentat_core/intern_set.rs.html new file mode 100644 index 00000000..849d9f7d --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_core/intern_set.rs.html @@ -0,0 +1,260 @@ + + + + + + + + + + intern_set.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+use std::collections::HashSet;
+use std::hash::Hash;
+use std::rc::Rc;
+
+/// An `InternSet` allows to "intern" some potentially large values, maintaining a single value
+/// instance owned by the `InternSet` and leaving consumers with lightweight ref-counted handles to
+/// the large owned value.  This can avoid expensive clone() operations.
+///
+/// In Mentat, such large values might be strings or arbitrary [a v] pairs.
+///
+/// See https://en.wikipedia.org/wiki/String_interning for discussion.
+#[derive(Clone, Debug, Default, Eq, PartialEq)]
+pub struct InternSet<T> where T: Eq + Hash {
+    pub inner: HashSet<Rc<T>>,
+}
+
+impl<T> InternSet<T> where T: Eq + Hash {
+    pub fn new() -> InternSet<T> {
+        InternSet {
+            inner: HashSet::new(),
+        }
+    }
+
+    pub fn len(&self) -> usize {
+        self.inner.len()
+    }
+
+    /// Intern a value, providing a ref-counted handle to the interned value.
+    ///
+    /// ```
+    /// use std::rc::Rc;
+    /// use mentat_core::intern_set::InternSet;
+    ///
+    /// let mut s = InternSet::new();
+    ///
+    /// let one = "foo".to_string();
+    /// let two = Rc::new("foo".to_string());
+    ///
+    /// let out_one = s.intern(one);
+    /// assert_eq!(out_one, two);
+    /// // assert!(!&out_one.ptr_eq(&two));      // Nightly-only.
+    ///
+    /// let out_two = s.intern(two);
+    /// assert_eq!(out_one, out_two);
+    /// assert_eq!(1, s.inner.len());
+    /// // assert!(&out_one.ptr_eq(&out_two));   // Nightly-only.
+    /// ```
+    pub fn intern<R: Into<Rc<T>>>(&mut self, value: R) -> Rc<T> {
+        let key: Rc<T> = value.into();
+        if self.inner.insert(key.clone()) {
+            key
+        } else {
+            self.inner.get(&key).unwrap().clone()
+        }
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_core/lib.rs.html b/docs/apis/rust/0.7.0/src/mentat_core/lib.rs.html new file mode 100644 index 00000000..1d4da827 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_core/lib.rs.html @@ -0,0 +1,1228 @@ + + + + + + + + + + lib.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+extern crate chrono;
+extern crate enum_set;
+extern crate failure;
+extern crate indexmap;
+extern crate ordered_float;
+extern crate uuid;
+extern crate serde;
+
+#[macro_use]
+extern crate lazy_static;
+
+#[macro_use]
+extern crate serde_derive;
+
+extern crate edn;
+
+pub mod values;
+mod cache;
+
+use std::collections::{
+    BTreeMap,
+};
+
+pub use uuid::Uuid;
+
+pub use chrono::{
+    DateTime,
+    Timelike,       // For truncation.
+};
+
+pub use edn::{
+    Cloned,
+    FromMicros,
+    FromRc,
+    Keyword,
+    ToMicros,
+    Utc,
+    ValueRc,
+};
+
+pub use edn::parse::{
+    parse_query,
+    ParseError as EdnParseError,
+};
+
+pub use cache::{
+    CachedAttributes,
+    UpdateableCache,
+};
+
+/// Core types defining a Mentat knowledge base.
+mod types;
+mod value_type_set;
+mod sql_types;
+
+pub use types::{
+    Binding,
+    Entid,
+    KnownEntid,
+    StructuredMap,
+    TypedValue,
+    ValueType,
+    ValueTypeTag,
+    now,
+};
+
+pub use value_type_set::{
+    ValueTypeSet,
+};
+
+pub use sql_types::{
+    SQLTypeAffinity,
+    SQLValueType,
+    SQLValueTypeSet,
+};
+
+/// Bit flags used in `flags0` column in temporary tables created during search,
+/// such as the `search_results`, `inexact_searches` and `exact_searches` tables.
+/// When moving to a more concrete table, such as `datoms`, they are expanded out
+/// via these flags and put into their own column rather than a bit field.
+pub enum AttributeBitFlags {
+    IndexAVET     = 1 << 0,
+    IndexVAET     = 1 << 1,
+    IndexFulltext = 1 << 2,
+    UniqueValue   = 1 << 3,
+}
+
+pub mod attribute {
+    use TypedValue;
+
+    #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+    pub enum Unique {
+        Value,
+        Identity,
+    }
+
+    impl Unique {
+        // This is easier than rejigging DB_UNIQUE_VALUE to not be EDN.
+        pub fn into_typed_value(self) -> TypedValue {
+            match self {
+                Unique::Value => TypedValue::typed_ns_keyword("db.unique", "value"),
+                Unique::Identity => TypedValue::typed_ns_keyword("db.unique", "identity"),
+            }
+        }
+    }
+}
+
+/// A Mentat schema attribute has a value type and several other flags determining how assertions
+/// with the attribute are interpreted.
+///
+/// TODO: consider packing this into a bitfield or similar.
+#[derive(Clone,Debug,Eq,Hash,Ord,PartialOrd,PartialEq)]
+pub struct Attribute {
+    /// The associated value type, i.e., `:db/valueType`?
+    pub value_type: ValueType,
+
+    /// `true` if this attribute is multi-valued, i.e., it is `:db/cardinality
+    /// :db.cardinality/many`.  `false` if this attribute is single-valued (the default), i.e., it
+    /// is `:db/cardinality :db.cardinality/one`.
+    pub multival: bool,
+
+    /// `None` if this attribute is neither unique-value nor unique-identity.
+    ///
+    /// `Some(attribute::Unique::Value)` if this attribute is unique-value, i.e., it is `:db/unique
+    /// :db.unique/value`.
+    ///
+    /// *Unique-value* means that there is at most one assertion with the attribute and a
+    /// particular value in the datom store.  Unique-value attributes can be used in lookup-refs.
+    ///
+    /// `Some(attribute::Unique::Identity)` if this attribute is unique-identity, i.e., it is `:db/unique
+    /// :db.unique/identity`.
+    ///
+    /// Unique-identity attributes always have value type `Ref`.
+    ///
+    /// *Unique-identity* means that the attribute is *unique-value* and that they can be used in
+    /// lookup-refs and will automatically upsert where appropriate.
+    pub unique: Option<attribute::Unique>,
+
+    /// `true` if this attribute is automatically indexed, i.e., it is `:db/indexing true`.
+    pub index: bool,
+
+    /// `true` if this attribute is automatically fulltext indexed, i.e., it is `:db/fulltext true`.
+    ///
+    /// Fulltext attributes always have string values.
+    pub fulltext: bool,
+
+    /// `true` if this attribute is a component, i.e., it is `:db/isComponent true`.
+    ///
+    /// Component attributes always have value type `Ref`.
+    ///
+    /// They are used to compose entities from component sub-entities: they are fetched recursively
+    /// by pull expressions, and they are automatically recursively deleted where appropriate.
+    pub component: bool,
+
+    /// `true` if this attribute doesn't require history to be kept, i.e., it is `:db/noHistory true`.
+    pub no_history: bool,
+}
+
+impl Attribute {
+    /// Combine several attribute flags into a bitfield used in temporary search tables.
+    pub fn flags(&self) -> u8 {
+        let mut flags: u8 = 0;
+
+        if self.index {
+            flags |= AttributeBitFlags::IndexAVET as u8;
+        }
+        if self.value_type == ValueType::Ref {
+            flags |= AttributeBitFlags::IndexVAET as u8;
+        }
+        if self.fulltext {
+            flags |= AttributeBitFlags::IndexFulltext as u8;
+        }
+        if self.unique.is_some() {
+            flags |= AttributeBitFlags::UniqueValue as u8;
+        }
+        flags
+    }
+
+    pub fn to_edn_value(&self, ident: Option<Keyword>) -> edn::Value {
+        let mut attribute_map: BTreeMap<edn::Value, edn::Value> = BTreeMap::default();
+        if let Some(ident) = ident {
+            attribute_map.insert(values::DB_IDENT.clone(), edn::Value::Keyword(ident));
+        }
+
+        attribute_map.insert(values::DB_VALUE_TYPE.clone(), self.value_type.into_edn_value());
+
+        attribute_map.insert(values::DB_CARDINALITY.clone(), if self.multival { values::DB_CARDINALITY_MANY.clone() } else { values::DB_CARDINALITY_ONE.clone() });
+
+        match self.unique {
+            Some(attribute::Unique::Value) => { attribute_map.insert(values::DB_UNIQUE.clone(), values::DB_UNIQUE_VALUE.clone()); },
+            Some(attribute::Unique::Identity) => { attribute_map.insert(values::DB_UNIQUE.clone(), values::DB_UNIQUE_IDENTITY.clone()); },
+            None => (),
+        }
+
+        if self.index {
+            attribute_map.insert(values::DB_INDEX.clone(), edn::Value::Boolean(true));
+        }
+
+        if self.fulltext {
+            attribute_map.insert(values::DB_FULLTEXT.clone(), edn::Value::Boolean(true));
+        }
+
+        if self.component {
+            attribute_map.insert(values::DB_IS_COMPONENT.clone(), edn::Value::Boolean(true));
+        }
+
+        if self.no_history {
+            attribute_map.insert(values::DB_NO_HISTORY.clone(), edn::Value::Boolean(true));
+        }
+
+        edn::Value::Map(attribute_map)
+    }
+}
+
+impl Default for Attribute {
+    fn default() -> Attribute {
+        Attribute {
+            // There's no particular reason to favour one value type, so Ref it is.
+            value_type: ValueType::Ref,
+            fulltext: false,
+            index: false,
+            multival: false,
+            unique: None,
+            component: false,
+            no_history: false,
+        }
+    }
+}
+
+/// Map `Keyword` idents (`:db/ident`) to positive integer entids (`1`).
+pub type IdentMap = BTreeMap<Keyword, Entid>;
+
+/// Map positive integer entids (`1`) to `Keyword` idents (`:db/ident`).
+pub type EntidMap = BTreeMap<Entid, Keyword>;
+
+/// Map attribute entids to `Attribute` instances.
+pub type AttributeMap = BTreeMap<Entid, Attribute>;
+
+/// Represents a Mentat schema.
+///
+/// Maintains the mapping between string idents and positive integer entids; and exposes the schema
+/// flags associated to a given entid (equivalently, ident).
+///
+/// TODO: consider a single bi-directional map instead of separate ident->entid and entid->ident
+/// maps.
+#[derive(Clone, Debug, Default, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub struct Schema {
+    /// Map entid->ident.
+    ///
+    /// Invariant: is the inverse map of `ident_map`.
+    pub entid_map: EntidMap,
+
+    /// Map ident->entid.
+    ///
+    /// Invariant: is the inverse map of `entid_map`.
+    pub ident_map: IdentMap,
+
+    /// Map entid->attribute flags.
+    ///
+    /// Invariant: key-set is the same as the key-set of `entid_map` (equivalently, the value-set of
+    /// `ident_map`).
+    pub attribute_map: AttributeMap,
+
+    /// Maintain a vec of unique attribute IDs for which the corresponding attribute in `attribute_map`
+    /// has `.component == true`.
+    pub component_attributes: Vec<Entid>,
+}
+
+pub trait HasSchema {
+    fn entid_for_type(&self, t: ValueType) -> Option<KnownEntid>;
+
+    fn get_ident<T>(&self, x: T) -> Option<&Keyword> where T: Into<Entid>;
+    fn get_entid(&self, x: &Keyword) -> Option<KnownEntid>;
+    fn attribute_for_entid<T>(&self, x: T) -> Option<&Attribute> where T: Into<Entid>;
+
+    // Returns the attribute and the entid named by the provided ident.
+    fn attribute_for_ident(&self, ident: &Keyword) -> Option<(&Attribute, KnownEntid)>;
+
+    /// Return true if the provided entid identifies an attribute in this schema.
+    fn is_attribute<T>(&self, x: T) -> bool where T: Into<Entid>;
+
+    /// Return true if the provided ident identifies an attribute in this schema.
+    fn identifies_attribute(&self, x: &Keyword) -> bool;
+
+    fn component_attributes(&self) -> &[Entid];
+}
+
+impl Schema {
+    pub fn new(ident_map: IdentMap, entid_map: EntidMap, attribute_map: AttributeMap) -> Schema {
+        let mut s = Schema { ident_map, entid_map, attribute_map, component_attributes: Vec::new() };
+        s.update_component_attributes();
+        s
+    }
+
+    /// Returns an symbolic representation of the schema suitable for applying across Mentat stores.
+    pub fn to_edn_value(&self) -> edn::Value {
+        edn::Value::Vector((&self.attribute_map).iter()
+            .map(|(entid, attribute)|
+                attribute.to_edn_value(self.get_ident(*entid).cloned()))
+            .collect())
+    }
+
+    fn get_raw_entid(&self, x: &Keyword) -> Option<Entid> {
+        self.ident_map.get(x).map(|x| *x)
+    }
+
+    pub fn update_component_attributes(&mut self) {
+        let mut components: Vec<Entid>;
+        components = self.attribute_map
+                         .iter()
+                         .filter_map(|(k, v)| if v.component { Some(*k) } else { None })
+                         .collect();
+        components.sort_unstable();
+        self.component_attributes = components;
+    }
+}
+
+impl HasSchema for Schema {
+    fn entid_for_type(&self, t: ValueType) -> Option<KnownEntid> {
+        // TODO: this can be made more efficient.
+        self.get_entid(&t.into_keyword())
+    }
+
+    fn get_ident<T>(&self, x: T) -> Option<&Keyword> where T: Into<Entid> {
+        self.entid_map.get(&x.into())
+    }
+
+    fn get_entid(&self, x: &Keyword) -> Option<KnownEntid> {
+        self.get_raw_entid(x).map(KnownEntid)
+    }
+
+    fn attribute_for_entid<T>(&self, x: T) -> Option<&Attribute> where T: Into<Entid> {
+        self.attribute_map.get(&x.into())
+    }
+
+    fn attribute_for_ident(&self, ident: &Keyword) -> Option<(&Attribute, KnownEntid)> {
+        self.get_raw_entid(&ident)
+            .and_then(|entid| {
+                self.attribute_for_entid(entid).map(|a| (a, KnownEntid(entid)))
+            })
+    }
+
+    /// Return true if the provided entid identifies an attribute in this schema.
+    fn is_attribute<T>(&self, x: T) -> bool where T: Into<Entid> {
+        self.attribute_map.contains_key(&x.into())
+    }
+
+    /// Return true if the provided ident identifies an attribute in this schema.
+    fn identifies_attribute(&self, x: &Keyword) -> bool {
+        self.get_raw_entid(x).map(|e| self.is_attribute(e)).unwrap_or(false)
+    }
+
+    fn component_attributes(&self) -> &[Entid] {
+        &self.component_attributes
+    }
+}
+
+pub mod intern_set;
+pub mod counter;
+pub mod util;
+
+/// A helper macro to sequentially process an iterable sequence,
+/// evaluating a block between each pair of items.
+///
+/// This is used to simply and efficiently produce output like
+///
+/// ```sql
+///   1, 2, 3
+/// ```
+///
+/// or
+///
+/// ```sql
+/// x = 1 AND y = 2
+/// ```
+///
+/// without producing an intermediate string sequence.
+#[macro_export]
+macro_rules! interpose {
+    ( $name: pat, $across: expr, $body: block, $inter: block ) => {
+        interpose_iter!($name, $across.iter(), $body, $inter)
+    }
+}
+
+/// A helper to bind `name` to values in `across`, running `body` for each value,
+/// and running `inter` between each value. See `interpose` for examples.
+#[macro_export]
+macro_rules! interpose_iter {
+    ( $name: pat, $across: expr, $body: block, $inter: block ) => {
+        let mut seq = $across;
+        if let Some($name) = seq.next() {
+            $body;
+            for $name in seq {
+                $inter;
+                $body;
+            }
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+
+    use std::str::FromStr;
+
+    fn associate_ident(schema: &mut Schema, i: Keyword, e: Entid) {
+        schema.entid_map.insert(e, i.clone());
+        schema.ident_map.insert(i, e);
+    }
+
+    fn add_attribute(schema: &mut Schema, e: Entid, a: Attribute) {
+        schema.attribute_map.insert(e, a);
+    }
+
+    #[test]
+    fn test_attribute_flags() {
+        let attr1 = Attribute {
+            index: true,
+            value_type: ValueType::Ref,
+            fulltext: false,
+            unique: None,
+            multival: false,
+            component: false,
+            no_history: false,
+        };
+
+        assert!(attr1.flags() & AttributeBitFlags::IndexAVET as u8 != 0);
+        assert!(attr1.flags() & AttributeBitFlags::IndexVAET as u8 != 0);
+        assert!(attr1.flags() & AttributeBitFlags::IndexFulltext as u8 == 0);
+        assert!(attr1.flags() & AttributeBitFlags::UniqueValue as u8 == 0);
+
+        let attr2 = Attribute {
+            index: false,
+            value_type: ValueType::Boolean,
+            fulltext: true,
+            unique: Some(attribute::Unique::Value),
+            multival: false,
+            component: false,
+            no_history: false,
+        };
+
+        assert!(attr2.flags() & AttributeBitFlags::IndexAVET as u8 == 0);
+        assert!(attr2.flags() & AttributeBitFlags::IndexVAET as u8 == 0);
+        assert!(attr2.flags() & AttributeBitFlags::IndexFulltext as u8 != 0);
+        assert!(attr2.flags() & AttributeBitFlags::UniqueValue as u8 != 0);
+
+        let attr3 = Attribute {
+            index: false,
+            value_type: ValueType::Boolean,
+            fulltext: true,
+            unique: Some(attribute::Unique::Identity),
+            multival: false,
+            component: false,
+            no_history: false,
+        };
+
+        assert!(attr3.flags() & AttributeBitFlags::IndexAVET as u8 == 0);
+        assert!(attr3.flags() & AttributeBitFlags::IndexVAET as u8 == 0);
+        assert!(attr3.flags() & AttributeBitFlags::IndexFulltext as u8 != 0);
+        assert!(attr3.flags() & AttributeBitFlags::UniqueValue as u8 != 0);
+    }
+
+    #[test]
+    fn test_datetime_truncation() {
+        let dt: DateTime<Utc> = DateTime::from_str("2018-01-11T00:34:09.273457004Z").expect("parsed");
+        let expected: DateTime<Utc> = DateTime::from_str("2018-01-11T00:34:09.273457Z").expect("parsed");
+
+        let tv: TypedValue = dt.into();
+        if let TypedValue::Instant(roundtripped) = tv {
+            assert_eq!(roundtripped, expected);
+        } else {
+            panic!();
+        }
+    }
+
+    #[test]
+    fn test_as_edn_value() {
+        let mut schema = Schema::default();
+
+        let attr1 = Attribute {
+            index: true,
+            value_type: ValueType::Ref,
+            fulltext: false,
+            unique: None,
+            multival: false,
+            component: false,
+            no_history: true,
+        };
+        associate_ident(&mut schema, Keyword::namespaced("foo", "bar"), 97);
+        add_attribute(&mut schema, 97, attr1);
+
+        let attr2 = Attribute {
+            index: false,
+            value_type: ValueType::String,
+            fulltext: true,
+            unique: Some(attribute::Unique::Value),
+            multival: true,
+            component: false,
+            no_history: false,
+        };
+        associate_ident(&mut schema, Keyword::namespaced("foo", "bas"), 98);
+        add_attribute(&mut schema, 98, attr2);
+
+        let attr3 = Attribute {
+            index: false,
+            value_type: ValueType::Boolean,
+            fulltext: false,
+            unique: Some(attribute::Unique::Identity),
+            multival: false,
+            component: true,
+            no_history: false,
+        };
+
+        associate_ident(&mut schema, Keyword::namespaced("foo", "bat"), 99);
+        add_attribute(&mut schema, 99, attr3);
+
+        let value = schema.to_edn_value();
+
+        let expected_output = r#"[ {   :db/ident     :foo/bar
+    :db/valueType :db.type/ref
+    :db/cardinality :db.cardinality/one
+    :db/index true
+    :db/noHistory true },
+{   :db/ident     :foo/bas
+    :db/valueType :db.type/string
+    :db/cardinality :db.cardinality/many
+    :db/unique :db.unique/value
+    :db/fulltext true },
+{   :db/ident     :foo/bat
+    :db/valueType :db.type/boolean
+    :db/cardinality :db.cardinality/one
+    :db/unique :db.unique/identity
+    :db/isComponent true }, ]"#;
+        let expected_value = edn::parse::value(&expected_output).expect("to be able to parse").without_spans();
+        assert_eq!(expected_value, value);
+
+        // let's compare the whole thing again, just to make sure we are not changing anything when we convert to edn.
+        let value2 = schema.to_edn_value();
+        assert_eq!(expected_value, value2);
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_core/sql_types.rs.html b/docs/apis/rust/0.7.0/src/mentat_core/sql_types.rs.html new file mode 100644 index 00000000..ce040a8c --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_core/sql_types.rs.html @@ -0,0 +1,402 @@ + + + + + + + + + + sql_types.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::collections::{
+    BTreeSet,
+};
+
+use types::{
+    ValueType,
+    ValueTypeTag,
+};
+
+use value_type_set::{
+    ValueTypeSet,
+};
+
+/// Type safe representation of the possible return values from SQLite's `typeof`
+#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub enum SQLTypeAffinity {
+    Null,    // "null"
+    Integer, // "integer"
+    Real,    // "real"
+    Text,    // "text"
+    Blob,    // "blob"
+}
+
+// Put this here rather than in `db` simply because it's widely needed.
+pub trait SQLValueType {
+    fn value_type_tag(&self) -> ValueTypeTag;
+    fn accommodates_integer(&self, int: i64) -> bool;
+
+    /// Return a pair of the ValueTypeTag for this value type, and the SQLTypeAffinity required
+    /// to distinguish it from any other types that share the same tag.
+    ///
+    /// Background: The tag alone is not enough to determine the type of a value, since multiple
+    /// ValueTypes may share the same tag (for example, ValueType::Long and ValueType::Double).
+    /// However, each ValueType can be determined by checking both the tag and the type's affinity.
+    fn sql_representation(&self) -> (ValueTypeTag, Option<SQLTypeAffinity>);
+}
+
+impl SQLValueType for ValueType {
+    fn sql_representation(&self) -> (ValueTypeTag, Option<SQLTypeAffinity>) {
+        match *self {
+            ValueType::Ref     => (0, None),
+            ValueType::Boolean => (1, None),
+            ValueType::Instant => (4, None),
+
+            // SQLite distinguishes integral from decimal types, allowing long and double to share a tag.
+            ValueType::Long    => (5, Some(SQLTypeAffinity::Integer)),
+            ValueType::Double  => (5, Some(SQLTypeAffinity::Real)),
+            ValueType::String  => (10, None),
+            ValueType::Uuid    => (11, None),
+            ValueType::Keyword => (13, None),
+        }
+    }
+
+    #[inline]
+    fn value_type_tag(&self) -> ValueTypeTag {
+        self.sql_representation().0
+    }
+
+    /// Returns true if the provided integer is in the SQLite value space of this type. For
+    /// example, `1` is how we encode `true`.
+    ///
+    /// ```
+    /// use mentat_core::{ValueType, SQLValueType};
+    /// assert!(!ValueType::Instant.accommodates_integer(1493399581314));
+    /// assert!(!ValueType::Instant.accommodates_integer(1493399581314000));
+    /// assert!(ValueType::Boolean.accommodates_integer(1));
+    /// assert!(!ValueType::Boolean.accommodates_integer(-1));
+    /// assert!(!ValueType::Boolean.accommodates_integer(10));
+    /// assert!(!ValueType::String.accommodates_integer(10));
+    /// ```
+    fn accommodates_integer(&self, int: i64) -> bool {
+        use ValueType::*;
+        match *self {
+            Instant                 => false,          // Always use #inst.
+            Long | Double           => true,
+            Ref                     => int >= 0,
+            Boolean                 => (int == 0) || (int == 1),
+            ValueType::String       => false,
+            Keyword                 => false,
+            Uuid                    => false,
+        }
+    }
+}
+
+/// We have an enum of types, `ValueType`. It can be collected into a set, `ValueTypeSet`. Each type
+/// is associated with a type tag, which is how a type is represented in, e.g., SQL storage. Types
+/// can share type tags, because backing SQL storage is able to differentiate between some types
+/// (e.g., longs and doubles), and so distinct tags aren't necessary. That association is defined by
+/// `SQLValueType`. That trait similarly extends to `ValueTypeSet`, which maps a collection of types
+/// into a collection of tags.
+pub trait SQLValueTypeSet {
+    fn value_type_tags(&self) -> BTreeSet<ValueTypeTag>;
+    fn has_unique_type_tag(&self) -> bool;
+    fn unique_type_tag(&self) -> Option<ValueTypeTag>;
+}
+
+impl SQLValueTypeSet for ValueTypeSet {
+    // This is inefficient, but it'll do for now.
+    fn value_type_tags(&self) -> BTreeSet<ValueTypeTag> {
+        let mut out = BTreeSet::new();
+        for t in self.0.iter() {
+            out.insert(t.value_type_tag());
+        }
+        out
+    }
+
+    fn unique_type_tag(&self) -> Option<ValueTypeTag> {
+        if self.is_unit() || self.has_unique_type_tag() {
+            self.exemplar().map(|t| t.value_type_tag())
+        } else {
+            None
+        }
+    }
+
+    fn has_unique_type_tag(&self) -> bool {
+        if self.is_unit() {
+            return true;
+        }
+
+        let mut acc = BTreeSet::new();
+        for t in self.0.iter() {
+            if acc.insert(t.value_type_tag()) && acc.len() > 1 {
+                // We inserted a second or subsequent value.
+                return false;
+            }
+        }
+        !acc.is_empty()
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_core/types.rs.html b/docs/apis/rust/0.7.0/src/mentat_core/types.rs.html new file mode 100644 index 00000000..752f83d2 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_core/types.rs.html @@ -0,0 +1,1562 @@ + + + + + + + + + + types.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use ::std::ffi::{
+    CString,
+};
+use ::std::os::raw::c_char;
+
+use ::std::rc::{
+    Rc,
+};
+
+use ::std::sync::{
+    Arc,
+};
+
+use std::fmt;
+use ::enum_set::EnumSet;
+
+use ::ordered_float::OrderedFloat;
+
+use ::uuid::Uuid;
+
+use ::chrono::{
+    DateTime,
+    Timelike,       // For truncation.
+};
+
+use ::indexmap::{
+    IndexMap,
+};
+
+use ::edn::{
+    self,
+    Cloned,
+    FromMicros,
+    FromRc,
+    Keyword,
+    Utc,
+    ValueRc,
+};
+
+use values;
+
+/// Represents one entid in the entid space.
+///
+/// Per https://www.sqlite.org/datatype3.html (see also http://stackoverflow.com/a/8499544), SQLite
+/// stores signed integers up to 64 bits in size.  Since u32 is not appropriate for our use case, we
+/// use i64 rather than manually truncating u64 to u63 and casting to i64 throughout the codebase.
+pub type Entid = i64;
+
+/// An entid that's either already in the store, or newly allocated to a tempid.
+/// TODO: we'd like to link this in some way to the lifetime of a particular PartitionMap.
+#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)]
+pub struct KnownEntid(pub Entid);
+
+impl From<KnownEntid> for Entid {
+    fn from(k: KnownEntid) -> Entid {
+        k.0
+    }
+}
+
+impl From<KnownEntid> for TypedValue {
+    fn from(k: KnownEntid) -> TypedValue {
+        TypedValue::Ref(k.0)
+    }
+}
+
+/// The attribute of each Mentat assertion has a :db/valueType constraining the value to a
+/// particular set.  Mentat recognizes the following :db/valueType values.
+#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+#[repr(u32)]
+pub enum ValueType {
+    Ref,
+    Boolean,
+    Instant,
+    Long,
+    Double,
+    String,
+    Keyword,
+    Uuid,
+}
+
+pub type ValueTypeTag = i32;
+
+impl ValueType {
+    pub fn all_enums() -> EnumSet<ValueType> {
+        // TODO: lazy_static.
+        let mut s = EnumSet::new();
+        s.insert(ValueType::Ref);
+        s.insert(ValueType::Boolean);
+        s.insert(ValueType::Instant);
+        s.insert(ValueType::Long);
+        s.insert(ValueType::Double);
+        s.insert(ValueType::String);
+        s.insert(ValueType::Keyword);
+        s.insert(ValueType::Uuid);
+        s
+    }
+}
+
+
+impl ::enum_set::CLike for ValueType {
+    fn to_u32(&self) -> u32 {
+        *self as u32
+    }
+
+    unsafe fn from_u32(v: u32) -> ValueType {
+        ::std::mem::transmute(v)
+    }
+}
+
+impl ValueType {
+    pub fn into_keyword(self) -> Keyword {
+        Keyword::namespaced("db.type", match self {
+            ValueType::Ref => "ref",
+            ValueType::Boolean => "boolean",
+            ValueType::Instant => "instant",
+            ValueType::Long => "long",
+            ValueType::Double => "double",
+            ValueType::String => "string",
+            ValueType::Keyword => "keyword",
+            ValueType::Uuid => "uuid",
+        })
+    }
+
+    pub fn from_keyword(keyword: &Keyword) -> Option<Self> {
+        if keyword.namespace() != Some("db.type") {
+            return None;
+        }
+
+        return match keyword.name() {
+            "ref" => Some(ValueType::Ref),
+            "boolean" => Some(ValueType::Boolean),
+            "instant" => Some(ValueType::Instant),
+            "long" => Some(ValueType::Long),
+            "double" => Some(ValueType::Double),
+            "string" => Some(ValueType::String),
+            "keyword" => Some(ValueType::Keyword),
+            "uuid" => Some(ValueType::Uuid),
+            _ => None,
+        }
+    }
+
+    pub fn into_typed_value(self) -> TypedValue {
+        TypedValue::typed_ns_keyword("db.type", match self {
+            ValueType::Ref => "ref",
+            ValueType::Boolean => "boolean",
+            ValueType::Instant => "instant",
+            ValueType::Long => "long",
+            ValueType::Double => "double",
+            ValueType::String => "string",
+            ValueType::Keyword => "keyword",
+            ValueType::Uuid => "uuid",
+        })
+    }
+
+    pub fn into_edn_value(self) -> edn::Value {
+        match self {
+            ValueType::Ref => values::DB_TYPE_REF.clone(),
+            ValueType::Boolean => values::DB_TYPE_BOOLEAN.clone(),
+            ValueType::Instant => values::DB_TYPE_INSTANT.clone(),
+            ValueType::Long => values::DB_TYPE_LONG.clone(),
+            ValueType::Double => values::DB_TYPE_DOUBLE.clone(),
+            ValueType::String => values::DB_TYPE_STRING.clone(),
+            ValueType::Keyword => values::DB_TYPE_KEYWORD.clone(),
+            ValueType::Uuid => values::DB_TYPE_UUID.clone(),
+        }
+    }
+
+    pub fn is_numeric(&self) -> bool {
+        match self {
+            &ValueType::Long | &ValueType::Double => true,
+            _ => false
+        }
+    }
+}
+
+impl fmt::Display for ValueType {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "{}", match *self {
+            ValueType::Ref =>     ":db.type/ref",
+            ValueType::Boolean => ":db.type/boolean",
+            ValueType::Instant => ":db.type/instant",
+            ValueType::Long =>    ":db.type/long",
+            ValueType::Double =>  ":db.type/double",
+            ValueType::String =>  ":db.type/string",
+            ValueType::Keyword => ":db.type/keyword",
+            ValueType::Uuid =>    ":db.type/uuid",
+        })
+    }
+}
+
+/// Represents a value that can be stored in a Mentat store.
+// TODO: expand to include :db.type/uri. https://github.com/mozilla/mentat/issues/201
+// TODO: JSON data type? https://github.com/mozilla/mentat/issues/31
+// TODO: BigInt? Bytes?
+#[derive(Clone, Debug, Eq, Hash, Ord, PartialOrd, PartialEq, Serialize, Deserialize)]
+pub enum TypedValue {
+    Ref(Entid),
+    Boolean(bool),
+    Long(i64),
+    Double(OrderedFloat<f64>),
+    Instant(DateTime<Utc>),               // Use `into()` to ensure truncation.
+    // TODO: &str throughout?
+    String(ValueRc<String>),
+    Keyword(ValueRc<Keyword>),
+    Uuid(Uuid),                        // It's only 128 bits, so this should be acceptable to clone.
+}
+
+/// The values bound in a query specification can be:
+///
+/// * Vecs of structured values, for multi-valued component attributes or nested expressions.
+/// * Single structured values, for single-valued component attributes or nested expressions.
+/// * Single typed values, for simple attributes.
+///
+/// The `Binding` enum defines these three options.
+///
+/// Datomic also supports structured inputs; at present Mentat does not, but this type
+/// would also serve that purpose.
+///
+/// Note that maps are not ordered, and so `Binding` is neither `Ord` nor `PartialOrd`.
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum Binding {
+    Scalar(TypedValue),
+    Vec(ValueRc<Vec<Binding>>),
+    Map(ValueRc<StructuredMap>),
+}
+
+impl<T> From<T> for Binding where T: Into<TypedValue> {
+    fn from(value: T) -> Self {
+        Binding::Scalar(value.into())
+    }
+}
+
+impl From<StructuredMap> for Binding {
+    fn from(value: StructuredMap) -> Self {
+        Binding::Map(ValueRc::new(value))
+    }
+}
+
+impl From<Vec<Binding>> for Binding {
+    fn from(value: Vec<Binding>) -> Self {
+        Binding::Vec(ValueRc::new(value))
+    }
+}
+
+impl Binding {
+    pub fn val(self) -> Option<TypedValue> {
+        match self {
+            Binding::Scalar(v) => Some(v),
+            _ => None,
+        }
+    }
+}
+
+/// A pull expression expands a binding into a structure. The returned structure
+/// associates attributes named in the input or retrieved from the store with values.
+/// This association is a `StructuredMap`.
+///
+/// Note that 'attributes' in Datomic's case can mean:
+/// - Reversed attribute keywords (:artist/_country).
+/// - An alias using `:as` (:artist/name :as "Band name").
+///
+/// We entirely support the former, and partially support the latter -- you can alias
+/// using a different keyword only.
+#[derive(Clone, Debug, Default, Eq, PartialEq)]
+pub struct StructuredMap(pub IndexMap<ValueRc<Keyword>, Binding>);
+
+impl StructuredMap {
+    pub fn insert<N, B>(&mut self, name: N, value: B) where N: Into<ValueRc<Keyword>>, B: Into<Binding> {
+        self.0.insert(name.into(), value.into());
+    }
+}
+
+impl From<IndexMap<ValueRc<Keyword>, Binding>> for StructuredMap {
+    fn from(src: IndexMap<ValueRc<Keyword>, Binding>) -> Self {
+        StructuredMap(src)
+    }
+}
+
+// Mostly for testing.
+impl<T> From<Vec<(Keyword, T)>> for StructuredMap where T: Into<Binding> {
+    fn from(value: Vec<(Keyword, T)>) -> Self {
+        let mut sm = StructuredMap::default();
+        for (k, v) in value.into_iter() {
+            sm.insert(k, v);
+        }
+        sm
+    }
+}
+
+impl Binding {
+    /// Returns true if the provided type is `Some` and matches this value's type, or if the
+    /// provided type is `None`.
+    #[inline]
+    pub fn is_congruent_with<T: Into<Option<ValueType>>>(&self, t: T) -> bool {
+        t.into().map_or(true, |x| self.matches_type(x))
+    }
+
+    #[inline]
+    pub fn matches_type(&self, t: ValueType) -> bool {
+        self.value_type() == Some(t)
+    }
+
+    pub fn value_type(&self) -> Option<ValueType> {
+        match self {
+            &Binding::Scalar(ref v) => Some(v.value_type()),
+
+            &Binding::Map(_) => None,
+            &Binding::Vec(_) => None,
+        }
+    }
+}
+
+
+impl TypedValue {
+    /// Returns true if the provided type is `Some` and matches this value's type, or if the
+    /// provided type is `None`.
+    #[inline]
+    pub fn is_congruent_with<T: Into<Option<ValueType>>>(&self, t: T) -> bool {
+        t.into().map_or(true, |x| self.matches_type(x))
+    }
+
+    #[inline]
+    pub fn matches_type(&self, t: ValueType) -> bool {
+        self.value_type() == t
+    }
+
+    pub fn value_type(&self) -> ValueType {
+        match self {
+            &TypedValue::Ref(_) => ValueType::Ref,
+            &TypedValue::Boolean(_) => ValueType::Boolean,
+            &TypedValue::Long(_) => ValueType::Long,
+            &TypedValue::Instant(_) => ValueType::Instant,
+            &TypedValue::Double(_) => ValueType::Double,
+            &TypedValue::String(_) => ValueType::String,
+            &TypedValue::Keyword(_) => ValueType::Keyword,
+            &TypedValue::Uuid(_) => ValueType::Uuid,
+        }
+    }
+
+    /// Construct a new `TypedValue::Keyword` instance by cloning the provided
+    /// values and wrapping them in a new `ValueRc`. This is expensive, so this might
+    /// be best limited to tests.
+    pub fn typed_ns_keyword(ns: &str, name: &str) -> TypedValue {
+        Keyword::namespaced(ns, name).into()
+    }
+
+    /// Construct a new `TypedValue::String` instance by cloning the provided
+    /// value and wrapping it in a new `ValueRc`. This is expensive, so this might
+    /// be best limited to tests.
+    pub fn typed_string(s: &str) -> TypedValue {
+        s.into()
+    }
+
+    pub fn current_instant() -> TypedValue {
+        Utc::now().into()
+    }
+
+    /// Construct a new `TypedValue::Instant` instance from the provided
+    /// microsecond timestamp.
+    pub fn instant(micros: i64) -> TypedValue {
+        DateTime::<Utc>::from_micros(micros).into()
+    }
+}
+
+trait MicrosecondPrecision {
+    /// Truncate the provided `DateTime` to microsecond precision.
+    fn microsecond_precision(self) -> Self;
+}
+
+impl MicrosecondPrecision for DateTime<Utc> {
+    fn microsecond_precision(self) -> DateTime<Utc> {
+        let nanoseconds = self.nanosecond();
+        if nanoseconds % 1000 == 0 {
+            return self;
+        }
+        let microseconds = nanoseconds / 1000;
+        let truncated = microseconds * 1000;
+        self.with_nanosecond(truncated).expect("valid timestamp")
+    }
+}
+
+/// Return the current time as a UTC `DateTime` instance with microsecond precision.
+pub fn now() -> DateTime<Utc> {
+    Utc::now().microsecond_precision()
+}
+
+// We don't do From<i64> or From<Entid> 'cos it's ambiguous.
+
+impl From<bool> for TypedValue {
+    fn from(value: bool) -> TypedValue {
+        TypedValue::Boolean(value)
+    }
+}
+
+/// Truncate the provided `DateTime` to microsecond precision, and return the corresponding
+/// `TypedValue::Instant`.
+impl From<DateTime<Utc>> for TypedValue {
+    fn from(value: DateTime<Utc>) -> TypedValue {
+        TypedValue::Instant(value.microsecond_precision())
+    }
+}
+
+impl From<Uuid> for TypedValue {
+    fn from(value: Uuid) -> TypedValue {
+        TypedValue::Uuid(value)
+    }
+}
+
+impl<'a> From<&'a str> for TypedValue {
+    fn from(value: &'a str) -> TypedValue {
+        TypedValue::String(ValueRc::new(value.to_string()))
+    }
+}
+
+impl From<Arc<String>> for TypedValue {
+    fn from(value: Arc<String>) -> TypedValue {
+        TypedValue::String(ValueRc::from_arc(value))
+    }
+}
+
+impl From<Rc<String>> for TypedValue {
+    fn from(value: Rc<String>) -> TypedValue {
+        TypedValue::String(ValueRc::from_rc(value))
+    }
+}
+
+impl From<Box<String>> for TypedValue {
+    fn from(value: Box<String>) -> TypedValue {
+        TypedValue::String(ValueRc::new(*value))
+    }
+}
+
+impl From<String> for TypedValue {
+    fn from(value: String) -> TypedValue {
+        TypedValue::String(ValueRc::new(value))
+    }
+}
+
+impl From<Arc<Keyword>> for TypedValue {
+    fn from(value: Arc<Keyword>) -> TypedValue {
+        TypedValue::Keyword(ValueRc::from_arc(value))
+    }
+}
+
+impl From<Rc<Keyword>> for TypedValue {
+    fn from(value: Rc<Keyword>) -> TypedValue {
+        TypedValue::Keyword(ValueRc::from_rc(value))
+    }
+}
+
+impl From<Keyword> for TypedValue {
+    fn from(value: Keyword) -> TypedValue {
+        TypedValue::Keyword(ValueRc::new(value))
+    }
+}
+
+impl From<u32> for TypedValue {
+    fn from(value: u32) -> TypedValue {
+        TypedValue::Long(value as i64)
+    }
+}
+
+impl From<i32> for TypedValue {
+    fn from(value: i32) -> TypedValue {
+        TypedValue::Long(value as i64)
+    }
+}
+
+impl From<f64> for TypedValue {
+    fn from(value: f64) -> TypedValue {
+        TypedValue::Double(OrderedFloat(value))
+    }
+}
+
+impl TypedValue {
+    pub fn into_known_entid(self) -> Option<KnownEntid> {
+        match self {
+            TypedValue::Ref(v) => Some(KnownEntid(v)),
+            _ => None,
+        }
+    }
+
+    pub fn into_entid(self) -> Option<Entid> {
+        match self {
+            TypedValue::Ref(v) => Some(v),
+            _ => None,
+        }
+    }
+
+    pub fn into_kw(self) -> Option<ValueRc<Keyword>> {
+        match self {
+            TypedValue::Keyword(v) => Some(v),
+            _ => None,
+        }
+    }
+
+    pub fn into_boolean(self) -> Option<bool> {
+        match self {
+            TypedValue::Boolean(v) => Some(v),
+            _ => None,
+        }
+    }
+
+    pub fn into_long(self) -> Option<i64> {
+        match self {
+            TypedValue::Long(v) => Some(v),
+            _ => None,
+        }
+    }
+
+    pub fn into_double(self) -> Option<f64> {
+        match self {
+            TypedValue::Double(v) => Some(v.into_inner()),
+            _ => None,
+        }
+    }
+
+    pub fn into_instant(self) -> Option<DateTime<Utc>> {
+        match self {
+            TypedValue::Instant(v) => Some(v),
+            _ => None,
+        }
+    }
+
+    pub fn into_timestamp(self) -> Option<i64> {
+        match self {
+            TypedValue::Instant(v) => Some(v.timestamp()),
+            _ => None,
+        }
+    }
+
+    pub fn into_string(self) -> Option<ValueRc<String>> {
+        match self {
+            TypedValue::String(v) => Some(v),
+            _ => None,
+        }
+    }
+
+    pub fn into_c_string(self) -> Option<*mut c_char> {
+        match self {
+            TypedValue::String(v) => {
+                // Get an independent copy of the string.
+                let s: String = v.cloned();
+
+                // Make a CString out of the new bytes.
+                let c: CString = CString::new(s).expect("String conversion failed!");
+
+                // Return a C-owned pointer.
+                Some(c.into_raw())
+            },
+            _ => None,
+        }
+    }
+
+    pub fn into_kw_c_string(self) -> Option<*mut c_char> {
+        match self {
+            TypedValue::Keyword(v) => {
+                // Get an independent copy of the string.
+                let s: String = v.to_string();
+
+                // Make a CString out of the new bytes.
+                let c: CString = CString::new(s).expect("String conversion failed!");
+
+                // Return a C-owned pointer.
+                Some(c.into_raw())
+            },
+            _ => None,
+        }
+    }
+
+    pub fn into_uuid_c_string(self) -> Option<*mut c_char> {
+        match self {
+            TypedValue::Uuid(v) => {
+                // Get an independent copy of the string.
+                let s: String = v.hyphenated().to_string();
+
+                // Make a CString out of the new bytes.
+                let c: CString = CString::new(s).expect("String conversion failed!");
+
+                // Return a C-owned pointer.
+                Some(c.into_raw())
+            },
+            _ => None,
+        }
+    }
+
+    pub fn into_uuid(self) -> Option<Uuid> {
+        match self {
+            TypedValue::Uuid(v) => Some(v),
+            _ => None,
+        }
+    }
+
+    pub fn into_uuid_string(self) -> Option<String> {
+        match self {
+            TypedValue::Uuid(v) => Some(v.hyphenated().to_string()),
+            _ => None,
+        }
+    }
+}
+
+impl Binding {
+    pub fn into_known_entid(self) -> Option<KnownEntid> {
+        match self {
+            Binding::Scalar(TypedValue::Ref(v)) => Some(KnownEntid(v)),
+            _ => None,
+        }
+    }
+
+    pub fn into_entid(self) -> Option<Entid> {
+        match self {
+            Binding::Scalar(TypedValue::Ref(v)) => Some(v),
+            _ => None,
+        }
+    }
+
+    pub fn into_kw(self) -> Option<ValueRc<Keyword>> {
+        match self {
+            Binding::Scalar(TypedValue::Keyword(v)) => Some(v),
+            _ => None,
+        }
+    }
+
+    pub fn into_boolean(self) -> Option<bool> {
+        match self {
+            Binding::Scalar(TypedValue::Boolean(v)) => Some(v),
+            _ => None,
+        }
+    }
+
+    pub fn into_long(self) -> Option<i64> {
+        match self {
+            Binding::Scalar(TypedValue::Long(v)) => Some(v),
+            _ => None,
+        }
+    }
+
+    pub fn into_double(self) -> Option<f64> {
+        match self {
+            Binding::Scalar(TypedValue::Double(v)) => Some(v.into_inner()),
+            _ => None,
+        }
+    }
+
+    pub fn into_instant(self) -> Option<DateTime<Utc>> {
+        match self {
+            Binding::Scalar(TypedValue::Instant(v)) => Some(v),
+            _ => None,
+        }
+    }
+
+    pub fn into_timestamp(self) -> Option<i64> {
+        match self {
+            Binding::Scalar(TypedValue::Instant(v)) => Some(v.timestamp()),
+            _ => None,
+        }
+    }
+
+    pub fn into_string(self) -> Option<ValueRc<String>> {
+        match self {
+            Binding::Scalar(TypedValue::String(v)) => Some(v),
+            _ => None,
+        }
+    }
+
+    pub fn into_uuid(self) -> Option<Uuid> {
+        match self {
+            Binding::Scalar(TypedValue::Uuid(v)) => Some(v),
+            _ => None,
+        }
+    }
+
+    pub fn into_uuid_string(self) -> Option<String> {
+        match self {
+            Binding::Scalar(TypedValue::Uuid(v)) => Some(v.hyphenated().to_string()),
+            _ => None,
+        }
+    }
+
+    pub fn into_c_string(self) -> Option<*mut c_char> {
+        match self {
+            Binding::Scalar(v) => v.into_c_string(),
+            _ => None,
+        }
+    }
+
+    pub fn into_kw_c_string(self) -> Option<*mut c_char> {
+        match self {
+            Binding::Scalar(v) => v.into_kw_c_string(),
+            _ => None,
+        }
+    }
+
+    pub fn into_uuid_c_string(self) -> Option<*mut c_char> {
+        match self {
+            Binding::Scalar(v) => v.into_uuid_c_string(),
+            _ => None,
+        }
+    }
+}
+
+#[test]
+fn test_typed_value() {
+    assert!(TypedValue::Boolean(false).is_congruent_with(None));
+    assert!(TypedValue::Boolean(false).is_congruent_with(ValueType::Boolean));
+    assert!(!TypedValue::typed_string("foo").is_congruent_with(ValueType::Boolean));
+    assert!(TypedValue::typed_string("foo").is_congruent_with(ValueType::String));
+    assert!(TypedValue::typed_string("foo").is_congruent_with(None));
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_core/util.rs.html b/docs/apis/rust/0.7.0/src/mentat_core/util.rs.html new file mode 100644 index 00000000..d8dc008d --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_core/util.rs.html @@ -0,0 +1,300 @@ + + + + + + + + + + util.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+/// Side-effect chaining on `Result`.
+pub trait ResultEffect<T> {
+    /// Invoke `f` if `self` is `Ok`, returning `self`.
+    fn when_ok<F: FnOnce()>(self, f: F) -> Self;
+
+    /// Invoke `f` if `self` is `Err`, returning `self`.
+    fn when_err<F: FnOnce()>(self, f: F) -> Self;
+}
+
+impl<T, E> ResultEffect<T> for Result<T, E> {
+    fn when_ok<F: FnOnce()>(self, f: F) -> Self {
+        if self.is_ok() {
+            f();
+        }
+        self
+    }
+
+    fn when_err<F: FnOnce()>(self, f: F) -> Self {
+        if self.is_err() {
+            f();
+        }
+        self
+    }
+}
+
+/// Side-effect chaining on `Option`.
+pub trait OptionEffect<T> {
+    /// Invoke `f` if `self` is `None`, returning `self`.
+    fn when_none<F: FnOnce()>(self, f: F) -> Self;
+
+    /// Invoke `f` if `self` is `Some`, returning `self`.
+    fn when_some<F: FnOnce()>(self, f: F) -> Self;
+}
+
+impl<T> OptionEffect<T> for Option<T> {
+    fn when_none<F: FnOnce()>(self, f: F) -> Self {
+        if self.is_none() {
+            f();
+        }
+        self
+    }
+
+    fn when_some<F: FnOnce()>(self, f: F) -> Self {
+        if self.is_some() {
+            f();
+        }
+        self
+    }
+}
+
+#[derive(Clone, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub enum Either<L, R> {
+    Left(L),
+    Right(R),
+}
+
+// Cribbed from https://github.com/bluss/either/blob/f793721f3fdeb694f009e731b23a2858286bc0d6/src/lib.rs#L219-L259.
+impl<L, R> Either<L, R> {
+    pub fn map_left<F, M>(self, f: F) -> Either<M, R>
+        where F: FnOnce(L) -> M
+    {
+        use self::Either::*;
+        match self {
+            Left(l) => Left(f(l)),
+            Right(r) => Right(r),
+        }
+    }
+
+    pub fn map_right<F, S>(self, f: F) -> Either<L, S>
+        where F: FnOnce(R) -> S
+    {
+        use self::Either::*;
+        match self {
+            Left(l) => Left(l),
+            Right(r) => Right(f(r)),
+        }
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_core/value_type_set.rs.html b/docs/apis/rust/0.7.0/src/mentat_core/value_type_set.rs.html new file mode 100644 index 00000000..db55cbce --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_core/value_type_set.rs.html @@ -0,0 +1,496 @@ + + + + + + + + + + value_type_set.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use ::enum_set::{
+    EnumSet,
+};
+
+use ::types::{
+    ValueType,
+};
+
+trait EnumSetExtensions<T: ::enum_set::CLike + Clone> {
+    /// Return a set containing both `x` and `y`.
+    fn of_both(x: T, y: T) -> EnumSet<T>;
+
+    /// Return a clone of `self` with `y` added.
+    fn with(&self, y: T) -> EnumSet<T>;
+}
+
+impl<T: ::enum_set::CLike + Clone> EnumSetExtensions<T> for EnumSet<T> {
+    /// Return a set containing both `x` and `y`.
+    fn of_both(x: T, y: T) -> Self {
+        let mut o = EnumSet::new();
+        o.insert(x);
+        o.insert(y);
+        o
+    }
+
+    /// Return a clone of `self` with `y` added.
+    fn with(&self, y: T) -> EnumSet<T> {
+        let mut o = self.clone();
+        o.insert(y);
+        o
+    }
+}
+
+
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
+pub struct ValueTypeSet(pub EnumSet<ValueType>);
+
+impl Default for ValueTypeSet {
+    fn default() -> ValueTypeSet {
+        ValueTypeSet::any()
+    }
+}
+
+impl ValueTypeSet {
+    pub fn any() -> ValueTypeSet {
+        ValueTypeSet(ValueType::all_enums())
+    }
+
+    pub fn none() -> ValueTypeSet {
+        ValueTypeSet(EnumSet::new())
+    }
+
+    /// Return a set containing only `t`.
+    pub fn of_one(t: ValueType) -> ValueTypeSet {
+        let mut s = EnumSet::new();
+        s.insert(t);
+        ValueTypeSet(s)
+    }
+
+    /// Return a set containing `Double` and `Long`.
+    pub fn of_numeric_types() -> ValueTypeSet {
+        ValueTypeSet(EnumSet::of_both(ValueType::Double, ValueType::Long))
+    }
+
+    /// Return a set containing `Double`, `Long`, and `Instant`.
+    pub fn of_numeric_and_instant_types() -> ValueTypeSet {
+        let mut s = EnumSet::new();
+        s.insert(ValueType::Double);
+        s.insert(ValueType::Long);
+        s.insert(ValueType::Instant);
+        ValueTypeSet(s)
+    }
+
+    /// Return a set containing `Ref` and `Keyword`.
+    pub fn of_keywords() -> ValueTypeSet {
+        ValueTypeSet(EnumSet::of_both(ValueType::Ref, ValueType::Keyword))
+    }
+
+    /// Return a set containing `Ref` and `Long`.
+    pub fn of_longs() -> ValueTypeSet {
+        ValueTypeSet(EnumSet::of_both(ValueType::Ref, ValueType::Long))
+    }
+}
+
+impl ValueTypeSet {
+    pub fn insert(&mut self, vt: ValueType) -> bool {
+        self.0.insert(vt)
+    }
+
+    pub fn len(&self) -> usize {
+        self.0.len()
+    }
+
+    /// Returns a set containing all the types in this set and `other`.
+    pub fn union(&self, other: &ValueTypeSet) -> ValueTypeSet {
+        ValueTypeSet(self.0.union(other.0))
+    }
+
+    pub fn intersection(&self, other: &ValueTypeSet) -> ValueTypeSet {
+        ValueTypeSet(self.0.intersection(other.0))
+    }
+
+    /// Returns the set difference between `self` and `other`, which is the
+    /// set of items in `self` that are not in `other`.
+    pub fn difference(&self, other: &ValueTypeSet) -> ValueTypeSet {
+        ValueTypeSet(self.0 - other.0)
+    }
+
+    /// Return an arbitrary type that's part of this set.
+    /// For a set containing a single type, this will be that type.
+    pub fn exemplar(&self) -> Option<ValueType> {
+        self.0.iter().next()
+    }
+
+    pub fn is_subset(&self, other: &ValueTypeSet) -> bool {
+        self.0.is_subset(&other.0)
+    }
+
+    /// Returns true if `self` and `other` contain no items in common.
+    pub fn is_disjoint(&self, other: &ValueTypeSet) -> bool {
+        self.0.is_disjoint(&other.0)
+    }
+
+    pub fn contains(&self, vt: ValueType) -> bool {
+        self.0.contains(&vt)
+    }
+
+    pub fn is_empty(&self) -> bool {
+        self.0.is_empty()
+    }
+
+    pub fn is_unit(&self) -> bool {
+        self.0.len() == 1
+    }
+
+    pub fn iter(&self) -> ::enum_set::Iter<ValueType> {
+        self.0.iter()
+    }
+}
+
+impl From<ValueType> for ValueTypeSet {
+    fn from(t: ValueType) -> Self {
+        ValueTypeSet::of_one(t)
+    }
+}
+
+impl ValueTypeSet {
+    pub fn is_only_numeric(&self) -> bool {
+        self.is_subset(&ValueTypeSet::of_numeric_types())
+    }
+}
+
+impl IntoIterator for ValueTypeSet {
+    type Item = ValueType;
+    type IntoIter = ::enum_set::Iter<ValueType>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.0.into_iter()
+    }
+}
+
+impl ::std::iter::FromIterator<ValueType> for ValueTypeSet {
+    fn from_iter<I: IntoIterator<Item = ValueType>>(iterator: I) -> Self {
+        let mut ret = Self::none();
+        ret.0.extend(iterator);
+        ret
+    }
+}
+
+impl ::std::iter::Extend<ValueType> for ValueTypeSet {
+    fn extend<I: IntoIterator<Item = ValueType>>(&mut self, iter: I) {
+        for element in iter {
+            self.0.insert(element);
+        }
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_core/values.rs.html b/docs/apis/rust/0.7.0/src/mentat_core/values.rs.html new file mode 100644 index 00000000..c71193a2 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_core/values.rs.html @@ -0,0 +1,254 @@ + + + + + + + + + + values.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+/// Literal `Value` instances in the the "db" namespace.
+///
+/// Used through-out the transactor to match core DB constructs.
+
+use edn::types::Value;
+use edn::symbols;
+
+/// Declare a lazy static `ident` of type `Value::Keyword` with the given `namespace` and
+/// `name`.
+///
+/// It may look surprising that we declare a new `lazy_static!` block rather than including
+/// invocations inside an existing `lazy_static!` block.  The latter cannot be done, since macros
+/// are expanded outside-in.  Looking at the `lazy_static!` source suggests that there is no harm in
+/// repeating that macro, since internally a multi-`static` block is expanded into many
+/// single-`static` blocks.
+///
+/// TODO: take just ":db.part/db" and define DB_PART_DB using "db.part" and "db".
+macro_rules! lazy_static_namespaced_keyword_value (
+    ($tag:ident, $namespace:expr, $name:expr) => (
+        lazy_static! {
+            pub static ref $tag: Value = {
+                Value::Keyword(symbols::Keyword::namespaced($namespace, $name))
+            };
+        }
+    )
+);
+
+lazy_static_namespaced_keyword_value!(DB_ADD, "db", "add");
+lazy_static_namespaced_keyword_value!(DB_ALTER_ATTRIBUTE, "db.alter", "attribute");
+lazy_static_namespaced_keyword_value!(DB_CARDINALITY, "db", "cardinality");
+lazy_static_namespaced_keyword_value!(DB_CARDINALITY_MANY, "db.cardinality", "many");
+lazy_static_namespaced_keyword_value!(DB_CARDINALITY_ONE, "db.cardinality", "one");
+lazy_static_namespaced_keyword_value!(DB_FULLTEXT, "db", "fulltext");
+lazy_static_namespaced_keyword_value!(DB_IDENT, "db", "ident");
+lazy_static_namespaced_keyword_value!(DB_INDEX, "db", "index");
+lazy_static_namespaced_keyword_value!(DB_INSTALL_ATTRIBUTE, "db.install", "attribute");
+lazy_static_namespaced_keyword_value!(DB_IS_COMPONENT, "db", "isComponent");
+lazy_static_namespaced_keyword_value!(DB_NO_HISTORY, "db", "noHistory");
+lazy_static_namespaced_keyword_value!(DB_PART_DB, "db.part", "db");
+lazy_static_namespaced_keyword_value!(DB_RETRACT, "db", "retract");
+lazy_static_namespaced_keyword_value!(DB_TYPE_BOOLEAN, "db.type", "boolean");
+lazy_static_namespaced_keyword_value!(DB_TYPE_DOUBLE, "db.type", "double");
+lazy_static_namespaced_keyword_value!(DB_TYPE_INSTANT, "db.type", "instant");
+lazy_static_namespaced_keyword_value!(DB_TYPE_KEYWORD, "db.type", "keyword");
+lazy_static_namespaced_keyword_value!(DB_TYPE_LONG, "db.type", "long");
+lazy_static_namespaced_keyword_value!(DB_TYPE_REF, "db.type", "ref");
+lazy_static_namespaced_keyword_value!(DB_TYPE_STRING, "db.type", "string");
+lazy_static_namespaced_keyword_value!(DB_TYPE_URI, "db.type", "uri");
+lazy_static_namespaced_keyword_value!(DB_TYPE_UUID, "db.type", "uuid");
+lazy_static_namespaced_keyword_value!(DB_UNIQUE, "db", "unique");
+lazy_static_namespaced_keyword_value!(DB_UNIQUE_IDENTITY, "db.unique", "identity");
+lazy_static_namespaced_keyword_value!(DB_UNIQUE_VALUE, "db.unique", "value");
+lazy_static_namespaced_keyword_value!(DB_VALUE_TYPE, "db", "valueType");
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/add_retract_alter_set.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/add_retract_alter_set.rs.html new file mode 100644 index 00000000..a460b327 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/add_retract_alter_set.rs.html @@ -0,0 +1,294 @@ + + + + + + + + + + add_retract_alter_set.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+use std::collections::BTreeMap;
+
+/// Witness assertions and retractions, folding (assertion, retraction) pairs into alterations.
+/// Assumes that no assertion or retraction will be witnessed more than once.
+///
+/// This keeps track of when we see a :db/add, a :db/retract, or both :db/add and :db/retract in
+/// some order.
+#[derive(Clone, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub struct AddRetractAlterSet<K, V> {
+    pub asserted: BTreeMap<K, V>,
+    pub retracted: BTreeMap<K, V>,
+    pub altered: BTreeMap<K, (V, V)>,
+}
+
+impl<K, V> Default for AddRetractAlterSet<K, V> where K: Ord {
+    fn default() -> AddRetractAlterSet<K, V> {
+        AddRetractAlterSet {
+            asserted: BTreeMap::default(),
+            retracted: BTreeMap::default(),
+            altered: BTreeMap::default(),
+        }
+    }
+}
+
+impl<K, V> AddRetractAlterSet<K, V> where K: Ord {
+    pub fn witness(&mut self, key: K, value: V, added: bool) {
+        if added {
+            if let Some(retracted_value) = self.retracted.remove(&key) {
+                self.altered.insert(key, (retracted_value, value));
+            } else {
+                self.asserted.insert(key, value);
+            }
+        } else {
+            if let Some(asserted_value) = self.asserted.remove(&key) {
+                self.altered.insert(key, (value, asserted_value));
+            } else {
+                self.retracted.insert(key, value);
+            }
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test() {
+        let mut set: AddRetractAlterSet<i64, char> = AddRetractAlterSet::default();
+        // Assertion.
+        set.witness(1, 'a', true);
+        // Retraction.
+        set.witness(2, 'b', false);
+        // Alteration.
+        set.witness(3, 'c', true);
+        set.witness(3, 'd', false);
+        // Alteration, witnessed in the with the retraction before the assertion.
+        set.witness(4, 'e', false);
+        set.witness(4, 'f', true);
+
+        let mut asserted = BTreeMap::default();
+        asserted.insert(1, 'a');
+        let mut retracted = BTreeMap::default();
+        retracted.insert(2, 'b');
+        let mut altered = BTreeMap::default();
+        altered.insert(3, ('d', 'c'));
+        altered.insert(4, ('e', 'f'));
+
+        assert_eq!(set.asserted, asserted);
+        assert_eq!(set.retracted, retracted);
+        assert_eq!(set.altered, altered);
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/bootstrap.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/bootstrap.rs.html new file mode 100644 index 00000000..52454a62 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/bootstrap.rs.html @@ -0,0 +1,738 @@ + + + + + + + + + + bootstrap.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+use edn;
+use errors::{
+    DbError,
+    Result,
+};
+use edn::types::Value;
+use edn::symbols;
+use entids;
+use db::TypedSQLValue;
+use edn::entities::Entity;
+use mentat_core::{
+    IdentMap,
+    Schema,
+    TypedValue,
+    values,
+};
+use schema::SchemaBuilding;
+use types::{Partition, PartitionMap};
+
+/// The first transaction ID applied to the knowledge base.
+///
+/// This is the start of the :db.part/tx partition.
+pub const TX0: i64 = 0x10000000;
+
+/// This is the start of the :db.part/user partition.
+pub const USER0: i64 = 0x10000;
+
+// Corresponds to the version of the :db.schema/core vocabulary.
+pub const CORE_SCHEMA_VERSION: u32 = 1;
+
+lazy_static! {
+    static ref V1_IDENTS: [(symbols::Keyword, i64); 40] = {
+            [(ns_keyword!("db", "ident"),             entids::DB_IDENT),
+             (ns_keyword!("db.part", "db"),           entids::DB_PART_DB),
+             (ns_keyword!("db", "txInstant"),         entids::DB_TX_INSTANT),
+             (ns_keyword!("db.install", "partition"), entids::DB_INSTALL_PARTITION),
+             (ns_keyword!("db.install", "valueType"), entids::DB_INSTALL_VALUE_TYPE),
+             (ns_keyword!("db.install", "attribute"), entids::DB_INSTALL_ATTRIBUTE),
+             (ns_keyword!("db", "valueType"),         entids::DB_VALUE_TYPE),
+             (ns_keyword!("db", "cardinality"),       entids::DB_CARDINALITY),
+             (ns_keyword!("db", "unique"),            entids::DB_UNIQUE),
+             (ns_keyword!("db", "isComponent"),       entids::DB_IS_COMPONENT),
+             (ns_keyword!("db", "index"),             entids::DB_INDEX),
+             (ns_keyword!("db", "fulltext"),          entids::DB_FULLTEXT),
+             (ns_keyword!("db", "noHistory"),         entids::DB_NO_HISTORY),
+             (ns_keyword!("db", "add"),               entids::DB_ADD),
+             (ns_keyword!("db", "retract"),           entids::DB_RETRACT),
+             (ns_keyword!("db.part", "user"),         entids::DB_PART_USER),
+             (ns_keyword!("db.part", "tx"),           entids::DB_PART_TX),
+             (ns_keyword!("db", "excise"),            entids::DB_EXCISE),
+             (ns_keyword!("db.excise", "attrs"),      entids::DB_EXCISE_ATTRS),
+             (ns_keyword!("db.excise", "beforeT"),    entids::DB_EXCISE_BEFORE_T),
+             (ns_keyword!("db.excise", "before"),     entids::DB_EXCISE_BEFORE),
+             (ns_keyword!("db.alter", "attribute"),   entids::DB_ALTER_ATTRIBUTE),
+             (ns_keyword!("db.type", "ref"),          entids::DB_TYPE_REF),
+             (ns_keyword!("db.type", "keyword"),      entids::DB_TYPE_KEYWORD),
+             (ns_keyword!("db.type", "long"),         entids::DB_TYPE_LONG),
+             (ns_keyword!("db.type", "double"),       entids::DB_TYPE_DOUBLE),
+             (ns_keyword!("db.type", "string"),       entids::DB_TYPE_STRING),
+             (ns_keyword!("db.type", "uuid"),         entids::DB_TYPE_UUID),
+             (ns_keyword!("db.type", "uri"),          entids::DB_TYPE_URI),
+             (ns_keyword!("db.type", "boolean"),      entids::DB_TYPE_BOOLEAN),
+             (ns_keyword!("db.type", "instant"),      entids::DB_TYPE_INSTANT),
+             (ns_keyword!("db.type", "bytes"),        entids::DB_TYPE_BYTES),
+             (ns_keyword!("db.cardinality", "one"),   entids::DB_CARDINALITY_ONE),
+             (ns_keyword!("db.cardinality", "many"),  entids::DB_CARDINALITY_MANY),
+             (ns_keyword!("db.unique", "value"),      entids::DB_UNIQUE_VALUE),
+             (ns_keyword!("db.unique", "identity"),   entids::DB_UNIQUE_IDENTITY),
+             (ns_keyword!("db", "doc"),               entids::DB_DOC),
+             (ns_keyword!("db.schema", "version"),    entids::DB_SCHEMA_VERSION),
+             (ns_keyword!("db.schema", "attribute"),  entids::DB_SCHEMA_ATTRIBUTE),
+             (ns_keyword!("db.schema", "core"),       entids::DB_SCHEMA_CORE),
+        ]
+    };
+
+    static ref V1_PARTS: [(symbols::Keyword, i64, i64); 3] = {
+            [(ns_keyword!("db.part", "db"), 0, (1 + V1_IDENTS.len()) as i64),
+             (ns_keyword!("db.part", "user"), USER0, USER0),
+             (ns_keyword!("db.part", "tx"), TX0, TX0),
+        ]
+    };
+
+    static ref V1_CORE_SCHEMA: [(symbols::Keyword); 16] = {
+            [(ns_keyword!("db", "ident")),
+             (ns_keyword!("db.install", "partition")),
+             (ns_keyword!("db.install", "valueType")),
+             (ns_keyword!("db.install", "attribute")),
+             (ns_keyword!("db", "txInstant")),
+             (ns_keyword!("db", "valueType")),
+             (ns_keyword!("db", "cardinality")),
+             (ns_keyword!("db", "doc")),
+             (ns_keyword!("db", "unique")),
+             (ns_keyword!("db", "isComponent")),
+             (ns_keyword!("db", "index")),
+             (ns_keyword!("db", "fulltext")),
+             (ns_keyword!("db", "noHistory")),
+             (ns_keyword!("db.alter", "attribute")),
+             (ns_keyword!("db.schema", "version")),
+             (ns_keyword!("db.schema", "attribute")),
+        ]
+    };
+
+    static ref V1_SYMBOLIC_SCHEMA: Value = {
+        let s = r#"
+{:db/ident             {:db/valueType   :db.type/keyword
+                        :db/cardinality :db.cardinality/one
+                        :db/index       true
+                        :db/unique      :db.unique/identity}
+ :db.install/partition {:db/valueType   :db.type/ref
+                        :db/cardinality :db.cardinality/many}
+ :db.install/valueType {:db/valueType   :db.type/ref
+                        :db/cardinality :db.cardinality/many}
+ :db.install/attribute {:db/valueType   :db.type/ref
+                        :db/cardinality :db.cardinality/many}
+ ;; TODO: support user-specified functions in the future.
+ ;; :db.install/function {:db/valueType :db.type/ref
+ ;;                       :db/cardinality :db.cardinality/many}
+ :db/txInstant         {:db/valueType   :db.type/instant
+                        :db/cardinality :db.cardinality/one
+                        :db/index       true}
+ :db/valueType         {:db/valueType   :db.type/ref
+                        :db/cardinality :db.cardinality/one}
+ :db/cardinality       {:db/valueType   :db.type/ref
+                        :db/cardinality :db.cardinality/one}
+ :db/doc               {:db/valueType   :db.type/string
+                        :db/cardinality :db.cardinality/one}
+ :db/unique            {:db/valueType   :db.type/ref
+                        :db/cardinality :db.cardinality/one}
+ :db/isComponent       {:db/valueType   :db.type/boolean
+                        :db/cardinality :db.cardinality/one}
+ :db/index             {:db/valueType   :db.type/boolean
+                        :db/cardinality :db.cardinality/one}
+ :db/fulltext          {:db/valueType   :db.type/boolean
+                        :db/cardinality :db.cardinality/one}
+ :db/noHistory         {:db/valueType   :db.type/boolean
+                        :db/cardinality :db.cardinality/one}
+ :db.alter/attribute   {:db/valueType   :db.type/ref
+                        :db/cardinality :db.cardinality/many}
+ :db.schema/version    {:db/valueType   :db.type/long
+                        :db/cardinality :db.cardinality/one}
+
+ ;; unique-value because an attribute can only belong to a single
+ ;; schema fragment.
+ :db.schema/attribute  {:db/valueType   :db.type/ref
+                        :db/index       true
+                        :db/unique      :db.unique/value
+                        :db/cardinality :db.cardinality/many}}"#;
+        edn::parse::value(s)
+            .map(|v| v.without_spans())
+            .map_err(|_| DbError::BadBootstrapDefinition("Unable to parse V1_SYMBOLIC_SCHEMA".into()))
+            .unwrap()
+    };
+}
+
+/// Convert (ident, entid) pairs into [:db/add IDENT :db/ident IDENT] `Value` instances.
+fn idents_to_assertions(idents: &[(symbols::Keyword, i64)]) -> Vec<Value> {
+    idents
+        .into_iter()
+        .map(|&(ref ident, _)| {
+            let value = Value::Keyword(ident.clone());
+            Value::Vector(vec![values::DB_ADD.clone(), value.clone(), values::DB_IDENT.clone(), value.clone()])
+        })
+        .collect()
+}
+
+/// Convert an ident list into [:db/add :db.schema/core :db.schema/attribute IDENT] `Value` instances.
+fn schema_attrs_to_assertions(version: u32, idents: &[symbols::Keyword]) -> Vec<Value> {
+    let schema_core = Value::Keyword(ns_keyword!("db.schema", "core"));
+    let schema_attr = Value::Keyword(ns_keyword!("db.schema", "attribute"));
+    let schema_version = Value::Keyword(ns_keyword!("db.schema", "version"));
+    idents
+        .into_iter()
+        .map(|ident| {
+            let value = Value::Keyword(ident.clone());
+            Value::Vector(vec![values::DB_ADD.clone(),
+                               schema_core.clone(),
+                               schema_attr.clone(),
+                               value])
+        })
+        .chain(::std::iter::once(Value::Vector(vec![values::DB_ADD.clone(),
+                                             schema_core.clone(),
+                                             schema_version,
+                                             Value::Integer(version as i64)])))
+        .collect()
+}
+
+/// Convert {:ident {:key :value ...} ...} to
+/// vec![(symbols::Keyword(:ident), symbols::Keyword(:key), TypedValue(:value)), ...].
+///
+/// Such triples are closer to what the transactor will produce when processing attribute
+/// assertions.
+fn symbolic_schema_to_triples(ident_map: &IdentMap, symbolic_schema: &Value) -> Result<Vec<(symbols::Keyword, symbols::Keyword, TypedValue)>> {
+    // Failure here is a coding error, not a runtime error.
+    let mut triples: Vec<(symbols::Keyword, symbols::Keyword, TypedValue)> = vec![];
+    // TODO: Consider `flat_map` and `map` rather than loop.
+    match *symbolic_schema {
+        Value::Map(ref m) => {
+            for (ident, mp) in m {
+                let ident = match ident {
+                    &Value::Keyword(ref ident) => ident,
+                    _ => bail!(DbError::BadBootstrapDefinition(format!("Expected namespaced keyword for ident but got '{:?}'", ident))),
+                };
+                match *mp {
+                    Value::Map(ref mpp) => {
+                        for (attr, value) in mpp {
+                            let attr = match attr {
+                                &Value::Keyword(ref attr) => attr,
+                                _ => bail!(DbError::BadBootstrapDefinition(format!("Expected namespaced keyword for attr but got '{:?}'", attr))),
+                        };
+
+                            // We have symbolic idents but the transactor handles entids.  Ad-hoc
+                            // convert right here.  This is a fundamental limitation on the
+                            // bootstrap symbolic schema format; we can't represent "real" keywords
+                            // at this time.
+                            //
+                            // TODO: remove this limitation, perhaps by including a type tag in the
+                            // bootstrap symbolic schema, or by representing the initial bootstrap
+                            // schema directly as Rust data.
+                            let typed_value = match TypedValue::from_edn_value(value) {
+                                Some(TypedValue::Keyword(ref k)) => {
+                                    ident_map.get(k)
+                                        .map(|entid| TypedValue::Ref(*entid))
+                                        .ok_or(DbError::UnrecognizedIdent(k.to_string()))?
+                                },
+                                Some(v) => v,
+                                _ => bail!(DbError::BadBootstrapDefinition(format!("Expected Mentat typed value for value but got '{:?}'", value)))
+                            };
+
+                            triples.push((ident.clone(), attr.clone(), typed_value));
+                        }
+                    },
+                    _ => bail!(DbError::BadBootstrapDefinition("Expected {:db/ident {:db/attr value ...} ...}".into()))
+                }
+            }
+        },
+        _ => bail!(DbError::BadBootstrapDefinition("Expected {...}".into()))
+    }
+    Ok(triples)
+}
+
+/// Convert {IDENT {:key :value ...} ...} to [[:db/add IDENT :key :value] ...].
+fn symbolic_schema_to_assertions(symbolic_schema: &Value) -> Result<Vec<Value>> {
+    // Failure here is a coding error, not a runtime error.
+    let mut assertions: Vec<Value> = vec![];
+    match *symbolic_schema {
+        Value::Map(ref m) => {
+            for (ident, mp) in m {
+                match *mp {
+                    Value::Map(ref mpp) => {
+                        for (attr, value) in mpp {
+                            assertions.push(Value::Vector(vec![values::DB_ADD.clone(),
+                                                               ident.clone(),
+                                                               attr.clone(),
+                                                               value.clone()]));
+                        }
+                    },
+                    _ => bail!(DbError::BadBootstrapDefinition("Expected {:db/ident {:db/attr value ...} ...}".into()))
+                }
+            }
+        },
+        _ => bail!(DbError::BadBootstrapDefinition("Expected {...}".into()))
+    }
+    Ok(assertions)
+}
+
+pub(crate) fn bootstrap_partition_map() -> PartitionMap {
+    V1_PARTS.iter()
+            .map(|&(ref part, start, index)| (part.to_string(), Partition::new(start, index)))
+            .collect()
+}
+
+pub(crate) fn bootstrap_ident_map() -> IdentMap {
+    V1_IDENTS.iter()
+             .map(|&(ref ident, entid)| (ident.clone(), entid))
+             .collect()
+}
+
+pub(crate) fn bootstrap_schema() -> Schema {
+    let ident_map = bootstrap_ident_map();
+    let bootstrap_triples = symbolic_schema_to_triples(&ident_map, &V1_SYMBOLIC_SCHEMA).expect("symbolic schema");
+    Schema::from_ident_map_and_triples(ident_map, bootstrap_triples).unwrap()
+}
+
+pub(crate) fn bootstrap_entities() -> Vec<Entity<edn::ValueAndSpan>> {
+    let bootstrap_assertions: Value = Value::Vector([
+        symbolic_schema_to_assertions(&V1_SYMBOLIC_SCHEMA).expect("symbolic schema"),
+        idents_to_assertions(&V1_IDENTS[..]),
+        schema_attrs_to_assertions(CORE_SCHEMA_VERSION, V1_CORE_SCHEMA.as_ref()),
+    ].concat());
+
+    // Failure here is a coding error (since the inputs are fixed), not a runtime error.
+    // TODO: represent these bootstrap data errors rather than just panicing.
+    let bootstrap_entities: Vec<Entity<edn::ValueAndSpan>> = edn::parse::entities(&bootstrap_assertions.to_string()).expect("bootstrap assertions");
+    return bootstrap_entities;
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/cache.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/cache.rs.html new file mode 100644 index 00000000..4d53b928 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/cache.rs.html @@ -0,0 +1,3464 @@ + + + + + + + + + + cache.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+///! An implementation of attribute caching.
+///! Attribute caching means storing the entities and values for a given attribute, in the current
+///! state of the world, in one or both directions (forward or reverse).
+///!
+///! One might use a reverse cache to implement fast in-memory lookup of unique identities. One
+///! might use a forward cache to implement fast in-memory lookup of common properties.
+///!
+///! These caches are specialized wrappers around maps. We have four: single/multi forward, and
+///! unique/non-unique reverse. There are traits to provide access.
+///!
+///! A little tower of functions allows for multiple caches to be updated when provided with a
+///! single SQLite cursor over `(a, e, v)`s, sorted appropriately.
+///!
+///! Much of the complexity in this module is to support copy-on-write.
+///!
+///! When a transaction begins, we expect:
+///!
+///! - Existing references to the `Conn`'s attribute cache to still be valid.
+///! - Isolation to be preserved: that cache will return the same answers until the transaction
+///!   commits and a fresh reference to the cache is obtained.
+///! - Assertions and retractions within the transaction to be reflected in the cache.
+///!   - Retractions apply first, then assertions.
+///! - No writes = limited memory allocation for the cache.
+///! - New attributes can be cached, and existing attributes uncached, during the transaction.
+///!   These changes are isolated, too.
+///!
+///! All of this means that we need a decent copy-on-write layer that can represent retractions.
+///!
+///! This is `InProgressSQLiteAttributeCache`. It listens for committed transactions, and handles
+///! changes to the cached attribute set, maintaining a reference back to the stable cache. When
+///! necessary it copies and modifies. Retractions are modeled via a `None` option.
+///!
+///! When we're done, we take each of the four caches, and each cached attribute that changed, and
+///! absorbe them back into the stable cache. This uses `Arc::make_mut`, so if nobody is looking at
+///! the old cache, we modify it in place.
+///!
+///! Most of the tests for this module are actually in `conn.rs`, where we can set up transactions
+///! and test the external API.
+
+use std::collections::{
+    BTreeMap,
+    BTreeSet,
+    HashSet,
+};
+
+use std::collections::btree_map::{
+    Entry,
+};
+
+use std::collections::btree_map::Entry::{
+    Occupied,
+    Vacant,
+};
+
+use std::iter::{
+    once,
+};
+
+use std::mem;
+
+use std::sync::Arc;
+
+use std::iter::Peekable;
+
+use num;
+
+use rusqlite;
+
+use mentat_core::{
+    Binding,
+    CachedAttributes,
+    Entid,
+    HasSchema,
+    Schema,
+    TypedValue,
+    UpdateableCache,
+    ValueRc,
+};
+
+use mentat_core::util::{
+    Either,
+};
+
+use mentat_sql::{
+    QueryBuilder,
+    SQLiteQueryBuilder,
+    SQLQuery,
+};
+
+use edn::entities::{
+    OpType,
+};
+
+use db::{
+    TypedSQLValue,
+};
+
+use errors::{
+    DbError,
+    Result,
+};
+
+use watcher::{
+    TransactWatcher,
+};
+
+// Right now we use BTreeMap, because we expect few cached attributes.
+pub type CacheMap<K, V> = BTreeMap<K, V>;
+
+trait Remove<T> where T: PartialEq {
+    fn remove_every(&mut self, item: &T) -> usize;
+}
+
+impl<T> Remove<T> for Vec<T> where T: PartialEq {
+    /// Remove all occurrences from a vector in-place, by equality.
+    /// Eventually replace with unstable feature: #40062.
+    fn remove_every(&mut self, item: &T) -> usize {
+        let mut removed = 0;
+        let range = num::range_step_inclusive(self.len() as isize - 1, 0, -1);
+        for i in range {
+            if self.get(i as usize).map_or(false, |x| x == item) {
+                self.remove(i as usize);
+                removed += 1;
+            }
+        }
+        removed
+    }
+}
+
+trait Absorb {
+    fn absorb(&mut self, other: Self);
+}
+
+impl<K, V> Absorb for CacheMap<K, Option<V>> where K: Ord {
+    fn absorb(&mut self, other: Self) {
+        for (e, v) in other.into_iter() {
+            match v {
+                None => {
+                    // It was deleted. Remove it from our map.
+                    self.remove(&e);
+                },
+                s @ Some(_) => {
+                    self.insert(e, s);
+                },
+            }
+        }
+    }
+}
+
+trait ExtendByAbsorbing {
+    /// Just like `extend`, but rather than replacing our value with the other, the other is
+    /// absorbed into ours.
+    fn extend_by_absorbing(&mut self, other: Self);
+}
+
+impl<K, V> ExtendByAbsorbing for BTreeMap<K, V> where K: Ord, V: Absorb {
+    fn extend_by_absorbing(&mut self, other: Self) {
+        for (k, v) in other.into_iter() {
+            match self.entry(k) {
+                Occupied(mut entry) => {
+                    entry.get_mut().absorb(v);
+                },
+                Vacant(entry) => {
+                    entry.insert(v);
+                },
+            }
+        }
+    }
+}
+
+// Can't currently put doc tests on traits, so here it is.
+#[test]
+fn test_vec_remove_item() {
+    let mut v = vec![1, 2, 3, 4, 5, 4, 3];
+    v.remove_every(&3);
+    assert_eq!(v, vec![1, 2, 4, 5, 4]);
+    v.remove_every(&4);
+    assert_eq!(v, vec![1, 2, 5]);
+}
+
+//
+// The basics of attribute caching.
+//
+
+pub type Aev = (Entid, Entid, TypedValue);
+
+pub struct AevFactory {
+    // Our own simple string-interning system.
+    strings: HashSet<ValueRc<String>>,
+}
+
+impl AevFactory {
+    fn new() -> AevFactory {
+        AevFactory {
+            strings: Default::default(),
+        }
+    }
+
+    fn intern(&mut self, v: TypedValue) -> TypedValue {
+        match v {
+            TypedValue::String(rc) => {
+                let existing = self.strings.get(&rc).cloned().map(TypedValue::String);
+                if let Some(existing) = existing {
+                    return existing;
+                }
+                self.strings.insert(rc.clone());
+                return TypedValue::String(rc);
+            },
+            t => t,
+        }
+    }
+
+    fn row_to_aev(&mut self, row: &rusqlite::Row) -> Aev {
+        let a: Entid = row.get(0);
+        let e: Entid = row.get(1);
+        let value_type_tag: i32 = row.get(3);
+        let v = TypedValue::from_sql_value_pair(row.get(2), value_type_tag).map(|x| x).unwrap();
+        (a, e, self.intern(v))
+    }
+}
+
+pub struct AevRows<'conn, F> {
+    rows: rusqlite::MappedRows<'conn, F>,
+}
+
+/// Unwrap the Result from MappedRows. We could also use this opportunity to map_err it, but
+/// for now it's convenient to avoid error handling.
+impl<'conn, F> Iterator for AevRows<'conn, F> where F: FnMut(&rusqlite::Row) -> Aev {
+    type Item = Aev;
+    fn next(&mut self) -> Option<Aev> {
+        self.rows
+            .next()
+            .map(|row_result| row_result.expect("All database contents should be representable"))
+    }
+}
+
+// The behavior of the cache is different for different kinds of attributes:
+// - cardinality/one doesn't need a vec
+// - unique/* should ideally have a bijective mapping (reverse lookup)
+
+pub trait AttributeCache {
+    fn has_e(&self, e: Entid) -> bool;
+    fn binding_for_e(&self, e: Entid) -> Option<Binding>;
+}
+
+trait RemoveFromCache {
+    fn remove(&mut self, e: Entid, v: &TypedValue);
+}
+
+trait ClearCache {
+    fn clear(&mut self);
+}
+
+trait CardinalityOneCache: RemoveFromCache + ClearCache {
+    fn set(&mut self, e: Entid, v: TypedValue);
+    fn get(&self, e: Entid) -> Option<&TypedValue>;
+}
+
+trait CardinalityManyCache: RemoveFromCache + ClearCache {
+    fn acc(&mut self, e: Entid, v: TypedValue);
+    fn set(&mut self, e: Entid, vs: Vec<TypedValue>);
+    fn get(&self, e: Entid) -> Option<&Vec<TypedValue>>;
+}
+
+#[derive(Clone, Debug, Default)]
+struct SingleValAttributeCache {
+    attr: Entid,
+    e_v: CacheMap<Entid, Option<TypedValue>>,
+}
+
+impl Absorb for SingleValAttributeCache {
+    fn absorb(&mut self, other: Self) {
+        assert_eq!(self.attr, other.attr);
+        self.e_v.absorb(other.e_v);
+    }
+}
+
+impl AttributeCache for SingleValAttributeCache {
+    fn binding_for_e(&self, e: Entid) -> Option<Binding> {
+        self.get(e).map(|v| v.clone().into())
+    }
+
+    fn has_e(&self, e: Entid) -> bool {
+        self.e_v.contains_key(&e)
+    }
+}
+
+impl ClearCache for SingleValAttributeCache {
+    fn clear(&mut self) {
+        self.e_v.clear();
+    }
+}
+
+impl RemoveFromCache for SingleValAttributeCache {
+    // We never directly remove from the cache unless we're InProgress. In that case, we
+    // want to leave a sentinel in place.
+    fn remove(&mut self, e: Entid, v: &TypedValue) {
+        match self.e_v.entry(e) {
+            Occupied(mut entry) => {
+                let removed = entry.insert(None);
+                match removed {
+                    None => {},                     // Already removed.
+                    Some(ref r) if r == v => {},    // We removed it!
+                    r => {
+                        eprintln!("Cache inconsistency: should be ({}, {:?}), was ({}, {:?}).",
+                                  e, v, e, r);
+                    }
+                }
+            },
+            Vacant(entry) => {
+                entry.insert(None);
+            },
+        }
+    }
+}
+
+impl CardinalityOneCache for SingleValAttributeCache {
+    fn set(&mut self, e: Entid, v: TypedValue) {
+        self.e_v.insert(e, Some(v));
+    }
+
+    fn get(&self, e: Entid) -> Option<&TypedValue> {
+        self.e_v.get(&e).and_then(|m| m.as_ref())
+    }
+}
+
+#[derive(Clone, Debug, Default)]
+struct MultiValAttributeCache {
+    attr: Entid,
+    e_vs: CacheMap<Entid, Vec<TypedValue>>,
+}
+
+impl Absorb for MultiValAttributeCache {
+    fn absorb(&mut self, other: Self) {
+        assert_eq!(self.attr, other.attr);
+        for (e, vs) in other.e_vs.into_iter() {
+            if vs.is_empty() {
+                self.e_vs.remove(&e);
+            } else {
+                // We always override with a whole vector, so let's just overwrite.
+                self.e_vs.insert(e, vs);
+            }
+        }
+    }
+}
+
+impl AttributeCache for MultiValAttributeCache {
+    fn binding_for_e(&self, e: Entid) -> Option<Binding> {
+        self.e_vs.get(&e).map(|vs| {
+            let bindings = vs.iter().cloned().map(|v| v.into()).collect();
+            Binding::Vec(ValueRc::new(bindings))
+        })
+    }
+
+    fn has_e(&self, e: Entid) -> bool {
+        self.e_vs.contains_key(&e)
+    }
+}
+
+impl ClearCache for MultiValAttributeCache {
+    fn clear(&mut self) {
+        self.e_vs.clear();
+    }
+}
+
+impl RemoveFromCache for MultiValAttributeCache {
+    fn remove(&mut self, e: Entid, v: &TypedValue) {
+        if let Some(vec) = self.e_vs.get_mut(&e) {
+            let removed = vec.remove_every(v);
+            if removed == 0 {
+                eprintln!("Cache inconsistency: tried to remove ({}, {:?}), was not present.", e, v);
+            }
+        } else {
+            eprintln!("Cache inconsistency: tried to remove ({}, {:?}), was empty.", e, v);
+        }
+    }
+}
+
+impl CardinalityManyCache for MultiValAttributeCache {
+    fn acc(&mut self, e: Entid, v: TypedValue) {
+        self.e_vs.entry(e).or_insert(vec![]).push(v)
+    }
+
+    fn set(&mut self, e: Entid, vs: Vec<TypedValue>) {
+        self.e_vs.insert(e, vs);
+    }
+
+    fn get(&self, e: Entid) -> Option<&Vec<TypedValue>> {
+        self.e_vs.get(&e)
+    }
+}
+
+#[derive(Clone, Debug, Default)]
+struct UniqueReverseAttributeCache {
+    attr: Entid,
+    v_e: CacheMap<TypedValue, Option<Entid>>,
+}
+
+impl Absorb for UniqueReverseAttributeCache {
+    fn absorb(&mut self, other: Self) {
+        assert_eq!(self.attr, other.attr);
+        self.v_e.absorb(other.v_e);
+    }
+}
+
+impl ClearCache for UniqueReverseAttributeCache {
+    fn clear(&mut self) {
+        self.v_e.clear();
+    }
+}
+
+impl RemoveFromCache for UniqueReverseAttributeCache {
+    fn remove(&mut self, e: Entid, v: &TypedValue) {
+        match self.v_e.entry(v.clone()) {           // Future: better entry API!
+            Occupied(mut entry) => {
+                let removed = entry.insert(None);
+                match removed {
+                    None => {},                     // Already removed.
+                    Some(r) if r == e => {},        // We removed it!
+                    r => {
+                        eprintln!("Cache inconsistency: should be ({}, {:?}), was ({}, {:?}).", e, v, e, r);
+                    }
+                }
+            },
+            Vacant(entry) => {
+                // It didn't already exist.
+                entry.insert(None);
+            },
+        }
+    }
+}
+
+impl UniqueReverseAttributeCache {
+    fn set(&mut self, e: Entid, v: TypedValue) {
+        self.v_e.insert(v, Some(e));
+    }
+
+    fn get_e(&self, v: &TypedValue) -> Option<Entid> {
+        self.v_e.get(v).and_then(|o| o.clone())
+    }
+
+    fn lookup(&self, v: &TypedValue) -> Option<Option<Entid>> {
+        self.v_e.get(v).cloned()
+    }
+}
+
+#[derive(Clone, Debug, Default)]
+struct NonUniqueReverseAttributeCache {
+    attr: Entid,
+    v_es: CacheMap<TypedValue, BTreeSet<Entid>>,
+}
+
+impl Absorb for NonUniqueReverseAttributeCache {
+    fn absorb(&mut self, other: Self) {
+        assert_eq!(self.attr, other.attr);
+        for (v, es) in other.v_es.into_iter() {
+            if es.is_empty() {
+                self.v_es.remove(&v);
+            } else {
+                // We always override with a whole vector, so let's just overwrite.
+                self.v_es.insert(v, es);
+            }
+        }
+    }
+}
+
+impl ClearCache for NonUniqueReverseAttributeCache {
+    fn clear(&mut self) {
+        self.v_es.clear();
+    }
+}
+
+impl RemoveFromCache for NonUniqueReverseAttributeCache {
+    fn remove(&mut self, e: Entid, v: &TypedValue) {
+        if let Some(vec) = self.v_es.get_mut(&v) {
+            let removed = vec.remove(&e);
+            if !removed {
+                eprintln!("Cache inconsistency: tried to remove ({}, {:?}), was not present.", e, v);
+            }
+        } else {
+            eprintln!("Cache inconsistency: tried to remove ({}, {:?}), was empty.", e, v);
+        }
+    }
+}
+
+impl NonUniqueReverseAttributeCache {
+    fn acc(&mut self, e: Entid, v: TypedValue) {
+        self.v_es.entry(v).or_insert(BTreeSet::new()).insert(e);
+    }
+
+    fn get_es(&self, v: &TypedValue) -> Option<&BTreeSet<Entid>> {
+        self.v_es.get(v)
+    }
+}
+
+fn with_aev_iter<F, I>(a: Entid, iter: &mut Peekable<I>, mut f: F)
+where I: Iterator<Item=Aev>,
+      F: FnMut(Entid, TypedValue) {
+    let check = Some(a);
+    while iter.peek().map(|&(a, _, _)| a) == check {
+        let (_, e, v) = iter.next().unwrap();
+        f(e, v);
+    }
+}
+
+fn accumulate_single_val_evs_forward<I, C>(a: Entid, f: &mut C, iter: &mut Peekable<I>) where I: Iterator<Item=Aev>, C: CardinalityOneCache {
+    with_aev_iter(a, iter, |e, v| f.set(e, v))
+}
+
+fn accumulate_multi_val_evs_forward<I, C>(a: Entid, f: &mut C, iter: &mut Peekable<I>) where I: Iterator<Item=Aev>, C: CardinalityManyCache {
+    with_aev_iter(a, iter, |e, v| f.acc(e, v))
+}
+
+fn accumulate_unique_evs_reverse<I>(a: Entid, r: &mut UniqueReverseAttributeCache, iter: &mut Peekable<I>) where I: Iterator<Item=Aev> {
+    with_aev_iter(a, iter, |e, v| r.set(e, v))
+}
+
+fn accumulate_non_unique_evs_reverse<I>(a: Entid, r: &mut NonUniqueReverseAttributeCache, iter: &mut Peekable<I>) where I: Iterator<Item=Aev> {
+    with_aev_iter(a, iter, |e, v| r.acc(e, v))
+}
+
+fn accumulate_single_val_unique_evs_both<I, C>(a: Entid, f: &mut C, r: &mut UniqueReverseAttributeCache, iter: &mut Peekable<I>) where I: Iterator<Item=Aev>, C: CardinalityOneCache {
+    with_aev_iter(a, iter, |e, v| {
+        f.set(e, v.clone());
+        r.set(e, v);
+    })
+}
+
+fn accumulate_multi_val_unique_evs_both<I, C>(a: Entid, f: &mut C, r: &mut UniqueReverseAttributeCache, iter: &mut Peekable<I>) where I: Iterator<Item=Aev>, C: CardinalityManyCache {
+    with_aev_iter(a, iter, |e, v| {
+        f.acc(e, v.clone());
+        r.set(e, v);
+    })
+}
+
+fn accumulate_single_val_non_unique_evs_both<I, C>(a: Entid, f: &mut C, r: &mut NonUniqueReverseAttributeCache, iter: &mut Peekable<I>) where I: Iterator<Item=Aev>, C: CardinalityOneCache {
+    with_aev_iter(a, iter, |e, v| {
+        f.set(e, v.clone());
+        r.acc(e, v);
+    })
+}
+
+fn accumulate_multi_val_non_unique_evs_both<I, C>(a: Entid, f: &mut C, r: &mut NonUniqueReverseAttributeCache, iter: &mut Peekable<I>) where I: Iterator<Item=Aev>, C: CardinalityManyCache {
+    with_aev_iter(a, iter, |e, v| {
+        f.acc(e, v.clone());
+        r.acc(e, v);
+    })
+}
+
+fn accumulate_removal_one<I, C>(a: Entid, c: &mut C, iter: &mut Peekable<I>) where I: Iterator<Item=Aev>, C: RemoveFromCache {
+    with_aev_iter(a, iter, |e, v| {
+        c.remove(e, &v);
+    })
+}
+
+fn accumulate_removal_both<I, F, R>(a: Entid, f: &mut F, r: &mut R, iter: &mut Peekable<I>)
+where I: Iterator<Item=Aev>, F: RemoveFromCache, R: RemoveFromCache {
+    with_aev_iter(a, iter, |e, v| {
+        f.remove(e, &v);
+        r.remove(e, &v);
+    })
+}
+
+
+//
+// Collect four different kinds of cache together, and track what we're storing.
+//
+
+#[derive(Copy, Clone, Eq, PartialEq)]
+enum AccumulationBehavior {
+    Add { replacing: bool },
+    Remove,
+}
+
+impl AccumulationBehavior {
+    fn is_replacing(&self) -> bool {
+        match self {
+            &AccumulationBehavior::Add { replacing } => replacing,
+            _ => false,
+        }
+    }
+}
+
+#[derive(Clone, Debug, Default)]
+pub struct AttributeCaches {
+    reverse_cached_attributes: BTreeSet<Entid>,
+    forward_cached_attributes: BTreeSet<Entid>,
+
+    single_vals: BTreeMap<Entid, SingleValAttributeCache>,
+    multi_vals: BTreeMap<Entid, MultiValAttributeCache>,
+    unique_reverse: BTreeMap<Entid, UniqueReverseAttributeCache>,
+    non_unique_reverse: BTreeMap<Entid, NonUniqueReverseAttributeCache>,
+}
+
+// TODO: if an entity or attribute is ever renumbered, the cache will need to be rebuilt.
+impl AttributeCaches {
+    //
+    // These function names are brief and local.
+    // f = forward; r = reverse; both = both forward and reverse.
+    // s = single-val; m = multi-val.
+    // u = unique; nu = non-unique.
+    // c = cache.
+    // Note that each of these optionally copies the entry from a fallback cache for copy-on-write.
+    #[inline]
+    fn fsc(&mut self, a: Entid, fallback: Option<&AttributeCaches>) -> &mut SingleValAttributeCache {
+        self.single_vals
+            .entry(a)
+            .or_insert_with(|| fallback.and_then(|c| c.single_vals.get(&a).cloned())
+                                       .unwrap_or_else(Default::default))
+    }
+
+    #[inline]
+    fn fmc(&mut self, a: Entid, fallback: Option<&AttributeCaches>) -> &mut MultiValAttributeCache {
+        self.multi_vals
+            .entry(a)
+            .or_insert_with(|| fallback.and_then(|c| c.multi_vals.get(&a).cloned())
+                                       .unwrap_or_else(Default::default))
+    }
+
+    #[inline]
+    fn ruc(&mut self, a: Entid, fallback: Option<&AttributeCaches>) -> &mut UniqueReverseAttributeCache {
+        self.unique_reverse
+            .entry(a)
+            .or_insert_with(|| fallback.and_then(|c| c.unique_reverse.get(&a).cloned())
+                                       .unwrap_or_else(Default::default))
+    }
+
+    #[inline]
+    fn rnuc(&mut self, a: Entid, fallback: Option<&AttributeCaches>) -> &mut NonUniqueReverseAttributeCache {
+        self.non_unique_reverse
+            .entry(a)
+            .or_insert_with(|| fallback.and_then(|c| c.non_unique_reverse.get(&a).cloned())
+                                       .unwrap_or_else(Default::default))
+    }
+
+    #[inline]
+    fn both_s_u<'r>(&'r mut self, a: Entid, forward_fallback: Option<&AttributeCaches>, reverse_fallback: Option<&AttributeCaches>) -> (&'r mut SingleValAttributeCache, &'r mut UniqueReverseAttributeCache) {
+        (self.single_vals
+             .entry(a)
+             .or_insert_with(|| forward_fallback.and_then(|c| c.single_vals.get(&a).cloned())
+                                                .unwrap_or_else(Default::default)),
+         self.unique_reverse
+             .entry(a)
+             .or_insert_with(|| reverse_fallback.and_then(|c| c.unique_reverse.get(&a).cloned())
+                                                .unwrap_or_else(Default::default)))
+    }
+
+    #[inline]
+    fn both_m_u<'r>(&'r mut self, a: Entid, forward_fallback: Option<&AttributeCaches>, reverse_fallback: Option<&AttributeCaches>) -> (&'r mut MultiValAttributeCache, &'r mut UniqueReverseAttributeCache) {
+        (self.multi_vals
+             .entry(a)
+             .or_insert_with(|| forward_fallback.and_then(|c| c.multi_vals.get(&a).cloned())
+                                                .unwrap_or_else(Default::default)),
+         self.unique_reverse
+             .entry(a)
+             .or_insert_with(|| reverse_fallback.and_then(|c| c.unique_reverse.get(&a).cloned())
+                                                .unwrap_or_else(Default::default)))
+    }
+
+    #[inline]
+    fn both_s_nu<'r>(&'r mut self, a: Entid, forward_fallback: Option<&AttributeCaches>, reverse_fallback: Option<&AttributeCaches>) -> (&'r mut SingleValAttributeCache, &'r mut NonUniqueReverseAttributeCache) {
+        (self.single_vals
+             .entry(a)
+             .or_insert_with(|| forward_fallback.and_then(|c| c.single_vals.get(&a).cloned())
+                                                .unwrap_or_else(Default::default)),
+         self.non_unique_reverse
+             .entry(a)
+            .or_insert_with(|| reverse_fallback.and_then(|c| c.non_unique_reverse.get(&a).cloned())
+                                               .unwrap_or_else(Default::default)))
+    }
+
+    #[inline]
+    fn both_m_nu<'r>(&'r mut self, a: Entid, forward_fallback: Option<&AttributeCaches>, reverse_fallback: Option<&AttributeCaches>) -> (&'r mut MultiValAttributeCache, &'r mut NonUniqueReverseAttributeCache) {
+        (self.multi_vals
+             .entry(a)
+             .or_insert_with(|| forward_fallback.and_then(|c| c.multi_vals.get(&a).cloned())
+                                                .unwrap_or_else(Default::default)),
+         self.non_unique_reverse
+             .entry(a)
+             .or_insert_with(|| reverse_fallback.and_then(|c| c.non_unique_reverse.get(&a).cloned())
+                                                .unwrap_or_else(Default::default)))
+    }
+
+    // Process rows in `iter` that all share an attribute with the first. Leaves the iterator
+    // advanced to the first non-matching row.
+    fn accumulate_evs<I>(&mut self,
+                         fallback: Option<&AttributeCaches>,
+                         schema: &Schema,
+                         iter: &mut Peekable<I>,
+                         behavior: AccumulationBehavior) where I: Iterator<Item=Aev> {
+        if let Some(&(a, _, _)) = iter.peek() {
+            if let Some(attribute) = schema.attribute_for_entid(a) {
+                let fallback_cached_forward = fallback.map_or(false, |c| c.is_attribute_cached_forward(a));
+                let fallback_cached_reverse = fallback.map_or(false, |c| c.is_attribute_cached_reverse(a));
+                let now_cached_forward = self.is_attribute_cached_forward(a);
+                let now_cached_reverse = self.is_attribute_cached_reverse(a);
+
+                let replace_a = behavior.is_replacing();
+                let copy_forward_if_missing = now_cached_forward && fallback_cached_forward && !replace_a;
+                let copy_reverse_if_missing = now_cached_reverse && fallback_cached_reverse && !replace_a;
+
+                let forward_fallback = if copy_forward_if_missing {
+                    fallback
+                } else {
+                    None
+                };
+                let reverse_fallback = if copy_reverse_if_missing {
+                    fallback
+                } else {
+                    None
+                };
+
+                let multi = attribute.multival;
+                let unique = attribute.unique.is_some();
+                match (now_cached_forward, now_cached_reverse, multi, unique) {
+                    (true, true, true, true) => {
+                        let (f, r) = self.both_m_u(a, forward_fallback, reverse_fallback);
+                        match behavior {
+                            AccumulationBehavior::Add { replacing } => {
+                                if replacing {
+                                    f.clear();
+                                    r.clear();
+                                }
+                                accumulate_multi_val_unique_evs_both(a, f, r, iter);
+                            },
+                            AccumulationBehavior::Remove => accumulate_removal_both(a, f, r, iter),
+                        }
+                    },
+                    (true, true, true, false) => {
+                        let (f, r) = self.both_m_nu(a, forward_fallback, reverse_fallback);
+                        match behavior {
+                            AccumulationBehavior::Add { replacing } => {
+                                if replacing {
+                                    f.clear();
+                                    r.clear();
+                                }
+                                accumulate_multi_val_non_unique_evs_both(a, f, r, iter);
+                            },
+                            AccumulationBehavior::Remove => accumulate_removal_both(a, f, r, iter),
+                        }
+                    },
+                    (true, true, false, true) => {
+                        let (f, r) = self.both_s_u(a, forward_fallback, reverse_fallback);
+                        match behavior {
+                            AccumulationBehavior::Add { replacing } => {
+                                if replacing {
+                                    f.clear();
+                                    r.clear();
+                                }
+                                accumulate_single_val_unique_evs_both(a, f, r, iter);
+                            },
+                            AccumulationBehavior::Remove => accumulate_removal_both(a, f, r, iter),
+                        }
+                    },
+                    (true, true, false, false) => {
+                        let (f, r) = self.both_s_nu(a, forward_fallback, reverse_fallback);
+                        match behavior {
+                            AccumulationBehavior::Add { replacing } => {
+                                if replacing {
+                                    f.clear();
+                                    r.clear();
+                                }
+                                accumulate_single_val_non_unique_evs_both(a, f, r, iter);
+                            },
+                            AccumulationBehavior::Remove => accumulate_removal_both(a, f, r, iter),
+                        }
+                    },
+                    (true, false, true, _) => {
+                        let f = self.fmc(a, forward_fallback);
+                        match behavior {
+                            AccumulationBehavior::Add { replacing } => {
+                                if replacing {
+                                    f.clear();
+                                }
+                                accumulate_multi_val_evs_forward(a, f, iter);
+                            },
+                            AccumulationBehavior::Remove => accumulate_removal_one(a, f, iter),
+                        }
+                    },
+                    (true, false, false, _) => {
+                        let f = self.fsc(a, forward_fallback);
+                        match behavior {
+                            AccumulationBehavior::Add { replacing } => {
+                                if replacing {
+                                    f.clear();
+                                }
+                                accumulate_single_val_evs_forward(a, f, iter)
+                            },
+                            AccumulationBehavior::Remove => accumulate_removal_one(a, f, iter),
+                        }
+                    },
+                    (false, true, _, true) => {
+                        let r = self.ruc(a, reverse_fallback);
+                        match behavior {
+                            AccumulationBehavior::Add { replacing } => {
+                                if replacing {
+                                    r.clear();
+                                }
+                                accumulate_unique_evs_reverse(a, r, iter);
+                            },
+                            AccumulationBehavior::Remove => accumulate_removal_one(a, r, iter),
+                        }
+                    },
+                    (false, true, _, false) => {
+                        let r = self.rnuc(a, reverse_fallback);
+                        match behavior {
+                            AccumulationBehavior::Add { replacing } => {
+                                if replacing {
+                                    r.clear();
+                                }
+                                accumulate_non_unique_evs_reverse(a, r, iter);
+                            },
+                            AccumulationBehavior::Remove => accumulate_removal_one(a, r, iter),
+                        }
+                    },
+                    (false, false, _, _) => {
+                        unreachable!();           // Must be cached in at least one direction!
+                    },
+                }
+            }
+        }
+    }
+
+    fn accumulate_into_cache<I>(&mut self, fallback: Option<&AttributeCaches>, schema: &Schema, mut iter: Peekable<I>, behavior: AccumulationBehavior) -> Result<()> where I: Iterator<Item=Aev> {
+        while iter.peek().is_some() {
+            self.accumulate_evs(fallback, schema, &mut iter, behavior);
+        }
+        Ok(())
+    }
+
+    fn clear_cache(&mut self) {
+        self.single_vals.clear();
+        self.multi_vals.clear();
+        self.unique_reverse.clear();
+        self.non_unique_reverse.clear();
+    }
+
+    fn unregister_all_attributes(&mut self) {
+        self.reverse_cached_attributes.clear();
+        self.forward_cached_attributes.clear();
+        self.clear_cache();
+    }
+
+    pub fn unregister_attribute<U>(&mut self, attribute: U)
+    where U: Into<Entid> {
+        let a = attribute.into();
+        self.reverse_cached_attributes.remove(&a);
+        self.forward_cached_attributes.remove(&a);
+        self.single_vals.remove(&a);
+        self.multi_vals.remove(&a);
+        self.unique_reverse.remove(&a);
+        self.non_unique_reverse.remove(&a);
+    }
+}
+
+// We need this block for fallback.
+impl AttributeCaches {
+    fn get_entid_for_value_if_present(&self, attribute: Entid, value: &TypedValue) -> Option<Option<Entid>> {
+        if self.is_attribute_cached_reverse(attribute) {
+            self.unique_reverse
+                .get(&attribute)
+                .and_then(|c| c.lookup(value))
+        } else {
+            None
+        }
+    }
+
+    fn get_value_for_entid_if_present(&self, schema: &Schema, attribute: Entid, entid: Entid) -> Option<Option<&TypedValue>> {
+        if let Some(&Some(ref tv)) = self.value_pairs(schema, attribute)
+                                         .and_then(|c| c.get(&entid)) {
+            Some(Some(tv))
+        } else {
+            None
+        }
+    }
+}
+
+/// SQL stuff.
+impl AttributeCaches {
+    fn repopulate(&mut self,
+                  schema: &Schema,
+                  sqlite: &rusqlite::Connection,
+                  attribute: Entid) -> Result<()> {
+        let is_fulltext = schema.attribute_for_entid(attribute).map_or(false, |s| s.fulltext);
+        let table = if is_fulltext { "fulltext_datoms" } else { "datoms" };
+        let sql = format!("SELECT a, e, v, value_type_tag FROM {} WHERE a = ? ORDER BY a ASC, e ASC", table);
+        let args: Vec<&rusqlite::types::ToSql> = vec![&attribute];
+        let mut stmt = sqlite.prepare(&sql)?;
+        let replacing = true;
+        self.repopulate_from_aevt(schema, &mut stmt, args, replacing)
+    }
+
+    fn repopulate_from_aevt<'a, 's, 'c, 'v>(&'a mut self,
+                                            schema: &'s Schema,
+                                            statement: &'c mut rusqlite::Statement,
+                                            args: Vec<&'v rusqlite::types::ToSql>,
+                                            replacing: bool) -> Result<()> {
+        let mut aev_factory = AevFactory::new();
+        let rows = statement.query_map(&args, |row| aev_factory.row_to_aev(row))?;
+        let aevs = AevRows {
+            rows: rows,
+        };
+        self.accumulate_into_cache(None, schema, aevs.peekable(), AccumulationBehavior::Add { replacing })?;
+        Ok(())
+    }
+}
+
+#[derive(Clone)]
+pub enum AttributeSpec {
+    All,
+    Specified {
+        // These are assumed to not include duplicates.
+        fts: Vec<Entid>,
+        non_fts: Vec<Entid>,
+    },
+}
+
+impl AttributeSpec {
+    pub fn all() -> AttributeSpec {
+        AttributeSpec::All
+    }
+
+    pub fn specified(attrs: &BTreeSet<Entid>, schema: &Schema) -> AttributeSpec {
+        let mut fts = Vec::with_capacity(attrs.len());
+        let mut non_fts = Vec::with_capacity(attrs.len());
+        for attr in attrs.iter() {
+            if let Some(a) = schema.attribute_for_entid(*attr) {
+                if a.fulltext {
+                    fts.push(*attr);
+                } else {
+                    non_fts.push(*attr);
+                }
+            }
+        }
+
+        AttributeSpec::Specified { fts, non_fts }
+    }
+}
+
+impl AttributeCaches {
+    /// Fetch the requested entities and attributes from the store and put them in the cache.
+    ///
+    /// The caller is responsible for ensuring that `entities` is unique, and for avoiding any
+    /// redundant work.
+    ///
+    /// Each provided attribute will be marked as forward-cached; the caller is responsible for
+    /// ensuring that this cache is complete or that it is not expected to be complete.
+    fn populate_cache_for_entities_and_attributes<'s, 'c>(&mut self,
+                                                          schema: &'s Schema,
+                                                          sqlite: &'c rusqlite::Connection,
+                                                          attrs: AttributeSpec,
+                                                          entities: &Vec<Entid>) -> Result<()> {
+
+        // Mark the attributes as cached as we go. We do this because we're going in through the
+        // back door here, and the usual caching API won't have taken care of this for us.
+        let mut qb = SQLiteQueryBuilder::new();
+        qb.push_sql("SELECT a, e, v, value_type_tag FROM ");
+        match attrs {
+            AttributeSpec::All => {
+                qb.push_sql("all_datoms WHERE e IN (");
+                interpose!(item, entities,
+                           { qb.push_sql(&item.to_string()) },
+                           { qb.push_sql(", ") });
+                qb.push_sql(") ORDER BY a ASC, e ASC");
+
+                self.forward_cached_attributes.extend(schema.attribute_map.keys());
+            },
+            AttributeSpec::Specified { fts, non_fts } => {
+                let has_fts = !fts.is_empty();
+                let has_non_fts = !non_fts.is_empty();
+
+                if !has_fts && !has_non_fts {
+                    // Nothing to do.
+                    return Ok(());
+                }
+
+                if has_non_fts {
+                    qb.push_sql("datoms WHERE e IN (");
+                    interpose!(item, entities,
+                               { qb.push_sql(&item.to_string()) },
+                               { qb.push_sql(", ") });
+                    qb.push_sql(") AND a IN (");
+                    interpose!(item, non_fts,
+                               { qb.push_sql(&item.to_string()) },
+                               { qb.push_sql(", ") });
+                    qb.push_sql(")");
+
+                    self.forward_cached_attributes.extend(non_fts.iter());
+                }
+
+                if has_fts && has_non_fts {
+                    // Both.
+                    qb.push_sql(" UNION ALL SELECT a, e, v, value_type_tag FROM ");
+                }
+
+                if has_fts {
+                    qb.push_sql("fulltext_datoms WHERE e IN (");
+                    interpose!(item, entities,
+                               { qb.push_sql(&item.to_string()) },
+                               { qb.push_sql(", ") });
+                    qb.push_sql(") AND a IN (");
+                    interpose!(item, fts,
+                               { qb.push_sql(&item.to_string()) },
+                               { qb.push_sql(", ") });
+                    qb.push_sql(")");
+
+                    self.forward_cached_attributes.extend(fts.iter());
+                }
+                qb.push_sql(" ORDER BY a ASC, e ASC");
+            },
+        };
+
+        let SQLQuery { sql, args } = qb.finish();
+        assert!(args.is_empty());                       // TODO: we know there are never args, but we'd like to run this query 'properly'.
+        let mut stmt = sqlite.prepare(sql.as_str())?;
+        let replacing = false;
+        self.repopulate_from_aevt(schema, &mut stmt, vec![], replacing)
+    }
+
+    /// Return a reference to the cache for the provided `a`, if `a` names an attribute that is
+    /// cached in the forward direction. If `a` doesn't name an attribute, or it's not cached at
+    /// all, or it's only cached in reverse (`v` to `e`, not `e` to `v`), `None` is returned.
+    pub fn forward_attribute_cache_for_attribute<'a, 's>(&'a self, schema: &'s Schema, a: Entid) -> Option<&'a AttributeCache> {
+        if !self.forward_cached_attributes.contains(&a) {
+            return None;
+        }
+        schema.attribute_for_entid(a)
+              .and_then(|attr|
+                if attr.multival {
+                    self.multi_vals.get(&a).map(|v| v as &AttributeCache)
+                } else {
+                    self.single_vals.get(&a).map(|v| v as &AttributeCache)
+                })
+    }
+
+    /// Fetch the requested entities and attributes from the store and put them in the cache.
+    /// The caller is responsible for ensuring that `entities` is unique.
+    /// Attributes for which every entity is already cached will not be processed again.
+    pub fn extend_cache_for_entities_and_attributes<'s, 'c>(&mut self,
+                                                            schema: &'s Schema,
+                                                            sqlite: &'c rusqlite::Connection,
+                                                            mut attrs: AttributeSpec,
+                                                            entities: &Vec<Entid>) -> Result<()> {
+        // TODO: Exclude any entities for which every attribute is known.
+        // TODO: initialize from an existing (complete) AttributeCache.
+
+        // Exclude any attributes for which every entity's value is already known.
+        match &mut attrs {
+            &mut AttributeSpec::All => {
+                // If we're caching all attributes, there's nothing we can exclude.
+            },
+            &mut AttributeSpec::Specified { ref mut non_fts, ref mut fts } => {
+                // Remove any attributes for which all entities are present in the cache (even
+                // as a 'miss').
+                let exclude_missing = |vec: &mut Vec<Entid>| {
+                    vec.retain(|a| {
+                        if let Some(attr) = schema.attribute_for_entid(*a) {
+                            if !self.forward_cached_attributes.contains(a) {
+                                // The attribute isn't cached at all. Do the work for all entities.
+                                return true;
+                            }
+
+                            // Return true if there are any entities missing for this attribute.
+                            if attr.multival {
+                                self.multi_vals
+                                    .get(&a)
+                                    .map(|cache| entities.iter().any(|e| !cache.has_e(*e)))
+                                    .unwrap_or(true)
+                            } else {
+                                self.single_vals
+                                    .get(&a)
+                                    .map(|cache| entities.iter().any(|e| !cache.has_e(*e)))
+                                    .unwrap_or(true)
+                            }
+                        } else {
+                            // Unknown attribute.
+                            false
+                        }
+                    });
+                };
+                exclude_missing(non_fts);
+                exclude_missing(fts);
+            },
+        }
+
+        self.populate_cache_for_entities_and_attributes(schema, sqlite, attrs, entities)
+    }
+
+    /// Fetch the requested entities and attributes and put them in a new cache.
+    /// The caller is responsible for ensuring that `entities` is unique.
+    pub fn make_cache_for_entities_and_attributes<'s, 'c>(schema: &'s Schema,
+                                                          sqlite: &'c rusqlite::Connection,
+                                                          attrs: AttributeSpec,
+                                                          entities: &Vec<Entid>) -> Result<AttributeCaches> {
+        let mut cache = AttributeCaches::default();
+        cache.populate_cache_for_entities_and_attributes(schema, sqlite, attrs, entities)?;
+        Ok(cache)
+    }
+}
+
+
+impl CachedAttributes for AttributeCaches {
+    fn get_values_for_entid(&self, schema: &Schema, attribute: Entid, entid: Entid) -> Option<&Vec<TypedValue>> {
+        self.values_pairs(schema, attribute)
+            .and_then(|c| c.get(&entid))
+    }
+
+    fn get_value_for_entid(&self, schema: &Schema, attribute: Entid, entid: Entid) -> Option<&TypedValue> {
+        if let Some(&Some(ref tv)) = self.value_pairs(schema, attribute)
+                                         .and_then(|c| c.get(&entid)) {
+            Some(tv)
+        } else {
+            None
+        }
+    }
+
+    fn has_cached_attributes(&self) -> bool {
+        !self.reverse_cached_attributes.is_empty() ||
+        !self.forward_cached_attributes.is_empty()
+    }
+
+    fn is_attribute_cached_reverse(&self, attribute: Entid) -> bool {
+        self.reverse_cached_attributes.contains(&attribute)
+    }
+
+    fn is_attribute_cached_forward(&self, attribute: Entid) -> bool {
+        self.forward_cached_attributes.contains(&attribute)
+    }
+
+    fn get_entid_for_value(&self, attribute: Entid, value: &TypedValue) -> Option<Entid> {
+        if self.is_attribute_cached_reverse(attribute) {
+            self.unique_reverse.get(&attribute).and_then(|c| c.get_e(value))
+        } else {
+            None
+        }
+    }
+
+    fn get_entids_for_value(&self, attribute: Entid, value: &TypedValue) -> Option<&BTreeSet<Entid>> {
+        if self.is_attribute_cached_reverse(attribute) {
+            self.non_unique_reverse.get(&attribute).and_then(|c| c.get_es(value))
+        } else {
+            None
+        }
+    }
+}
+
+impl UpdateableCache for AttributeCaches {
+    fn update<I>(&mut self, schema: &Schema, retractions: I, assertions: I) -> Result<()>
+    where I: Iterator<Item=(Entid, Entid, TypedValue)> {
+        self.update_with_fallback(None, schema, retractions, assertions)
+    }
+}
+
+impl AttributeCaches {
+    fn update_with_fallback<I>(&mut self, fallback: Option<&AttributeCaches>, schema: &Schema, retractions: I, assertions: I) -> Result<()>
+    where I: Iterator<Item=(Entid, Entid, TypedValue)> {
+        let r_aevs = retractions.peekable();
+        self.accumulate_into_cache(fallback, schema, r_aevs, AccumulationBehavior::Remove)?;
+
+        let aevs = assertions.peekable();
+        self.accumulate_into_cache(fallback, schema, aevs, AccumulationBehavior::Add { replacing: false })
+    }
+
+    fn values_pairs<U>(&self, schema: &Schema, attribute: U) -> Option<&BTreeMap<Entid, Vec<TypedValue>>>
+    where U: Into<Entid> {
+        let attribute = attribute.into();
+        schema.attribute_for_entid(attribute)
+              .and_then(|attr|
+                if attr.multival {
+                    self.multi_vals
+                        .get(&attribute)
+                        .map(|c| &c.e_vs)
+                } else {
+                    None
+                })
+    }
+
+    fn value_pairs<U>(&self, schema: &Schema, attribute: U) -> Option<&CacheMap<Entid, Option<TypedValue>>>
+    where U: Into<Entid> {
+        let attribute = attribute.into();
+        schema.attribute_for_entid(attribute)
+              .and_then(|attr|
+                if attr.multival {
+                    None
+                } else {
+                    self.single_vals
+                        .get(&attribute)
+                        .map(|c| &c.e_v)
+                })
+    }
+}
+
+impl Absorb for AttributeCaches {
+    // Replace or insert attribute-cache pairs from `other` into `self`.
+    // Fold in any in-place deletions.
+    fn absorb(&mut self, other: Self) {
+        self.forward_cached_attributes.extend(other.forward_cached_attributes);
+        self.reverse_cached_attributes.extend(other.reverse_cached_attributes);
+
+        self.single_vals.extend_by_absorbing(other.single_vals);
+        self.multi_vals.extend_by_absorbing(other.multi_vals);
+        self.unique_reverse.extend_by_absorbing(other.unique_reverse);
+        self.non_unique_reverse.extend_by_absorbing(other.non_unique_reverse);
+    }
+}
+
+#[derive(Clone, Debug, Default)]
+pub struct SQLiteAttributeCache {
+    inner: Arc<AttributeCaches>,
+}
+
+impl SQLiteAttributeCache {
+    fn make_mut<'s>(&'s mut self) -> &'s mut AttributeCaches {
+        Arc::make_mut(&mut self.inner)
+    }
+
+    fn make_override(&self) -> AttributeCaches {
+        let mut new = AttributeCaches::default();
+        new.forward_cached_attributes = self.inner.forward_cached_attributes.clone();
+        new.reverse_cached_attributes = self.inner.reverse_cached_attributes.clone();
+        new
+    }
+
+    pub fn register_forward<U>(&mut self, schema: &Schema, sqlite: &rusqlite::Connection, attribute: U) -> Result<()>
+    where U: Into<Entid> {
+        let a = attribute.into();
+
+        // The attribute must exist!
+        let _ = schema.attribute_for_entid(a).ok_or_else(|| DbError::UnknownAttribute(a))?;
+        let caches = self.make_mut();
+        caches.forward_cached_attributes.insert(a);
+        caches.repopulate(schema, sqlite, a)
+    }
+
+    pub fn register_reverse<U>(&mut self, schema: &Schema, sqlite: &rusqlite::Connection, attribute: U) -> Result<()>
+    where U: Into<Entid> {
+        let a = attribute.into();
+
+        // The attribute must exist!
+        let _ = schema.attribute_for_entid(a).ok_or_else(|| DbError::UnknownAttribute(a))?;
+
+        let caches = self.make_mut();
+        caches.reverse_cached_attributes.insert(a);
+        caches.repopulate(schema, sqlite, a)
+    }
+
+    pub fn register<U>(&mut self, schema: &Schema, sqlite: &rusqlite::Connection, attribute: U) -> Result<()>
+    where U: Into<Entid> {
+        let a = attribute.into();
+
+        // TODO: reverse-index unique by default?
+
+        let caches = self.make_mut();
+        caches.forward_cached_attributes.insert(a);
+        caches.reverse_cached_attributes.insert(a);
+        caches.repopulate(schema, sqlite, a)
+    }
+
+    pub fn unregister<U>(&mut self, attribute: U)
+    where U: Into<Entid> {
+        self.make_mut().unregister_attribute(attribute);
+    }
+
+    pub fn unregister_all(&mut self) {
+        self.make_mut().unregister_all_attributes();
+    }
+}
+
+impl UpdateableCache for SQLiteAttributeCache {
+    fn update<I>(&mut self, schema: &Schema, retractions: I, assertions: I) -> Result<()>
+    where I: Iterator<Item=(Entid, Entid, TypedValue)> {
+        self.make_mut().update(schema, retractions, assertions)
+    }
+}
+
+impl CachedAttributes for SQLiteAttributeCache {
+    fn get_values_for_entid(&self, schema: &Schema, attribute: Entid, entid: Entid) -> Option<&Vec<TypedValue>> {
+        self.inner.get_values_for_entid(schema, attribute, entid)
+    }
+
+    fn get_value_for_entid(&self, schema: &Schema, attribute: Entid, entid: Entid) -> Option<&TypedValue> {
+        self.inner.get_value_for_entid(schema, attribute, entid)
+    }
+
+    fn is_attribute_cached_reverse(&self, attribute: Entid) -> bool {
+        self.inner.is_attribute_cached_reverse(attribute)
+    }
+
+    fn is_attribute_cached_forward(&self, attribute: Entid) -> bool {
+        self.inner.is_attribute_cached_forward(attribute)
+    }
+
+    fn has_cached_attributes(&self) -> bool {
+        !self.inner.forward_cached_attributes.is_empty() ||
+        !self.inner.reverse_cached_attributes.is_empty()
+    }
+
+    fn get_entids_for_value(&self, attribute: Entid, value: &TypedValue) -> Option<&BTreeSet<Entid>> {
+        self.inner.get_entids_for_value(attribute, value)
+    }
+
+    fn get_entid_for_value(&self, attribute: Entid, value: &TypedValue) -> Option<Entid> {
+        self.inner.get_entid_for_value(attribute, value)
+    }
+}
+
+impl SQLiteAttributeCache {
+    /// Intended for use from tests.
+    pub fn values_pairs<U>(&self, schema: &Schema, attribute: U) -> Option<&BTreeMap<Entid, Vec<TypedValue>>>
+    where U: Into<Entid> {
+        self.inner.values_pairs(schema, attribute)
+    }
+
+    /// Intended for use from tests.
+    pub fn value_pairs<U>(&self, schema: &Schema, attribute: U) -> Option<&BTreeMap<Entid, Option<TypedValue>>>
+    where U: Into<Entid> {
+        self.inner.value_pairs(schema, attribute)
+    }
+}
+
+/// We maintain a diff on top of the `inner` -- existing -- cache.
+/// That involves tracking unregisterings and registerings.
+#[derive(Debug, Default)]
+pub struct InProgressSQLiteAttributeCache {
+    inner: Arc<AttributeCaches>,
+    pub overlay: AttributeCaches,
+    unregistered_forward: BTreeSet<Entid>,
+    unregistered_reverse: BTreeSet<Entid>,
+}
+
+impl InProgressSQLiteAttributeCache {
+    pub fn from_cache(inner: SQLiteAttributeCache) -> InProgressSQLiteAttributeCache {
+        let overlay = inner.make_override();
+        InProgressSQLiteAttributeCache {
+            inner: inner.inner,
+            overlay: overlay,
+            unregistered_forward: Default::default(),
+            unregistered_reverse: Default::default(),
+        }
+    }
+
+    pub fn register_forward<U>(&mut self, schema: &Schema, sqlite: &rusqlite::Connection, attribute: U) -> Result<()>
+    where U: Into<Entid> {
+        let a = attribute.into();
+
+        // The attribute must exist!
+        let _ = schema.attribute_for_entid(a).ok_or_else(|| DbError::UnknownAttribute(a))?;
+
+        if self.is_attribute_cached_forward(a) {
+            return Ok(());
+        }
+
+        self.unregistered_forward.remove(&a);
+        self.overlay.forward_cached_attributes.insert(a);
+        self.overlay.repopulate(schema, sqlite, a)
+    }
+
+    pub fn register_reverse<U>(&mut self, schema: &Schema, sqlite: &rusqlite::Connection, attribute: U) -> Result<()>
+    where U: Into<Entid> {
+        let a = attribute.into();
+
+        // The attribute must exist!
+        let _ = schema.attribute_for_entid(a).ok_or_else(|| DbError::UnknownAttribute(a))?;
+
+        if self.is_attribute_cached_reverse(a) {
+            return Ok(());
+        }
+
+        self.unregistered_reverse.remove(&a);
+        self.overlay.reverse_cached_attributes.insert(a);
+        self.overlay.repopulate(schema, sqlite, a)
+    }
+
+    pub fn register<U>(&mut self, schema: &Schema, sqlite: &rusqlite::Connection, attribute: U) -> Result<()>
+    where U: Into<Entid> {
+        let a = attribute.into();
+
+        // The attribute must exist!
+        let _ = schema.attribute_for_entid(a).ok_or_else(|| DbError::UnknownAttribute(a))?;
+
+        // TODO: reverse-index unique by default?
+        let reverse_done = self.is_attribute_cached_reverse(a);
+        let forward_done = self.is_attribute_cached_forward(a);
+
+        if forward_done && reverse_done {
+            return Ok(());
+        }
+
+        self.unregistered_forward.remove(&a);
+        self.unregistered_reverse.remove(&a);
+        if !reverse_done {
+            self.overlay.reverse_cached_attributes.insert(a);
+        }
+        if !forward_done {
+            self.overlay.forward_cached_attributes.insert(a);
+        }
+
+        self.overlay.repopulate(schema, sqlite, a)
+    }
+
+
+    pub fn unregister<U>(&mut self, attribute: U)
+    where U: Into<Entid> {
+        let a = attribute.into();
+        self.overlay.unregister_attribute(a);
+        self.unregistered_forward.insert(a);
+        self.unregistered_reverse.insert(a);
+    }
+
+    pub fn unregister_all(&mut self) {
+        self.overlay.unregister_all_attributes();
+        self.unregistered_forward.extend(self.inner.forward_cached_attributes.iter().cloned());
+        self.unregistered_reverse.extend(self.inner.reverse_cached_attributes.iter().cloned());
+    }
+}
+
+impl UpdateableCache for InProgressSQLiteAttributeCache {
+    fn update<I>(&mut self, schema: &Schema, retractions: I, assertions: I) -> Result<()>
+    where I: Iterator<Item=(Entid, Entid, TypedValue)> {
+        self.overlay.update_with_fallback(Some(&self.inner), schema, retractions, assertions)
+    }
+}
+
+impl CachedAttributes for InProgressSQLiteAttributeCache {
+    fn get_values_for_entid(&self, schema: &Schema, attribute: Entid, entid: Entid) -> Option<&Vec<TypedValue>> {
+        if self.unregistered_forward.contains(&attribute) {
+            None
+        } else {
+            // If it was present in `inner` but the values were deleted, there will be an empty
+            // array in `overlay` -- `Some(vec![])` -- and we won't fall through.
+            // We can safely use `or_else`.
+            self.overlay
+                .get_values_for_entid(schema, attribute, entid)
+                .or_else(|| self.inner.get_values_for_entid(schema, attribute, entid))
+        }
+    }
+
+    fn get_value_for_entid(&self, schema: &Schema, attribute: Entid, entid: Entid) -> Option<&TypedValue> {
+        if self.unregistered_forward.contains(&attribute) {
+            None
+        } else {
+            // If it was present in `inner` but the value was deleted, there will be `Some(None)`
+            // in `overlay`, and we won't fall through.
+            // We can safely use `or_else`.
+            match self.overlay.get_value_for_entid_if_present(schema, attribute, entid) {
+                Some(present) => present,
+                None => self.inner.get_value_for_entid(schema, attribute, entid),
+            }
+        }
+    }
+
+    fn is_attribute_cached_reverse(&self, attribute: Entid) -> bool {
+        !self.unregistered_reverse.contains(&attribute) &&
+        (self.inner.reverse_cached_attributes.contains(&attribute) ||
+         self.overlay.reverse_cached_attributes.contains(&attribute))
+    }
+
+    fn is_attribute_cached_forward(&self, attribute: Entid) -> bool {
+        !self.unregistered_forward.contains(&attribute) &&
+        (self.inner.forward_cached_attributes.contains(&attribute) ||
+         self.overlay.forward_cached_attributes.contains(&attribute))
+    }
+
+    fn has_cached_attributes(&self) -> bool {
+        // If we've added any, we're definitely not empty.
+        if self.overlay.has_cached_attributes() {
+            return true;
+        }
+
+        // If we haven't removed any, pass through to inner.
+        if self.unregistered_forward.is_empty() &&
+           self.unregistered_reverse.is_empty() {
+            return self.inner.has_cached_attributes();
+        }
+
+        // Otherwise, we need to check whether we've removed anything that was cached.
+        if self.inner
+               .forward_cached_attributes
+               .iter()
+               .filter(|a| !self.unregistered_forward.contains(a))
+               .next()
+               .is_some() {
+            return true;
+        }
+
+        self.inner
+            .reverse_cached_attributes
+            .iter()
+            .filter(|a| !self.unregistered_reverse.contains(a))
+            .next()
+            .is_some()
+    }
+
+    fn get_entids_for_value(&self, attribute: Entid, value: &TypedValue) -> Option<&BTreeSet<Entid>> {
+        if self.unregistered_reverse.contains(&attribute) {
+            None
+        } else {
+            self.overlay
+                .get_entids_for_value(attribute, value)
+                .or_else(|| self.inner.get_entids_for_value(attribute, value))
+        }
+    }
+
+    fn get_entid_for_value(&self, attribute: Entid, value: &TypedValue) -> Option<Entid> {
+        if self.unregistered_reverse.contains(&attribute) {
+            None
+        } else {
+            // If it was present in `inner` but the value was deleted, there will be `Some(None)`
+            // in `overlay`, and we won't fall through.
+            // We can safely use `or_else`.
+            match self.overlay.get_entid_for_value_if_present(attribute, value) {
+                Some(present) => present,
+                None => self.inner.get_entid_for_value(attribute, value),
+            }
+        }
+    }
+}
+
+impl InProgressSQLiteAttributeCache {
+    /// Intended for use from tests.
+    pub fn values_pairs<U>(&self, schema: &Schema, attribute: U) -> Option<&BTreeMap<Entid, Vec<TypedValue>>>
+    where U: Into<Entid> {
+        let a = attribute.into();
+        self.overlay.values_pairs(schema, a)
+                    .or_else(|| self.inner.values_pairs(schema, a))
+    }
+
+    /// Intended for use from tests.
+    pub fn value_pairs<U>(&self, schema: &Schema, attribute: U) -> Option<&BTreeMap<Entid, Option<TypedValue>>>
+    where U: Into<Entid> {
+        let a = attribute.into();
+        self.overlay
+            .value_pairs(schema, a)
+            .or_else(|| self.inner.value_pairs(schema, a))
+    }
+
+    pub fn commit_to(self, destination: &mut SQLiteAttributeCache) {
+        // If the destination is empty, great: just take `overlay`.
+        if !destination.has_cached_attributes() {
+            destination.inner = Arc::new(self.overlay);
+            return;
+        }
+
+        // If we have exclusive write access to the destination cache, update it in place.
+        // Because the `Conn` also contains an `Arc`, this will ordinarily never be the case.
+        // In order to hit this code block, we need to eliminate our reference… do so by dropping
+        // our copy of the `Arc`.
+        ::std::mem::drop(self.inner);
+        if let Some(dest) = Arc::get_mut(&mut destination.inner) {
+            // Yeah, we unregister in both directions. The only way
+            // `unregistered_forward` won't be the same as `unregistered_reverse` is if
+            // our `overlay` added one direction back in.
+            for unregistered in self.unregistered_forward.union(&self.unregistered_reverse) {
+                dest.unregister_attribute(*unregistered);
+            }
+
+            // Now replace each attribute's entry with `overlay`.
+            dest.absorb(self.overlay);
+            return;
+        }
+
+        // If we don't, populate `self.overlay` with whatever we didn't overwrite,
+        // and then shim it into `destination.`
+        // We haven't implemented this because it does not currently occur.
+        // TODO: do this! Then do this:
+        // destination.inner = Arc::new(self.overlay);
+        unimplemented!();
+    }
+}
+
+pub struct InProgressCacheTransactWatcher<'a> {
+    // A transaction might involve attributes that we cache. Track those values here so that
+    // we can update the cache after we commit the transaction.
+    collected_assertions: BTreeMap<Entid, Either<(), Vec<(Entid, TypedValue)>>>,
+    collected_retractions: BTreeMap<Entid, Either<(), Vec<(Entid, TypedValue)>>>,
+    cache: &'a mut InProgressSQLiteAttributeCache,
+    active: bool,
+}
+
+impl<'a> InProgressCacheTransactWatcher<'a> {
+    fn new(cache: &'a mut InProgressSQLiteAttributeCache) -> InProgressCacheTransactWatcher<'a> {
+        let mut w = InProgressCacheTransactWatcher {
+            collected_assertions: Default::default(),
+            collected_retractions: Default::default(),
+            cache: cache,
+            active: true,
+        };
+
+        // This won't change during a transact.
+        w.active = w.cache.has_cached_attributes();
+        w
+    }
+}
+
+impl<'a> TransactWatcher for InProgressCacheTransactWatcher<'a> {
+    fn datom(&mut self, op: OpType, e: Entid, a: Entid, v: &TypedValue) {
+        if !self.active {
+            return;
+        }
+
+        let target = if op == OpType::Add {
+            &mut self.collected_assertions
+        } else {
+            &mut self.collected_retractions
+        };
+        match target.entry(a) {
+            Entry::Vacant(entry) => {
+                let is_cached = self.cache.is_attribute_cached_forward(a) ||
+                                self.cache.is_attribute_cached_reverse(a);
+                if is_cached {
+                    entry.insert(Either::Right(vec![(e, v.clone())]));
+                } else {
+                    entry.insert(Either::Left(()));
+                }
+            },
+            Entry::Occupied(mut entry) => {
+                match entry.get_mut() {
+                    &mut Either::Left(_) => {
+                        // Nothing to do.
+                    },
+                    &mut Either::Right(ref mut vec) => {
+                        vec.push((e, v.clone()));
+                    },
+                }
+            },
+        }
+    }
+
+    fn done(&mut self, _t: &Entid, schema: &Schema) -> Result<()> {
+        // Oh, I wish we had impl trait. Without it we have a six-line type signature if we
+        // try to break this out as a helper function.
+        let collected_retractions = mem::replace(&mut self.collected_retractions, Default::default());
+        let collected_assertions = mem::replace(&mut self.collected_assertions, Default::default());
+        let mut intermediate_expansion =
+            once(collected_retractions)
+                .chain(once(collected_assertions))
+                .into_iter()
+                .map(move |tree| tree.into_iter()
+                                     .filter_map(move |(a, evs)| {
+                                        match evs {
+                                            // Drop the empty placeholders.
+                                            Either::Left(_) => None,
+                                            Either::Right(vec) => Some((a, vec)),
+                                        }
+                                     })
+                                     .flat_map(move |(a, evs)| {
+                                        // Flatten into a vec of (a, e, v).
+                                        evs.into_iter().map(move |(e, v)| (a, e, v))
+                                     }));
+        let retractions = intermediate_expansion.next().unwrap();
+        let assertions = intermediate_expansion.next().unwrap();
+        self.cache.update(schema, retractions, assertions)
+    }
+}
+
+impl InProgressSQLiteAttributeCache {
+    pub fn transact_watcher<'a>(&'a mut self) -> InProgressCacheTransactWatcher<'a> {
+        InProgressCacheTransactWatcher::new(self)
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/db.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/db.rs.html new file mode 100644 index 00000000..8be4db85 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/db.rs.html @@ -0,0 +1,5680 @@ + + + + + + + + + + db.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+1996
+1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
+2059
+2060
+2061
+2062
+2063
+2064
+2065
+2066
+2067
+2068
+2069
+2070
+2071
+2072
+2073
+2074
+2075
+2076
+2077
+2078
+2079
+2080
+2081
+2082
+2083
+2084
+2085
+2086
+2087
+2088
+2089
+2090
+2091
+2092
+2093
+2094
+2095
+2096
+2097
+2098
+2099
+2100
+2101
+2102
+2103
+2104
+2105
+2106
+2107
+2108
+2109
+2110
+2111
+2112
+2113
+2114
+2115
+2116
+2117
+2118
+2119
+2120
+2121
+2122
+2123
+2124
+2125
+2126
+2127
+2128
+2129
+2130
+2131
+2132
+2133
+2134
+2135
+2136
+2137
+2138
+2139
+2140
+2141
+2142
+2143
+2144
+2145
+2146
+2147
+2148
+2149
+2150
+2151
+2152
+2153
+2154
+2155
+2156
+2157
+2158
+2159
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2180
+2181
+2182
+2183
+2184
+2185
+2186
+2187
+2188
+2189
+2190
+2191
+2192
+2193
+2194
+2195
+2196
+2197
+2198
+2199
+2200
+2201
+2202
+2203
+2204
+2205
+2206
+2207
+2208
+2209
+2210
+2211
+2212
+2213
+2214
+2215
+2216
+2217
+2218
+2219
+2220
+2221
+2222
+2223
+2224
+2225
+2226
+2227
+2228
+2229
+2230
+2231
+2232
+2233
+2234
+2235
+2236
+2237
+2238
+2239
+2240
+2241
+2242
+2243
+2244
+2245
+2246
+2247
+2248
+2249
+2250
+2251
+2252
+2253
+2254
+2255
+2256
+2257
+2258
+2259
+2260
+2261
+2262
+2263
+2264
+2265
+2266
+2267
+2268
+2269
+2270
+2271
+2272
+2273
+2274
+2275
+2276
+2277
+2278
+2279
+2280
+2281
+2282
+2283
+2284
+2285
+2286
+2287
+2288
+2289
+2290
+2291
+2292
+2293
+2294
+2295
+2296
+2297
+2298
+2299
+2300
+2301
+2302
+2303
+2304
+2305
+2306
+2307
+2308
+2309
+2310
+2311
+2312
+2313
+2314
+2315
+2316
+2317
+2318
+2319
+2320
+2321
+2322
+2323
+2324
+2325
+2326
+2327
+2328
+2329
+2330
+2331
+2332
+2333
+2334
+2335
+2336
+2337
+2338
+2339
+2340
+2341
+2342
+2343
+2344
+2345
+2346
+2347
+2348
+2349
+2350
+2351
+2352
+2353
+2354
+2355
+2356
+2357
+2358
+2359
+2360
+2361
+2362
+2363
+2364
+2365
+2366
+2367
+2368
+2369
+2370
+2371
+2372
+2373
+2374
+2375
+2376
+2377
+2378
+2379
+2380
+2381
+2382
+2383
+2384
+2385
+2386
+2387
+2388
+2389
+2390
+2391
+2392
+2393
+2394
+2395
+2396
+2397
+2398
+2399
+2400
+2401
+2402
+2403
+2404
+2405
+2406
+2407
+2408
+2409
+2410
+2411
+2412
+2413
+2414
+2415
+2416
+2417
+2418
+2419
+2420
+2421
+2422
+2423
+2424
+2425
+2426
+2427
+2428
+2429
+2430
+2431
+2432
+2433
+2434
+2435
+2436
+2437
+2438
+2439
+2440
+2441
+2442
+2443
+2444
+2445
+2446
+2447
+2448
+2449
+2450
+2451
+2452
+2453
+2454
+2455
+2456
+2457
+2458
+2459
+2460
+2461
+2462
+2463
+2464
+2465
+2466
+2467
+2468
+2469
+2470
+2471
+2472
+2473
+2474
+2475
+2476
+2477
+2478
+2479
+2480
+2481
+2482
+2483
+2484
+2485
+2486
+2487
+2488
+2489
+2490
+2491
+2492
+2493
+2494
+2495
+2496
+2497
+2498
+2499
+2500
+2501
+2502
+2503
+2504
+2505
+2506
+2507
+2508
+2509
+2510
+2511
+2512
+2513
+2514
+2515
+2516
+2517
+2518
+2519
+2520
+2521
+2522
+2523
+2524
+2525
+2526
+2527
+2528
+2529
+2530
+2531
+2532
+2533
+2534
+2535
+2536
+2537
+2538
+2539
+2540
+2541
+2542
+2543
+2544
+2545
+2546
+2547
+2548
+2549
+2550
+2551
+2552
+2553
+2554
+2555
+2556
+2557
+2558
+2559
+2560
+2561
+2562
+2563
+2564
+2565
+2566
+2567
+2568
+2569
+2570
+2571
+2572
+2573
+2574
+2575
+2576
+2577
+2578
+2579
+2580
+2581
+2582
+2583
+2584
+2585
+2586
+2587
+2588
+2589
+2590
+2591
+2592
+2593
+2594
+2595
+2596
+2597
+2598
+2599
+2600
+2601
+2602
+2603
+2604
+2605
+2606
+2607
+2608
+2609
+2610
+2611
+2612
+2613
+2614
+2615
+2616
+2617
+2618
+2619
+2620
+2621
+2622
+2623
+2624
+2625
+2626
+2627
+2628
+2629
+2630
+2631
+2632
+2633
+2634
+2635
+2636
+2637
+2638
+2639
+2640
+2641
+2642
+2643
+2644
+2645
+2646
+2647
+2648
+2649
+2650
+2651
+2652
+2653
+2654
+2655
+2656
+2657
+2658
+2659
+2660
+2661
+2662
+2663
+2664
+2665
+2666
+2667
+2668
+2669
+2670
+2671
+2672
+2673
+2674
+2675
+2676
+2677
+2678
+2679
+2680
+2681
+2682
+2683
+2684
+2685
+2686
+2687
+2688
+2689
+2690
+2691
+2692
+2693
+2694
+2695
+2696
+2697
+2698
+2699
+2700
+2701
+2702
+2703
+2704
+2705
+2706
+2707
+2708
+2709
+2710
+2711
+2712
+2713
+2714
+2715
+2716
+2717
+2718
+2719
+2720
+2721
+2722
+2723
+2724
+2725
+2726
+2727
+2728
+2729
+2730
+2731
+2732
+2733
+2734
+2735
+2736
+2737
+2738
+2739
+2740
+2741
+2742
+2743
+2744
+2745
+2746
+2747
+2748
+2749
+2750
+2751
+2752
+2753
+2754
+2755
+2756
+2757
+2758
+2759
+2760
+2761
+2762
+2763
+2764
+2765
+2766
+2767
+2768
+2769
+2770
+2771
+2772
+2773
+2774
+2775
+2776
+2777
+2778
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+use failure::ResultExt;
+
+use std::borrow::Borrow;
+use std::collections::HashMap;
+use std::collections::hash_map::{
+    Entry,
+};
+use std::fmt::Display;
+use std::iter::{once, repeat};
+use std::ops::Range;
+use std::path::Path;
+
+use itertools;
+use itertools::Itertools;
+use rusqlite;
+use rusqlite::TransactionBehavior;
+use rusqlite::limits::Limit;
+use rusqlite::types::{ToSql, ToSqlOutput};
+
+use ::{repeat_values, to_namespaced_keyword};
+use bootstrap;
+
+use edn::{
+    DateTime,
+    Utc,
+    Uuid,
+    Value,
+};
+
+use entids;
+use mentat_core::{
+    attribute,
+    Attribute,
+    AttributeBitFlags,
+    Entid,
+    FromMicros,
+    IdentMap,
+    Schema,
+    AttributeMap,
+    TypedValue,
+    ToMicros,
+    ValueType,
+    ValueRc,
+};
+
+use errors::{
+    DbError,
+    Result,
+    DbSqlErrorKind,
+};
+use metadata;
+use schema::{
+    SchemaBuilding,
+};
+use types::{
+    AVMap,
+    AVPair,
+    DB,
+    Partition,
+    PartitionMap,
+};
+use tx::transact;
+
+use watcher::{
+    NullWatcher,
+};
+
+// In PRAGMA foo='bar', `'bar'` must be a constant string (it cannot be a
+// bound parameter), so we need to escape manually. According to
+// https://www.sqlite.org/faq.html, the only character that must be escaped is
+// the single quote, which is escaped by placing two single quotes in a row.
+fn escape_string_for_pragma(s: &str) -> String {
+    s.replace("'", "''")
+}
+
+fn make_connection(uri: &Path, maybe_encryption_key: Option<&str>) -> rusqlite::Result<rusqlite::Connection> {
+    let conn = match uri.to_string_lossy().len() {
+        0 => rusqlite::Connection::open_in_memory()?,
+        _ => rusqlite::Connection::open(uri)?,
+    };
+
+    let page_size = 32768;
+
+    let initial_pragmas = if let Some(encryption_key) = maybe_encryption_key {
+        assert!(cfg!(feature = "sqlcipher"),
+                "This function shouldn't be called with a key unless we have sqlcipher support");
+        // Important: The `cipher_page_size` cannot be changed without breaking
+        // the ability to open databases that were written when using a
+        // different `cipher_page_size`. Additionally, it (AFAICT) must be a
+        // positive multiple of `page_size`. We use the same value for both here.
+        format!("
+            PRAGMA key='{}';
+            PRAGMA cipher_page_size={};
+        ", escape_string_for_pragma(encryption_key), page_size)
+    } else {
+        String::new()
+    };
+
+    // See https://github.com/mozilla/mentat/issues/505 for details on temp_store
+    // pragma and how it might interact together with consumers such as Firefox.
+    // temp_store=2 is currently present to force SQLite to store temp files in memory.
+    // Some of the platforms we support do not have a tmp partition (e.g. Android)
+    // necessary to store temp files on disk. Ideally, consumers should be able to
+    // override this behaviour (see issue 505).
+    conn.execute_batch(&format!("
+        {}
+        PRAGMA journal_mode=wal;
+        PRAGMA wal_autocheckpoint=32;
+        PRAGMA journal_size_limit=3145728;
+        PRAGMA foreign_keys=ON;
+        PRAGMA temp_store=2;
+    ", initial_pragmas))?;
+
+    Ok(conn)
+}
+
+pub fn new_connection<T>(uri: T) -> rusqlite::Result<rusqlite::Connection> where T: AsRef<Path> {
+    make_connection(uri.as_ref(), None)
+}
+
+#[cfg(feature = "sqlcipher")]
+pub fn new_connection_with_key<P, S>(uri: P, encryption_key: S) -> rusqlite::Result<rusqlite::Connection>
+where P: AsRef<Path>, S: AsRef<str> {
+    make_connection(uri.as_ref(), Some(encryption_key.as_ref()))
+}
+
+#[cfg(feature = "sqlcipher")]
+pub fn change_encryption_key<S>(conn: &rusqlite::Connection, encryption_key: S) -> rusqlite::Result<()>
+where S: AsRef<str> {
+    let escaped = escape_string_for_pragma(encryption_key.as_ref());
+    // `conn.execute` complains that this returns a result, and using a query
+    // for it requires more boilerplate.
+    conn.execute_batch(&format!("PRAGMA rekey = '{}';", escaped))
+}
+
+/// Version history:
+///
+/// 1: initial Rust Mentat schema.
+pub const CURRENT_VERSION: i32 = 1;
+
+/// MIN_SQLITE_VERSION should be changed when there's a new minimum version of sqlite required
+/// for the project to work.
+const MIN_SQLITE_VERSION: i32 = 3008000;
+
+const TRUE: &'static bool = &true;
+const FALSE: &'static bool = &false;
+
+/// Turn an owned bool into a static reference to a bool.
+///
+/// `rusqlite` is designed around references to values; this lets us use computed bools easily.
+#[inline(always)]
+fn to_bool_ref(x: bool) -> &'static bool {
+    if x { TRUE } else { FALSE }
+}
+
+lazy_static! {
+    /// SQL statements to be executed, in order, to create the Mentat SQL schema (version 1).
+    #[cfg_attr(rustfmt, rustfmt_skip)]
+    static ref V1_STATEMENTS: Vec<&'static str> = { vec![
+        r#"CREATE TABLE datoms (e INTEGER NOT NULL, a SMALLINT NOT NULL, v BLOB NOT NULL, tx INTEGER NOT NULL,
+                                value_type_tag SMALLINT NOT NULL,
+                                index_avet TINYINT NOT NULL DEFAULT 0, index_vaet TINYINT NOT NULL DEFAULT 0,
+                                index_fulltext TINYINT NOT NULL DEFAULT 0,
+                                unique_value TINYINT NOT NULL DEFAULT 0)"#,
+        r#"CREATE UNIQUE INDEX idx_datoms_eavt ON datoms (e, a, value_type_tag, v)"#,
+        r#"CREATE UNIQUE INDEX idx_datoms_aevt ON datoms (a, e, value_type_tag, v)"#,
+
+        // Opt-in index: only if a has :db/index true.
+        r#"CREATE UNIQUE INDEX idx_datoms_avet ON datoms (a, value_type_tag, v, e) WHERE index_avet IS NOT 0"#,
+
+        // Opt-in index: only if a has :db/valueType :db.type/ref.  No need for tag here since all
+        // indexed elements are refs.
+        r#"CREATE UNIQUE INDEX idx_datoms_vaet ON datoms (v, a, e) WHERE index_vaet IS NOT 0"#,
+
+        // Opt-in index: only if a has :db/fulltext true; thus, it has :db/valueType :db.type/string,
+        // which is not :db/valueType :db.type/ref.  That is, index_vaet and index_fulltext are mutually
+        // exclusive.
+        r#"CREATE INDEX idx_datoms_fulltext ON datoms (value_type_tag, v, a, e) WHERE index_fulltext IS NOT 0"#,
+
+        // TODO: possibly remove this index.  :db.unique/{value,identity} should be asserted by the
+        // transactor in all cases, but the index may speed up some of SQLite's query planning.  For now,
+        // it serves to validate the transactor implementation.  Note that tag is needed here to
+        // differentiate, e.g., keywords and strings.
+        r#"CREATE UNIQUE INDEX idx_datoms_unique_value ON datoms (a, value_type_tag, v) WHERE unique_value IS NOT 0"#,
+
+        r#"CREATE TABLE transactions (e INTEGER NOT NULL, a SMALLINT NOT NULL, v BLOB NOT NULL, tx INTEGER NOT NULL, added TINYINT NOT NULL DEFAULT 1, value_type_tag SMALLINT NOT NULL)"#,
+        r#"CREATE INDEX idx_transactions_tx ON transactions (tx, added)"#,
+
+        // Fulltext indexing.
+        // A fulltext indexed value v is an integer rowid referencing fulltext_values.
+
+        // Optional settings:
+        // tokenize="porter"#,
+        // prefix='2,3'
+        // By default we use Unicode-aware tokenizing (particularly for case folding), but preserve
+        // diacritics.
+        r#"CREATE VIRTUAL TABLE fulltext_values
+             USING FTS4 (text NOT NULL, searchid INT, tokenize=unicode61 "remove_diacritics=0")"#,
+
+        // This combination of view and triggers allows you to transparently
+        // update-or-insert into FTS. Just INSERT INTO fulltext_values_view (text, searchid).
+        r#"CREATE VIEW fulltext_values_view AS SELECT * FROM fulltext_values"#,
+        r#"CREATE TRIGGER replace_fulltext_searchid
+             INSTEAD OF INSERT ON fulltext_values_view
+             WHEN EXISTS (SELECT 1 FROM fulltext_values WHERE text = new.text)
+             BEGIN
+               UPDATE fulltext_values SET searchid = new.searchid WHERE text = new.text;
+             END"#,
+        r#"CREATE TRIGGER insert_fulltext_searchid
+             INSTEAD OF INSERT ON fulltext_values_view
+             WHEN NOT EXISTS (SELECT 1 FROM fulltext_values WHERE text = new.text)
+             BEGIN
+               INSERT INTO fulltext_values (text, searchid) VALUES (new.text, new.searchid);
+             END"#,
+
+        // A view transparently interpolating fulltext indexed values into the datom structure.
+        r#"CREATE VIEW fulltext_datoms AS
+             SELECT e, a, fulltext_values.text AS v, tx, value_type_tag, index_avet, index_vaet, index_fulltext, unique_value
+               FROM datoms, fulltext_values
+               WHERE datoms.index_fulltext IS NOT 0 AND datoms.v = fulltext_values.rowid"#,
+
+        // A view transparently interpolating all entities (fulltext and non-fulltext) into the datom structure.
+        r#"CREATE VIEW all_datoms AS
+             SELECT e, a, v, tx, value_type_tag, index_avet, index_vaet, index_fulltext, unique_value
+               FROM datoms
+               WHERE index_fulltext IS 0
+             UNION ALL
+             SELECT e, a, v, tx, value_type_tag, index_avet, index_vaet, index_fulltext, unique_value
+               FROM fulltext_datoms"#,
+
+        // Materialized views of the metadata.
+        r#"CREATE TABLE idents (e INTEGER NOT NULL, a SMALLINT NOT NULL, v BLOB NOT NULL, value_type_tag SMALLINT NOT NULL)"#,
+        r#"CREATE INDEX idx_idents_unique ON idents (e, a, v, value_type_tag)"#,
+        r#"CREATE TABLE schema (e INTEGER NOT NULL, a SMALLINT NOT NULL, v BLOB NOT NULL, value_type_tag SMALLINT NOT NULL)"#,
+        r#"CREATE INDEX idx_schema_unique ON schema (e, a, v, value_type_tag)"#,
+        // TODO: store entid instead of ident for partition name.
+        r#"CREATE TABLE parts (part TEXT NOT NULL PRIMARY KEY, start INTEGER NOT NULL, idx INTEGER NOT NULL)"#,
+        ]
+    };
+}
+
+/// Set the SQLite user version.
+///
+/// Mentat manages its own SQL schema version using the user version.  See the [SQLite
+/// documentation](https://www.sqlite.org/pragma.html#pragma_user_version).
+fn set_user_version(conn: &rusqlite::Connection, version: i32) -> Result<()> {
+    conn.execute(&format!("PRAGMA user_version = {}", version), &[])
+        .context(DbSqlErrorKind::CouldNotSetVersionPragma)?;
+    Ok(())
+}
+
+/// Get the SQLite user version.
+///
+/// Mentat manages its own SQL schema version using the user version.  See the [SQLite
+/// documentation](https://www.sqlite.org/pragma.html#pragma_user_version).
+fn get_user_version(conn: &rusqlite::Connection) -> Result<i32> {
+    let v = conn.query_row("PRAGMA user_version", &[], |row| {
+        row.get(0)
+    }).context(DbSqlErrorKind::CouldNotGetVersionPragma)?;
+    Ok(v)
+}
+
+/// Do just enough work that either `create_current_version` or sync can populate the DB.
+pub fn create_empty_current_version(conn: &mut rusqlite::Connection) -> Result<(rusqlite::Transaction, DB)> {
+    let tx = conn.transaction_with_behavior(TransactionBehavior::Exclusive)?;
+
+    for statement in (&V1_STATEMENTS).iter() {
+        tx.execute(statement, &[])?;
+    }
+
+    set_user_version(&tx, CURRENT_VERSION)?;
+
+    let bootstrap_schema = bootstrap::bootstrap_schema();
+    let bootstrap_partition_map = bootstrap::bootstrap_partition_map();
+
+    Ok((tx, DB::new(bootstrap_partition_map, bootstrap_schema)))
+}
+
+// TODO: rename "SQL" functions to align with "datoms" functions.
+pub fn create_current_version(conn: &mut rusqlite::Connection) -> Result<DB> {
+    let (tx, mut db) = create_empty_current_version(conn)?;
+
+    // TODO: think more carefully about allocating new parts and bitmasking part ranges.
+    // TODO: install these using bootstrap assertions.  It's tricky because the part ranges are implicit.
+    // TODO: one insert, chunk into 999/3 sections, for safety.
+    // This is necessary: `transact` will only UPDATE parts, not INSERT them if they're missing.
+    for (part, partition) in db.partition_map.iter() {
+        // TODO: Convert "keyword" part to SQL using Value conversion.
+        tx.execute("INSERT INTO parts VALUES (?, ?, ?)", &[part, &partition.start, &partition.index])?;
+    }
+
+    // TODO: return to transact_internal to self-manage the encompassing SQLite transaction.
+    let bootstrap_schema_for_mutation = Schema::default(); // The bootstrap transaction will populate this schema.
+
+    let (_report, next_partition_map, next_schema, _watcher) = transact(&tx, db.partition_map, &bootstrap_schema_for_mutation, &db.schema, NullWatcher(), bootstrap::bootstrap_entities())?;
+
+    // TODO: validate metadata mutations that aren't schema related, like additional partitions.
+    if let Some(next_schema) = next_schema {
+        if next_schema != db.schema {
+            bail!(DbError::NotYetImplemented(format!("Initial bootstrap transaction did not produce expected bootstrap schema")));
+        }
+    }
+
+    // TODO: use the drop semantics to do this automagically?
+    tx.commit()?;
+
+    db.partition_map = next_partition_map;
+    Ok(db)
+}
+
+pub fn ensure_current_version(conn: &mut rusqlite::Connection) -> Result<DB> {
+    if rusqlite::version_number() < MIN_SQLITE_VERSION {
+        panic!("Mentat requires at least sqlite {}", MIN_SQLITE_VERSION);
+    }
+
+    let user_version = get_user_version(&conn)?;
+    match user_version {
+        0               => create_current_version(conn),
+        CURRENT_VERSION => read_db(conn),
+
+        // TODO: support updating an existing store.
+        v => bail!(DbError::NotYetImplemented(format!("Opening databases with Mentat version: {}", v))),
+    }
+}
+
+pub trait TypedSQLValue {
+    fn from_sql_value_pair(value: rusqlite::types::Value, value_type_tag: i32) -> Result<TypedValue>;
+    fn to_sql_value_pair<'a>(&'a self) -> (ToSqlOutput<'a>, i32);
+    fn from_edn_value(value: &Value) -> Option<TypedValue>;
+    fn to_edn_value_pair(&self) -> (Value, ValueType);
+}
+
+impl TypedSQLValue for TypedValue {
+    /// Given a SQLite `value` and a `value_type_tag`, return the corresponding `TypedValue`.
+    fn from_sql_value_pair(value: rusqlite::types::Value, value_type_tag: i32) -> Result<TypedValue> {
+        match (value_type_tag, value) {
+            (0, rusqlite::types::Value::Integer(x)) => Ok(TypedValue::Ref(x)),
+            (1, rusqlite::types::Value::Integer(x)) => Ok(TypedValue::Boolean(0 != x)),
+
+            // Negative integers are simply times before 1970.
+            (4, rusqlite::types::Value::Integer(x)) => Ok(TypedValue::Instant(DateTime::<Utc>::from_micros(x))),
+
+            // SQLite distinguishes integral from decimal types, allowing long and double to
+            // share a tag.
+            (5, rusqlite::types::Value::Integer(x)) => Ok(TypedValue::Long(x)),
+            (5, rusqlite::types::Value::Real(x)) => Ok(TypedValue::Double(x.into())),
+            (10, rusqlite::types::Value::Text(x)) => Ok(x.into()),
+            (11, rusqlite::types::Value::Blob(x)) => {
+                let u = Uuid::from_bytes(x.as_slice());
+                if u.is_err() {
+                    // Rather than exposing Uuid's ParseError…
+                    bail!(DbError::BadSQLValuePair(rusqlite::types::Value::Blob(x),
+                                                     value_type_tag));
+                }
+                Ok(TypedValue::Uuid(u.unwrap()))
+            },
+            (13, rusqlite::types::Value::Text(x)) => {
+                to_namespaced_keyword(&x).map(|k| k.into())
+            },
+            (_, value) => bail!(DbError::BadSQLValuePair(value, value_type_tag)),
+        }
+    }
+
+    /// Given an EDN `value`, return a corresponding Mentat `TypedValue`.
+    ///
+    /// An EDN `Value` does not encode a unique Mentat `ValueType`, so the composition
+    /// `from_edn_value(first(to_edn_value_pair(...)))` loses information.  Additionally, there are
+    /// EDN values which are not Mentat typed values.
+    ///
+    /// This function is deterministic.
+    fn from_edn_value(value: &Value) -> Option<TypedValue> {
+        match value {
+            &Value::Boolean(x) => Some(TypedValue::Boolean(x)),
+            &Value::Instant(x) => Some(TypedValue::Instant(x)),
+            &Value::Integer(x) => Some(TypedValue::Long(x)),
+            &Value::Uuid(x) => Some(TypedValue::Uuid(x)),
+            &Value::Float(ref x) => Some(TypedValue::Double(x.clone())),
+            &Value::Text(ref x) => Some(x.clone().into()),
+            &Value::Keyword(ref x) => Some(x.clone().into()),
+            _ => None
+        }
+    }
+
+    /// Return the corresponding SQLite `value` and `value_type_tag` pair.
+    fn to_sql_value_pair<'a>(&'a self) -> (ToSqlOutput<'a>, i32) {
+        match self {
+            &TypedValue::Ref(x) => (rusqlite::types::Value::Integer(x).into(), 0),
+            &TypedValue::Boolean(x) => (rusqlite::types::Value::Integer(if x { 1 } else { 0 }).into(), 1),
+            &TypedValue::Instant(x) => (rusqlite::types::Value::Integer(x.to_micros()).into(), 4),
+            // SQLite distinguishes integral from decimal types, allowing long and double to share a tag.
+            &TypedValue::Long(x) => (rusqlite::types::Value::Integer(x).into(), 5),
+            &TypedValue::Double(x) => (rusqlite::types::Value::Real(x.into_inner()).into(), 5),
+            &TypedValue::String(ref x) => (rusqlite::types::ValueRef::Text(x.as_str()).into(), 10),
+            &TypedValue::Uuid(ref u) => (rusqlite::types::Value::Blob(u.as_bytes().to_vec()).into(), 11),
+            &TypedValue::Keyword(ref x) => (rusqlite::types::ValueRef::Text(&x.to_string()).into(), 13),
+        }
+    }
+
+    /// Return the corresponding EDN `value` and `value_type` pair.
+    fn to_edn_value_pair(&self) -> (Value, ValueType) {
+        match self {
+            &TypedValue::Ref(x) => (Value::Integer(x), ValueType::Ref),
+            &TypedValue::Boolean(x) => (Value::Boolean(x), ValueType::Boolean),
+            &TypedValue::Instant(x) => (Value::Instant(x), ValueType::Instant),
+            &TypedValue::Long(x) => (Value::Integer(x), ValueType::Long),
+            &TypedValue::Double(x) => (Value::Float(x), ValueType::Double),
+            &TypedValue::String(ref x) => (Value::Text(x.as_ref().clone()), ValueType::String),
+            &TypedValue::Uuid(ref u) => (Value::Uuid(u.clone()), ValueType::Uuid),
+            &TypedValue::Keyword(ref x) => (Value::Keyword(x.as_ref().clone()), ValueType::Keyword),
+        }
+    }
+}
+
+/// Read an arbitrary [e a v value_type_tag] materialized view from the given table in the SQL
+/// store.
+fn read_materialized_view(conn: &rusqlite::Connection, table: &str) -> Result<Vec<(Entid, Entid, TypedValue)>> {
+    let mut stmt: rusqlite::Statement = conn.prepare(format!("SELECT e, a, v, value_type_tag FROM {}", table).as_str())?;
+    let m: Result<Vec<(Entid, Entid, TypedValue)>> = stmt.query_and_then(&[], |row| {
+        let e: Entid = row.get_checked(0)?;
+        let a: Entid = row.get_checked(1)?;
+        let v: rusqlite::types::Value = row.get_checked(2)?;
+        let value_type_tag: i32 = row.get_checked(3)?;
+        let typed_value = TypedValue::from_sql_value_pair(v, value_type_tag)?;
+        Ok((e, a, typed_value))
+    })?.collect();
+    m
+}
+
+/// Read the partition map materialized view from the given SQL store.
+fn read_partition_map(conn: &rusqlite::Connection) -> Result<PartitionMap> {
+    let mut stmt: rusqlite::Statement = conn.prepare("SELECT part, start, idx FROM parts")?;
+    let m = stmt.query_and_then(&[], |row| -> Result<(String, Partition)> {
+        Ok((row.get_checked(0)?, Partition::new(row.get_checked(1)?, row.get_checked(2)?)))
+    })?.collect();
+    m
+}
+
+/// Read the ident map materialized view from the given SQL store.
+fn read_ident_map(conn: &rusqlite::Connection) -> Result<IdentMap> {
+    let v = read_materialized_view(conn, "idents")?;
+    v.into_iter().map(|(e, a, typed_value)| {
+        if a != entids::DB_IDENT {
+            bail!(DbError::NotYetImplemented(format!("bad idents materialized view: expected :db/ident but got {}", a)));
+        }
+        if let TypedValue::Keyword(keyword) = typed_value {
+            Ok((keyword.as_ref().clone(), e))
+        } else {
+            bail!(DbError::NotYetImplemented(format!("bad idents materialized view: expected [entid :db/ident keyword] but got [entid :db/ident {:?}]", typed_value)));
+        }
+    }).collect()
+}
+
+/// Read the schema materialized view from the given SQL store.
+fn read_attribute_map(conn: &rusqlite::Connection) -> Result<AttributeMap> {
+    let entid_triples = read_materialized_view(conn, "schema")?;
+    let mut attribute_map = AttributeMap::default();
+    metadata::update_attribute_map_from_entid_triples(&mut attribute_map, entid_triples, ::std::iter::empty())?;
+    Ok(attribute_map)
+}
+
+/// Read the materialized views from the given SQL store and return a Mentat `DB` for querying and
+/// applying transactions.
+pub fn read_db(conn: &rusqlite::Connection) -> Result<DB> {
+    let partition_map = read_partition_map(conn)?;
+    let ident_map = read_ident_map(conn)?;
+    let attribute_map = read_attribute_map(conn)?;
+    let schema = Schema::from_ident_map_and_attribute_map(ident_map, attribute_map)?;
+    Ok(DB::new(partition_map, schema))
+}
+
+/// Internal representation of an [e a v added] datom, ready to be transacted against the store.
+pub type ReducedEntity<'a> = (Entid, Entid, &'a Attribute, TypedValue, bool);
+
+#[derive(Clone,Debug,Eq,Hash,Ord,PartialOrd,PartialEq)]
+pub enum SearchType {
+    Exact,
+    Inexact,
+}
+
+/// `MentatStoring` will be the trait that encapsulates the storage layer.  It is consumed by the
+/// transaction processing layer.
+///
+/// Right now, the only implementation of `MentatStoring` is the SQLite-specific SQL schema.  In the
+/// future, we might consider other SQL engines (perhaps with different fulltext indexing), or
+/// entirely different data stores, say ones shaped like key-value stores.
+pub trait MentatStoring {
+    /// Given a slice of [a v] lookup-refs, look up the corresponding [e a v] triples.
+    ///
+    /// It is assumed that the attribute `a` in each lookup-ref is `:db/unique`, so that at most one
+    /// matching [e a v] triple exists.  (If this is not true, some matching entid `e` will be
+    /// chosen non-deterministically, if one exists.)
+    ///
+    /// Returns a map &(a, v) -> e, to avoid cloning potentially large values.  The keys of the map
+    /// are exactly those (a, v) pairs that have an assertion [e a v] in the store.
+    fn resolve_avs<'a>(&self, avs: &'a [&'a AVPair]) -> Result<AVMap<'a>>;
+
+    /// Begin (or prepare) the underlying storage layer for a new Mentat transaction.
+    ///
+    /// Use this to create temporary tables, prepare indices, set pragmas, etc, before the initial
+    /// `insert_non_fts_searches` invocation.
+    fn begin_tx_application(&self) -> Result<()>;
+
+    // TODO: this is not a reasonable abstraction, but I don't want to really consider non-SQL storage just yet.
+    fn insert_non_fts_searches<'a>(&self, entities: &'a [ReducedEntity], search_type: SearchType) -> Result<()>;
+    fn insert_fts_searches<'a>(&self, entities: &'a [ReducedEntity], search_type: SearchType) -> Result<()>;
+
+    /// Finalize the underlying storage layer after a Mentat transaction.
+    ///
+    /// Use this to finalize temporary tables, complete indices, revert pragmas, etc, after the
+    /// final `insert_non_fts_searches` invocation.
+    fn commit_transaction(&self, tx_id: Entid) -> Result<()>;
+
+    /// Extract metadata-related [e a typed_value added] datoms committed in the given transaction.
+    fn committed_metadata_assertions(&self, tx_id: Entid) -> Result<Vec<(Entid, Entid, TypedValue, bool)>>;
+}
+
+/// Take search rows and complete `temp.search_results`.
+///
+/// See https://github.com/mozilla/mentat/wiki/Transacting:-entity-to-SQL-translation.
+fn search(conn: &rusqlite::Connection) -> Result<()> {
+    // First is fast, only one table walk: lookup by exact eav.
+    // Second is slower, but still only one table walk: lookup old value by ea.
+    let s = r#"
+      INSERT INTO temp.search_results
+      SELECT t.e0, t.a0, t.v0, t.value_type_tag0, t.added0, t.flags0, ':db.cardinality/many', d.rowid, d.v
+      FROM temp.exact_searches AS t
+      LEFT JOIN datoms AS d
+      ON t.e0 = d.e AND
+         t.a0 = d.a AND
+         t.value_type_tag0 = d.value_type_tag AND
+         t.v0 = d.v
+
+      UNION ALL
+
+      SELECT t.e0, t.a0, t.v0, t.value_type_tag0, t.added0, t.flags0, ':db.cardinality/one', d.rowid, d.v
+      FROM temp.inexact_searches AS t
+      LEFT JOIN datoms AS d
+      ON t.e0 = d.e AND
+         t.a0 = d.a"#;
+
+    let mut stmt = conn.prepare_cached(s)?;
+    stmt.execute(&[]).context(DbSqlErrorKind::CouldNotSearch)?;
+    Ok(())
+}
+
+/// Insert the new transaction into the `transactions` table.
+///
+/// This turns the contents of `search_results` into a new transaction.
+///
+/// See https://github.com/mozilla/mentat/wiki/Transacting:-entity-to-SQL-translation.
+fn insert_transaction(conn: &rusqlite::Connection, tx: Entid) -> Result<()> {
+    // Mentat follows Datomic and treats its input as a set.  That means it is okay to transact the
+    // same [e a v] twice in one transaction.  However, we don't want to represent the transacted
+    // datom twice.  Therefore, the transactor unifies repeated datoms, and in addition we add
+    // indices to the search inputs and search results to ensure that we don't see repeated datoms
+    // at this point.
+
+    let s = r#"
+      INSERT INTO transactions (e, a, v, tx, added, value_type_tag)
+      SELECT e0, a0, v0, ?, 1, value_type_tag0
+      FROM temp.search_results
+      WHERE added0 IS 1 AND ((rid IS NULL) OR ((rid IS NOT NULL) AND (v0 IS NOT v)))"#;
+
+    let mut stmt = conn.prepare_cached(s)?;
+    stmt.execute(&[&tx]).context(DbSqlErrorKind::TxInsertFailedToAddMissingDatoms)?;
+
+    let s = r#"
+      INSERT INTO transactions (e, a, v, tx, added, value_type_tag)
+      SELECT e0, a0, v, ?, 0, value_type_tag0
+      FROM temp.search_results
+      WHERE rid IS NOT NULL AND
+            ((added0 IS 0) OR
+             (added0 IS 1 AND search_type IS ':db.cardinality/one' AND v0 IS NOT v))"#;
+
+    let mut stmt = conn.prepare_cached(s)?;
+    stmt.execute(&[&tx]).context(DbSqlErrorKind::TxInsertFailedToRetractDatoms)?;
+
+    Ok(())
+}
+
+/// Update the contents of the `datoms` materialized view with the new transaction.
+///
+/// This applies the contents of `search_results` to the `datoms` table (in place).
+///
+/// See https://github.com/mozilla/mentat/wiki/Transacting:-entity-to-SQL-translation.
+fn update_datoms(conn: &rusqlite::Connection, tx: Entid) -> Result<()> {
+    // Delete datoms that were retracted, or those that were :db.cardinality/one and will be
+    // replaced.
+    let s = r#"
+        WITH ids AS (SELECT rid
+                     FROM temp.search_results
+                     WHERE rid IS NOT NULL AND
+                           ((added0 IS 0) OR
+                            (added0 IS 1 AND search_type IS ':db.cardinality/one' AND v0 IS NOT v)))
+        DELETE FROM datoms WHERE rowid IN ids"#;
+
+    let mut stmt = conn.prepare_cached(s)?;
+    stmt.execute(&[]).context(DbSqlErrorKind::DatomsUpdateFailedToRetract)?;
+
+    // Insert datoms that were added and not already present. We also must expand our bitfield into
+    // flags.  Since Mentat follows Datomic and treats its input as a set, it is okay to transact
+    // the same [e a v] twice in one transaction, but we don't want to represent the transacted
+    // datom twice in datoms.  The transactor unifies repeated datoms, and in addition we add
+    // indices to the search inputs and search results to ensure that we don't see repeated datoms
+    // at this point.
+    let s = format!(r#"
+      INSERT INTO datoms (e, a, v, tx, value_type_tag, index_avet, index_vaet, index_fulltext, unique_value)
+      SELECT e0, a0, v0, ?, value_type_tag0,
+             flags0 & {} IS NOT 0,
+             flags0 & {} IS NOT 0,
+             flags0 & {} IS NOT 0,
+             flags0 & {} IS NOT 0
+      FROM temp.search_results
+      WHERE added0 IS 1 AND ((rid IS NULL) OR ((rid IS NOT NULL) AND (v0 IS NOT v)))"#,
+      AttributeBitFlags::IndexAVET as u8,
+      AttributeBitFlags::IndexVAET as u8,
+      AttributeBitFlags::IndexFulltext as u8,
+      AttributeBitFlags::UniqueValue as u8);
+
+    let mut stmt = conn.prepare_cached(&s)?;
+    stmt.execute(&[&tx]).context(DbSqlErrorKind::DatomsUpdateFailedToAdd)?;
+    Ok(())
+}
+
+impl MentatStoring for rusqlite::Connection {
+    fn resolve_avs<'a>(&self, avs: &'a [&'a AVPair]) -> Result<AVMap<'a>> {
+        // Start search_id's at some identifiable number.
+        let initial_search_id = 2000;
+        let bindings_per_statement = 4;
+
+        // We map [a v] -> numeric search_id -> e, and then we use the search_id lookups to finally
+        // produce the map [a v] -> e.
+        //
+        // TODO: `collect` into a HashSet so that any (a, v) is resolved at most once.
+        let max_vars = self.limit(Limit::SQLITE_LIMIT_VARIABLE_NUMBER) as usize;
+        let chunks: itertools::IntoChunks<_> = avs.into_iter().enumerate().chunks(max_vars / 4);
+
+        // We'd like to `flat_map` here, but it's not obvious how to `flat_map` across `Result`.
+        // Alternatively, this is a `fold`, and it might be wise to express it as such.
+        let results: Result<Vec<Vec<_>>> = chunks.into_iter().map(|chunk| -> Result<Vec<_>> {
+            let mut count = 0;
+
+            // We must keep these computed values somewhere to reference them later, so we can't
+            // combine this `map` and the subsequent `flat_map`.
+            let block: Vec<(i64, i64, ToSqlOutput<'a>, i32)> = chunk.map(|(index, &&(a, ref v))| {
+                count += 1;
+                let search_id: i64 = initial_search_id + index as i64;
+                let (value, value_type_tag) = v.to_sql_value_pair();
+                (search_id, a, value, value_type_tag)
+            }).collect();
+
+            // `params` reference computed values in `block`.
+            let params: Vec<&ToSql> = block.iter().flat_map(|&(ref searchid, ref a, ref value, ref value_type_tag)| {
+                // Avoid inner heap allocation.
+                once(searchid as &ToSql)
+                    .chain(once(a as &ToSql)
+                           .chain(once(value as &ToSql)
+                                  .chain(once(value_type_tag as &ToSql))))
+            }).collect();
+
+            // TODO: cache these statements for selected values of `count`.
+            // TODO: query against `datoms` and UNION ALL with `fulltext_datoms` rather than
+            // querying against `all_datoms`.  We know all the attributes, and in the common case,
+            // where most unique attributes will not be fulltext-indexed, we'll be querying just
+            // `datoms`, which will be much faster.ˇ
+            assert!(bindings_per_statement * count < max_vars, "Too many values: {} * {} >= {}", bindings_per_statement, count, max_vars);
+
+            let values: String = repeat_values(bindings_per_statement, count);
+            let s: String = format!("WITH t(search_id, a, v, value_type_tag) AS (VALUES {}) SELECT t.search_id, d.e \
+                                     FROM t, all_datoms AS d \
+                                     WHERE d.index_avet IS NOT 0 AND d.a = t.a AND d.value_type_tag = t.value_type_tag AND d.v = t.v",
+                                    values);
+            let mut stmt: rusqlite::Statement = self.prepare(s.as_str())?;
+
+            let m: Result<Vec<(i64, Entid)>> = stmt.query_and_then(&params, |row| -> Result<(i64, Entid)> {
+                Ok((row.get_checked(0)?, row.get_checked(1)?))
+            })?.collect();
+            m
+        }).collect::<Result<Vec<Vec<(i64, Entid)>>>>();
+
+        // Flatten.
+        let results: Vec<(i64, Entid)> = results?.as_slice().concat();
+
+        // Create map [a v] -> e.
+        let m: HashMap<&'a AVPair, Entid> = results.into_iter().map(|(search_id, entid)| {
+            let index: usize = (search_id - initial_search_id) as usize;
+            (avs[index], entid)
+        }).collect();
+        Ok(m)
+    }
+
+    /// Create empty temporary tables for search parameters and search results.
+    fn begin_tx_application(&self) -> Result<()> {
+        // We can't do this in one shot, since we can't prepare a batch statement.
+        let statements = [
+            r#"DROP TABLE IF EXISTS temp.exact_searches"#,
+            // Note that `flags0` is a bitfield of several flags compressed via
+            // `AttributeBitFlags.flags()` in the temporary search tables, later
+            // expanded in the `datoms` insertion.
+            r#"CREATE TABLE temp.exact_searches (
+               e0 INTEGER NOT NULL,
+               a0 SMALLINT NOT NULL,
+               v0 BLOB NOT NULL,
+               value_type_tag0 SMALLINT NOT NULL,
+               added0 TINYINT NOT NULL,
+               flags0 TINYINT NOT NULL)"#,
+            // There's no real need to split exact and inexact searches, so long as we keep things
+            // in the correct place and performant.  Splitting has the advantage of being explicit
+            // and slightly easier to read, so we'll do that to start.
+            r#"DROP TABLE IF EXISTS temp.inexact_searches"#,
+            r#"CREATE TABLE temp.inexact_searches (
+               e0 INTEGER NOT NULL,
+               a0 SMALLINT NOT NULL,
+               v0 BLOB NOT NULL,
+               value_type_tag0 SMALLINT NOT NULL,
+               added0 TINYINT NOT NULL,
+               flags0 TINYINT NOT NULL)"#,
+
+            // It is fine to transact the same [e a v] twice in one transaction, but the transaction
+            // processor should unify such repeated datoms.  This index will cause insertion to fail
+            // if the transaction processor incorrectly tries to assert the same (cardinality one)
+            // datom twice.  (Sadly, the failure is opaque.)
+            r#"CREATE UNIQUE INDEX IF NOT EXISTS temp.inexact_searches_unique ON inexact_searches (e0, a0) WHERE added0 = 1"#,
+            r#"DROP TABLE IF EXISTS temp.search_results"#,
+            // TODO: don't encode search_type as a STRING.  This is explicit and much easier to read
+            // than another flag, so we'll do it to start, and optimize later.
+            r#"CREATE TABLE temp.search_results (
+               e0 INTEGER NOT NULL,
+               a0 SMALLINT NOT NULL,
+               v0 BLOB NOT NULL,
+               value_type_tag0 SMALLINT NOT NULL,
+               added0 TINYINT NOT NULL,
+               flags0 TINYINT NOT NULL,
+               search_type STRING NOT NULL,
+               rid INTEGER,
+               v BLOB)"#,
+            // It is fine to transact the same [e a v] twice in one transaction, but the transaction
+            // processor should identify those datoms.  This index will cause insertion to fail if
+            // the internals of the database searching code incorrectly find the same datom twice.
+            // (Sadly, the failure is opaque.)
+            //
+            // N.b.: temp goes on index name, not table name.  See http://stackoverflow.com/a/22308016.
+            r#"CREATE UNIQUE INDEX IF NOT EXISTS temp.search_results_unique ON search_results (e0, a0, v0, value_type_tag0)"#,
+        ];
+
+        for statement in &statements {
+            let mut stmt = self.prepare_cached(statement)?;
+            stmt.execute(&[]).context(DbSqlErrorKind::FailedToCreateTempTables)?;
+        }
+
+        Ok(())
+    }
+
+    /// Insert search rows into temporary search tables.
+    ///
+    /// Eventually, the details of this approach will be captured in
+    /// https://github.com/mozilla/mentat/wiki/Transacting:-entity-to-SQL-translation.
+    fn insert_non_fts_searches<'a>(&self, entities: &'a [ReducedEntity<'a>], search_type: SearchType) -> Result<()> {
+        let bindings_per_statement = 6;
+
+        let max_vars = self.limit(Limit::SQLITE_LIMIT_VARIABLE_NUMBER) as usize;
+        let chunks: itertools::IntoChunks<_> = entities.into_iter().chunks(max_vars / bindings_per_statement);
+
+        // We'd like to flat_map here, but it's not obvious how to flat_map across Result.
+        let results: Result<Vec<()>> = chunks.into_iter().map(|chunk| -> Result<()> {
+            let mut count = 0;
+
+            // We must keep these computed values somewhere to reference them later, so we can't
+            // combine this map and the subsequent flat_map.
+            // (e0, a0, v0, value_type_tag0, added0, flags0)
+            let block: Result<Vec<(i64 /* e */,
+                                   i64 /* a */,
+                                   ToSqlOutput<'a> /* value */,
+                                   i32 /* value_type_tag */,
+                                   bool, /* added0 */
+                                   u8 /* flags0 */)>> = chunk.map(|&(e, a, ref attribute, ref typed_value, added)| {
+                count += 1;
+
+                // Now we can represent the typed value as an SQL value.
+                let (value, value_type_tag): (ToSqlOutput, i32) = typed_value.to_sql_value_pair();
+
+                Ok((e, a, value, value_type_tag, added, attribute.flags()))
+            }).collect();
+            let block = block?;
+
+            // `params` reference computed values in `block`.
+            let params: Vec<&ToSql> = block.iter().flat_map(|&(ref e, ref a, ref value, ref value_type_tag, added, ref flags)| {
+                // Avoid inner heap allocation.
+                // TODO: extract some finite length iterator to make this less indented!
+                once(e as &ToSql)
+                    .chain(once(a as &ToSql)
+                           .chain(once(value as &ToSql)
+                                  .chain(once(value_type_tag as &ToSql)
+                                         .chain(once(to_bool_ref(added) as &ToSql)
+                                                .chain(once(flags as &ToSql))))))
+            }).collect();
+
+            // TODO: cache this for selected values of count.
+            assert!(bindings_per_statement * count < max_vars, "Too many values: {} * {} >= {}", bindings_per_statement, count, max_vars);
+            let values: String = repeat_values(bindings_per_statement, count);
+            let s: String = if search_type == SearchType::Exact {
+                format!("INSERT INTO temp.exact_searches (e0, a0, v0, value_type_tag0, added0, flags0) VALUES {}", values)
+            } else {
+                // This will err for duplicates within the tx.
+                format!("INSERT INTO temp.inexact_searches (e0, a0, v0, value_type_tag0, added0, flags0) VALUES {}", values)
+            };
+
+            // TODO: consider ensuring we inserted the expected number of rows.
+            let mut stmt = self.prepare_cached(s.as_str())?;
+            stmt.execute(&params)
+                .context(DbSqlErrorKind::NonFtsInsertionIntoTempSearchTableFailed)
+                .map_err(|e| e.into())
+                .map(|_c| ())
+        }).collect::<Result<Vec<()>>>();
+
+        results.map(|_| ())
+    }
+
+    /// Insert search rows into temporary search tables.
+    ///
+    /// Eventually, the details of this approach will be captured in
+    /// https://github.com/mozilla/mentat/wiki/Transacting:-entity-to-SQL-translation.
+    fn insert_fts_searches<'a>(&self, entities: &'a [ReducedEntity<'a>], search_type: SearchType) -> Result<()> {
+        let max_vars = self.limit(Limit::SQLITE_LIMIT_VARIABLE_NUMBER) as usize;
+        let bindings_per_statement = 6;
+
+        let mut outer_searchid = 2000;
+
+        let chunks: itertools::IntoChunks<_> = entities.into_iter().chunks(max_vars / bindings_per_statement);
+
+        // From string to (searchid, value_type_tag).
+        let mut seen: HashMap<ValueRc<String>, (i64, i32)> = HashMap::with_capacity(entities.len());
+
+        // We'd like to flat_map here, but it's not obvious how to flat_map across Result.
+        let results: Result<Vec<()>> = chunks.into_iter().map(|chunk| -> Result<()> {
+            let mut datom_count = 0;
+            let mut string_count = 0;
+
+            // We must keep these computed values somewhere to reference them later, so we can't
+            // combine this map and the subsequent flat_map.
+            // (e0, a0, v0, value_type_tag0, added0, flags0)
+            let block: Result<Vec<(i64 /* e */,
+                                   i64 /* a */,
+                                   Option<ToSqlOutput<'a>> /* value */,
+                                   i32 /* value_type_tag */,
+                                   bool /* added0 */,
+                                   u8 /* flags0 */,
+                                   i64 /* searchid */)>> = chunk.map(|&(e, a, ref attribute, ref typed_value, added)| {
+                match typed_value {
+                    &TypedValue::String(ref rc) => {
+                        datom_count += 1;
+                        let entry = seen.entry(rc.clone());
+                        match entry {
+                            Entry::Occupied(entry) => {
+                                let &(searchid, value_type_tag) = entry.get();
+                                Ok((e, a, None, value_type_tag, added, attribute.flags(), searchid))
+                            },
+                            Entry::Vacant(entry) => {
+                                outer_searchid += 1;
+                                string_count += 1;
+
+                                // Now we can represent the typed value as an SQL value.
+                                let (value, value_type_tag): (ToSqlOutput, i32) = typed_value.to_sql_value_pair();
+                                entry.insert((outer_searchid, value_type_tag));
+
+                                Ok((e, a, Some(value), value_type_tag, added, attribute.flags(), outer_searchid))
+                            }
+                        }
+                    },
+                    _ => {
+                        bail!(DbError::WrongTypeValueForFtsAssertion);
+                    },
+                }
+
+
+            }).collect();
+            let block = block?;
+
+            // First, insert all fulltext string values.
+            // `fts_params` reference computed values in `block`.
+            let fts_params: Vec<&ToSql> =
+                block.iter()
+                     .filter(|&&(ref _e, ref _a, ref value, ref _value_type_tag, _added, ref _flags, ref _searchid)| {
+                         value.is_some()
+                     })
+                     .flat_map(|&(ref _e, ref _a, ref value, ref _value_type_tag, _added, ref _flags, ref searchid)| {
+                         // Avoid inner heap allocation.
+                         once(value as &ToSql)
+                             .chain(once(searchid as &ToSql))
+                     }).collect();
+
+            // TODO: make this maximally efficient. It's not terribly inefficient right now.
+            let fts_values: String = repeat_values(2, string_count);
+            let fts_s: String = format!("INSERT INTO fulltext_values_view (text, searchid) VALUES {}", fts_values);
+
+            // TODO: consider ensuring we inserted the expected number of rows.
+            let mut stmt = self.prepare_cached(fts_s.as_str())?;
+            stmt.execute(&fts_params).context(DbSqlErrorKind::FtsInsertionFailed)?;
+
+            // Second, insert searches.
+            // `params` reference computed values in `block`.
+            let params: Vec<&ToSql> = block.iter().flat_map(|&(ref e, ref a, ref _value, ref value_type_tag, added, ref flags, ref searchid)| {
+                // Avoid inner heap allocation.
+                // TODO: extract some finite length iterator to make this less indented!
+                once(e as &ToSql)
+                    .chain(once(a as &ToSql)
+                           .chain(once(searchid as &ToSql)
+                                  .chain(once(value_type_tag as &ToSql)
+                                         .chain(once(to_bool_ref(added) as &ToSql)
+                                                .chain(once(flags as &ToSql))))))
+            }).collect();
+
+            // TODO: cache this for selected values of count.
+            assert!(bindings_per_statement * datom_count < max_vars, "Too many values: {} * {} >= {}", bindings_per_statement, datom_count, max_vars);
+            let inner = "(?, ?, (SELECT rowid FROM fulltext_values WHERE searchid = ?), ?, ?, ?)".to_string();
+            // Like "(?, ?, (SELECT rowid FROM fulltext_values WHERE searchid = ?), ?, ?, ?), (?, ?, (SELECT rowid FROM fulltext_values WHERE searchid = ?), ?, ?, ?)".
+            let fts_values: String = repeat(inner).take(datom_count).join(", ");
+            let s: String = if search_type == SearchType::Exact {
+                format!("INSERT INTO temp.exact_searches (e0, a0, v0, value_type_tag0, added0, flags0) VALUES {}", fts_values)
+            } else {
+                format!("INSERT INTO temp.inexact_searches (e0, a0, v0, value_type_tag0, added0, flags0) VALUES {}", fts_values)
+            };
+
+            // TODO: consider ensuring we inserted the expected number of rows.
+            let mut stmt = self.prepare_cached(s.as_str())?;
+            stmt.execute(&params).context(DbSqlErrorKind::FtsInsertionIntoTempSearchTableFailed)
+                .map_err(|e| e.into())
+                .map(|_c| ())
+        }).collect::<Result<Vec<()>>>();
+
+        // Finally, clean up temporary searchids.
+        let mut stmt = self.prepare_cached("UPDATE fulltext_values SET searchid = NULL WHERE searchid IS NOT NULL")?;
+        stmt.execute(&[]).context(DbSqlErrorKind::FtsFailedToDropSearchIds)?;
+        results.map(|_| ())
+    }
+
+    fn commit_transaction(&self, tx_id: Entid) -> Result<()> {
+        search(&self)?;
+        insert_transaction(&self, tx_id)?;
+        update_datoms(&self, tx_id)?;
+        Ok(())
+    }
+
+    fn committed_metadata_assertions(&self, tx_id: Entid) -> Result<Vec<(Entid, Entid, TypedValue, bool)>> {
+        // TODO: use concat! to avoid creating String instances.
+        let mut stmt = self.prepare_cached(format!("SELECT e, a, v, value_type_tag, added FROM transactions WHERE tx = ? AND a IN {} ORDER BY e, a, v, value_type_tag, added", entids::METADATA_SQL_LIST.as_str()).as_str())?;
+        let params = [&tx_id as &ToSql];
+        let m: Result<Vec<_>> = stmt.query_and_then(&params[..], |row| -> Result<(Entid, Entid, TypedValue, bool)> {
+            Ok((row.get_checked(0)?,
+                row.get_checked(1)?,
+                TypedValue::from_sql_value_pair(row.get_checked(2)?, row.get_checked(3)?)?,
+                row.get_checked(4)?))
+        })?.collect();
+        m
+    }
+}
+
+/// Update the current partition map materialized view.
+// TODO: only update changed partitions.
+pub fn update_partition_map(conn: &rusqlite::Connection, partition_map: &PartitionMap) -> Result<()> {
+    let values_per_statement = 2;
+    let max_vars = conn.limit(Limit::SQLITE_LIMIT_VARIABLE_NUMBER) as usize;
+    let max_partitions = max_vars / values_per_statement;
+    if partition_map.len() > max_partitions {
+        bail!(DbError::NotYetImplemented(format!("No more than {} partitions are supported", max_partitions)));
+    }
+
+    // Like "UPDATE parts SET idx = CASE WHEN part = ? THEN ? WHEN part = ? THEN ? ELSE idx END".
+    let s = format!("UPDATE parts SET idx = CASE {} ELSE idx END",
+                    repeat("WHEN part = ? THEN ?").take(partition_map.len()).join(" "));
+
+    let params: Vec<&ToSql> = partition_map.iter().flat_map(|(name, partition)| {
+        once(name as &ToSql)
+            .chain(once(&partition.index as &ToSql))
+    }).collect();
+
+    // TODO: only cache the latest of these statements.  Changing the set of partitions isn't
+    // supported in the Clojure implementation at all, and might not be supported in Mentat soon,
+    // so this is very low priority.
+    let mut stmt = conn.prepare_cached(s.as_str())?;
+    stmt.execute(&params[..]).context(DbSqlErrorKind::FailedToUpdatePartitionMap)?;
+    Ok(())
+}
+
+/// Update the metadata materialized views based on the given metadata report.
+///
+/// This updates the "entids", "idents", and "schema" materialized views, copying directly from the
+/// "datoms" and "transactions" table as appropriate.
+pub fn update_metadata(conn: &rusqlite::Connection, _old_schema: &Schema, new_schema: &Schema, metadata_report: &metadata::MetadataReport) -> Result<()>
+{
+    use metadata::AttributeAlteration::*;
+
+    // Populate the materialized view directly from datoms (and, potentially in the future,
+    // transactions).  This might generalize nicely as we expand the set of materialized views.
+    // TODO: consider doing this in fewer SQLite execute() invocations.
+    // TODO: use concat! to avoid creating String instances.
+    if !metadata_report.idents_altered.is_empty() {
+        // Idents is the materialized view of the [entid :db/ident ident] slice of datoms.
+        conn.execute(format!("DELETE FROM idents").as_str(),
+                     &[])?;
+        conn.execute(format!("INSERT INTO idents SELECT e, a, v, value_type_tag FROM datoms WHERE a IN {}", entids::IDENTS_SQL_LIST.as_str()).as_str(),
+                     &[])?;
+    }
+
+
+    let mut stmt = conn.prepare(format!("INSERT INTO schema SELECT e, a, v, value_type_tag FROM datoms WHERE e = ? AND a IN {}", entids::SCHEMA_SQL_LIST.as_str()).as_str())?;
+    for &entid in &metadata_report.attributes_installed {
+        stmt.execute(&[&entid as &ToSql])?;
+    }
+
+    let mut delete_stmt = conn.prepare(format!("DELETE FROM schema WHERE e = ? AND a IN {}", entids::SCHEMA_SQL_LIST.as_str()).as_str())?;
+    let mut insert_stmt = conn.prepare(format!("INSERT INTO schema SELECT e, a, v, value_type_tag FROM datoms WHERE e = ? AND a IN {}", entids::SCHEMA_SQL_LIST.as_str()).as_str())?;
+    let mut index_stmt = conn.prepare("UPDATE datoms SET index_avet = ? WHERE a = ?")?;
+    let mut unique_value_stmt = conn.prepare("UPDATE datoms SET unique_value = ? WHERE a = ?")?;
+    let mut cardinality_stmt = conn.prepare(r#"
+SELECT EXISTS
+    (SELECT 1
+        FROM datoms AS left, datoms AS right
+        WHERE left.a = ? AND
+        left.a = right.a AND
+        left.e = right.e AND
+        left.v <> right.v)"#)?;
+
+    for (&entid, alterations) in &metadata_report.attributes_altered {
+        delete_stmt.execute(&[&entid as &ToSql])?;
+        insert_stmt.execute(&[&entid as &ToSql])?;
+
+        let attribute = new_schema.require_attribute_for_entid(entid)?;
+
+        for alteration in alterations {
+            match alteration {
+                &Index => {
+                    // This should always succeed.
+                    index_stmt.execute(&[&attribute.index, &entid as &ToSql])?;
+                },
+                &Unique => {
+                    // TODO: This can fail if there are conflicting values; give a more helpful
+                    // error message in this case.
+                    if unique_value_stmt.execute(&[to_bool_ref(attribute.unique.is_some()), &entid as &ToSql]).is_err() {
+                        match attribute.unique {
+                            Some(attribute::Unique::Value) => bail!(DbError::SchemaAlterationFailed(format!("Cannot alter schema attribute {} to be :db.unique/value", entid))),
+                            Some(attribute::Unique::Identity) => bail!(DbError::SchemaAlterationFailed(format!("Cannot alter schema attribute {} to be :db.unique/identity", entid))),
+                            None => unreachable!(), // This shouldn't happen, even after we support removing :db/unique.
+                        }
+                    }
+                },
+                &Cardinality => {
+                    // We can always go from :db.cardinality/one to :db.cardinality many.  It's
+                    // :db.cardinality/many to :db.cardinality/one that can fail.
+                    //
+                    // TODO: improve the failure message.  Perhaps try to mimic what Datomic says in
+                    // this case?
+                    if !attribute.multival {
+                        let mut rows = cardinality_stmt.query(&[&entid as &ToSql])?;
+                        if rows.next().is_some() {
+                            bail!(DbError::SchemaAlterationFailed(format!("Cannot alter schema attribute {} to be :db.cardinality/one", entid)));
+                        }
+                    }
+                },
+                &NoHistory | &IsComponent => {
+                    // There's no on disk change required for either of these.
+                },
+            }
+        }
+    }
+
+    Ok(())
+}
+
+pub trait PartitionMapping {
+    fn allocate_entid<S: ?Sized + Ord + Display>(&mut self, partition: &S) -> i64 where String: Borrow<S>;
+    fn allocate_entids<S: ?Sized + Ord + Display>(&mut self, partition: &S, n: usize) -> Range<i64> where String: Borrow<S>;
+    fn contains_entid(&self, entid: Entid) -> bool;
+}
+
+impl PartitionMapping for PartitionMap {
+    /// Allocate a single fresh entid in the given `partition`.
+    fn allocate_entid<S: ?Sized + Ord + Display>(&mut self, partition: &S) -> i64 where String: Borrow<S> {
+        self.allocate_entids(partition, 1).start
+    }
+
+    /// Allocate `n` fresh entids in the given `partition`.
+    fn allocate_entids<S: ?Sized + Ord + Display>(&mut self, partition: &S, n: usize) -> Range<i64> where String: Borrow<S> {
+        match self.get_mut(partition) {
+            Some(partition) => {
+                let idx = partition.index;
+                partition.index += n as i64;
+                idx..partition.index
+            },
+            // This is a programming error.
+            None => panic!("Cannot allocate entid from unknown partition: {}", partition),
+        }
+    }
+
+    fn contains_entid(&self, entid: Entid) -> bool {
+        self.values().any(|partition| partition.contains_entid(entid))
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    extern crate env_logger;
+
+    use super::*;
+    use bootstrap;
+    use debug;
+    use errors;
+    use edn;
+    use mentat_core::{
+        HasSchema,
+        Keyword,
+        KnownEntid,
+        attribute,
+    };
+    use mentat_core::intern_set::{
+        InternSet,
+    };
+    use mentat_core::util::Either::*;
+    use edn::entities::{
+        OpType,
+        TempId,
+    };
+    use rusqlite;
+    use std::collections::{
+        BTreeMap,
+    };
+    use internal_types::{
+        Term,
+        TermWithTempIds,
+    };
+    use types::TxReport;
+    use tx::{
+        transact_terms,
+    };
+
+    // Macro to parse a `Borrow<str>` to an `edn::Value` and assert the given `edn::Value` `matches`
+    // against it.
+    //
+    // This is a macro only to give nice line numbers when tests fail.
+    macro_rules! assert_matches {
+        ( $input: expr, $expected: expr ) => {{
+            // Failure to parse the expected pattern is a coding error, so we unwrap.
+            let pattern_value = edn::parse::value($expected.borrow())
+                .expect(format!("to be able to parse expected {}", $expected).as_str())
+                .without_spans();
+            assert!($input.matches(&pattern_value),
+                    "Expected value:\n{}\nto match pattern:\n{}\n",
+                    $input.to_pretty(120).unwrap(),
+                    pattern_value.to_pretty(120).unwrap());
+        }}
+    }
+
+    // Transact $input against the given $conn, expecting success or a `Result<TxReport, String>`.
+    //
+    // This unwraps safely and makes asserting errors pleasant.
+    macro_rules! assert_transact {
+        ( $conn: expr, $input: expr, $expected: expr ) => {{
+            trace!("assert_transact: {}", $input);
+            let result = $conn.transact($input).map_err(|e| e.to_string());
+            assert_eq!(result, $expected.map_err(|e| e.to_string()));
+        }};
+        ( $conn: expr, $input: expr ) => {{
+            trace!("assert_transact: {}", $input);
+            let result = $conn.transact($input);
+            assert!(result.is_ok(), "Expected Ok(_), got `{}`", result.unwrap_err());
+            result.unwrap()
+        }};
+    }
+
+    // A connection that doesn't try to be clever about possibly sharing its `Schema`.  Compare to
+    // `mentat::Conn`.
+    struct TestConn {
+        sqlite: rusqlite::Connection,
+        partition_map: PartitionMap,
+        schema: Schema,
+    }
+
+    impl TestConn {
+        fn assert_materialized_views(&self) {
+            let materialized_ident_map = read_ident_map(&self.sqlite).expect("ident map");
+            let materialized_attribute_map = read_attribute_map(&self.sqlite).expect("schema map");
+
+            let materialized_schema = Schema::from_ident_map_and_attribute_map(materialized_ident_map, materialized_attribute_map).expect("schema");
+            assert_eq!(materialized_schema, self.schema);
+        }
+
+        fn transact<I>(&mut self, transaction: I) -> Result<TxReport> where I: Borrow<str> {
+            // Failure to parse the transaction is a coding error, so we unwrap.
+            let entities = edn::parse::entities(transaction.borrow()).expect(format!("to be able to parse {} into entities", transaction.borrow()).as_str());
+
+            let details = {
+                // The block scopes the borrow of self.sqlite.
+                // We're about to write, so go straight ahead and get an IMMEDIATE transaction.
+                let tx = self.sqlite.transaction_with_behavior(TransactionBehavior::Immediate)?;
+                // Applying the transaction can fail, so we don't unwrap.
+                let details = transact(&tx, self.partition_map.clone(), &self.schema, &self.schema, NullWatcher(), entities)?;
+                tx.commit()?;
+                details
+            };
+
+            let (report, next_partition_map, next_schema, _watcher) = details;
+            self.partition_map = next_partition_map;
+            if let Some(next_schema) = next_schema {
+                self.schema = next_schema;
+            }
+
+            // Verify that we've updated the materialized views during transacting.
+            self.assert_materialized_views();
+
+            Ok(report)
+        }
+
+        fn transact_simple_terms<I>(&mut self, terms: I, tempid_set: InternSet<TempId>) -> Result<TxReport> where I: IntoIterator<Item=TermWithTempIds> {
+            let details = {
+                // The block scopes the borrow of self.sqlite.
+                // We're about to write, so go straight ahead and get an IMMEDIATE transaction.
+                let tx = self.sqlite.transaction_with_behavior(TransactionBehavior::Immediate)?;
+                // Applying the transaction can fail, so we don't unwrap.
+                let details = transact_terms(&tx, self.partition_map.clone(), &self.schema, &self.schema, NullWatcher(), terms, tempid_set)?;
+                tx.commit()?;
+                details
+            };
+
+            let (report, next_partition_map, next_schema, _watcher) = details;
+            self.partition_map = next_partition_map;
+            if let Some(next_schema) = next_schema {
+                self.schema = next_schema;
+            }
+
+            // Verify that we've updated the materialized views during transacting.
+            self.assert_materialized_views();
+
+            Ok(report)
+        }
+
+        fn last_tx_id(&self) -> Entid {
+            self.partition_map.get(&":db.part/tx".to_string()).unwrap().index - 1
+        }
+
+        fn last_transaction(&self) -> edn::Value {
+            debug::transactions_after(&self.sqlite, &self.schema, self.last_tx_id() - 1).expect("last_transaction").0[0].into_edn()
+        }
+
+        fn datoms(&self) -> edn::Value {
+            debug::datoms_after(&self.sqlite, &self.schema, bootstrap::TX0).expect("datoms").into_edn()
+        }
+
+        fn fulltext_values(&self) -> edn::Value {
+            debug::fulltext_values(&self.sqlite).expect("fulltext_values").into_edn()
+        }
+
+        fn with_sqlite(mut conn: rusqlite::Connection) -> TestConn {
+            let db = ensure_current_version(&mut conn).unwrap();
+
+            // Does not include :db/txInstant.
+            let datoms = debug::datoms_after(&conn, &db.schema, 0).unwrap();
+            assert_eq!(datoms.0.len(), 94);
+
+            // Includes :db/txInstant.
+            let transactions = debug::transactions_after(&conn, &db.schema, 0).unwrap();
+            assert_eq!(transactions.0.len(), 1);
+            assert_eq!(transactions.0[0].0.len(), 95);
+
+            let mut parts = db.partition_map;
+
+            // Add a fake partition to allow tests to do things like
+            // [:db/add 111 :foo/bar 222]
+            {
+                let fake_partition = Partition { start: 100, index: 1000 };
+                parts.insert(":db.part/fake".into(), fake_partition);
+            }
+
+            let test_conn = TestConn {
+                sqlite: conn,
+                partition_map: parts,
+                schema: db.schema,
+            };
+
+            // Verify that we've created the materialized views during bootstrapping.
+            test_conn.assert_materialized_views();
+
+            test_conn
+        }
+    }
+
+    impl Default for TestConn {
+        fn default() -> TestConn {
+            TestConn::with_sqlite(new_connection("").expect("Couldn't open in-memory db"))
+        }
+    }
+
+    fn tempids(report: &TxReport) -> edn::Value {
+        let mut map: BTreeMap<edn::Value, edn::Value> = BTreeMap::default();
+        for (tempid, &entid) in report.tempids.iter() {
+            map.insert(edn::Value::Text(tempid.clone()), edn::Value::Integer(entid));
+        }
+        edn::Value::Map(map)
+    }
+
+    fn run_test_add(mut conn: TestConn) {
+        // Test inserting :db.cardinality/one elements.
+        assert_transact!(conn, "[[:db/add 100 :db.schema/version 1]
+                                 [:db/add 101 :db.schema/version 2]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[100 :db.schema/version 1 ?tx true]
+                          [101 :db.schema/version 2 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                       "[[100 :db.schema/version 1]
+                         [101 :db.schema/version 2]]");
+
+        // Test inserting :db.cardinality/many elements.
+        assert_transact!(conn, "[[:db/add 200 :db.schema/attribute 100]
+                                 [:db/add 200 :db.schema/attribute 101]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[200 :db.schema/attribute 100 ?tx true]
+                          [200 :db.schema/attribute 101 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[100 :db.schema/version 1]
+                          [101 :db.schema/version 2]
+                          [200 :db.schema/attribute 100]
+                          [200 :db.schema/attribute 101]]");
+
+        // Test replacing existing :db.cardinality/one elements.
+        assert_transact!(conn, "[[:db/add 100 :db.schema/version 11]
+                                 [:db/add 101 :db.schema/version 22]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[100 :db.schema/version 1 ?tx false]
+                          [100 :db.schema/version 11 ?tx true]
+                          [101 :db.schema/version 2 ?tx false]
+                          [101 :db.schema/version 22 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[100 :db.schema/version 11]
+                          [101 :db.schema/version 22]
+                          [200 :db.schema/attribute 100]
+                          [200 :db.schema/attribute 101]]");
+
+
+        // Test that asserting existing :db.cardinality/one elements doesn't change the store.
+        assert_transact!(conn, "[[:db/add 100 :db.schema/version 11]
+                                 [:db/add 101 :db.schema/version 22]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[100 :db.schema/version 11]
+                          [101 :db.schema/version 22]
+                          [200 :db.schema/attribute 100]
+                          [200 :db.schema/attribute 101]]");
+
+
+        // Test that asserting existing :db.cardinality/many elements doesn't change the store.
+        assert_transact!(conn, "[[:db/add 200 :db.schema/attribute 100]
+                                 [:db/add 200 :db.schema/attribute 101]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[100 :db.schema/version 11]
+                          [101 :db.schema/version 22]
+                          [200 :db.schema/attribute 100]
+                          [200 :db.schema/attribute 101]]");
+    }
+
+    #[test]
+    fn test_add() {
+        run_test_add(TestConn::default());
+    }
+
+    #[test]
+    fn test_tx_assertions() {
+        let mut conn = TestConn::default();
+
+        // Test that txInstant can be asserted.
+        assert_transact!(conn, "[[:db/add (transaction-tx) :db/txInstant #inst \"2017-06-16T00:56:41.257Z\"]
+                                 [:db/add 100 :db/ident :name/Ivan]
+                                 [:db/add 101 :db/ident :name/Petr]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[100 :db/ident :name/Ivan ?tx true]
+                          [101 :db/ident :name/Petr ?tx true]
+                          [?tx :db/txInstant #inst \"2017-06-16T00:56:41.257Z\" ?tx true]]");
+
+        // Test multiple txInstant with different values should fail.
+        assert_transact!(conn, "[[:db/add (transaction-tx) :db/txInstant #inst \"2017-06-16T00:59:11.257Z\"]
+                                 [:db/add (transaction-tx) :db/txInstant #inst \"2017-06-16T00:59:11.752Z\"]
+                                 [:db/add 102 :db/ident :name/Vlad]]",
+                         Err("schema constraint violation: cardinality conflicts:\n  CardinalityOneAddConflict { e: 268435458, a: 3, vs: {Instant(2017-06-16T00:59:11.257Z), Instant(2017-06-16T00:59:11.752Z)} }\n"));
+
+        // Test multiple txInstants with the same value.
+        assert_transact!(conn, "[[:db/add (transaction-tx) :db/txInstant #inst \"2017-06-16T00:59:11.257Z\"]
+                                 [:db/add (transaction-tx) :db/txInstant #inst \"2017-06-16T00:59:11.257Z\"]
+                                 [:db/add 103 :db/ident :name/Dimitri]
+                                 [:db/add 104 :db/ident :name/Anton]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[103 :db/ident :name/Dimitri ?tx true]
+                          [104 :db/ident :name/Anton ?tx true]
+                          [?tx :db/txInstant #inst \"2017-06-16T00:59:11.257Z\" ?tx true]]");
+
+        // We need a few attributes to work with.
+        assert_transact!(conn, "[[:db/add 111 :db/ident :test/str]
+                                 [:db/add 111 :db/valueType :db.type/string]
+                                 [:db/add 222 :db/ident :test/ref]
+                                 [:db/add 222 :db/valueType :db.type/ref]]");
+
+        // Test that we can assert metadata about the current transaction.
+        assert_transact!(conn, "[[:db/add (transaction-tx) :test/str \"We want metadata!\"]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[?tx :db/txInstant ?ms ?tx true]
+                          [?tx :test/str \"We want metadata!\" ?tx true]]");
+
+        // Test that we can use (transaction-tx) as a value.
+        assert_transact!(conn, "[[:db/add 333 :test/ref (transaction-tx)]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[333 :test/ref ?tx ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+
+        // Test that we type-check properly.  In the value position, (transaction-tx) yields a ref;
+        // :db/ident expects a keyword.
+        assert_transact!(conn, "[[:db/add 444 :db/ident (transaction-tx)]]",
+                         Err("not yet implemented: Transaction function transaction-tx produced value of type :db.type/ref but expected type :db.type/keyword"));
+
+        // Test that we can assert metadata about the current transaction.
+        assert_transact!(conn, "[[:db/add (transaction-tx) :test/ref (transaction-tx)]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[?tx :db/txInstant ?ms ?tx true]
+                          [?tx :test/ref ?tx ?tx true]]");
+    }
+
+    #[test]
+    fn test_retract() {
+        let mut conn = TestConn::default();
+
+        // Insert a few :db.cardinality/one elements.
+        assert_transact!(conn, "[[:db/add 100 :db.schema/version 1]
+                                 [:db/add 101 :db.schema/version 2]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[100 :db.schema/version 1 ?tx true]
+                          [101 :db.schema/version 2 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[100 :db.schema/version 1]
+                          [101 :db.schema/version 2]]");
+
+        // And a few :db.cardinality/many elements.
+        assert_transact!(conn, "[[:db/add 200 :db.schema/attribute 100]
+                                 [:db/add 200 :db.schema/attribute 101]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[200 :db.schema/attribute 100 ?tx true]
+                          [200 :db.schema/attribute 101 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[100 :db.schema/version 1]
+                          [101 :db.schema/version 2]
+                          [200 :db.schema/attribute 100]
+                          [200 :db.schema/attribute 101]]");
+
+        // Test that we can retract :db.cardinality/one elements.
+        assert_transact!(conn, "[[:db/retract 100 :db.schema/version 1]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[100 :db.schema/version 1 ?tx false]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[101 :db.schema/version 2]
+                          [200 :db.schema/attribute 100]
+                          [200 :db.schema/attribute 101]]");
+
+        // Test that we can retract :db.cardinality/many elements.
+        assert_transact!(conn, "[[:db/retract 200 :db.schema/attribute 100]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[200 :db.schema/attribute 100 ?tx false]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[101 :db.schema/version 2]
+                          [200 :db.schema/attribute 101]]");
+
+        // Verify that retracting :db.cardinality/{one,many} elements that are not present doesn't
+        // change the store.
+        assert_transact!(conn, "[[:db/retract 100 :db.schema/version 1]
+                                 [:db/retract 200 :db.schema/attribute 100]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[101 :db.schema/version 2]
+                          [200 :db.schema/attribute 101]]");
+    }
+
+    // Unique is required!
+    #[test]
+    fn test_upsert_issue_538() {
+        let mut conn = TestConn::default();
+        assert_transact!(conn, "
+            [{:db/ident :person/name
+              :db/valueType :db.type/string
+              :db/cardinality :db.cardinality/many}
+             {:db/ident :person/age
+              :db/valueType :db.type/long
+              :db/cardinality :db.cardinality/one}
+             {:db/ident :person/email
+              :db/valueType :db.type/string
+              :db/unique :db.unique/identity
+              :db/cardinality :db.cardinality/many}]",
+              Err("bad schema assertion: :db/unique :db/unique_identity without :db/index true for entid: 65538"));
+    }
+
+    // TODO: don't use :db/ident to test upserts!
+    #[test]
+    fn test_upsert_vector() {
+        let mut conn = TestConn::default();
+
+        // Insert some :db.unique/identity elements.
+        assert_transact!(conn, "[[:db/add 100 :db/ident :name/Ivan]
+                                 [:db/add 101 :db/ident :name/Petr]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[100 :db/ident :name/Ivan ?tx true]
+                          [101 :db/ident :name/Petr ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[100 :db/ident :name/Ivan]
+                          [101 :db/ident :name/Petr]]");
+
+        // Upserting two tempids to the same entid works.
+        let report = assert_transact!(conn, "[[:db/add \"t1\" :db/ident :name/Ivan]
+                                              [:db/add \"t1\" :db.schema/attribute 100]
+                                              [:db/add \"t2\" :db/ident :name/Petr]
+                                              [:db/add \"t2\" :db.schema/attribute 101]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[100 :db.schema/attribute :name/Ivan ?tx true]
+                          [101 :db.schema/attribute :name/Petr ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[100 :db/ident :name/Ivan]
+                          [100 :db.schema/attribute :name/Ivan]
+                          [101 :db/ident :name/Petr]
+                          [101 :db.schema/attribute :name/Petr]]");
+        assert_matches!(tempids(&report),
+                        "{\"t1\" 100
+                          \"t2\" 101}");
+
+        // Upserting a tempid works.  The ref doesn't have to exist (at this time), but we can't
+        // reuse an existing ref due to :db/unique :db.unique/value.
+        let report = assert_transact!(conn, "[[:db/add \"t1\" :db/ident :name/Ivan]
+                                              [:db/add \"t1\" :db.schema/attribute 102]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[100 :db.schema/attribute 102 ?tx true]
+                          [?true :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[100 :db/ident :name/Ivan]
+                          [100 :db.schema/attribute :name/Ivan]
+                          [100 :db.schema/attribute 102]
+                          [101 :db/ident :name/Petr]
+                          [101 :db.schema/attribute :name/Petr]]");
+        assert_matches!(tempids(&report),
+                        "{\"t1\" 100}");
+
+        // A single complex upsert allocates a new entid.
+        let report = assert_transact!(conn, "[[:db/add \"t1\" :db.schema/attribute \"t2\"]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[65536 :db.schema/attribute 65537 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(tempids(&report),
+                        "{\"t1\" 65536
+                          \"t2\" 65537}");
+
+        // Conflicting upserts fail.
+        assert_transact!(conn, "[[:db/add \"t1\" :db/ident :name/Ivan]
+                                 [:db/add \"t1\" :db/ident :name/Petr]]",
+                         Err("schema constraint violation: conflicting upserts:\n  tempid External(\"t1\") upserts to {KnownEntid(100), KnownEntid(101)}\n"));
+
+        // The error messages of conflicting upserts gives information about all failing upserts (in a particular generation).
+        assert_transact!(conn, "[[:db/add \"t2\" :db/ident :name/Grigory]
+                                 [:db/add \"t2\" :db/ident :name/Petr]
+                                 [:db/add \"t2\" :db/ident :name/Ivan]
+                                 [:db/add \"t1\" :db/ident :name/Ivan]
+                                 [:db/add \"t1\" :db/ident :name/Petr]]",
+                         Err("schema constraint violation: conflicting upserts:\n  tempid External(\"t1\") upserts to {KnownEntid(100), KnownEntid(101)}\n  tempid External(\"t2\") upserts to {KnownEntid(100), KnownEntid(101)}\n"));
+
+        // tempids in :db/retract that don't upsert fail.
+        assert_transact!(conn, "[[:db/retract \"t1\" :db/ident :name/Anonymous]]",
+                         Err("not yet implemented: [:db/retract ...] entity referenced tempid that did not upsert: t1"));
+
+        // tempids in :db/retract that do upsert are retracted.  The ref given doesn't exist, so the
+        // assertion will be ignored.
+        let report = assert_transact!(conn, "[[:db/add \"t1\" :db/ident :name/Ivan]
+                                              [:db/retract \"t1\" :db.schema/attribute 103]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(tempids(&report),
+                        "{\"t1\" 100}");
+
+        // A multistep upsert.  The upsert algorithm will first try to resolve "t1", fail, and then
+        // allocate both "t1" and "t2".
+        let report = assert_transact!(conn, "[[:db/add \"t1\" :db/ident :name/Josef]
+                                              [:db/add \"t2\" :db.schema/attribute \"t1\"]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[65538 :db/ident :name/Josef ?tx true]
+                          [65539 :db.schema/attribute :name/Josef ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(tempids(&report),
+                        "{\"t1\" 65538
+                          \"t2\" 65539}");
+
+        // A multistep insert.  This time, we can resolve both, but we have to try "t1", succeed,
+        // and then resolve "t2".
+        // TODO: We can't quite test this without more schema elements.
+        // conn.transact("[[:db/add \"t1\" :db/ident :name/Josef]
+        //                 [:db/add \"t2\" :db/ident \"t1\"]]");
+        // assert_matches!(conn.last_transaction(),
+        //                 "[[65538 :db/ident :name/Josef]
+        //                   [65538 :db/ident :name/Karl]
+        //                   [?tx :db/txInstant ?ms ?tx true]]");
+    }
+
+    #[test]
+    fn test_resolved_upserts() {
+        let mut conn = TestConn::default();
+        assert_transact!(conn, "[
+            {:db/ident :test/id
+             :db/valueType :db.type/string
+             :db/unique :db.unique/identity
+             :db/index true
+             :db/cardinality :db.cardinality/one}
+            {:db/ident :test/ref
+             :db/valueType :db.type/ref
+             :db/unique :db.unique/identity
+             :db/index true
+             :db/cardinality :db.cardinality/one}
+        ]");
+
+        // Partial data for :test/id, links via :test/ref.
+        assert_transact!(conn, r#"[
+            [:db/add 100 :test/id "0"]
+            [:db/add 101 :test/ref 100]
+            [:db/add 102 :test/ref 101]
+            [:db/add 103 :test/ref 102]
+        ]"#);
+
+        // Fill in the rest of the data for :test/id, using the links of :test/ref.
+        let report = assert_transact!(conn, r#"[
+            {:db/id "a" :test/id "0"}
+            {:db/id "b" :test/id "1" :test/ref "a"}
+            {:db/id "c" :test/id "2" :test/ref "b"}
+            {:db/id "d" :test/id "3" :test/ref "c"}
+        ]"#);
+
+        assert_matches!(tempids(&report), r#"{
+            "a" 100
+            "b" 101
+            "c" 102
+            "d" 103
+        }"#);
+
+        assert_matches!(conn.last_transaction(), r#"[
+            [101 :test/id "1" ?tx true]
+            [102 :test/id "2" ?tx true]
+            [103 :test/id "3" ?tx true]
+            [?tx :db/txInstant ?ms ?tx true]
+        ]"#);
+    }
+
+    #[test]
+    fn test_sqlite_limit() {
+        let conn = new_connection("").expect("Couldn't open in-memory db");
+        let initial = conn.limit(Limit::SQLITE_LIMIT_VARIABLE_NUMBER);
+        // Sanity check.
+        assert!(initial > 500);
+
+        // Make sure setting works.
+        conn.set_limit(Limit::SQLITE_LIMIT_VARIABLE_NUMBER, 222);
+        assert_eq!(222, conn.limit(Limit::SQLITE_LIMIT_VARIABLE_NUMBER));
+    }
+
+    #[test]
+    fn test_db_install() {
+        let mut conn = TestConn::default();
+
+        // We can assert a new attribute.
+        assert_transact!(conn, "[[:db/add 100 :db/ident :test/ident]
+                                 [:db/add 100 :db/valueType :db.type/long]
+                                 [:db/add 100 :db/cardinality :db.cardinality/many]]");
+
+        assert_eq!(conn.schema.entid_map.get(&100).cloned().unwrap(), to_namespaced_keyword(":test/ident").unwrap());
+        assert_eq!(conn.schema.ident_map.get(&to_namespaced_keyword(":test/ident").unwrap()).cloned().unwrap(), 100);
+        let attribute = conn.schema.attribute_for_entid(100).unwrap().clone();
+        assert_eq!(attribute.value_type, ValueType::Long);
+        assert_eq!(attribute.multival, true);
+        assert_eq!(attribute.fulltext, false);
+
+        assert_matches!(conn.last_transaction(),
+                        "[[100 :db/ident :test/ident ?tx true]
+                          [100 :db/valueType :db.type/long ?tx true]
+                          [100 :db/cardinality :db.cardinality/many ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[100 :db/ident :test/ident]
+                          [100 :db/valueType :db.type/long]
+                          [100 :db/cardinality :db.cardinality/many]]");
+
+        // Let's check we actually have the schema characteristics we expect.
+        let attribute = conn.schema.attribute_for_entid(100).unwrap().clone();
+        assert_eq!(attribute.value_type, ValueType::Long);
+        assert_eq!(attribute.multival, true);
+        assert_eq!(attribute.fulltext, false);
+
+        // Let's check that we can use the freshly installed attribute.
+        assert_transact!(conn, "[[:db/add 101 100 -10]
+                                 [:db/add 101 :test/ident -9]]");
+
+        assert_matches!(conn.last_transaction(),
+                        "[[101 :test/ident -10 ?tx true]
+                          [101 :test/ident -9 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+
+        // Cannot retract a characteristic of an installed attribute.
+        assert_transact!(conn,
+                         "[[:db/retract 100 :db/cardinality :db.cardinality/many]]",
+                         Err("bad schema assertion: Retracting attribute 8 for entity 100 not permitted."));
+
+        // Trying to install an attribute without a :db/ident is allowed.
+        assert_transact!(conn, "[[:db/add 101 :db/valueType :db.type/long]
+                                 [:db/add 101 :db/cardinality :db.cardinality/many]]");
+    }
+
+    #[test]
+    fn test_db_alter() {
+        let mut conn = TestConn::default();
+
+        // Start by installing a :db.cardinality/one attribute.
+        assert_transact!(conn, "[[:db/add 100 :db/ident :test/ident]
+                                 [:db/add 100 :db/valueType :db.type/keyword]
+                                 [:db/add 100 :db/cardinality :db.cardinality/one]]");
+
+        // Trying to alter the :db/valueType will fail.
+        assert_transact!(conn, "[[:db/add 100 :db/valueType :db.type/long]]",
+                         Err("bad schema assertion: Schema alteration for existing attribute with entid 100 is not valid"));
+
+        // But we can alter the cardinality.
+        assert_transact!(conn, "[[:db/add 100 :db/cardinality :db.cardinality/many]]");
+
+        assert_matches!(conn.last_transaction(),
+                        "[[100 :db/cardinality :db.cardinality/one ?tx false]
+                          [100 :db/cardinality :db.cardinality/many ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[100 :db/ident :test/ident]
+                          [100 :db/valueType :db.type/keyword]
+                          [100 :db/cardinality :db.cardinality/many]]");
+
+        // Let's check we actually have the schema characteristics we expect.
+        let attribute = conn.schema.attribute_for_entid(100).unwrap().clone();
+        assert_eq!(attribute.value_type, ValueType::Keyword);
+        assert_eq!(attribute.multival, true);
+        assert_eq!(attribute.fulltext, false);
+
+        // Let's check that we can use the freshly altered attribute's new characteristic.
+        assert_transact!(conn, "[[:db/add 101 100 :test/value1]
+                                 [:db/add 101 :test/ident :test/value2]]");
+
+        assert_matches!(conn.last_transaction(),
+                        "[[101 :test/ident :test/value1 ?tx true]
+                          [101 :test/ident :test/value2 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+    }
+
+    #[test]
+    fn test_db_ident() {
+        let mut conn = TestConn::default();
+
+        // We can assert a new :db/ident.
+        assert_transact!(conn, "[[:db/add 100 :db/ident :name/Ivan]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[100 :db/ident :name/Ivan ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[100 :db/ident :name/Ivan]]");
+        assert_eq!(conn.schema.entid_map.get(&100).cloned().unwrap(), to_namespaced_keyword(":name/Ivan").unwrap());
+        assert_eq!(conn.schema.ident_map.get(&to_namespaced_keyword(":name/Ivan").unwrap()).cloned().unwrap(), 100);
+
+        // We can re-assert an existing :db/ident.
+        assert_transact!(conn, "[[:db/add 100 :db/ident :name/Ivan]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[100 :db/ident :name/Ivan]]");
+        assert_eq!(conn.schema.entid_map.get(&100).cloned().unwrap(), to_namespaced_keyword(":name/Ivan").unwrap());
+        assert_eq!(conn.schema.ident_map.get(&to_namespaced_keyword(":name/Ivan").unwrap()).cloned().unwrap(), 100);
+
+        // We can alter an existing :db/ident to have a new keyword.
+        assert_transact!(conn, "[[:db/add :name/Ivan :db/ident :name/Petr]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[100 :db/ident :name/Ivan ?tx false]
+                          [100 :db/ident :name/Petr ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[100 :db/ident :name/Petr]]");
+        // Entid map is updated.
+        assert_eq!(conn.schema.entid_map.get(&100).cloned().unwrap(), to_namespaced_keyword(":name/Petr").unwrap());
+        // Ident map contains the new ident.
+        assert_eq!(conn.schema.ident_map.get(&to_namespaced_keyword(":name/Petr").unwrap()).cloned().unwrap(), 100);
+        // Ident map no longer contains the old ident.
+        assert!(conn.schema.ident_map.get(&to_namespaced_keyword(":name/Ivan").unwrap()).is_none());
+
+        // We can re-purpose an old ident.
+        assert_transact!(conn, "[[:db/add 101 :db/ident :name/Ivan]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[101 :db/ident :name/Ivan ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[100 :db/ident :name/Petr]
+                          [101 :db/ident :name/Ivan]]");
+        // Entid map contains both entids.
+        assert_eq!(conn.schema.entid_map.get(&100).cloned().unwrap(), to_namespaced_keyword(":name/Petr").unwrap());
+        assert_eq!(conn.schema.entid_map.get(&101).cloned().unwrap(), to_namespaced_keyword(":name/Ivan").unwrap());
+        // Ident map contains the new ident.
+        assert_eq!(conn.schema.ident_map.get(&to_namespaced_keyword(":name/Petr").unwrap()).cloned().unwrap(), 100);
+        // Ident map contains the old ident, but re-purposed to the new entid.
+        assert_eq!(conn.schema.ident_map.get(&to_namespaced_keyword(":name/Ivan").unwrap()).cloned().unwrap(), 101);
+
+        // We can retract an existing :db/ident.
+        assert_transact!(conn, "[[:db/retract :name/Petr :db/ident :name/Petr]]");
+        // It's really gone.
+        assert!(conn.schema.entid_map.get(&100).is_none());
+        assert!(conn.schema.ident_map.get(&to_namespaced_keyword(":name/Petr").unwrap()).is_none());
+    }
+
+    #[test]
+    fn test_db_alter_cardinality() {
+        let mut conn = TestConn::default();
+
+        // Start by installing a :db.cardinality/one attribute.
+        assert_transact!(conn, "[[:db/add 100 :db/ident :test/ident]
+                                 [:db/add 100 :db/valueType :db.type/long]
+                                 [:db/add 100 :db/cardinality :db.cardinality/one]]");
+
+        assert_transact!(conn, "[[:db/add 200 :test/ident 1]]");
+
+        // We can always go from :db.cardinality/one to :db.cardinality/many.
+        assert_transact!(conn, "[[:db/add 100 :db/cardinality :db.cardinality/many]]");
+
+        assert_transact!(conn, "[[:db/add 200 :test/ident 2]]");
+
+        assert_matches!(conn.datoms(),
+                        "[[100 :db/ident :test/ident]
+                          [100 :db/valueType :db.type/long]
+                          [100 :db/cardinality :db.cardinality/many]
+                          [200 :test/ident 1]
+                          [200 :test/ident 2]]");
+
+        // We can't always go from :db.cardinality/many to :db.cardinality/one.
+        assert_transact!(conn, "[[:db/add 100 :db/cardinality :db.cardinality/one]]",
+                         // TODO: give more helpful error details.
+                         Err("schema alteration failed: Cannot alter schema attribute 100 to be :db.cardinality/one"));
+    }
+
+    #[test]
+    fn test_db_alter_unique_value() {
+        let mut conn = TestConn::default();
+
+        // Start by installing a :db.cardinality/one attribute.
+        assert_transact!(conn, "[[:db/add 100 :db/ident :test/ident]
+                                 [:db/add 100 :db/valueType :db.type/long]
+                                 [:db/add 100 :db/cardinality :db.cardinality/one]]");
+
+        assert_transact!(conn, "[[:db/add 200 :test/ident 1]
+                                 [:db/add 201 :test/ident 1]]");
+
+        // We can't always migrate to be :db.unique/value.
+        assert_transact!(conn, "[[:db/add :test/ident :db/unique :db.unique/value]]",
+                         // TODO: give more helpful error details.
+                         Err("schema alteration failed: Cannot alter schema attribute 100 to be :db.unique/value"));
+
+        // Not even indirectly!
+        assert_transact!(conn, "[[:db/add :test/ident :db/unique :db.unique/identity]]",
+                         // TODO: give more helpful error details.
+                         Err("schema alteration failed: Cannot alter schema attribute 100 to be :db.unique/identity"));
+
+        // But we can if we make sure there's no repeated [a v] pair.
+        assert_transact!(conn, "[[:db/add 201 :test/ident 2]]");
+
+        assert_transact!(conn, "[[:db/add :test/ident :db/index true]
+                                 [:db/add :test/ident :db/unique :db.unique/value]
+                                 [:db/add :db.part/db :db.alter/attribute 100]]");
+
+        // We can also retract the uniqueness constraint altogether.
+        assert_transact!(conn, "[[:db/retract :test/ident :db/unique :db.unique/value]]");
+
+        // Once we've done so, the schema shows it's not unique…
+        {
+            let attr = conn.schema.attribute_for_ident(&Keyword::namespaced("test", "ident")).unwrap().0;
+            assert_eq!(None, attr.unique);
+        }
+
+        // … and we can add more assertions with duplicate values.
+        assert_transact!(conn, "[[:db/add 121 :test/ident 1]
+                                 [:db/add 221 :test/ident 2]]");
+    }
+
+    /// Verify that we can't alter :db/fulltext schema characteristics at all.
+    #[test]
+    fn test_db_alter_fulltext() {
+        let mut conn = TestConn::default();
+
+        // Start by installing a :db/fulltext true and a :db/fulltext unset attribute.
+        assert_transact!(conn, "[[:db/add 111 :db/ident :test/fulltext]
+                                 [:db/add 111 :db/valueType :db.type/string]
+                                 [:db/add 111 :db/unique :db.unique/identity]
+                                 [:db/add 111 :db/index true]
+                                 [:db/add 111 :db/fulltext true]
+                                 [:db/add 222 :db/ident :test/string]
+                                 [:db/add 222 :db/cardinality :db.cardinality/one]
+                                 [:db/add 222 :db/valueType :db.type/string]
+                                 [:db/add 222 :db/index true]]");
+
+        assert_transact!(conn,
+                         "[[:db/retract 111 :db/fulltext true]]",
+                         Err("bad schema assertion: Retracting attribute 12 for entity 111 not permitted."));
+
+        assert_transact!(conn,
+                         "[[:db/add 222 :db/fulltext true]]",
+                         Err("bad schema assertion: Schema alteration for existing attribute with entid 222 is not valid"));
+    }
+
+    #[test]
+    fn test_db_fulltext() {
+        let mut conn = TestConn::default();
+
+        // Start by installing a few :db/fulltext true attributes.
+        assert_transact!(conn, "[[:db/add 111 :db/ident :test/fulltext]
+                                 [:db/add 111 :db/valueType :db.type/string]
+                                 [:db/add 111 :db/unique :db.unique/identity]
+                                 [:db/add 111 :db/index true]
+                                 [:db/add 111 :db/fulltext true]
+                                 [:db/add 222 :db/ident :test/other]
+                                 [:db/add 222 :db/cardinality :db.cardinality/one]
+                                 [:db/add 222 :db/valueType :db.type/string]
+                                 [:db/add 222 :db/index true]
+                                 [:db/add 222 :db/fulltext true]]");
+
+        // Let's check we actually have the schema characteristics we expect.
+        let fulltext = conn.schema.attribute_for_entid(111).cloned().expect(":test/fulltext");
+        assert_eq!(fulltext.value_type, ValueType::String);
+        assert_eq!(fulltext.fulltext, true);
+        assert_eq!(fulltext.multival, false);
+        assert_eq!(fulltext.unique, Some(attribute::Unique::Identity));
+
+        let other = conn.schema.attribute_for_entid(222).cloned().expect(":test/other");
+        assert_eq!(other.value_type, ValueType::String);
+        assert_eq!(other.fulltext, true);
+        assert_eq!(other.multival, false);
+        assert_eq!(other.unique, None);
+
+        // We can add fulltext indexed datoms.
+        assert_transact!(conn, "[[:db/add 301 :test/fulltext \"test this\"]]");
+        // value column is rowid into fulltext table.
+        assert_matches!(conn.fulltext_values(),
+                        "[[1 \"test this\"]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[301 :test/fulltext 1 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[111 :db/ident :test/fulltext]
+                          [111 :db/valueType :db.type/string]
+                          [111 :db/unique :db.unique/identity]
+                          [111 :db/index true]
+                          [111 :db/fulltext true]
+                          [222 :db/ident :test/other]
+                          [222 :db/valueType :db.type/string]
+                          [222 :db/cardinality :db.cardinality/one]
+                          [222 :db/index true]
+                          [222 :db/fulltext true]
+                          [301 :test/fulltext 1]]");
+
+        // We can replace existing fulltext indexed datoms.
+        assert_transact!(conn, "[[:db/add 301 :test/fulltext \"alternate thing\"]]");
+        // value column is rowid into fulltext table.
+        assert_matches!(conn.fulltext_values(),
+                        "[[1 \"test this\"]
+                          [2 \"alternate thing\"]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[301 :test/fulltext 1 ?tx false]
+                          [301 :test/fulltext 2 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[111 :db/ident :test/fulltext]
+                          [111 :db/valueType :db.type/string]
+                          [111 :db/unique :db.unique/identity]
+                          [111 :db/index true]
+                          [111 :db/fulltext true]
+                          [222 :db/ident :test/other]
+                          [222 :db/valueType :db.type/string]
+                          [222 :db/cardinality :db.cardinality/one]
+                          [222 :db/index true]
+                          [222 :db/fulltext true]
+                          [301 :test/fulltext 2]]");
+
+        // We can upsert keyed by fulltext indexed datoms.
+        assert_transact!(conn, "[[:db/add \"t\" :test/fulltext \"alternate thing\"]
+                                 [:db/add \"t\" :test/other \"other\"]]");
+        // value column is rowid into fulltext table.
+        assert_matches!(conn.fulltext_values(),
+                        "[[1 \"test this\"]
+                          [2 \"alternate thing\"]
+                          [3 \"other\"]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[301 :test/other 3 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[111 :db/ident :test/fulltext]
+                          [111 :db/valueType :db.type/string]
+                          [111 :db/unique :db.unique/identity]
+                          [111 :db/index true]
+                          [111 :db/fulltext true]
+                          [222 :db/ident :test/other]
+                          [222 :db/valueType :db.type/string]
+                          [222 :db/cardinality :db.cardinality/one]
+                          [222 :db/index true]
+                          [222 :db/fulltext true]
+                          [301 :test/fulltext 2]
+                          [301 :test/other 3]]");
+
+        // We can re-use fulltext values; they won't be added to the fulltext values table twice.
+        assert_transact!(conn, "[[:db/add 302 :test/other \"alternate thing\"]]");
+        // value column is rowid into fulltext table.
+        assert_matches!(conn.fulltext_values(),
+                        "[[1 \"test this\"]
+                          [2 \"alternate thing\"]
+                          [3 \"other\"]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[302 :test/other 2 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[111 :db/ident :test/fulltext]
+                          [111 :db/valueType :db.type/string]
+                          [111 :db/unique :db.unique/identity]
+                          [111 :db/index true]
+                          [111 :db/fulltext true]
+                          [222 :db/ident :test/other]
+                          [222 :db/valueType :db.type/string]
+                          [222 :db/cardinality :db.cardinality/one]
+                          [222 :db/index true]
+                          [222 :db/fulltext true]
+                          [301 :test/fulltext 2]
+                          [301 :test/other 3]
+                          [302 :test/other 2]]");
+
+        // We can retract fulltext indexed datoms.  The underlying fulltext value remains -- indeed,
+        // it might still be in use.
+        assert_transact!(conn, "[[:db/retract 302 :test/other \"alternate thing\"]]");
+        // value column is rowid into fulltext table.
+        assert_matches!(conn.fulltext_values(),
+                        "[[1 \"test this\"]
+                          [2 \"alternate thing\"]
+                          [3 \"other\"]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[302 :test/other 2 ?tx false]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(conn.datoms(),
+                        "[[111 :db/ident :test/fulltext]
+                          [111 :db/valueType :db.type/string]
+                          [111 :db/unique :db.unique/identity]
+                          [111 :db/index true]
+                          [111 :db/fulltext true]
+                          [222 :db/ident :test/other]
+                          [222 :db/valueType :db.type/string]
+                          [222 :db/cardinality :db.cardinality/one]
+                          [222 :db/index true]
+                          [222 :db/fulltext true]
+                          [301 :test/fulltext 2]
+                          [301 :test/other 3]]");
+    }
+
+    #[test]
+    fn test_lookup_refs_entity_column() {
+        let mut conn = TestConn::default();
+
+        // Start by installing a few attributes.
+        assert_transact!(conn, "[[:db/add 111 :db/ident :test/unique_value]
+                                 [:db/add 111 :db/valueType :db.type/string]
+                                 [:db/add 111 :db/unique :db.unique/value]
+                                 [:db/add 111 :db/index true]
+                                 [:db/add 222 :db/ident :test/unique_identity]
+                                 [:db/add 222 :db/valueType :db.type/long]
+                                 [:db/add 222 :db/unique :db.unique/identity]
+                                 [:db/add 222 :db/index true]
+                                 [:db/add 333 :db/ident :test/not_unique]
+                                 [:db/add 333 :db/cardinality :db.cardinality/one]
+                                 [:db/add 333 :db/valueType :db.type/keyword]
+                                 [:db/add 333 :db/index true]]");
+
+        // And a few datoms to match against.
+        assert_transact!(conn, "[[:db/add 501 :test/unique_value \"test this\"]
+                                 [:db/add 502 :test/unique_value \"other\"]
+                                 [:db/add 503 :test/unique_identity -10]
+                                 [:db/add 504 :test/unique_identity -20]
+                                 [:db/add 505 :test/not_unique :test/keyword]
+                                 [:db/add 506 :test/not_unique :test/keyword]]");
+
+        // We can resolve lookup refs in the entity column, referring to the attribute as an entid or an ident.
+        assert_transact!(conn, "[[:db/add (lookup-ref :test/unique_value \"test this\") :test/not_unique :test/keyword]
+                                 [:db/add (lookup-ref 111 \"other\") :test/not_unique :test/keyword]
+                                 [:db/add (lookup-ref :test/unique_identity -10) :test/not_unique :test/keyword]
+                                 [:db/add (lookup-ref 222 -20) :test/not_unique :test/keyword]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[501 :test/not_unique :test/keyword ?tx true]
+                          [502 :test/not_unique :test/keyword ?tx true]
+                          [503 :test/not_unique :test/keyword ?tx true]
+                          [504 :test/not_unique :test/keyword ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+
+        // We cannot resolve lookup refs that aren't :db/unique.
+        assert_transact!(conn,
+                         "[[:db/add (lookup-ref :test/not_unique :test/keyword) :test/not_unique :test/keyword]]",
+                         Err("not yet implemented: Cannot resolve (lookup-ref 333 Keyword(Keyword(NamespaceableName { namespace: Some(\"test\"), name: \"keyword\" }))) with attribute that is not :db/unique"));
+
+        // We type check the lookup ref's value against the lookup ref's attribute.
+        assert_transact!(conn,
+                         "[[:db/add (lookup-ref :test/unique_value :test/not_a_string) :test/not_unique :test/keyword]]",
+                         Err("value \':test/not_a_string\' is not the expected Mentat value type String"));
+
+        // Each lookup ref in the entity column must resolve
+        assert_transact!(conn,
+                         "[[:db/add (lookup-ref :test/unique_value \"unmatched string value\") :test/not_unique :test/keyword]]",
+                         Err("no entid found for ident: couldn\'t lookup [a v]: (111, String(\"unmatched string value\"))"));
+    }
+
+    #[test]
+    fn test_lookup_refs_value_column() {
+        let mut conn = TestConn::default();
+
+        // Start by installing a few attributes.
+        assert_transact!(conn, "[[:db/add 111 :db/ident :test/unique_value]
+                                 [:db/add 111 :db/valueType :db.type/string]
+                                 [:db/add 111 :db/unique :db.unique/value]
+                                 [:db/add 111 :db/index true]
+                                 [:db/add 222 :db/ident :test/unique_identity]
+                                 [:db/add 222 :db/valueType :db.type/long]
+                                 [:db/add 222 :db/unique :db.unique/identity]
+                                 [:db/add 222 :db/index true]
+                                 [:db/add 333 :db/ident :test/not_unique]
+                                 [:db/add 333 :db/cardinality :db.cardinality/one]
+                                 [:db/add 333 :db/valueType :db.type/keyword]
+                                 [:db/add 333 :db/index true]
+                                 [:db/add 444 :db/ident :test/ref]
+                                 [:db/add 444 :db/valueType :db.type/ref]
+                                 [:db/add 444 :db/unique :db.unique/identity]
+                                 [:db/add 444 :db/index true]]");
+
+        // And a few datoms to match against.
+        assert_transact!(conn, "[[:db/add 501 :test/unique_value \"test this\"]
+                                 [:db/add 502 :test/unique_value \"other\"]
+                                 [:db/add 503 :test/unique_identity -10]
+                                 [:db/add 504 :test/unique_identity -20]
+                                 [:db/add 505 :test/not_unique :test/keyword]
+                                 [:db/add 506 :test/not_unique :test/keyword]]");
+
+        // We can resolve lookup refs in the entity column, referring to the attribute as an entid or an ident.
+        assert_transact!(conn, "[[:db/add 601 :test/ref (lookup-ref :test/unique_value \"test this\")]
+                                 [:db/add 602 :test/ref (lookup-ref 111 \"other\")]
+                                 [:db/add 603 :test/ref (lookup-ref :test/unique_identity -10)]
+                                 [:db/add 604 :test/ref (lookup-ref 222 -20)]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[601 :test/ref 501 ?tx true]
+                          [602 :test/ref 502 ?tx true]
+                          [603 :test/ref 503 ?tx true]
+                          [604 :test/ref 504 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+
+        // We cannot resolve lookup refs for attributes that aren't :db/ref.
+        assert_transact!(conn,
+                         "[[:db/add \"t\" :test/not_unique (lookup-ref :test/unique_value \"test this\")]]",
+                         Err("not yet implemented: Cannot resolve value lookup ref for attribute 333 that is not :db/valueType :db.type/ref"));
+
+        // If a value column lookup ref resolves, we can upsert against it.  Here, the lookup ref
+        // resolves to 501, which upserts "t" to 601.
+        assert_transact!(conn, "[[:db/add \"t\" :test/ref (lookup-ref :test/unique_value \"test this\")]
+                                 [:db/add \"t\" :test/not_unique :test/keyword]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[601 :test/not_unique :test/keyword ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+
+        // Each lookup ref in the value column must resolve
+        assert_transact!(conn,
+                         "[[:db/add \"t\" :test/ref (lookup-ref :test/unique_value \"unmatched string value\")]]",
+                         Err("no entid found for ident: couldn\'t lookup [a v]: (111, String(\"unmatched string value\"))"));
+    }
+
+    #[test]
+    fn test_explode_value_lists() {
+        let mut conn = TestConn::default();
+
+        // Start by installing a few attributes.
+        assert_transact!(conn, "[[:db/add 111 :db/ident :test/many]
+                                 [:db/add 111 :db/valueType :db.type/long]
+                                 [:db/add 111 :db/cardinality :db.cardinality/many]
+                                 [:db/add 222 :db/ident :test/one]
+                                 [:db/add 222 :db/valueType :db.type/long]
+                                 [:db/add 222 :db/cardinality :db.cardinality/one]]");
+
+        // Check that we can explode vectors for :db.cardinality/many attributes.
+        assert_transact!(conn, "[[:db/add 501 :test/many [1]]
+                                 [:db/add 502 :test/many [2 3]]
+                                 [:db/add 503 :test/many [4 5 6]]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[501 :test/many 1 ?tx true]
+                          [502 :test/many 2 ?tx true]
+                          [502 :test/many 3 ?tx true]
+                          [503 :test/many 4 ?tx true]
+                          [503 :test/many 5 ?tx true]
+                          [503 :test/many 6 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+
+        // Check that we can explode nested vectors for :db.cardinality/many attributes.
+        assert_transact!(conn, "[[:db/add 600 :test/many [1 [2] [[3] [4]] []]]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[600 :test/many 1 ?tx true]
+                          [600 :test/many 2 ?tx true]
+                          [600 :test/many 3 ?tx true]
+                          [600 :test/many 4 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+
+        // Check that we cannot explode vectors for :db.cardinality/one attributes.
+        assert_transact!(conn,
+                         "[[:db/add 501 :test/one [1]]]",
+                         Err("not yet implemented: Cannot explode vector value for attribute 222 that is not :db.cardinality :db.cardinality/many"));
+        assert_transact!(conn,
+                         "[[:db/add 501 :test/one [2 3]]]",
+                         Err("not yet implemented: Cannot explode vector value for attribute 222 that is not :db.cardinality :db.cardinality/many"));
+    }
+
+    #[test]
+    fn test_explode_map_notation() {
+        let mut conn = TestConn::default();
+
+        // Start by installing a few attributes.
+        assert_transact!(conn, "[[:db/add 111 :db/ident :test/many]
+                                 [:db/add 111 :db/valueType :db.type/long]
+                                 [:db/add 111 :db/cardinality :db.cardinality/many]
+                                 [:db/add 222 :db/ident :test/component]
+                                 [:db/add 222 :db/isComponent true]
+                                 [:db/add 222 :db/valueType :db.type/ref]
+                                 [:db/add 333 :db/ident :test/unique]
+                                 [:db/add 333 :db/unique :db.unique/identity]
+                                 [:db/add 333 :db/index true]
+                                 [:db/add 333 :db/valueType :db.type/long]
+                                 [:db/add 444 :db/ident :test/dangling]
+                                 [:db/add 444 :db/valueType :db.type/ref]]");
+
+        // Check that we can explode map notation without :db/id.
+        let report = assert_transact!(conn, "[{:test/many 1}]");
+        assert_matches!(conn.last_transaction(),
+                        "[[?e :test/many 1 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(tempids(&report),
+                        "{}");
+
+        // Check that we can explode map notation with :db/id, as an entid, ident, and tempid.
+        let report = assert_transact!(conn, "[{:db/id :db/ident :test/many 1}
+                                              {:db/id 500 :test/many 2}
+                                              {:db/id \"t\" :test/many 3}]");
+        assert_matches!(conn.last_transaction(),
+                        "[[1 :test/many 1 ?tx true]
+                          [500 :test/many 2 ?tx true]
+                          [?e :test/many 3 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(tempids(&report),
+                        "{\"t\" 65537}");
+
+        // Check that we can explode map notation with :db/id as a lookup-ref or tx-function.
+        let report = assert_transact!(conn, "[{:db/id (lookup-ref :db/ident :db/ident) :test/many 4}
+                                              {:db/id (transaction-tx) :test/many 5}]");
+        assert_matches!(conn.last_transaction(),
+                        "[[1 :test/many 4 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]
+                          [?tx :test/many 5 ?tx true]]");
+        assert_matches!(tempids(&report),
+                        "{}");
+
+        // Check that we can explode map notation with nested vector values.
+        let report = assert_transact!(conn, "[{:test/many [1 2]}]");
+        assert_matches!(conn.last_transaction(),
+                        "[[?e :test/many 1 ?tx true]
+                          [?e :test/many 2 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(tempids(&report),
+                        "{}");
+
+        // Check that we can explode map notation with nested maps if the attribute is
+        // :db/isComponent true.
+        let report = assert_transact!(conn, "[{:test/component {:test/many 1}}]");
+        assert_matches!(conn.last_transaction(),
+                        "[[?e :test/component ?f ?tx true]
+                          [?f :test/many 1 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(tempids(&report),
+                        "{}");
+
+        // Check that we can explode map notation with nested maps if the inner map contains a
+        // :db/unique :db.unique/identity attribute.
+        let report = assert_transact!(conn, "[{:test/dangling {:test/unique 10}}]");
+        assert_matches!(conn.last_transaction(),
+                        "[[?e :test/dangling ?f ?tx true]
+                          [?f :test/unique 10 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(tempids(&report),
+                        "{}");
+
+        // Verify that we can't explode map notation with nested maps if the inner map would be
+        // dangling.
+        assert_transact!(conn,
+                         "[{:test/dangling {:test/many 11}}]",
+                         Err("not yet implemented: Cannot explode nested map value that would lead to dangling entity for attribute 444"));
+
+        // Verify that we can explode map notation with nested maps, even if the inner map would be
+        // dangling, if we give a :db/id explicitly.
+        assert_transact!(conn, "[{:test/dangling {:db/id \"t\" :test/many 12}}]");
+    }
+
+    #[test]
+    fn test_explode_reversed_notation() {
+        let mut conn = TestConn::default();
+
+        // Start by installing a few attributes.
+        assert_transact!(conn, "[[:db/add 111 :db/ident :test/many]
+                                 [:db/add 111 :db/valueType :db.type/long]
+                                 [:db/add 111 :db/cardinality :db.cardinality/many]
+                                 [:db/add 222 :db/ident :test/component]
+                                 [:db/add 222 :db/isComponent true]
+                                 [:db/add 222 :db/valueType :db.type/ref]
+                                 [:db/add 333 :db/ident :test/unique]
+                                 [:db/add 333 :db/unique :db.unique/identity]
+                                 [:db/add 333 :db/index true]
+                                 [:db/add 333 :db/valueType :db.type/long]
+                                 [:db/add 444 :db/ident :test/dangling]
+                                 [:db/add 444 :db/valueType :db.type/ref]]");
+
+        // Check that we can explode direct reversed notation, entids.
+        let report = assert_transact!(conn, "[[:db/add 100 :test/_dangling 200]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[200 :test/dangling 100 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(tempids(&report),
+                        "{}");
+
+        // Check that we can explode direct reversed notation, idents.
+        let report = assert_transact!(conn, "[[:db/add :test/many :test/_dangling :test/unique]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[333 :test/dangling :test/many ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(tempids(&report),
+                        "{}");
+
+        // Check that we can explode direct reversed notation, tempids.
+        let report = assert_transact!(conn, "[[:db/add \"s\" :test/_dangling \"t\"]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[65537 :test/dangling 65536 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        // This is implementation specific, but it should be deterministic.
+        assert_matches!(tempids(&report),
+                        "{\"s\" 65536
+                          \"t\" 65537}");
+
+        // Check that we can explode reversed notation in map notation without :db/id.
+        let report = assert_transact!(conn, "[{:test/_dangling 501}
+                                              {:test/_dangling :test/many}
+                                              {:test/_dangling \"t\"}]");
+        assert_matches!(conn.last_transaction(),
+                        "[[111 :test/dangling ?e1 ?tx true]
+                          [501 :test/dangling ?e2 ?tx true]
+                          [65538 :test/dangling ?e3 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(tempids(&report),
+                        "{\"t\" 65538}");
+
+        // Check that we can explode reversed notation in map notation with :db/id, entid.
+        let report = assert_transact!(conn, "[{:db/id 600 :test/_dangling 601}]");
+        assert_matches!(conn.last_transaction(),
+                        "[[601 :test/dangling 600 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(tempids(&report),
+                        "{}");
+
+        // Check that we can explode reversed notation in map notation with :db/id, ident.
+        let report = assert_transact!(conn, "[{:db/id :test/component :test/_dangling :test/component}]");
+        assert_matches!(conn.last_transaction(),
+                        "[[222 :test/dangling :test/component ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(tempids(&report),
+                        "{}");
+
+        // Check that we can explode reversed notation in map notation with :db/id, tempid.
+        let report = assert_transact!(conn, "[{:db/id \"s\" :test/_dangling \"t\"}]");
+        assert_matches!(conn.last_transaction(),
+                        "[[65543 :test/dangling 65542 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        // This is implementation specific, but it should be deterministic.
+        assert_matches!(tempids(&report),
+                        "{\"s\" 65542
+                          \"t\" 65543}");
+
+        // Check that we can use the same attribute in both forward and backward form in the same
+        // transaction.
+        let report = assert_transact!(conn, "[[:db/add 888 :test/dangling 889]
+                                              [:db/add 888 :test/_dangling 889]]");
+        assert_matches!(conn.last_transaction(),
+                        "[[888 :test/dangling 889 ?tx true]
+                          [889 :test/dangling 888 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(tempids(&report),
+                        "{}");
+
+        // Check that we can use the same attribute in both forward and backward form in the same
+        // transaction in map notation.
+        let report = assert_transact!(conn, "[{:db/id 998 :test/dangling 999 :test/_dangling 999}]");
+        assert_matches!(conn.last_transaction(),
+                        "[[998 :test/dangling 999 ?tx true]
+                          [999 :test/dangling 998 ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+        assert_matches!(tempids(&report),
+                        "{}");
+
+    }
+
+    #[test]
+    fn test_explode_reversed_notation_errors() {
+        let mut conn = TestConn::default();
+
+        // Start by installing a few attributes.
+        assert_transact!(conn, "[[:db/add 111 :db/ident :test/many]
+                                 [:db/add 111 :db/valueType :db.type/long]
+                                 [:db/add 111 :db/cardinality :db.cardinality/many]
+                                 [:db/add 222 :db/ident :test/component]
+                                 [:db/add 222 :db/isComponent true]
+                                 [:db/add 222 :db/valueType :db.type/ref]
+                                 [:db/add 333 :db/ident :test/unique]
+                                 [:db/add 333 :db/unique :db.unique/identity]
+                                 [:db/add 333 :db/index true]
+                                 [:db/add 333 :db/valueType :db.type/long]
+                                 [:db/add 444 :db/ident :test/dangling]
+                                 [:db/add 444 :db/valueType :db.type/ref]]");
+
+        // `tx-parser` should fail to parse direct reverse notation with nested value maps and
+        // nested value vectors, so we only test things that "get through" to the map notation
+        // dynamic processor here.
+
+        // Verify that we can't explode reverse notation in map notation with nested value maps.
+        assert_transact!(conn,
+                         "[{:test/_dangling {:test/many 14}}]",
+                         Err("not yet implemented: Cannot explode map notation value in :attr/_reversed notation for attribute 444"));
+
+        // Verify that we can't explode reverse notation in map notation with nested value vectors.
+        assert_transact!(conn,
+                         "[{:test/_dangling [:test/many]}]",
+                         Err("not yet implemented: Cannot explode vector value in :attr/_reversed notation for attribute 444"));
+
+        // Verify that we can't use reverse notation with non-:db.type/ref attributes.
+        assert_transact!(conn,
+                         "[{:test/_unique 500}]",
+                         Err("not yet implemented: Cannot use :attr/_reversed notation for attribute 333 that is not :db/valueType :db.type/ref"));
+
+        // Verify that we can't use reverse notation with unrecognized attributes.
+        assert_transact!(conn,
+                         "[{:test/_unknown 500}]",
+                         Err("no entid found for ident: :test/unknown")); // TODO: make this error reference the original :test/_unknown.
+
+        // Verify that we can't use reverse notation with bad value types: here, an unknown keyword
+        // that can't be coerced to a ref.
+        assert_transact!(conn,
+                         "[{:test/_dangling :test/unknown}]",
+                         Err("no entid found for ident: :test/unknown"));
+        // And here, a float.
+        assert_transact!(conn,
+                         "[{:test/_dangling 1.23}]",
+                         Err("value \'1.23\' is not the expected Mentat value type Ref"));
+    }
+
+    #[test]
+    fn test_cardinality_one_violation_existing_entity() {
+        let mut conn = TestConn::default();
+
+        // Start by installing a few attributes.
+        assert_transact!(conn, r#"[
+            [:db/add 111 :db/ident :test/one]
+            [:db/add 111 :db/valueType :db.type/long]
+            [:db/add 111 :db/cardinality :db.cardinality/one]
+            [:db/add 112 :db/ident :test/unique]
+            [:db/add 112 :db/index true]
+            [:db/add 112 :db/valueType :db.type/string]
+            [:db/add 112 :db/cardinality :db.cardinality/one]
+            [:db/add 112 :db/unique :db.unique/identity]
+        ]"#);
+
+        assert_transact!(conn, r#"[
+            [:db/add "foo" :test/unique "x"]
+        ]"#);
+
+        // You can try to assert two values for the same entity and attribute,
+        // but you'll get an error.
+        assert_transact!(conn, r#"[
+            [:db/add "foo" :test/unique "x"]
+            [:db/add "foo" :test/one 123]
+            [:db/add "bar" :test/unique "x"]
+            [:db/add "bar" :test/one 124]
+        ]"#,
+        // This is implementation specific (due to the allocated entid), but it should be deterministic.
+        Err("schema constraint violation: cardinality conflicts:\n  CardinalityOneAddConflict { e: 65536, a: 111, vs: {Long(123), Long(124)} }\n"));
+
+        // It also fails for map notation.
+        assert_transact!(conn, r#"[
+            {:test/unique "x", :test/one 123}
+            {:test/unique "x", :test/one 124}
+        ]"#,
+        // This is implementation specific (due to the allocated entid), but it should be deterministic.
+        Err("schema constraint violation: cardinality conflicts:\n  CardinalityOneAddConflict { e: 65536, a: 111, vs: {Long(123), Long(124)} }\n"));
+    }
+
+    #[test]
+    fn test_conflicting_upserts() {
+        let mut conn = TestConn::default();
+
+        assert_transact!(conn, r#"[
+            {:db/ident :page/id :db/valueType :db.type/string :db/index true :db/unique :db.unique/identity}
+            {:db/ident :page/ref :db/valueType :db.type/ref :db/index true :db/unique :db.unique/identity}
+            {:db/ident :page/title :db/valueType :db.type/string :db/cardinality :db.cardinality/many}
+        ]"#);
+
+        // Let's test some conflicting upserts.  First, valid data to work with -- note self references.
+        assert_transact!(conn, r#"[
+            [:db/add 111 :page/id "1"]
+            [:db/add 111 :page/ref 111]
+            [:db/add 222 :page/id "2"]
+            [:db/add 222 :page/ref 222]
+        ]"#);
+
+        // Now valid upserts.  Note the references are valid.
+        let report = assert_transact!(conn, r#"[
+            [:db/add "a" :page/id "1"]
+            [:db/add "a" :page/ref "a"]
+            [:db/add "b" :page/id "2"]
+            [:db/add "b" :page/ref "b"]
+        ]"#);
+        assert_matches!(tempids(&report),
+                        "{\"a\" 111
+                          \"b\" 222}");
+
+        // Now conflicting upserts.  Note the references are reversed.  This example is interesting
+        // because the first round `UpsertE` instances upsert, and this resolves all of the tempids
+        // in the `UpsertEV` instances.  However, those `UpsertEV` instances lead to conflicting
+        // upserts!  This tests that we don't resolve too far, giving a chance for those upserts to
+        // fail.  This error message is crossing generations, although it's not reflected in the
+        // error data structure.
+        assert_transact!(conn, r#"[
+            [:db/add "a" :page/id "1"]
+            [:db/add "a" :page/ref "b"]
+            [:db/add "b" :page/id "2"]
+            [:db/add "b" :page/ref "a"]
+        ]"#,
+        Err("schema constraint violation: conflicting upserts:\n  tempid External(\"a\") upserts to {KnownEntid(111), KnownEntid(222)}\n  tempid External(\"b\") upserts to {KnownEntid(111), KnownEntid(222)}\n"));
+
+        // Here's a case where the upsert is not resolved, just allocated, but leads to conflicting
+        // cardinality one datoms.
+        assert_transact!(conn, r#"[
+            [:db/add "x" :page/ref 333]
+            [:db/add "x" :page/ref 444]
+        ]"#,
+        Err("schema constraint violation: cardinality conflicts:\n  CardinalityOneAddConflict { e: 65539, a: 65537, vs: {Ref(333), Ref(444)} }\n"));
+    }
+
+    #[test]
+    fn test_upsert_issue_532() {
+        let mut conn = TestConn::default();
+
+        assert_transact!(conn, r#"[
+            {:db/ident :page/id :db/valueType :db.type/string :db/index true :db/unique :db.unique/identity}
+            {:db/ident :page/ref :db/valueType :db.type/ref :db/index true :db/unique :db.unique/identity}
+            {:db/ident :page/title :db/valueType :db.type/string :db/cardinality :db.cardinality/many}
+        ]"#);
+
+        // Observe that "foo" and "zot" upsert to the same entid, and that doesn't cause a
+        // cardinality conflict, because we treat the input with set semantics and accept
+        // duplicate datoms.
+        let report = assert_transact!(conn, r#"[
+            [:db/add "bar" :page/id "z"]
+            [:db/add "foo" :page/ref "bar"]
+            [:db/add "foo" :page/title "x"]
+            [:db/add "zot" :page/ref "bar"]
+            [:db/add "zot" :db/ident :other/ident]
+        ]"#);
+        assert_matches!(tempids(&report),
+                        "{\"bar\" ?b
+                          \"foo\" ?f
+                          \"zot\" ?f}");
+        assert_matches!(conn.last_transaction(),
+                        "[[?b :page/id \"z\" ?tx true]
+                          [?f :db/ident :other/ident ?tx true]
+                          [?f :page/ref ?b ?tx true]
+                          [?f :page/title \"x\" ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+
+        let report = assert_transact!(conn, r#"[
+            [:db/add "foo" :page/id "x"]
+            [:db/add "foo" :page/title "x"]
+            [:db/add "bar" :page/id "x"]
+            [:db/add "bar" :page/title "y"]
+        ]"#);
+        assert_matches!(tempids(&report),
+                        "{\"foo\" ?e
+                          \"bar\" ?e}");
+
+        // One entity, two page titles.
+        assert_matches!(conn.last_transaction(),
+                        "[[?e :page/id \"x\" ?tx true]
+                          [?e :page/title \"x\" ?tx true]
+                          [?e :page/title \"y\" ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+
+        // Here, "foo", "bar", and "baz", all refer to the same reference, but none of them actually
+        // upsert to existing entities.
+        let report = assert_transact!(conn, r#"[
+            [:db/add "foo" :page/id "id"]
+            [:db/add "bar" :db/ident :bar/bar]
+            {:db/id "baz" :page/id "id" :db/ident :bar/bar}
+        ]"#);
+        assert_matches!(tempids(&report),
+                        "{\"foo\" ?e
+                          \"bar\" ?e
+                          \"baz\" ?e}");
+
+        assert_matches!(conn.last_transaction(),
+                        "[[?e :db/ident :bar/bar ?tx true]
+                          [?e :page/id \"id\" ?tx true]
+                          [?tx :db/txInstant ?ms ?tx true]]");
+
+        // If we do it again, everything resolves to the same IDs.
+        let report = assert_transact!(conn, r#"[
+            [:db/add "foo" :page/id "id"]
+            [:db/add "bar" :db/ident :bar/bar]
+            {:db/id "baz" :page/id "id" :db/ident :bar/bar}
+        ]"#);
+        assert_matches!(tempids(&report),
+                        "{\"foo\" ?e
+                          \"bar\" ?e
+                          \"baz\" ?e}");
+
+        assert_matches!(conn.last_transaction(),
+                        "[[?tx :db/txInstant ?ms ?tx true]]");
+    }
+
+    #[test]
+    fn test_term_typechecking_issue_663() {
+        // The builder interfaces provide untrusted `Term` instances to the transactor, bypassing
+        // the typechecking layers invoked in the schema-aware coercion from `edn::Value` into
+        // `TypedValue`.  Typechecking now happens lower in the stack (as well as higher in the
+        // stack) so we shouldn't be able to insert bad data into the store.
+
+        let mut conn = TestConn::default();
+
+        let mut terms = vec![];
+
+        terms.push(Term::AddOrRetract(OpType::Add, Left(KnownEntid(200)), entids::DB_IDENT, Left(TypedValue::typed_string("test"))));
+        terms.push(Term::AddOrRetract(OpType::Retract, Left(KnownEntid(100)), entids::DB_TX_INSTANT, Left(TypedValue::Long(-1))));
+
+        let report = conn.transact_simple_terms(terms, InternSet::new());
+
+        match report.unwrap_err().downcast() {
+            Ok(DbError::SchemaConstraintViolation(errors::SchemaConstraintViolation::TypeDisagreements { conflicting_datoms })) => {
+                let mut map = BTreeMap::default();
+                map.insert((100, entids::DB_TX_INSTANT, TypedValue::Long(-1)), ValueType::Instant);
+                map.insert((200, entids::DB_IDENT, TypedValue::typed_string("test")), ValueType::Keyword);
+
+                assert_eq!(conflicting_datoms, map);
+            },
+            x => panic!("expected schema constraint violation, got {:?}", x),
+        }
+    }
+
+    #[test]
+    fn test_cardinality_constraints() {
+        let mut conn = TestConn::default();
+
+        assert_transact!(conn, r#"[
+            {:db/id 200 :db/ident :test/one :db/valueType :db.type/long :db/cardinality :db.cardinality/one}
+            {:db/id 201 :db/ident :test/many :db/valueType :db.type/long :db/cardinality :db.cardinality/many}
+        ]"#);
+
+        // Can add the same datom multiple times for an attribute, regardless of cardinality.
+        assert_transact!(conn, r#"[
+            [:db/add 100 :test/one 1]
+            [:db/add 100 :test/one 1]
+            [:db/add 100 :test/many 2]
+            [:db/add 100 :test/many 2]
+        ]"#);
+
+        // Can retract the same datom multiple times for an attribute, regardless of cardinality.
+        assert_transact!(conn, r#"[
+            [:db/retract 100 :test/one 1]
+            [:db/retract 100 :test/one 1]
+            [:db/retract 100 :test/many 2]
+            [:db/retract 100 :test/many 2]
+        ]"#);
+
+        // Can't transact multiple datoms for a cardinality one attribute.
+        assert_transact!(conn, r#"[
+            [:db/add 100 :test/one 3]
+            [:db/add 100 :test/one 4]
+        ]"#,
+        Err("schema constraint violation: cardinality conflicts:\n  CardinalityOneAddConflict { e: 100, a: 200, vs: {Long(3), Long(4)} }\n"));
+
+        // Can transact multiple datoms for a cardinality many attribute.
+        assert_transact!(conn, r#"[
+            [:db/add 100 :test/many 5]
+            [:db/add 100 :test/many 6]
+        ]"#);
+
+        // Can't add and retract the same datom for an attribute, regardless of cardinality.
+        assert_transact!(conn, r#"[
+            [:db/add     100 :test/one 7]
+            [:db/retract 100 :test/one 7]
+            [:db/add     100 :test/many 8]
+            [:db/retract 100 :test/many 8]
+        ]"#,
+        Err("schema constraint violation: cardinality conflicts:\n  AddRetractConflict { e: 100, a: 200, vs: {Long(7)} }\n  AddRetractConflict { e: 100, a: 201, vs: {Long(8)} }\n"));
+    }
+
+    #[test]
+    #[cfg(feature = "sqlcipher")]
+    fn test_sqlcipher_openable() {
+        let secret_key = "key";
+        let sqlite = new_connection_with_key("../fixtures/v1encrypted.db", secret_key).expect("Failed to find test DB");
+        sqlite.query_row("SELECT COUNT(*) FROM sqlite_master", &[], |row| row.get::<_, i64>(0))
+            .expect("Failed to execute sql query on encrypted DB");
+    }
+
+    #[cfg(feature = "sqlcipher")]
+    fn test_open_fail<F>(opener: F) where F: FnOnce() -> rusqlite::Result<rusqlite::Connection> {
+        let err = opener().expect_err("Should fail to open encrypted DB");
+        match err {
+            rusqlite::Error::SqliteFailure(err, ..) => {
+                assert_eq!(err.extended_code, 26, "Should get error code 26 (not a database).");
+            },
+            err => {
+                panic!("Wrong error type! {}", err);
+            }
+        }
+    }
+
+    #[test]
+    #[cfg(feature = "sqlcipher")]
+    fn test_sqlcipher_requires_key() {
+        // Don't use a key.
+        test_open_fail(|| new_connection("../fixtures/v1encrypted.db"));
+    }
+
+    #[test]
+    #[cfg(feature = "sqlcipher")]
+    fn test_sqlcipher_requires_correct_key() {
+        // Use a key, but the wrong one.
+        test_open_fail(|| new_connection_with_key("../fixtures/v1encrypted.db", "wrong key"));
+    }
+
+    #[test]
+    #[cfg(feature = "sqlcipher")]
+    fn test_sqlcipher_some_transactions() {
+        let sqlite = new_connection_with_key("", "hunter2").expect("Failed to create encrypted connection");
+        // Run a basic test as a sanity check.
+        run_test_add(TestConn::with_sqlite(sqlite));
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/debug.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/debug.rs.html new file mode 100644 index 00000000..34ce9577 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/debug.rs.html @@ -0,0 +1,632 @@ + + + + + + + + + + debug.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+/// Low-level functions for testing.
+
+use std::borrow::Borrow;
+use std::io::{Write};
+
+use itertools::Itertools;
+use rusqlite;
+use rusqlite::types::{ToSql};
+use tabwriter::TabWriter;
+
+use bootstrap;
+use db::TypedSQLValue;
+use edn;
+use entids;
+use errors::Result;
+use mentat_core::{
+    HasSchema,
+    SQLValueType,
+    TypedValue,
+    ValueType,
+};
+use edn::entities::{
+    Entid,
+};
+use schema::{
+    SchemaBuilding,
+};
+use types::Schema;
+
+/// Represents a *datom* (assertion) in the store.
+#[derive(Clone,Debug,Eq,Hash,Ord,PartialOrd,PartialEq)]
+pub(crate) struct Datom {
+    // TODO: generalize this.
+    e: Entid,
+    a: Entid,
+    v: edn::Value,
+    tx: i64,
+    added: Option<bool>,
+}
+
+/// Represents a set of datoms (assertions) in the store.
+///
+/// To make comparision easier, we deterministically order.  The ordering is the ascending tuple
+/// ordering determined by `(e, a, (value_type_tag, v), tx)`, where `value_type_tag` is an internal
+/// value that is not exposed but is deterministic.
+pub(crate) struct Datoms(pub Vec<Datom>);
+
+/// Represents an ordered sequence of transactions in the store.
+///
+/// To make comparision easier, we deterministically order.  The ordering is the ascending tuple
+/// ordering determined by `(e, a, (value_type_tag, v), tx, added)`, where `value_type_tag` is an
+/// internal value that is not exposed but is deterministic, and `added` is ordered such that
+/// retracted assertions appear before added assertions.
+pub(crate) struct Transactions(pub Vec<Datoms>);
+
+/// Represents the fulltext values in the store.
+pub(crate) struct FulltextValues(pub Vec<(i64, String)>);
+
+impl Datom {
+    pub(crate) fn into_edn(&self) -> edn::Value {
+        let f = |entid: &Entid| -> edn::Value {
+            match *entid {
+                Entid::Entid(ref y) => edn::Value::Integer(y.clone()),
+                Entid::Ident(ref y) => edn::Value::Keyword(y.clone()),
+            }
+        };
+
+        let mut v = vec![f(&self.e), f(&self.a), self.v.clone()];
+        if let Some(added) = self.added {
+            v.push(edn::Value::Integer(self.tx));
+            v.push(edn::Value::Boolean(added));
+        }
+
+        edn::Value::Vector(v)
+    }
+}
+
+impl Datoms {
+    pub(crate) fn into_edn(&self) -> edn::Value {
+        edn::Value::Vector((&self.0).into_iter().map(|x| x.into_edn()).collect())
+    }
+}
+
+impl Transactions {
+    pub(crate) fn into_edn(&self) -> edn::Value {
+        edn::Value::Vector((&self.0).into_iter().map(|x| x.into_edn()).collect())
+    }
+}
+
+impl FulltextValues {
+    pub(crate) fn into_edn(&self) -> edn::Value {
+        edn::Value::Vector((&self.0).into_iter().map(|&(x, ref y)| edn::Value::Vector(vec![edn::Value::Integer(x), edn::Value::Text(y.clone())])).collect())
+    }
+}
+
+/// Turn TypedValue::Ref into TypedValue::Keyword when it is possible.
+trait ToIdent {
+  fn map_ident(self, schema: &Schema) -> Self;
+}
+
+impl ToIdent for TypedValue {
+    fn map_ident(self, schema: &Schema) -> Self {
+        if let TypedValue::Ref(e) = self {
+            schema.get_ident(e).cloned().map(|i| i.into()).unwrap_or(TypedValue::Ref(e))
+        } else {
+            self
+        }
+    }
+}
+
+/// Convert a numeric entid to an ident `Entid` if possible, otherwise a numeric `Entid`.
+fn to_entid(schema: &Schema, entid: i64) -> Entid {
+    schema.get_ident(entid).map_or(Entid::Entid(entid), |ident| Entid::Ident(ident.clone()))
+}
+
+/// Return the set of datoms in the store, ordered by (e, a, v, tx), but not including any datoms of
+/// the form [... :db/txInstant ...].
+pub(crate) fn datoms<S: Borrow<Schema>>(conn: &rusqlite::Connection, schema: &S) -> Result<Datoms> {
+    datoms_after(conn, schema, bootstrap::TX0 - 1)
+}
+
+/// Return the set of datoms in the store with transaction ID strictly greater than the given `tx`,
+/// ordered by (e, a, v, tx).
+///
+/// The datom set returned does not include any datoms of the form [... :db/txInstant ...].
+pub(crate) fn datoms_after<S: Borrow<Schema>>(conn: &rusqlite::Connection, schema: &S, tx: i64) -> Result<Datoms> {
+    let borrowed_schema = schema.borrow();
+
+    let mut stmt: rusqlite::Statement = conn.prepare("SELECT e, a, v, value_type_tag, tx FROM datoms WHERE tx > ? ORDER BY e ASC, a ASC, value_type_tag ASC, v ASC, tx ASC")?;
+
+    let r: Result<Vec<_>> = stmt.query_and_then(&[&tx], |row| {
+        let e: i64 = row.get_checked(0)?;
+        let a: i64 = row.get_checked(1)?;
+
+        if a == entids::DB_TX_INSTANT {
+            return Ok(None);
+        }
+
+        let v: rusqlite::types::Value = row.get_checked(2)?;
+        let value_type_tag: i32 = row.get_checked(3)?;
+
+        let attribute = borrowed_schema.require_attribute_for_entid(a)?;
+        let value_type_tag = if !attribute.fulltext { value_type_tag } else { ValueType::Long.value_type_tag() };
+
+        let typed_value = TypedValue::from_sql_value_pair(v, value_type_tag)?.map_ident(borrowed_schema);
+        let (value, _) = typed_value.to_edn_value_pair();
+
+        let tx: i64 = row.get_checked(4)?;
+
+        Ok(Some(Datom {
+            e: Entid::Entid(e),
+            a: to_entid(borrowed_schema, a),
+            v: value,
+            tx: tx,
+            added: None,
+        }))
+    })?.collect();
+
+    Ok(Datoms(r?.into_iter().filter_map(|x| x).collect()))
+}
+
+/// Return the sequence of transactions in the store with transaction ID strictly greater than the
+/// given `tx`, ordered by (tx, e, a, v).
+///
+/// Each transaction returned includes the [(transaction-tx) :db/txInstant ...] datom.
+pub(crate) fn transactions_after<S: Borrow<Schema>>(conn: &rusqlite::Connection, schema: &S, tx: i64) -> Result<Transactions> {
+    let borrowed_schema = schema.borrow();
+
+    let mut stmt: rusqlite::Statement = conn.prepare("SELECT e, a, v, value_type_tag, tx, added FROM transactions WHERE tx > ? ORDER BY tx ASC, e ASC, a ASC, value_type_tag ASC, v ASC, added ASC")?;
+
+    let r: Result<Vec<_>> = stmt.query_and_then(&[&tx], |row| {
+        let e: i64 = row.get_checked(0)?;
+        let a: i64 = row.get_checked(1)?;
+
+        let v: rusqlite::types::Value = row.get_checked(2)?;
+        let value_type_tag: i32 = row.get_checked(3)?;
+
+        let attribute = borrowed_schema.require_attribute_for_entid(a)?;
+        let value_type_tag = if !attribute.fulltext { value_type_tag } else { ValueType::Long.value_type_tag() };
+
+        let typed_value = TypedValue::from_sql_value_pair(v, value_type_tag)?.map_ident(borrowed_schema);
+        let (value, _) = typed_value.to_edn_value_pair();
+
+        let tx: i64 = row.get_checked(4)?;
+        let added: bool = row.get_checked(5)?;
+
+        Ok(Datom {
+            e: Entid::Entid(e),
+            a: to_entid(borrowed_schema, a),
+            v: value,
+            tx: tx,
+            added: Some(added),
+        })
+    })?.collect();
+
+    // Group by tx.
+    let r: Vec<Datoms> = r?.into_iter().group_by(|x| x.tx).into_iter().map(|(_key, group)| Datoms(group.collect())).collect();
+    Ok(Transactions(r))
+}
+
+/// Return the set of fulltext values in the store, ordered by rowid.
+pub(crate) fn fulltext_values(conn: &rusqlite::Connection) -> Result<FulltextValues> {
+    let mut stmt: rusqlite::Statement = conn.prepare("SELECT rowid, text FROM fulltext_values ORDER BY rowid")?;
+
+    let r: Result<Vec<_>> = stmt.query_and_then(&[], |row| {
+        let rowid: i64 = row.get_checked(0)?;
+        let text: String = row.get_checked(1)?;
+        Ok((rowid, text))
+    })?.collect();
+
+    r.map(FulltextValues)
+}
+
+/// Execute the given `sql` query with the given `params` and format the results as a
+/// tab-and-newline formatted string suitable for debug printing.
+///
+/// The query is printed followed by a newline, then the returned columns followed by a newline, and
+/// then the data rows and columns.  All columns are aligned.
+pub(crate) fn dump_sql_query(conn: &rusqlite::Connection, sql: &str, params: &[&ToSql]) -> Result<String> {
+    let mut stmt: rusqlite::Statement = conn.prepare(sql)?;
+
+    let mut tw = TabWriter::new(Vec::new()).padding(2);
+    write!(&mut tw, "{}\n", sql).unwrap();
+
+    for column_name in stmt.column_names() {
+        write!(&mut tw, "{}\t", column_name).unwrap();
+    }
+    write!(&mut tw, "\n").unwrap();
+
+    let r: Result<Vec<_>> = stmt.query_and_then(params, |row| {
+        for i in 0..row.column_count() {
+            let value: rusqlite::types::Value = row.get_checked(i)?;
+            write!(&mut tw, "{:?}\t", value).unwrap();
+        }
+        write!(&mut tw, "\n").unwrap();
+        Ok(())
+    })?.collect();
+    r?;
+
+    let dump = String::from_utf8(tw.into_inner().unwrap()).unwrap();
+    Ok(dump)
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/entids.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/entids.rs.html new file mode 100644 index 00000000..590fa6a0 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/entids.rs.html @@ -0,0 +1,352 @@ + + + + + + + + + + entids.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+/// Literal `Entid` values in the the "db" namespace.
+///
+/// Used through-out the transactor to match core DB constructs.
+
+use types::{Entid};
+
+// Added in SQL schema v1.
+pub const DB_IDENT: Entid = 1;
+pub const DB_PART_DB: Entid = 2;
+pub const DB_TX_INSTANT: Entid = 3;
+pub const DB_INSTALL_PARTITION: Entid = 4;
+pub const DB_INSTALL_VALUE_TYPE: Entid = 5;
+pub const DB_INSTALL_ATTRIBUTE: Entid = 6;
+pub const DB_VALUE_TYPE: Entid = 7;
+pub const DB_CARDINALITY: Entid = 8;
+pub const DB_UNIQUE: Entid = 9;
+pub const DB_IS_COMPONENT: Entid = 10;
+pub const DB_INDEX: Entid = 11;
+pub const DB_FULLTEXT: Entid = 12;
+pub const DB_NO_HISTORY: Entid = 13;
+pub const DB_ADD: Entid = 14;
+pub const DB_RETRACT: Entid = 15;
+pub const DB_PART_USER: Entid = 16;
+pub const DB_PART_TX: Entid = 17;
+pub const DB_EXCISE: Entid = 18;
+pub const DB_EXCISE_ATTRS: Entid = 19;
+pub const DB_EXCISE_BEFORE_T: Entid = 20;
+pub const DB_EXCISE_BEFORE: Entid = 21;
+pub const DB_ALTER_ATTRIBUTE: Entid = 22;
+pub const DB_TYPE_REF: Entid = 23;
+pub const DB_TYPE_KEYWORD: Entid = 24;
+pub const DB_TYPE_LONG: Entid = 25;
+pub const DB_TYPE_DOUBLE: Entid = 26;
+pub const DB_TYPE_STRING: Entid = 27;
+pub const DB_TYPE_UUID: Entid = 28;
+pub const DB_TYPE_URI: Entid = 29;
+pub const DB_TYPE_BOOLEAN: Entid = 30;
+pub const DB_TYPE_INSTANT: Entid = 31;
+pub const DB_TYPE_BYTES: Entid = 32;
+pub const DB_CARDINALITY_ONE: Entid = 33;
+pub const DB_CARDINALITY_MANY: Entid = 34;
+pub const DB_UNIQUE_VALUE: Entid = 35;
+pub const DB_UNIQUE_IDENTITY: Entid = 36;
+pub const DB_DOC: Entid = 37;
+pub const DB_SCHEMA_VERSION: Entid = 38;
+pub const DB_SCHEMA_ATTRIBUTE: Entid = 39;
+pub const DB_SCHEMA_CORE: Entid = 40;
+
+/// Return `false` if the given attribute will not change the metadata: recognized idents, schema,
+/// partitions in the partition map.
+pub fn might_update_metadata(attribute: Entid) -> bool {
+    if attribute > DB_DOC {
+        return false
+    }
+    match attribute {
+        // Idents.
+        DB_IDENT |
+        // Schema.
+        DB_CARDINALITY |
+        DB_DOC |
+        DB_FULLTEXT |
+        DB_INDEX |
+        DB_IS_COMPONENT |
+        DB_UNIQUE |
+        DB_VALUE_TYPE =>
+            true,
+        _ => false,
+    }
+}
+
+lazy_static! {
+    /// Attributes that are "ident related".  These might change the "idents" materialized view.
+    pub static ref IDENTS_SQL_LIST: String = {
+        format!("({})",
+                DB_IDENT)
+    };
+
+    /// Attributes that are "schema related".  These might change the "schema" materialized view.
+    pub static ref SCHEMA_SQL_LIST: String = {
+        format!("({}, {}, {}, {}, {}, {}, {})",
+                DB_CARDINALITY,
+                DB_DOC,
+                DB_FULLTEXT,
+                DB_INDEX,
+                DB_IS_COMPONENT,
+                DB_UNIQUE,
+                DB_VALUE_TYPE)
+    };
+
+    /// Attributes that are "metadata" related.  These might change one of the materialized views.
+    pub static ref METADATA_SQL_LIST: String = {
+        format!("({}, {}, {}, {}, {}, {}, {}, {})",
+                DB_CARDINALITY,
+                DB_DOC,
+                DB_FULLTEXT,
+                DB_IDENT,
+                DB_INDEX,
+                DB_IS_COMPONENT,
+                DB_UNIQUE,
+                DB_VALUE_TYPE)
+    };
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/errors.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/errors.rs.html new file mode 100644 index 00000000..7e64c663 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/errors.rs.html @@ -0,0 +1,698 @@ + + + + + + + + + + errors.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+use failure::{
+    Backtrace,
+    Context,
+    Error,
+    Fail,
+};
+
+use std::collections::{
+    BTreeMap,
+    BTreeSet,
+};
+
+use rusqlite;
+
+use edn::entities::{
+    TempId,
+};
+use mentat_core::{
+    KnownEntid,
+};
+use types::{
+    Entid,
+    TypedValue,
+    ValueType,
+};
+
+#[macro_export]
+macro_rules! bail {
+    ($e:expr) => (
+        return Err($e.into());
+    )
+}
+
+pub type Result<T> = ::std::result::Result<T, Error>;
+
+// TODO Error/ErrorKind pair
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum CardinalityConflict {
+    /// A cardinality one attribute has multiple assertions `[e a v1], [e a v2], ...`.
+    CardinalityOneAddConflict {
+        e: Entid,
+        a: Entid,
+        vs: BTreeSet<TypedValue>,
+    },
+
+    /// A datom has been both asserted and retracted, like `[:db/add e a v]` and `[:db/retract e a v]`.
+    AddRetractConflict {
+        e: Entid,
+        a: Entid,
+        vs: BTreeSet<TypedValue>,
+    },
+}
+
+// TODO Error/ErrorKind pair
+#[derive(Clone, Debug, Eq, PartialEq, Fail)]
+pub enum SchemaConstraintViolation {
+    /// A transaction tried to assert datoms where one tempid upserts to two (or more) distinct
+    /// entids.
+    ConflictingUpserts {
+        /// A map from tempid to the entids it would upsert to.
+        ///
+        /// In the future, we might even be able to attribute the upserts to particular (reduced)
+        /// datoms, i.e., to particular `[e a v]` triples that caused the constraint violation.
+        /// Attributing constraint violations to input data is more difficult to the multiple
+        /// rewriting passes the input undergoes.
+        conflicting_upserts: BTreeMap<TempId, BTreeSet<KnownEntid>>,
+    },
+
+    /// A transaction tried to assert a datom or datoms with the wrong value `v` type(s).
+    TypeDisagreements {
+        /// The key (`[e a v]`) has an invalid value `v`: it is not of the expected value type.
+        conflicting_datoms: BTreeMap<(Entid, Entid, TypedValue), ValueType>
+    },
+
+    /// A transaction tried to assert datoms that don't observe the schema's cardinality constraints.
+    CardinalityConflicts {
+        conflicts: Vec<CardinalityConflict>,
+    },
+}
+
+impl ::std::fmt::Display for SchemaConstraintViolation {
+    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
+        use self::SchemaConstraintViolation::*;
+        match self {
+            &ConflictingUpserts { ref conflicting_upserts } => {
+                writeln!(f, "conflicting upserts:")?;
+                for (tempid, entids) in conflicting_upserts {
+                    writeln!(f, "  tempid {:?} upserts to {:?}", tempid, entids)?;
+                }
+                Ok(())
+            },
+            &TypeDisagreements { ref conflicting_datoms } => {
+                writeln!(f, "type disagreements:")?;
+                for (ref datom, expected_type) in conflicting_datoms {
+                    writeln!(f, "  expected value of type {} but got datom [{} {} {:?}]", expected_type, datom.0, datom.1, datom.2)?;
+                }
+                Ok(())
+            },
+            &CardinalityConflicts { ref conflicts } => {
+                writeln!(f, "cardinality conflicts:")?;
+                for ref conflict in conflicts {
+                    writeln!(f, "  {:?}", conflict)?;
+                }
+                Ok(())
+            },
+        }
+    }
+}
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum InputError {
+    /// Map notation included a bad `:db/id` value.
+    BadDbId,
+
+    /// A value place cannot be interpreted as an entity place (for example, in nested map
+    /// notation).
+    BadEntityPlace,
+}
+
+impl ::std::fmt::Display for InputError {
+    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
+        use self::InputError::*;
+        match self {
+            &BadDbId => {
+                writeln!(f, ":db/id in map notation must either not be present or be an entid, an ident, or a tempid")
+            },
+            &BadEntityPlace => {
+                writeln!(f, "cannot convert value place into entity place")
+            },
+        }
+    }
+}
+
+#[derive(Debug, Fail)]
+pub enum DbError {
+    /// We're just not done yet.  Message that the feature is recognized but not yet
+    /// implemented.
+    #[fail(display = "not yet implemented: {}", _0)]
+    NotYetImplemented(String),
+
+    /// We've been given a value that isn't the correct Mentat type.
+    #[fail(display = "value '{}' is not the expected Mentat value type {:?}", _0, _1)]
+    BadValuePair(String, ValueType),
+
+    /// We've got corrupt data in the SQL store: a value and value_type_tag don't line up.
+    /// TODO _1.data_type()
+    #[fail(display = "bad SQL (value_type_tag, value) pair: ({:?}, {:?})", _0, _1)]
+    BadSQLValuePair(rusqlite::types::Value, i32),
+
+    // /// The SQLite store user_version isn't recognized.  This could be an old version of Mentat
+    // /// trying to open a newer version SQLite store; or it could be a corrupt file; or ...
+    // #[fail(display = "bad SQL store user_version: {}", _0)]
+    // BadSQLiteStoreVersion(i32),
+
+    /// A bootstrap definition couldn't be parsed or installed.  This is a programmer error, not
+    /// a runtime error.
+    #[fail(display = "bad bootstrap definition: {}", _0)]
+    BadBootstrapDefinition(String),
+
+    /// A schema assertion couldn't be parsed.
+    #[fail(display = "bad schema assertion: {}", _0)]
+    BadSchemaAssertion(String),
+
+    /// An ident->entid mapping failed.
+    #[fail(display = "no entid found for ident: {}", _0)]
+    UnrecognizedIdent(String),
+
+    /// An entid->ident mapping failed.
+    /// We also use this error if you try to transact an entid that we didn't allocate,
+    /// in part because we blow the stack in error_chain if we define a new enum!
+    #[fail(display = "unrecognized or no ident found for entid: {}", _0)]
+    UnrecognizedEntid(Entid),
+
+    #[fail(display = "unknown attribute for entid: {}", _0)]
+    UnknownAttribute(Entid),
+
+    #[fail(display = "cannot reverse-cache non-unique attribute: {}", _0)]
+    CannotCacheNonUniqueAttributeInReverse(Entid),
+
+    #[fail(display = "schema alteration failed: {}", _0)]
+    SchemaAlterationFailed(String),
+
+    /// A transaction tried to violate a constraint of the schema of the Mentat store.
+    #[fail(display = "schema constraint violation: {}", _0)]
+    SchemaConstraintViolation(SchemaConstraintViolation),
+
+    /// The transaction was malformed in some way (that was not recognized at parse time; for
+    /// example, in a way that is schema-dependent).
+    #[fail(display = "transaction input error: {}", _0)]
+    InputError(InputError),
+
+    #[fail(display = "Cannot transact a fulltext assertion with a typed value that is not :db/valueType :db.type/string")]
+    WrongTypeValueForFtsAssertion,
+}
+
+#[derive(Debug)]
+pub struct DbSqlError {
+    inner: Context<DbSqlErrorKind>,
+}
+
+impl Fail for DbSqlError {
+    fn cause(&self) -> Option<&Fail> {
+        self.inner.cause()
+    }
+
+    fn backtrace(&self) -> Option<&Backtrace> {
+        self.inner.backtrace()
+    }
+}
+
+impl ::std::fmt::Display for DbSqlError {
+    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
+        ::std::fmt::Display::fmt(&self.inner, f)
+    }
+}
+
+impl DbSqlError {
+    pub fn kind(&self) -> DbSqlErrorKind {
+        *self.inner.get_context()
+    }
+}
+
+impl From<DbSqlErrorKind> for DbSqlError {
+    fn from(kind: DbSqlErrorKind) -> DbSqlError {
+        DbSqlError { inner: Context::new(kind) }
+    }
+}
+
+impl From<Context<DbSqlErrorKind>> for DbSqlError {
+    fn from(inner: Context<DbSqlErrorKind>) -> DbSqlError {
+        DbSqlError { inner: inner }
+    }
+}
+
+#[derive(Copy, Clone, Eq, PartialEq, Debug, Fail)]
+pub enum DbSqlErrorKind {
+    #[fail(display = "Could not set_user_version")]
+    CouldNotSetVersionPragma,
+
+    #[fail(display = "Could not get_user_version")]
+    CouldNotGetVersionPragma,
+
+    #[fail(display = "Could not search!")]
+    CouldNotSearch,
+
+    #[fail(display = "Could not insert transaction: failed to add datoms not already present")]
+    TxInsertFailedToAddMissingDatoms,
+
+    #[fail(display = "Could not insert transaction: failed to retract datoms already present")]
+    TxInsertFailedToRetractDatoms,
+
+    #[fail(display = "Could not update datoms: failed to retract datoms already present")]
+    DatomsUpdateFailedToRetract,
+
+    #[fail(display = "Could not update datoms: failed to add datoms not already present")]
+    DatomsUpdateFailedToAdd,
+
+    #[fail(display = "Failed to create temporary tables")]
+    FailedToCreateTempTables,
+
+    #[fail(display = "Could not insert non-fts one statements into temporary search table!")]
+    NonFtsInsertionIntoTempSearchTableFailed,
+
+    #[fail(display = "Could not insert fts values into fts table!")]
+    FtsInsertionFailed,
+
+    #[fail(display = "Could not insert FTS statements into temporary search table!")]
+    FtsInsertionIntoTempSearchTableFailed,
+
+    #[fail(display = "Could not drop FTS search ids!")]
+    FtsFailedToDropSearchIds,
+
+    #[fail(display = "Could not update partition map")]
+    FailedToUpdatePartitionMap,
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/internal_types.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/internal_types.rs.html new file mode 100644 index 00000000..77561a48 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/internal_types.rs.html @@ -0,0 +1,556 @@ + + + + + + + + + + internal_types.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+//! Types used only within the transactor.  These should not be exposed outside of this crate.
+
+use std::collections::{
+    BTreeMap,
+    BTreeSet,
+    HashMap,
+};
+use std::rc::Rc;
+
+use mentat_core::KnownEntid;
+
+use mentat_core::util::Either;
+
+use edn;
+use edn::{
+    SpannedValue,
+    ValueAndSpan,
+};
+
+use errors;
+use errors::{
+    DbError,
+    Result,
+};
+use schema::{
+    SchemaTypeChecking,
+};
+use types::{
+    Attribute,
+    AVMap,
+    AVPair,
+    Entid,
+    Schema,
+    TransactableValue,
+    TypedValue,
+    ValueType,
+};
+use edn::entities;
+use edn::entities::{
+    EntityPlace,
+    OpType,
+    TempId,
+    TxFunction,
+};
+
+impl TransactableValue for ValueAndSpan {
+    fn into_typed_value(self, schema: &Schema, value_type: ValueType) -> Result<TypedValue> {
+        schema.to_typed_value(&self, value_type)
+    }
+
+    fn into_entity_place(self) -> Result<EntityPlace<Self>> {
+        use self::SpannedValue::*;
+        match self.inner {
+            Integer(v) => Ok(EntityPlace::Entid(entities::Entid::Entid(v))),
+            Keyword(v) => {
+                if v.is_namespaced() {
+                    Ok(EntityPlace::Entid(entities::Entid::Ident(v)))
+                } else {
+                    // We only allow namespaced idents.
+                    bail!(DbError::InputError(errors::InputError::BadEntityPlace))
+                }
+            },
+            Text(v) => Ok(EntityPlace::TempId(TempId::External(v))),
+            List(ls) => {
+                let mut it = ls.iter();
+                match (it.next().map(|x| &x.inner), it.next(), it.next(), it.next()) {
+                    // Like "(transaction-id)".
+                    (Some(&PlainSymbol(ref op)), None, None, None) => {
+                        Ok(EntityPlace::TxFunction(TxFunction { op: op.clone() }))
+                    },
+                    // Like "(lookup-ref)".
+                    (Some(&PlainSymbol(edn::PlainSymbol(ref s))), Some(a), Some(v), None) if s == "lookup-ref" => {
+                        match a.clone().into_entity_place()? {
+                            EntityPlace::Entid(a) => Ok(EntityPlace::LookupRef(entities::LookupRef { a: entities::AttributePlace::Entid(a), v: v.clone() })),
+                            EntityPlace::TempId(_) |
+                            EntityPlace::TxFunction(_) |
+                            EntityPlace::LookupRef(_) => bail!(DbError::InputError(errors::InputError::BadEntityPlace)),
+                        }
+                    },
+                    _ => bail!(DbError::InputError(errors::InputError::BadEntityPlace)),
+                }
+            },
+            Nil |
+            Boolean(_) |
+            Instant(_) |
+            BigInteger(_) |
+            Float(_) |
+            Uuid(_) |
+            PlainSymbol(_) |
+            NamespacedSymbol(_) |
+            Vector(_) |
+            Set(_) |
+            Map(_) => bail!(DbError::InputError(errors::InputError::BadEntityPlace)),
+        }
+    }
+
+    fn as_tempid(&self) -> Option<TempId> {
+        self.inner.as_text().cloned().map(TempId::External)
+    }
+}
+
+impl TransactableValue for TypedValue {
+    fn into_typed_value(self, _schema: &Schema, value_type: ValueType) -> Result<TypedValue> {
+        if self.value_type() != value_type {
+            bail!(DbError::BadValuePair(format!("{:?}", self), value_type));
+        }
+        Ok(self)
+    }
+
+    fn into_entity_place(self) -> Result<EntityPlace<Self>> {
+        match self {
+            TypedValue::Ref(x) => Ok(EntityPlace::Entid(entities::Entid::Entid(x))),
+            TypedValue::Keyword(x) => Ok(EntityPlace::Entid(entities::Entid::Ident((*x).clone()))),
+            TypedValue::String(x) => Ok(EntityPlace::TempId(TempId::External((*x).clone()))),
+            TypedValue::Boolean(_) |
+            TypedValue::Long(_) |
+            TypedValue::Double(_) |
+            TypedValue::Instant(_) |
+            TypedValue::Uuid(_) => bail!(DbError::InputError(errors::InputError::BadEntityPlace)),
+        }
+    }
+
+    fn as_tempid(&self) -> Option<TempId> {
+        match self {
+            &TypedValue::String(ref s) => Some(TempId::External((**s).clone())),
+            _ => None,
+        }
+    }
+}
+
+#[derive(Clone, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub enum Term<E, V> {
+    AddOrRetract(OpType, E, Entid, V),
+}
+
+use self::Either::*;
+
+pub type KnownEntidOr<T> = Either<KnownEntid, T>;
+pub type TypedValueOr<T> = Either<TypedValue, T>;
+
+pub type TempIdHandle = Rc<TempId>;
+pub type TempIdMap = HashMap<TempIdHandle, KnownEntid>;
+
+pub type LookupRef = Rc<AVPair>;
+
+/// Internal representation of an entid on its way to resolution.  We either have the simple case (a
+/// numeric entid), a lookup-ref that still needs to be resolved (an atomized [a v] pair), or a temp
+/// ID that needs to be upserted or allocated (an atomized tempid).
+#[derive(Clone,Debug,Eq,Hash,Ord,PartialOrd,PartialEq)]
+pub enum LookupRefOrTempId {
+    LookupRef(LookupRef),
+    TempId(TempIdHandle)
+}
+
+pub type TermWithTempIdsAndLookupRefs = Term<KnownEntidOr<LookupRefOrTempId>, TypedValueOr<LookupRefOrTempId>>;
+pub type TermWithTempIds = Term<KnownEntidOr<TempIdHandle>, TypedValueOr<TempIdHandle>>;
+pub type TermWithoutTempIds = Term<KnownEntid, TypedValue>;
+pub type Population = Vec<TermWithTempIds>;
+
+impl TermWithTempIds {
+    // These have no tempids by definition, and just need to be unwrapped.  This operation might
+    // also be called "lowering" or "level lowering", but the concept of "unwrapping" is common in
+    // Rust and seems appropriate here.
+    pub(crate) fn unwrap(self) -> TermWithoutTempIds {
+        match self {
+            Term::AddOrRetract(op, Left(n), a, Left(v)) => Term::AddOrRetract(op, n, a, v),
+            _ => unreachable!(),
+        }
+    }
+}
+
+/// Given a `KnownEntidOr` or a `TypedValueOr`, replace any internal `LookupRef` with the entid from
+/// the given map.  Fail if any `LookupRef` cannot be replaced.
+///
+/// `lift` allows to specify how the entid found is mapped into the output type.  (This could
+/// also be an `Into` or `From` requirement.)
+///
+/// The reason for this awkward expression is that we're parameterizing over the _type constructor_
+/// (`EntidOr` or `TypedValueOr`), which is not trivial to express in Rust.  This only works because
+/// they're both the same `Result<...>` type with different parameterizations.
+pub fn replace_lookup_ref<T, U>(lookup_map: &AVMap, desired_or: Either<T, LookupRefOrTempId>, lift: U) -> errors::Result<Either<T, TempIdHandle>> where U: FnOnce(Entid) -> T {
+    match desired_or {
+        Left(desired) => Ok(Left(desired)), // N.b., must unwrap here -- the ::Left types are different!
+        Right(other) => {
+            match other {
+                LookupRefOrTempId::TempId(t) => Ok(Right(t)),
+                LookupRefOrTempId::LookupRef(av) => lookup_map.get(&*av)
+                    .map(|x| lift(*x)).map(Left)
+                    // XXX TODO: fix this error kind!
+                    .ok_or_else(|| DbError::UnrecognizedIdent(format!("couldn't lookup [a v]: {:?}", (*av).clone())).into()),
+            }
+        }
+    }
+}
+
+#[derive(Clone, Debug, Default)]
+pub(crate) struct AddAndRetract {
+    pub(crate) add: BTreeSet<TypedValue>,
+    pub(crate) retract: BTreeSet<TypedValue>,
+}
+
+// A trie-like structure mapping a -> e -> v that prefix compresses and makes uniqueness constraint
+// checking more efficient.  BTree* for deterministic errors.
+pub(crate) type AEVTrie<'schema> = BTreeMap<(Entid, &'schema Attribute), BTreeMap<Entid, AddAndRetract>>;
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/lib.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/lib.rs.html new file mode 100644 index 00000000..21678dd5 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/lib.rs.html @@ -0,0 +1,408 @@ + + + + + + + + + + lib.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+extern crate failure;
+#[macro_use] extern crate failure_derive;
+extern crate indexmap;
+extern crate itertools;
+#[macro_use] extern crate lazy_static;
+#[macro_use] extern crate log;
+
+extern crate num;
+extern crate petgraph;
+extern crate rusqlite;
+extern crate tabwriter;
+extern crate time;
+
+#[macro_use] extern crate edn;
+#[macro_use] extern crate mentat_core;
+extern crate mentat_sql;
+
+use std::iter::repeat;
+
+use itertools::Itertools;
+
+pub use errors::{
+    DbError,
+    Result,
+    SchemaConstraintViolation,
+};
+#[macro_use] pub mod errors;
+
+mod add_retract_alter_set;
+pub mod cache;
+pub mod db;
+mod bootstrap;
+pub mod debug;
+pub mod entids;
+pub mod internal_types;    // pub because we need them for building entities programmatically.
+mod metadata;
+mod schema;
+pub mod tx_observer;
+mod watcher;
+mod tx;
+mod tx_checking;
+pub mod types;
+mod upsert_resolution;
+
+// Export these for reference from tests. cfg(test) should work, but doesn't.
+// #[cfg(test)]
+pub use bootstrap::{
+    TX0,
+    USER0,
+};
+
+pub use schema::{
+    AttributeBuilder,
+    AttributeValidation,
+};
+
+pub use bootstrap::{
+    CORE_SCHEMA_VERSION,
+};
+
+use edn::symbols;
+
+pub use entids::{
+    DB_SCHEMA_CORE,
+};
+
+pub use db::{
+    TypedSQLValue,
+    new_connection,
+};
+
+#[cfg(feature = "sqlcipher")]
+pub use db::{
+    new_connection_with_key,
+    change_encryption_key,
+};
+
+pub use watcher::{
+    TransactWatcher,
+};
+
+pub use tx::{
+    transact,
+    transact_terms,
+};
+
+pub use tx_observer::{
+    InProgressObserverTransactWatcher,
+    TxObservationService,
+    TxObserver,
+};
+
+pub use types::{
+    AttributeSet,
+    DB,
+    PartitionMap,
+    TransactableValue,
+    TxReport,
+};
+
+pub fn to_namespaced_keyword(s: &str) -> Result<symbols::Keyword> {
+    let splits = [':', '/'];
+    let mut i = s.split(&splits[..]);
+    let nsk = match (i.next(), i.next(), i.next(), i.next()) {
+        (Some(""), Some(namespace), Some(name), None) => Some(symbols::Keyword::namespaced(namespace, name)),
+        _ => None,
+    };
+
+    nsk.ok_or(DbError::NotYetImplemented(format!("InvalidKeyword: {}", s)).into())
+}
+
+/// Prepare an SQL `VALUES` block, like (?, ?, ?), (?, ?, ?).
+///
+/// The number of values per tuple determines  `(?, ?, ?)`.  The number of tuples determines `(...), (...)`.
+///
+/// # Examples
+///
+/// ```rust
+/// # use mentat_db::{repeat_values};
+/// assert_eq!(repeat_values(1, 3), "(?), (?), (?)".to_string());
+/// assert_eq!(repeat_values(3, 1), "(?, ?, ?)".to_string());
+/// assert_eq!(repeat_values(2, 2), "(?, ?), (?, ?)".to_string());
+/// ```
+pub fn repeat_values(values_per_tuple: usize, tuples: usize) -> String {
+    assert!(values_per_tuple >= 1);
+    assert!(tuples >= 1);
+    // Like "(?, ?, ?)".
+    let inner = format!("({})", repeat("?").take(values_per_tuple).join(", "));
+    // Like "(?, ?, ?), (?, ?, ?)".
+    let values: String = repeat(inner).take(tuples).join(", ");
+    values
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/metadata.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/metadata.rs.html new file mode 100644 index 00000000..27ce01d4 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/metadata.rs.html @@ -0,0 +1,810 @@ + + + + + + + + + + metadata.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+//! Most transactions can mutate the Mentat metadata by transacting assertions:
+//!
+//! - they can add (and, eventually, retract and alter) recognized idents using the `:db/ident`
+//!   attribute;
+//!
+//! - they can add (and, eventually, retract and alter) schema attributes using various `:db/*`
+//!   attributes;
+//!
+//! - eventually, they will be able to add (and possibly retract) entid partitions using a Mentat
+//!   equivalent (perhaps :db/partition or :db.partition/start) to Datomic's `:db.install/partition`
+//!   attribute.
+//!
+//! This module recognizes, validates, applies, and reports on these mutations.
+
+use failure::ResultExt;
+
+use std::collections::{BTreeMap, BTreeSet};
+use std::collections::btree_map::Entry;
+
+use add_retract_alter_set::{
+    AddRetractAlterSet,
+};
+use edn::symbols;
+use entids;
+use errors::{
+    DbError,
+    Result,
+};
+use mentat_core::{
+    attribute,
+    Entid,
+    Schema,
+    AttributeMap,
+    TypedValue,
+    ValueType,
+};
+
+use schema::{
+    AttributeBuilder,
+    AttributeValidation,
+};
+
+/// An alteration to an attribute.
+#[derive(Clone, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub enum AttributeAlteration {
+    /// From http://blog.datomic.com/2014/01/schema-alteration.html:
+    /// - rename attributes
+    /// - rename your own programmatic identities (uses of :db/ident)
+    /// - add or remove indexes
+    Index,
+    /// - add or remove uniqueness constraints
+    Unique,
+    /// - change attribute cardinality
+    Cardinality,
+    /// - change whether history is retained for an attribute
+    NoHistory,
+    /// - change whether an attribute is treated as a component
+    IsComponent,
+}
+
+/// An alteration to an ident.
+#[derive(Clone, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub enum IdentAlteration {
+    Ident(symbols::Keyword),
+}
+
+/// Summarizes changes to metadata such as a a `Schema` and (in the future) a `PartitionMap`.
+#[derive(Clone, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub struct MetadataReport {
+    // Entids that were not present in the original `AttributeMap` that was mutated.
+    pub attributes_installed: BTreeSet<Entid>,
+
+    // Entids that were present in the original `AttributeMap` that was mutated, together with a
+    // representation of the mutations that were applied.
+    pub attributes_altered: BTreeMap<Entid, Vec<AttributeAlteration>>,
+
+    // Idents that were installed into the `AttributeMap`.
+    pub idents_altered: BTreeMap<Entid, IdentAlteration>,
+}
+
+impl MetadataReport {
+    pub fn attributes_did_change(&self) -> bool {
+        !(self.attributes_installed.is_empty() &&
+          self.attributes_altered.is_empty())
+    }
+}
+
+/// Update a `AttributeMap` in place from the given `[e a typed_value]` triples.
+///
+/// This is suitable for producing a `AttributeMap` from the `schema` materialized view, which does not
+/// contain install and alter markers.
+///
+/// Returns a report summarizing the mutations that were applied.
+pub fn update_attribute_map_from_entid_triples<A, R>(attribute_map: &mut AttributeMap, assertions: A, retractions: R) -> Result<MetadataReport>
+    where A: IntoIterator<Item=(Entid, Entid, TypedValue)>,
+          R: IntoIterator<Item=(Entid, Entid, TypedValue)> {
+
+    fn attribute_builder_to_modify(attribute_id: Entid, existing: &AttributeMap) -> AttributeBuilder {
+        existing.get(&attribute_id)
+                .map(AttributeBuilder::to_modify_attribute)
+                .unwrap_or_else(AttributeBuilder::default)
+    }
+
+    // Group mutations by impacted entid.
+    let mut builders: BTreeMap<Entid, AttributeBuilder> = BTreeMap::new();
+
+    // For retractions, we start with an attribute builder that's pre-populated with the existing
+    // attribute values. That allows us to check existing values and unset them.
+    for (entid, attr, ref value) in retractions.into_iter() {
+        let builder = builders.entry(entid).or_insert_with(|| attribute_builder_to_modify(entid, attribute_map));
+        match attr {
+            // You can only retract :db/unique, :db/doc, :db/isComponent; all others
+            // must be altered instead of retracted, or are not allowed to change.
+            entids::DB_DOC => {
+                // Nothing to do here; we don't keep docstrings inside `Attribute`s.
+            },
+            entids::DB_IS_COMPONENT => {
+                match value {
+                    &TypedValue::Boolean(v) if builder.component == Some(v) => {
+                        builder.component(false);
+                    },
+                    v => {
+                        bail!(DbError::BadSchemaAssertion(format!("Attempted to retract :db/isComponent with the wrong value {:?}.", v)));
+                    },
+                }
+            },
+            entids::DB_UNIQUE => {
+                match *value {
+                    TypedValue::Ref(u) => {
+                        match u {
+                            entids::DB_UNIQUE_VALUE if builder.unique == Some(Some(attribute::Unique::Value)) => {
+                                builder.non_unique();
+                            },
+                            entids::DB_UNIQUE_IDENTITY if builder.unique == Some(Some(attribute::Unique::Identity)) => {
+                                builder.non_unique();
+                            },
+                            v => {
+                                bail!(DbError::BadSchemaAssertion(format!("Attempted to retract :db/unique with the wrong value {}.", v)));
+                            },
+                        }
+                    },
+                    _ => bail!(DbError::BadSchemaAssertion(format!("Expected [:db/retract _ :db/unique :db.unique/_] but got [:db/retract {} :db/unique {:?}]", entid, value)))
+                }
+            },
+            _ => {
+                bail!(DbError::BadSchemaAssertion(format!("Retracting attribute {} for entity {} not permitted.", attr, entid)));
+            },
+        }
+    }
+
+    for (entid, attr, ref value) in assertions.into_iter() {
+        // For assertions, we can start with an empty attribute builder.
+        let builder = builders.entry(entid).or_insert_with(Default::default);
+
+        // TODO: improve error messages throughout.
+        match attr {
+            entids::DB_DOC => {
+                match *value {
+                    TypedValue::String(_) => {},
+                    _ => bail!(DbError::BadSchemaAssertion(format!("Expected [... :db/doc \"string value\"] but got [... :db/doc {:?}] for entid {} and attribute {}", value, entid, attr)))
+                }
+            },
+
+            entids::DB_VALUE_TYPE => {
+                match *value {
+                    TypedValue::Ref(entids::DB_TYPE_BOOLEAN) => { builder.value_type(ValueType::Boolean); },
+                    TypedValue::Ref(entids::DB_TYPE_DOUBLE)  => { builder.value_type(ValueType::Double); },
+                    TypedValue::Ref(entids::DB_TYPE_INSTANT) => { builder.value_type(ValueType::Instant); },
+                    TypedValue::Ref(entids::DB_TYPE_KEYWORD) => { builder.value_type(ValueType::Keyword); },
+                    TypedValue::Ref(entids::DB_TYPE_LONG)    => { builder.value_type(ValueType::Long); },
+                    TypedValue::Ref(entids::DB_TYPE_REF)     => { builder.value_type(ValueType::Ref); },
+                    TypedValue::Ref(entids::DB_TYPE_STRING)  => { builder.value_type(ValueType::String); },
+                    TypedValue::Ref(entids::DB_TYPE_UUID)    => { builder.value_type(ValueType::Uuid); },
+                    _ => bail!(DbError::BadSchemaAssertion(format!("Expected [... :db/valueType :db.type/*] but got [... :db/valueType {:?}] for entid {} and attribute {}", value, entid, attr)))
+                }
+            },
+
+            entids::DB_CARDINALITY => {
+                match *value {
+                    TypedValue::Ref(entids::DB_CARDINALITY_MANY) => { builder.multival(true); },
+                    TypedValue::Ref(entids::DB_CARDINALITY_ONE) => { builder.multival(false); },
+                    _ => bail!(DbError::BadSchemaAssertion(format!("Expected [... :db/cardinality :db.cardinality/many|:db.cardinality/one] but got [... :db/cardinality {:?}]", value)))
+                }
+            },
+
+            entids::DB_UNIQUE => {
+                match *value {
+                    TypedValue::Ref(entids::DB_UNIQUE_VALUE) => { builder.unique(attribute::Unique::Value); },
+                    TypedValue::Ref(entids::DB_UNIQUE_IDENTITY) => { builder.unique(attribute::Unique::Identity); },
+                    _ => bail!(DbError::BadSchemaAssertion(format!("Expected [... :db/unique :db.unique/value|:db.unique/identity] but got [... :db/unique {:?}]", value)))
+                }
+            },
+
+            entids::DB_INDEX => {
+                match *value {
+                    TypedValue::Boolean(x) => { builder.index(x); },
+                    _ => bail!(DbError::BadSchemaAssertion(format!("Expected [... :db/index true|false] but got [... :db/index {:?}]", value)))
+                }
+            },
+
+            entids::DB_FULLTEXT => {
+                match *value {
+                    TypedValue::Boolean(x) => { builder.fulltext(x); },
+                    _ => bail!(DbError::BadSchemaAssertion(format!("Expected [... :db/fulltext true|false] but got [... :db/fulltext {:?}]", value)))
+                }
+            },
+
+            entids::DB_IS_COMPONENT => {
+                match *value {
+                    TypedValue::Boolean(x) => { builder.component(x); },
+                    _ => bail!(DbError::BadSchemaAssertion(format!("Expected [... :db/isComponent true|false] but got [... :db/isComponent {:?}]", value)))
+                }
+            },
+
+            entids::DB_NO_HISTORY => {
+                match *value {
+                    TypedValue::Boolean(x) => { builder.no_history(x); },
+                    _ => bail!(DbError::BadSchemaAssertion(format!("Expected [... :db/noHistory true|false] but got [... :db/noHistory {:?}]", value)))
+                }
+            },
+
+            _ => {
+                bail!(DbError::BadSchemaAssertion(format!("Do not recognize attribute {} for entid {}", attr, entid)))
+            }
+        }
+    };
+
+    let mut attributes_installed: BTreeSet<Entid> = BTreeSet::default();
+    let mut attributes_altered: BTreeMap<Entid, Vec<AttributeAlteration>> = BTreeMap::default();
+
+    for (entid, builder) in builders.into_iter() {
+        match attribute_map.entry(entid) {
+            Entry::Vacant(entry) => {
+                // Validate once…
+                builder.validate_install_attribute().context(DbError::BadSchemaAssertion(format!("Schema alteration for new attribute with entid {} is not valid", entid)))?;
+
+                // … and twice, now we have the Attribute.
+                let a = builder.build();
+                a.validate(|| entid.to_string())?;
+                entry.insert(builder.build());
+                attributes_installed.insert(entid);
+            },
+
+            Entry::Occupied(mut entry) => {
+                builder.validate_alter_attribute().context(DbError::BadSchemaAssertion(format!("Schema alteration for existing attribute with entid {} is not valid", entid)))?;
+                let mutations = builder.mutate(entry.get_mut());
+                attributes_altered.insert(entid, mutations);
+            },
+        }
+    }
+
+    Ok(MetadataReport {
+        attributes_installed: attributes_installed,
+        attributes_altered: attributes_altered,
+        idents_altered: BTreeMap::default(),
+    })
+}
+
+/// Update a `Schema` in place from the given `[e a typed_value added]` quadruples.
+///
+/// This layer enforces that ident assertions of the form [entid :db/ident ...] (as distinct from
+/// attribute assertions) are present and correct.
+///
+/// This is suitable for mutating a `Schema` from an applied transaction.
+///
+/// Returns a report summarizing the mutations that were applied.
+pub fn update_schema_from_entid_quadruples<U>(schema: &mut Schema, assertions: U) -> Result<MetadataReport>
+    where U: IntoIterator<Item=(Entid, Entid, TypedValue, bool)> {
+
+    // Group attribute assertions into asserted, retracted, and updated.  We assume all our
+    // attribute assertions are :db/cardinality :db.cardinality/one (so they'll only be added or
+    // retracted at most once), which means all attribute alterations are simple changes from an old
+    // value to a new value.
+    let mut attribute_set: AddRetractAlterSet<(Entid, Entid), TypedValue> = AddRetractAlterSet::default();
+    let mut ident_set: AddRetractAlterSet<Entid, symbols::Keyword> = AddRetractAlterSet::default();
+
+    for (e, a, typed_value, added) in assertions.into_iter() {
+        // Here we handle :db/ident assertions.
+        if a == entids::DB_IDENT {
+            if let TypedValue::Keyword(ref keyword) = typed_value {
+                ident_set.witness(e, keyword.as_ref().clone(), added);
+                continue
+            } else {
+                // Something is terribly wrong: the schema ensures we have a keyword.
+                unreachable!();
+            }
+        }
+
+        attribute_set.witness((e, a), typed_value, added);
+    }
+
+    // Collect triples.
+    let retracted_triples = attribute_set.retracted.into_iter().map(|((e, a), typed_value)| (e, a, typed_value));
+    let asserted_triples = attribute_set.asserted.into_iter().map(|((e, a), typed_value)| (e, a, typed_value));
+    let altered_triples = attribute_set.altered.into_iter().map(|((e, a), (_old_value, new_value))| (e, a, new_value));
+
+    let report = update_attribute_map_from_entid_triples(&mut schema.attribute_map,
+                                                         asserted_triples.chain(altered_triples),
+                                                         retracted_triples)?;
+
+    let mut idents_altered: BTreeMap<Entid, IdentAlteration> = BTreeMap::new();
+
+    // Asserted, altered, or retracted :db/idents update the relevant entids.
+    for (entid, ident) in ident_set.asserted {
+        schema.entid_map.insert(entid, ident.clone());
+        schema.ident_map.insert(ident.clone(), entid);
+        idents_altered.insert(entid, IdentAlteration::Ident(ident.clone()));
+    }
+
+    for (entid, (old_ident, new_ident)) in ident_set.altered {
+        schema.entid_map.insert(entid, new_ident.clone()); // Overwrite existing.
+        schema.ident_map.remove(&old_ident); // Remove old.
+        schema.ident_map.insert(new_ident.clone(), entid); // Insert new.
+        idents_altered.insert(entid, IdentAlteration::Ident(new_ident.clone()));
+    }
+
+    for (entid, ident) in ident_set.retracted {
+        schema.entid_map.remove(&entid);
+        schema.ident_map.remove(&ident);
+        idents_altered.insert(entid, IdentAlteration::Ident(ident.clone()));
+    }
+
+    if report.attributes_did_change() {
+        schema.update_component_attributes();
+    }
+
+    Ok(MetadataReport {
+        idents_altered: idents_altered,
+        .. report
+    })
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/schema.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/schema.rs.html new file mode 100644 index 00000000..0782786a --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/schema.rs.html @@ -0,0 +1,1196 @@ + + + + + + + + + + schema.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+use db::TypedSQLValue;
+use edn;
+use errors::{
+    DbError,
+    Result,
+};
+use edn::symbols;
+use mentat_core::{
+    attribute,
+    Attribute,
+    Entid,
+    EntidMap,
+    HasSchema,
+    IdentMap,
+    KnownEntid,
+    Schema,
+    AttributeMap,
+    TypedValue,
+    ValueType,
+};
+use metadata;
+use metadata::{
+    AttributeAlteration,
+};
+
+pub trait AttributeValidation {
+    fn validate<F>(&self, ident: F) -> Result<()> where F: Fn() -> String;
+}
+
+impl AttributeValidation for Attribute {
+    fn validate<F>(&self, ident: F) -> Result<()> where F: Fn() -> String {
+        if self.unique == Some(attribute::Unique::Value) && !self.index {
+            bail!(DbError::BadSchemaAssertion(format!(":db/unique :db/unique_value without :db/index true for entid: {}", ident())))
+        }
+        if self.unique == Some(attribute::Unique::Identity) && !self.index {
+            bail!(DbError::BadSchemaAssertion(format!(":db/unique :db/unique_identity without :db/index true for entid: {}", ident())))
+        }
+        if self.fulltext && self.value_type != ValueType::String {
+            bail!(DbError::BadSchemaAssertion(format!(":db/fulltext true without :db/valueType :db.type/string for entid: {}", ident())))
+        }
+        if self.fulltext && !self.index {
+            bail!(DbError::BadSchemaAssertion(format!(":db/fulltext true without :db/index true for entid: {}", ident())))
+        }
+        if self.component && self.value_type != ValueType::Ref {
+            bail!(DbError::BadSchemaAssertion(format!(":db/isComponent true without :db/valueType :db.type/ref for entid: {}", ident())))
+        }
+        // TODO: consider warning if we have :db/index true for :db/valueType :db.type/string,
+        // since this may be inefficient.  More generally, we should try to drive complex
+        // :db/valueType (string, uri, json in the future) users to opt-in to some hash-indexing
+        // scheme, as discussed in https://github.com/mozilla/mentat/issues/69.
+        Ok(())
+    }
+}
+
+/// Return `Ok(())` if `attribute_map` defines a valid Mentat schema.
+fn validate_attribute_map(entid_map: &EntidMap, attribute_map: &AttributeMap) -> Result<()> {
+    for (entid, attribute) in attribute_map {
+        let ident = || entid_map.get(entid).map(|ident| ident.to_string()).unwrap_or(entid.to_string());
+        attribute.validate(ident)?;
+    }
+    Ok(())
+}
+
+#[derive(Clone,Debug,Default,Eq,Hash,Ord,PartialOrd,PartialEq)]
+pub struct AttributeBuilder {
+    helpful: bool,
+    pub value_type: Option<ValueType>,
+    pub multival: Option<bool>,
+    pub unique: Option<Option<attribute::Unique>>,
+    pub index: Option<bool>,
+    pub fulltext: Option<bool>,
+    pub component: Option<bool>,
+    pub no_history: Option<bool>,
+}
+
+impl AttributeBuilder {
+    /// Make a new AttributeBuilder for human consumption: it will help you
+    /// by flipping relevant flags.
+    pub fn helpful() -> Self {
+        AttributeBuilder {
+            helpful: true,
+            ..Default::default()
+        }
+    }
+
+    /// Make a new AttributeBuilder from an existing Attribute. This is important to allow
+    /// retraction. Only attributes that we allow to change are duplicated here.
+    pub fn to_modify_attribute(attribute: &Attribute) -> Self {
+        let mut ab = AttributeBuilder::default();
+        ab.multival   = Some(attribute.multival);
+        ab.unique     = Some(attribute.unique);
+        ab.component  = Some(attribute.component);
+        ab
+    }
+
+    pub fn value_type<'a>(&'a mut self, value_type: ValueType) -> &'a mut Self {
+        self.value_type = Some(value_type);
+        self
+    }
+
+    pub fn multival<'a>(&'a mut self, multival: bool) -> &'a mut Self {
+        self.multival = Some(multival);
+        self
+    }
+
+    pub fn non_unique<'a>(&'a mut self) -> &'a mut Self {
+        self.unique = Some(None);
+        self
+    }
+
+    pub fn unique<'a>(&'a mut self, unique: attribute::Unique) -> &'a mut Self {
+        if self.helpful && unique == attribute::Unique::Identity {
+            self.index = Some(true);
+        }
+        self.unique = Some(Some(unique));
+        self
+    }
+
+    pub fn index<'a>(&'a mut self, index: bool) -> &'a mut Self {
+        self.index = Some(index);
+        self
+    }
+
+    pub fn fulltext<'a>(&'a mut self, fulltext: bool) -> &'a mut Self {
+        self.fulltext = Some(fulltext);
+        if self.helpful && fulltext {
+            self.index = Some(true);
+        }
+        self
+    }
+
+    pub fn component<'a>(&'a mut self, component: bool) -> &'a mut Self {
+        self.component = Some(component);
+        self
+    }
+
+    pub fn no_history<'a>(&'a mut self, no_history: bool) -> &'a mut Self {
+        self.no_history = Some(no_history);
+        self
+    }
+
+    pub fn validate_install_attribute(&self) -> Result<()> {
+        if self.value_type.is_none() {
+            bail!(DbError::BadSchemaAssertion("Schema attribute for new attribute does not set :db/valueType".into()));
+        }
+        Ok(())
+    }
+
+    pub fn validate_alter_attribute(&self) -> Result<()> {
+        if self.value_type.is_some() {
+            bail!(DbError::BadSchemaAssertion("Schema alteration must not set :db/valueType".into()));
+        }
+        if self.fulltext.is_some() {
+            bail!(DbError::BadSchemaAssertion("Schema alteration must not set :db/fulltext".into()));
+        }
+        Ok(())
+    }
+
+    pub fn build(&self) -> Attribute {
+        let mut attribute = Attribute::default();
+        if let Some(value_type) = self.value_type {
+            attribute.value_type = value_type;
+        }
+        if let Some(fulltext) = self.fulltext {
+            attribute.fulltext = fulltext;
+        }
+        if let Some(multival) = self.multival {
+            attribute.multival = multival;
+        }
+        if let Some(ref unique) = self.unique {
+            attribute.unique = unique.clone();
+        }
+        if let Some(index) = self.index {
+            attribute.index = index;
+        }
+        if let Some(component) = self.component {
+            attribute.component = component;
+        }
+        if let Some(no_history) = self.no_history {
+            attribute.no_history = no_history;
+        }
+
+        attribute
+    }
+
+    pub fn mutate(&self, attribute: &mut Attribute) -> Vec<AttributeAlteration> {
+        let mut mutations = Vec::new();
+        if let Some(multival) = self.multival {
+            if multival != attribute.multival {
+                attribute.multival = multival;
+                mutations.push(AttributeAlteration::Cardinality);
+            }
+        }
+
+        if let Some(ref unique) = self.unique {
+            if *unique != attribute.unique {
+                attribute.unique = unique.clone();
+                mutations.push(AttributeAlteration::Unique);
+            }
+        } else {
+            if attribute.unique != None {
+                attribute.unique = None;
+                mutations.push(AttributeAlteration::Unique);
+            }
+        }
+
+        if let Some(index) = self.index {
+            if index != attribute.index {
+                attribute.index = index;
+                mutations.push(AttributeAlteration::Index);
+            }
+        }
+        if let Some(component) = self.component {
+            if component != attribute.component {
+                attribute.component = component;
+                mutations.push(AttributeAlteration::IsComponent);
+            }
+        }
+        if let Some(no_history) = self.no_history {
+            if no_history != attribute.no_history {
+                attribute.no_history = no_history;
+                mutations.push(AttributeAlteration::NoHistory);
+            }
+        }
+
+        mutations
+    }
+}
+
+pub trait SchemaBuilding {
+    fn require_ident(&self, entid: Entid) -> Result<&symbols::Keyword>;
+    fn require_entid(&self, ident: &symbols::Keyword) -> Result<KnownEntid>;
+    fn require_attribute_for_entid(&self, entid: Entid) -> Result<&Attribute>;
+    fn from_ident_map_and_attribute_map(ident_map: IdentMap, attribute_map: AttributeMap) -> Result<Schema>;
+    fn from_ident_map_and_triples<U>(ident_map: IdentMap, assertions: U) -> Result<Schema>
+        where U: IntoIterator<Item=(symbols::Keyword, symbols::Keyword, TypedValue)>;
+}
+
+impl SchemaBuilding for Schema {
+    fn require_ident(&self, entid: Entid) -> Result<&symbols::Keyword> {
+        self.get_ident(entid).ok_or(DbError::UnrecognizedEntid(entid).into())
+    }
+
+    fn require_entid(&self, ident: &symbols::Keyword) -> Result<KnownEntid> {
+        self.get_entid(&ident).ok_or(DbError::UnrecognizedIdent(ident.to_string()).into())
+    }
+
+    fn require_attribute_for_entid(&self, entid: Entid) -> Result<&Attribute> {
+        self.attribute_for_entid(entid).ok_or(DbError::UnrecognizedEntid(entid).into())
+    }
+
+    /// Create a valid `Schema` from the constituent maps.
+    fn from_ident_map_and_attribute_map(ident_map: IdentMap, attribute_map: AttributeMap) -> Result<Schema> {
+        let entid_map: EntidMap = ident_map.iter().map(|(k, v)| (v.clone(), k.clone())).collect();
+
+        validate_attribute_map(&entid_map, &attribute_map)?;
+        Ok(Schema::new(ident_map, entid_map, attribute_map))
+    }
+
+    /// Turn vec![(Keyword(:ident), Keyword(:key), TypedValue(:value)), ...] into a Mentat `Schema`.
+    fn from_ident_map_and_triples<U>(ident_map: IdentMap, assertions: U) -> Result<Schema>
+        where U: IntoIterator<Item=(symbols::Keyword, symbols::Keyword, TypedValue)>{
+
+        let entid_assertions: Result<Vec<(Entid, Entid, TypedValue)>> = assertions.into_iter().map(|(symbolic_ident, symbolic_attr, value)| {
+            let ident: i64 = *ident_map.get(&symbolic_ident).ok_or(DbError::UnrecognizedIdent(symbolic_ident.to_string()))?;
+            let attr: i64 = *ident_map.get(&symbolic_attr).ok_or(DbError::UnrecognizedIdent(symbolic_attr.to_string()))?;
+            Ok((ident, attr, value))
+        }).collect();
+
+        let mut schema = Schema::from_ident_map_and_attribute_map(ident_map, AttributeMap::default())?;
+        let metadata_report = metadata::update_attribute_map_from_entid_triples(&mut schema.attribute_map,
+                                                                                entid_assertions?,
+                                                                                // No retractions.
+                                                                                ::std::iter::empty())?;
+
+        // Rebuild the component attributes list if necessary.
+        if metadata_report.attributes_did_change() {
+            schema.update_component_attributes();
+        }
+        Ok(schema)
+    }
+}
+
+pub trait SchemaTypeChecking {
+    /// Do schema-aware typechecking and coercion.
+    ///
+    /// Either assert that the given value is in the value type's value set, or (in limited cases)
+    /// coerce the given value into the value type's value set.
+    fn to_typed_value(&self, value: &edn::ValueAndSpan, value_type: ValueType) -> Result<TypedValue>;
+}
+
+impl SchemaTypeChecking for Schema {
+    fn to_typed_value(&self, value: &edn::ValueAndSpan, value_type: ValueType) -> Result<TypedValue> {
+        // TODO: encapsulate entid-ident-attribute for better error messages, perhaps by including
+        // the attribute (rather than just the attribute's value type) into this function or a
+        // wrapper function.
+        match TypedValue::from_edn_value(&value.clone().without_spans()) {
+            // We don't recognize this EDN at all.  Get out!
+            None => bail!(DbError::BadValuePair(format!("{}", value), value_type)),
+            Some(typed_value) => match (value_type, typed_value) {
+                // Most types don't coerce at all.
+                (ValueType::Boolean, tv @ TypedValue::Boolean(_)) => Ok(tv),
+                (ValueType::Long, tv @ TypedValue::Long(_)) => Ok(tv),
+                (ValueType::Double, tv @ TypedValue::Double(_)) => Ok(tv),
+                (ValueType::String, tv @ TypedValue::String(_)) => Ok(tv),
+                (ValueType::Uuid, tv @ TypedValue::Uuid(_)) => Ok(tv),
+                (ValueType::Instant, tv @ TypedValue::Instant(_)) => Ok(tv),
+                (ValueType::Keyword, tv @ TypedValue::Keyword(_)) => Ok(tv),
+                // Ref coerces a little: we interpret some things depending on the schema as a Ref.
+                (ValueType::Ref, TypedValue::Long(x)) => Ok(TypedValue::Ref(x)),
+                (ValueType::Ref, TypedValue::Keyword(ref x)) => self.require_entid(&x).map(|entid| entid.into()),
+
+                // Otherwise, we have a type mismatch.
+                // Enumerate all of the types here to allow the compiler to help us.
+                // We don't enumerate all `TypedValue` cases, though: that would multiply this
+                // collection by 8!
+                (vt @ ValueType::Boolean, _) |
+                (vt @ ValueType::Long, _) |
+                (vt @ ValueType::Double, _) |
+                (vt @ ValueType::String, _) |
+                (vt @ ValueType::Uuid, _) |
+                (vt @ ValueType::Instant, _) |
+                (vt @ ValueType::Keyword, _) |
+                (vt @ ValueType::Ref, _)
+                => bail!(DbError::BadValuePair(format!("{}", value), vt)),
+            }
+        }
+    }
+}
+
+
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use self::edn::Keyword;
+
+    fn add_attribute(schema: &mut Schema,
+            ident: Keyword,
+            entid: Entid,
+            attribute: Attribute) {
+
+        schema.entid_map.insert(entid, ident.clone());
+        schema.ident_map.insert(ident.clone(), entid);
+
+        if attribute.component {
+            schema.component_attributes.push(entid);
+        }
+
+        schema.attribute_map.insert(entid, attribute);
+    }
+
+    #[test]
+    fn validate_attribute_map_success() {
+        let mut schema = Schema::default();
+        // attribute that is not an index has no uniqueness
+        add_attribute(&mut schema, Keyword::namespaced("foo", "bar"), 97, Attribute {
+            index: false,
+            value_type: ValueType::Boolean,
+            fulltext: false,
+            unique: None,
+            multival: false,
+            component: false,
+            no_history: false,
+        });
+        // attribute is unique by value and an index
+        add_attribute(&mut schema, Keyword::namespaced("foo", "baz"), 98, Attribute {
+            index: true,
+            value_type: ValueType::Long,
+            fulltext: false,
+            unique: Some(attribute::Unique::Value),
+            multival: false,
+            component: false,
+            no_history: false,
+        });
+        // attribue is unique by identity and an index
+        add_attribute(&mut schema, Keyword::namespaced("foo", "bat"), 99, Attribute {
+            index: true,
+            value_type: ValueType::Ref,
+            fulltext: false,
+            unique: Some(attribute::Unique::Identity),
+            multival: false,
+            component: false,
+            no_history: false,
+        });
+        // attribute is a components and a `Ref`
+        add_attribute(&mut schema, Keyword::namespaced("foo", "bak"), 100, Attribute {
+            index: false,
+            value_type: ValueType::Ref,
+            fulltext: false,
+            unique: None,
+            multival: false,
+            component: true,
+            no_history: false,
+        });
+        // fulltext attribute is a string and an index
+        add_attribute(&mut schema, Keyword::namespaced("foo", "bap"), 101, Attribute {
+            index: true,
+            value_type: ValueType::String,
+            fulltext: true,
+            unique: None,
+            multival: false,
+            component: false,
+            no_history: false,
+        });
+
+        assert!(validate_attribute_map(&schema.entid_map, &schema.attribute_map).is_ok());
+    }
+
+    #[test]
+    fn invalid_schema_unique_value_not_index() {
+        let mut schema = Schema::default();
+        // attribute unique by value but not index
+        let ident = Keyword::namespaced("foo", "bar");
+        add_attribute(&mut schema, ident , 99, Attribute {
+            index: false,
+            value_type: ValueType::Boolean,
+            fulltext: false,
+            unique: Some(attribute::Unique::Value),
+            multival: false,
+            component: false,
+            no_history: false,
+        });
+
+        let err = validate_attribute_map(&schema.entid_map, &schema.attribute_map).err();
+        assert!(err.is_some());
+
+        match err.unwrap().downcast() {
+            Ok(DbError::BadSchemaAssertion(message)) => { assert_eq!(message, ":db/unique :db/unique_value without :db/index true for entid: :foo/bar"); },
+            x => panic!("expected Bad Schema Assertion error, got {:?}", x),
+        }
+    }
+
+    #[test]
+    fn invalid_schema_unique_identity_not_index() {
+        let mut schema = Schema::default();
+        // attribute is unique by identity but not index
+        add_attribute(&mut schema, Keyword::namespaced("foo", "bar"), 99, Attribute {
+            index: false,
+            value_type: ValueType::Long,
+            fulltext: false,
+            unique: Some(attribute::Unique::Identity),
+            multival: false,
+            component: false,
+            no_history: false,
+        });
+
+        let err = validate_attribute_map(&schema.entid_map, &schema.attribute_map).err();
+        assert!(err.is_some());
+
+        match err.unwrap().downcast() {
+            Ok(DbError::BadSchemaAssertion(message)) => { assert_eq!(message, ":db/unique :db/unique_identity without :db/index true for entid: :foo/bar"); },
+            x => panic!("expected Bad Schema Assertion error, got {:?}", x),
+        }
+    }
+
+    #[test]
+    fn invalid_schema_component_not_ref() {
+        let mut schema = Schema::default();
+        // attribute that is a component is not a `Ref`
+        add_attribute(&mut schema, Keyword::namespaced("foo", "bar"), 99, Attribute {
+            index: false,
+            value_type: ValueType::Boolean,
+            fulltext: false,
+            unique: None,
+            multival: false,
+            component: true,
+            no_history: false,
+        });
+
+        let err = validate_attribute_map(&schema.entid_map, &schema.attribute_map).err();
+        assert!(err.is_some());
+
+        match err.unwrap().downcast() {
+            Ok(DbError::BadSchemaAssertion(message)) => { assert_eq!(message, ":db/isComponent true without :db/valueType :db.type/ref for entid: :foo/bar"); },
+            x => panic!("expected Bad Schema Assertion error, got {:?}", x),
+        }
+    }
+
+    #[test]
+    fn invalid_schema_fulltext_not_index() {
+        let mut schema = Schema::default();
+        // attribute that is fulltext is not an index
+        add_attribute(&mut schema, Keyword::namespaced("foo", "bar"), 99, Attribute {
+            index: false,
+            value_type: ValueType::String,
+            fulltext: true,
+            unique: None,
+            multival: false,
+            component: false,
+            no_history: false,
+        });
+
+        let err = validate_attribute_map(&schema.entid_map, &schema.attribute_map).err();
+        assert!(err.is_some());
+
+        match err.unwrap().downcast() {
+            Ok(DbError::BadSchemaAssertion(message)) => { assert_eq!(message, ":db/fulltext true without :db/index true for entid: :foo/bar"); },
+            x => panic!("expected Bad Schema Assertion error, got {:?}", x),
+        }
+    }
+
+    fn invalid_schema_fulltext_index_not_string() {
+        let mut schema = Schema::default();
+        // attribute that is fulltext and not a `String`
+        add_attribute(&mut schema, Keyword::namespaced("foo", "bar"), 99, Attribute {
+            index: true,
+            value_type: ValueType::Long,
+            fulltext: true,
+            unique: None,
+            multival: false,
+            component: false,
+            no_history: false,
+        });
+
+        let err = validate_attribute_map(&schema.entid_map, &schema.attribute_map).err();
+        assert!(err.is_some());
+
+        match err.unwrap().downcast() {
+            Ok(DbError::BadSchemaAssertion(message)) => { assert_eq!(message, ":db/fulltext true without :db/valueType :db.type/string for entid: :foo/bar"); },
+            x => panic!("expected Bad Schema Assertion error, got {:?}", x),
+        }
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/tx.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/tx.rs.html new file mode 100644 index 00000000..b2cb2e07 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/tx.rs.html @@ -0,0 +1,2014 @@ + + + + + + + + + + tx.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+//! This module implements the transaction application algorithm described at
+//! https://github.com/mozilla/mentat/wiki/Transacting and its children pages.
+//!
+//! The implementation proceeds in four main stages, labeled "Pipeline stage 1" through "Pipeline
+//! stage 4".  _Pipeline_ may be a misnomer, since the stages as written **cannot** be interleaved
+//! in parallel.  That is, a single transacted entity cannot flow through all the stages without its
+//! sibling entities.
+//!
+//! This unintuitive architectural decision was made because the second and third stages (resolving
+//! lookup refs and tempids, respectively) operate _in bulk_ to minimize the number of expensive
+//! SQLite queries by processing many in one SQLite invocation.  Pipeline stage 2 doesn't need to
+//! operate like this: it is easy to handle each transacted entity independently of all the others
+//! (and earlier, less efficient, implementations did this).  However, Pipeline stage 3 appears to
+//! require processing multiple elements at the same time, since there can be arbitrarily complex
+//! graph relationships between tempids.  Pipeline stage 4 (inserting elements into the SQL store)
+//! could also be expressed as an independent operation per transacted entity, but there are
+//! non-trivial uniqueness relationships inside a single transaction that need to enforced.
+//! Therefore, some multi-entity processing is required, and a per-entity pipeline becomes less
+//! attractive.
+//!
+//! A note on the types in the implementation.  The pipeline stages are strongly typed: each stage
+//! accepts and produces a subset of the previous.  We hope this will reduce errors as data moves
+//! through the system.  In contrast the Clojure implementation rewrote the fundamental entity type
+//! in place and suffered bugs where particular code paths missed cases.
+//!
+//! The type hierarchy accepts `Entity` instances from the transaction parser and flows `Term`
+//! instances through the term-rewriting transaction applier.  `Term` is a general `[:db/add e a v]`
+//! with restrictions on the `e` and `v` components.  The hierarchy is expressed using `Result` to
+//! model either/or, and layers of `Result` are stripped -- we might say the `Term` instances are
+//! _lowered_ as they flow through the pipeline.  This type hierarchy could have been expressed by
+//! combinatorially increasing `enum` cases, but this makes it difficult to handle the `e` and `v`
+//! components symmetrically.  Hence, layers of `Result` type aliases.  Hopefully the explanatory
+//! names -- `TermWithTempIdsAndLookupRefs`, anyone? -- and strongly typed stage functions will help
+//! keep everything straight.
+
+use std::borrow::{
+    Cow,
+};
+use std::collections::{
+    BTreeMap,
+    BTreeSet,
+    VecDeque,
+};
+use std::iter::{
+    once,
+};
+use std::rc::{
+    Rc,
+};
+
+use db;
+use db::{
+    MentatStoring,
+    PartitionMapping,
+};
+use edn::{
+    Keyword,
+};
+use entids;
+use errors;
+use errors::{
+    DbError,
+    Result,
+};
+use internal_types::{
+    AddAndRetract,
+    AEVTrie,
+    KnownEntidOr,
+    LookupRef,
+    LookupRefOrTempId,
+    TempIdHandle,
+    TempIdMap,
+    Term,
+    TermWithTempIds,
+    TermWithTempIdsAndLookupRefs,
+    TermWithoutTempIds,
+    TypedValueOr,
+    replace_lookup_ref,
+};
+
+use mentat_core::util::Either;
+
+use mentat_core::{
+    DateTime,
+    KnownEntid,
+    Schema,
+    Utc,
+    attribute,
+    now,
+};
+
+use mentat_core::intern_set::InternSet;
+
+use edn::entities as entmod;
+use edn::entities::{
+    AttributePlace,
+    Entity,
+    OpType,
+    TempId,
+};
+use metadata;
+use rusqlite;
+use schema::{
+    SchemaBuilding,
+};
+use tx_checking;
+use types::{
+    AVMap,
+    AVPair,
+    Attribute,
+    Entid,
+    PartitionMap,
+    TransactableValue,
+    TxReport,
+    TypedValue,
+    ValueType,
+};
+use upsert_resolution::{
+    FinalPopulations,
+    Generation,
+};
+use watcher::{
+    TransactWatcher,
+};
+
+/// A transaction on its way to being applied.
+#[derive(Debug)]
+pub struct Tx<'conn, 'a, W> where W: TransactWatcher {
+    /// The storage to apply against.  In the future, this will be a Mentat connection.
+    store: &'conn rusqlite::Connection, // TODO: db::MentatStoring,
+
+    /// The partition map to allocate entids from.
+    ///
+    /// The partition map is volatile in the sense that every succesful transaction updates
+    /// allocates at least one tx ID, so we own and modify our own partition map.
+    partition_map: PartitionMap,
+
+    /// The schema to update from the transaction entities.
+    ///
+    /// Transactions only update the schema infrequently, so we borrow this schema until we need to
+    /// modify it.
+    schema_for_mutation: Cow<'a, Schema>,
+
+    /// The schema to use when interpreting the transaction entities.
+    ///
+    /// This schema is not updated, so we just borrow it.
+    schema: &'a Schema,
+
+    watcher: W,
+
+    /// The transaction ID of the transaction.
+    tx_id: Entid,
+}
+
+/// Remove any :db/id value from the given map notation, converting the returned value into
+/// something suitable for the entity position rather than something suitable for a value position.
+pub fn remove_db_id<V: TransactableValue>(map: &mut entmod::MapNotation<V>) -> Result<Option<entmod::EntityPlace<V>>> {
+    // TODO: extract lazy defined constant.
+    let db_id_key = entmod::Entid::Ident(Keyword::namespaced("db", "id"));
+
+    let db_id: Option<entmod::EntityPlace<V>> = if let Some(id) = map.remove(&db_id_key) {
+        match id {
+            entmod::ValuePlace::Entid(e) => Some(entmod::EntityPlace::Entid(e)),
+            entmod::ValuePlace::LookupRef(e) => Some(entmod::EntityPlace::LookupRef(e)),
+            entmod::ValuePlace::TempId(e) => Some(entmod::EntityPlace::TempId(e)),
+            entmod::ValuePlace::TxFunction(e) => Some(entmod::EntityPlace::TxFunction(e)),
+            entmod::ValuePlace::Atom(v) => Some(v.into_entity_place()?),
+            entmod::ValuePlace::Vector(_) |
+            entmod::ValuePlace::MapNotation(_) => {
+                bail!(DbError::InputError(errors::InputError::BadDbId))
+            },
+        }
+    } else {
+        None
+    };
+
+    Ok(db_id)
+}
+
+impl<'conn, 'a, W> Tx<'conn, 'a, W> where W: TransactWatcher {
+    pub fn new(
+        store: &'conn rusqlite::Connection,
+        partition_map: PartitionMap,
+        schema_for_mutation: &'a Schema,
+        schema: &'a Schema,
+        watcher: W,
+        tx_id: Entid) -> Tx<'conn, 'a, W> {
+        Tx {
+            store: store,
+            partition_map: partition_map,
+            schema_for_mutation: Cow::Borrowed(schema_for_mutation),
+            schema: schema,
+            watcher: watcher,
+            tx_id: tx_id,
+        }
+    }
+
+    /// Given a collection of tempids and the [a v] pairs that they might upsert to, resolve exactly
+    /// which [a v] pairs do upsert to entids, and map each tempid that upserts to the upserted
+    /// entid.  The keys of the resulting map are exactly those tempids that upserted.
+    pub(crate) fn resolve_temp_id_avs<'b>(&self, temp_id_avs: &'b [(TempIdHandle, AVPair)]) -> Result<TempIdMap> {
+        if temp_id_avs.is_empty() {
+            return Ok(TempIdMap::default());
+        }
+
+        // Map [a v]->entid.
+        let mut av_pairs: Vec<&AVPair> = vec![];
+        for i in 0..temp_id_avs.len() {
+            av_pairs.push(&temp_id_avs[i].1);
+        }
+
+        // Lookup in the store.
+        let av_map: AVMap = self.store.resolve_avs(&av_pairs[..])?;
+
+        debug!("looked up avs {:?}", av_map);
+
+        // Map id->entid.
+        let mut tempids: TempIdMap = TempIdMap::default();
+
+        // Errors.  BTree* since we want deterministic results.
+        let mut conflicting_upserts: BTreeMap<TempId, BTreeSet<KnownEntid>> = BTreeMap::default();
+
+        for &(ref tempid, ref av_pair) in temp_id_avs {
+            trace!("tempid {:?} av_pair {:?} -> {:?}", tempid, av_pair, av_map.get(&av_pair));
+            if let Some(entid) = av_map.get(&av_pair).cloned().map(KnownEntid) {
+                tempids.insert(tempid.clone(), entid).map(|previous| {
+                    if entid != previous {
+                        conflicting_upserts.entry((**tempid).clone()).or_insert_with(|| once(previous).collect::<BTreeSet<_>>()).insert(entid);
+                    }
+                });
+            }
+        }
+
+        if !conflicting_upserts.is_empty() {
+            bail!(DbError::SchemaConstraintViolation(errors::SchemaConstraintViolation::ConflictingUpserts { conflicting_upserts }));
+        }
+
+        Ok(tempids)
+    }
+
+    /// Pipeline stage 1: convert `Entity` instances into `Term` instances, ready for term
+    /// rewriting.
+    ///
+    /// The `Term` instances produce share interned TempId and LookupRef handles, and we return the
+    /// interned handle sets so that consumers can ensure all handles are used appropriately.
+    fn entities_into_terms_with_temp_ids_and_lookup_refs<I, V: TransactableValue>(&self, entities: I) -> Result<(Vec<TermWithTempIdsAndLookupRefs>, InternSet<TempId>, InternSet<AVPair>)> where I: IntoIterator<Item=Entity<V>> {
+        struct InProcess<'a> {
+            partition_map: &'a PartitionMap,
+            schema: &'a Schema,
+            mentat_id_count: i64,
+            tx_id: KnownEntid,
+            temp_ids: InternSet<TempId>,
+            lookup_refs: InternSet<AVPair>,
+        }
+
+        impl<'a> InProcess<'a> {
+            fn with_schema_and_partition_map(schema: &'a Schema, partition_map: &'a PartitionMap, tx_id: KnownEntid) -> InProcess<'a> {
+                InProcess {
+                    partition_map,
+                    schema,
+                    mentat_id_count: 0,
+                    tx_id,
+                    temp_ids: InternSet::new(),
+                    lookup_refs: InternSet::new(),
+                }
+            }
+
+            fn ensure_entid_exists(&self, e: Entid) -> Result<KnownEntid> {
+                if self.partition_map.contains_entid(e) {
+                    Ok(KnownEntid(e))
+                } else {
+                    bail!(DbError::UnrecognizedEntid(e))
+                }
+            }
+
+            fn ensure_ident_exists(&self, e: &Keyword) -> Result<KnownEntid> {
+                self.schema.require_entid(e)
+            }
+
+            fn intern_lookup_ref<W: TransactableValue>(&mut self, lookup_ref: &entmod::LookupRef<W>) -> Result<LookupRef> {
+                let lr_a: i64 = match lookup_ref.a {
+                    AttributePlace::Entid(entmod::Entid::Entid(ref a)) => *a,
+                    AttributePlace::Entid(entmod::Entid::Ident(ref a)) => self.schema.require_entid(&a)?.into(),
+                };
+                let lr_attribute: &Attribute = self.schema.require_attribute_for_entid(lr_a)?;
+
+                let lr_typed_value: TypedValue = lookup_ref.v.clone().into_typed_value(&self.schema, lr_attribute.value_type)?;
+                if lr_attribute.unique.is_none() {
+                    bail!(DbError::NotYetImplemented(format!("Cannot resolve (lookup-ref {} {:?}) with attribute that is not :db/unique", lr_a, lr_typed_value)))
+                }
+
+                Ok(self.lookup_refs.intern((lr_a, lr_typed_value)))
+            }
+
+            fn intern_temp_id(&mut self, temp_id: TempId) -> Rc<TempId> {
+                self.temp_ids.intern(temp_id)
+            }
+
+            /// Allocate private internal tempids reserved for Mentat.  Internal tempids just need to be
+            /// unique within one transaction; they should never escape a transaction.
+            fn allocate_mentat_id<W: TransactableValue>(&mut self) -> entmod::EntityPlace<W> {
+                self.mentat_id_count += 1;
+                entmod::EntityPlace::TempId(TempId::Internal(self.mentat_id_count))
+            }
+
+            fn entity_e_into_term_e<W: TransactableValue>(&mut self, x: entmod::EntityPlace<W>) -> Result<KnownEntidOr<LookupRefOrTempId>> {
+                match x {
+                    entmod::EntityPlace::Entid(e) => {
+                        let e = match e {
+                            entmod::Entid::Entid(ref e) => self.ensure_entid_exists(*e)?,
+                            entmod::Entid::Ident(ref e) => self.ensure_ident_exists(&e)?,
+                        };
+                        Ok(Either::Left(e))
+                    },
+
+                    entmod::EntityPlace::TempId(e) => {
+                        Ok(Either::Right(LookupRefOrTempId::TempId(self.intern_temp_id(e))))
+                    },
+
+                    entmod::EntityPlace::LookupRef(ref lookup_ref) => {
+                        Ok(Either::Right(LookupRefOrTempId::LookupRef(self.intern_lookup_ref(lookup_ref)?)))
+                    },
+
+                    entmod::EntityPlace::TxFunction(ref tx_function) => {
+                        match tx_function.op.0.as_str() {
+                            "transaction-tx" => Ok(Either::Left(self.tx_id)),
+                            unknown @ _ => bail!(DbError::NotYetImplemented(format!("Unknown transaction function {}", unknown))),
+                        }
+                    },
+                }
+            }
+
+            fn entity_a_into_term_a(&mut self, x: entmod::Entid) -> Result<Entid> {
+                let a = match x {
+                    entmod::Entid::Entid(ref a) => *a,
+                    entmod::Entid::Ident(ref a) => self.schema.require_entid(&a)?.into(),
+                };
+                Ok(a)
+            }
+
+            fn entity_e_into_term_v<W: TransactableValue>(&mut self, x: entmod::EntityPlace<W>) -> Result<TypedValueOr<LookupRefOrTempId>> {
+                self.entity_e_into_term_e(x).map(|r| r.map_left(|ke| TypedValue::Ref(ke.0)))
+            }
+
+            fn entity_v_into_term_e<W: TransactableValue>(&mut self, x: entmod::ValuePlace<W>, backward_a: &entmod::Entid) -> Result<KnownEntidOr<LookupRefOrTempId>> {
+                match backward_a.unreversed() {
+                    None => {
+                        bail!(DbError::NotYetImplemented(format!("Cannot explode map notation value in :attr/_reversed notation for forward attribute")));
+                    },
+                    Some(forward_a) => {
+                        let forward_a = self.entity_a_into_term_a(forward_a)?;
+                        let forward_attribute = self.schema.require_attribute_for_entid(forward_a)?;
+                        if forward_attribute.value_type != ValueType::Ref {
+                            bail!(DbError::NotYetImplemented(format!("Cannot use :attr/_reversed notation for attribute {} that is not :db/valueType :db.type/ref", forward_a)))
+                        }
+
+                        match x {
+                            entmod::ValuePlace::Atom(v) => {
+                                // Here is where we do schema-aware typechecking: we either assert
+                                // that the given value is in the attribute's value set, or (in
+                                // limited cases) coerce the value into the attribute's value set.
+                                match v.as_tempid() {
+                                    Some(tempid) => Ok(Either::Right(LookupRefOrTempId::TempId(self.intern_temp_id(tempid)))),
+                                    None => {
+                                        if let TypedValue::Ref(entid) = v.into_typed_value(&self.schema, ValueType::Ref)? {
+                                            Ok(Either::Left(KnownEntid(entid)))
+                                        } else {
+                                            // The given value is expected to be :db.type/ref, so this shouldn't happen.
+                                            bail!(DbError::NotYetImplemented(format!("Cannot use :attr/_reversed notation for attribute {} with value that is not :db.valueType :db.type/ref", forward_a)))
+                                        }
+                                    }
+                                }
+                            },
+
+                            entmod::ValuePlace::Entid(entid) =>
+                                Ok(Either::Left(KnownEntid(self.entity_a_into_term_a(entid)?))),
+
+                            entmod::ValuePlace::TempId(tempid) =>
+                                Ok(Either::Right(LookupRefOrTempId::TempId(self.intern_temp_id(tempid)))),
+
+                            entmod::ValuePlace::LookupRef(ref lookup_ref) =>
+                                Ok(Either::Right(LookupRefOrTempId::LookupRef(self.intern_lookup_ref(lookup_ref)?))),
+
+                            entmod::ValuePlace::TxFunction(ref tx_function) => {
+                                match tx_function.op.0.as_str() {
+                                    "transaction-tx" => Ok(Either::Left(KnownEntid(self.tx_id.0))),
+                                    unknown @ _ => bail!(DbError::NotYetImplemented(format!("Unknown transaction function {}", unknown))),
+                                }
+                            },
+
+                            entmod::ValuePlace::Vector(_) =>
+                                bail!(DbError::NotYetImplemented(format!("Cannot explode vector value in :attr/_reversed notation for attribute {}", forward_a))),
+
+                            entmod::ValuePlace::MapNotation(_) =>
+                                bail!(DbError::NotYetImplemented(format!("Cannot explode map notation value in :attr/_reversed notation for attribute {}", forward_a))),
+                        }
+                    },
+                }
+            }
+        }
+
+        let mut in_process = InProcess::with_schema_and_partition_map(&self.schema, &self.partition_map, KnownEntid(self.tx_id));
+
+        // We want to handle entities in the order they're given to us, while also "exploding" some
+        // entities into many.  We therefore push the initial entities onto the back of the deque,
+        // take from the front of the deque, and explode onto the front as well.
+        let mut deque: VecDeque<Entity<V>> = VecDeque::default();
+        deque.extend(entities);
+
+        let mut terms: Vec<TermWithTempIdsAndLookupRefs> = Vec::with_capacity(deque.len());
+
+        while let Some(entity) = deque.pop_front() {
+            match entity {
+                Entity::MapNotation(mut map_notation) => {
+                    // :db/id is optional; if it's not given, we generate a special internal tempid
+                    // to use for upserting.  This tempid will not be reported in the TxReport.
+                    let db_id: entmod::EntityPlace<V> = remove_db_id(&mut map_notation)?.unwrap_or_else(|| in_process.allocate_mentat_id());
+
+                    // We're not nested, so :db/isComponent is not relevant.  We just explode the
+                    // map notation.
+                    for (a, v) in map_notation {
+                        deque.push_front(Entity::AddOrRetract {
+                            op: OpType::Add,
+                            e: db_id.clone(),
+                            a: AttributePlace::Entid(a),
+                            v: v,
+                        });
+                    }
+                },
+
+                Entity::AddOrRetract { op, e, a, v } => {
+                    let AttributePlace::Entid(a) = a;
+
+                    if let Some(reversed_a) = a.unreversed() {
+                        let reversed_e = in_process.entity_v_into_term_e(v, &a)?;
+                        let reversed_a = in_process.entity_a_into_term_a(reversed_a)?;
+                        let reversed_v = in_process.entity_e_into_term_v(e)?;
+                        terms.push(Term::AddOrRetract(OpType::Add, reversed_e, reversed_a, reversed_v));
+                    } else {
+                        let a = in_process.entity_a_into_term_a(a)?;
+                        let attribute = self.schema.require_attribute_for_entid(a)?;
+
+                        let v = match v {
+                            entmod::ValuePlace::Atom(v) => {
+                                // Here is where we do schema-aware typechecking: we either assert
+                                // that the given value is in the attribute's value set, or (in
+                                // limited cases) coerce the value into the attribute's value set.
+                                if attribute.value_type == ValueType::Ref {
+                                    match v.as_tempid() {
+                                        Some(tempid) => Either::Right(LookupRefOrTempId::TempId(in_process.intern_temp_id(tempid))),
+                                        None => v.into_typed_value(&self.schema, attribute.value_type).map(Either::Left)?,
+                                    }
+                                } else {
+                                    v.into_typed_value(&self.schema, attribute.value_type).map(Either::Left)?
+                                }
+                            },
+
+                            entmod::ValuePlace::Entid(entid) =>
+                                Either::Left(TypedValue::Ref(in_process.entity_a_into_term_a(entid)?)),
+
+                            entmod::ValuePlace::TempId(tempid) =>
+                                Either::Right(LookupRefOrTempId::TempId(in_process.intern_temp_id(tempid))),
+
+                            entmod::ValuePlace::LookupRef(ref lookup_ref) => {
+                                if attribute.value_type != ValueType::Ref {
+                                    bail!(DbError::NotYetImplemented(format!("Cannot resolve value lookup ref for attribute {} that is not :db/valueType :db.type/ref", a)))
+                                }
+
+                                Either::Right(LookupRefOrTempId::LookupRef(in_process.intern_lookup_ref(lookup_ref)?))
+                            },
+
+                            entmod::ValuePlace::TxFunction(ref tx_function) => {
+                                let typed_value = match tx_function.op.0.as_str() {
+                                    "transaction-tx" => TypedValue::Ref(self.tx_id),
+                                    unknown @ _ => bail!(DbError::NotYetImplemented(format!("Unknown transaction function {}", unknown))),
+                                };
+
+                                // Here we do schema-aware typechecking: we assert that the computed
+                                // value is in the attribute's value set.  If and when we have
+                                // transaction functions that produce numeric values, we'll have to
+                                // be more careful here, because a function that produces an integer
+                                // value can be used where a double is expected.  See also
+                                // `SchemaTypeChecking.to_typed_value(...)`.
+                                if attribute.value_type != typed_value.value_type() {
+                                    bail!(DbError::NotYetImplemented(format!("Transaction function {} produced value of type {} but expected type {}",
+                                                                               tx_function.op.0.as_str(), typed_value.value_type(), attribute.value_type)));
+                                }
+
+                                Either::Left(typed_value)
+                            },
+
+                            entmod::ValuePlace::Vector(vs) => {
+                                if !attribute.multival {
+                                    bail!(DbError::NotYetImplemented(format!("Cannot explode vector value for attribute {} that is not :db.cardinality :db.cardinality/many", a)));
+                                }
+
+                                for vv in vs {
+                                    deque.push_front(Entity::AddOrRetract {
+                                        op: op.clone(),
+                                        e: e.clone(),
+                                        a: AttributePlace::Entid(entmod::Entid::Entid(a)),
+                                        v: vv,
+                                    });
+                                }
+                                continue
+                            },
+
+                            entmod::ValuePlace::MapNotation(mut map_notation) => {
+                                // TODO: consider handling this at the tx-parser level.  That would be
+                                // more strict and expressive, but it would lead to splitting
+                                // AddOrRetract, which proliferates types and code, or only handling
+                                // nested maps rather than map values, like Datomic does.
+                                if op != OpType::Add {
+                                    bail!(DbError::NotYetImplemented(format!("Cannot explode nested map value in :db/retract for attribute {}", a)));
+                                }
+
+                                if attribute.value_type != ValueType::Ref {
+                                    bail!(DbError::NotYetImplemented(format!("Cannot explode nested map value for attribute {} that is not :db/valueType :db.type/ref", a)))
+                                }
+
+                                // :db/id is optional; if it's not given, we generate a special internal tempid
+                                // to use for upserting.  This tempid will not be reported in the TxReport.
+                                let db_id: Option<entmod::EntityPlace<V>> = remove_db_id(&mut map_notation)?;
+                                let mut dangling = db_id.is_none();
+                                let db_id: entmod::EntityPlace<V> = db_id.unwrap_or_else(|| in_process.allocate_mentat_id());
+
+                                // We're nested, so we want to ensure we're not creating "dangling"
+                                // entities that can't be reached.  If we're :db/isComponent, then this
+                                // is not dangling.  Otherwise, the resulting map needs to have a
+                                // :db/unique :db.unique/identity [a v] pair, so that it's reachable.
+                                // Per http://docs.datomic.com/transactions.html: "Either the reference
+                                // to the nested map must be a component attribute, or the nested map
+                                // must include a unique attribute. This constraint prevents the
+                                // accidental creation of easily-orphaned entities that have no identity
+                                // or relation to other entities."
+                                if attribute.component {
+                                    dangling = false;
+                                }
+
+                                for (inner_a, inner_v) in map_notation {
+                                    if let Some(reversed_a) = inner_a.unreversed() {
+                                        // We definitely have a reference.  The reference might be
+                                        // dangling (a bare entid, for example), but we don't yet
+                                        // support nested maps and reverse notation simultaneously
+                                        // (i.e., we don't accept {:reverse/_attribute {:nested map}})
+                                        // so we don't need to check that the nested map reference isn't
+                                        // dangling.
+                                        dangling = false;
+
+                                        let reversed_e = in_process.entity_v_into_term_e(inner_v, &inner_a)?;
+                                        let reversed_a = in_process.entity_a_into_term_a(reversed_a)?;
+                                        let reversed_v = in_process.entity_e_into_term_v(db_id.clone())?;
+                                        terms.push(Term::AddOrRetract(OpType::Add, reversed_e, reversed_a, reversed_v));
+                                    } else {
+                                        let inner_a = in_process.entity_a_into_term_a(inner_a)?;
+                                        let inner_attribute = self.schema.require_attribute_for_entid(inner_a)?;
+                                        if inner_attribute.unique == Some(attribute::Unique::Identity) {
+                                            dangling = false;
+                                        }
+
+                                        deque.push_front(Entity::AddOrRetract {
+                                            op: OpType::Add,
+                                            e: db_id.clone(),
+                                            a: AttributePlace::Entid(entmod::Entid::Entid(inner_a)),
+                                            v: inner_v,
+                                        });
+                                    }
+                                }
+
+                                if dangling {
+                                    bail!(DbError::NotYetImplemented(format!("Cannot explode nested map value that would lead to dangling entity for attribute {}", a)));
+                                }
+
+                                in_process.entity_e_into_term_v(db_id)?
+                            },
+                        };
+
+                        let e = in_process.entity_e_into_term_e(e)?;
+                        terms.push(Term::AddOrRetract(op, e, a, v));
+                    }
+                },
+            }
+        };
+        Ok((terms, in_process.temp_ids, in_process.lookup_refs))
+    }
+
+    /// Pipeline stage 2: rewrite `Term` instances with lookup refs into `Term` instances without
+    /// lookup refs.
+    ///
+    /// The `Term` instances produced share interned TempId handles and have no LookupRef references.
+    fn resolve_lookup_refs<I>(&self, lookup_ref_map: &AVMap, terms: I) -> Result<Vec<TermWithTempIds>> where I: IntoIterator<Item=TermWithTempIdsAndLookupRefs> {
+        terms.into_iter().map(|term: TermWithTempIdsAndLookupRefs| -> Result<TermWithTempIds> {
+            match term {
+                Term::AddOrRetract(op, e, a, v) => {
+                    let e = replace_lookup_ref(&lookup_ref_map, e, |x| KnownEntid(x))?;
+                    let v = replace_lookup_ref(&lookup_ref_map, v, |x| TypedValue::Ref(x))?;
+                    Ok(Term::AddOrRetract(op, e, a, v))
+                },
+            }
+        }).collect::<Result<Vec<_>>>()
+    }
+
+    /// Transact the given `entities` against the store.
+    ///
+    /// This approach is explained in https://github.com/mozilla/mentat/wiki/Transacting.
+    // TODO: move this to the transactor layer.
+    pub fn transact_entities<I, V: TransactableValue>(&mut self, entities: I) -> Result<TxReport>
+    where I: IntoIterator<Item=Entity<V>> {
+        // Pipeline stage 1: entities -> terms with tempids and lookup refs.
+        let (terms_with_temp_ids_and_lookup_refs, tempid_set, lookup_ref_set) = self.entities_into_terms_with_temp_ids_and_lookup_refs(entities)?;
+
+        // Pipeline stage 2: resolve lookup refs -> terms with tempids.
+        let lookup_ref_avs: Vec<&(i64, TypedValue)> = lookup_ref_set.inner.iter().map(|rc| &**rc).collect();
+        let lookup_ref_map: AVMap = self.store.resolve_avs(&lookup_ref_avs[..])?;
+
+        let terms_with_temp_ids = self.resolve_lookup_refs(&lookup_ref_map, terms_with_temp_ids_and_lookup_refs)?;
+
+        self.transact_simple_terms(terms_with_temp_ids, tempid_set)
+    }
+
+    pub fn transact_simple_terms<I>(&mut self, terms: I, tempid_set: InternSet<TempId>) -> Result<TxReport>
+    where I: IntoIterator<Item=TermWithTempIds> {
+        // TODO: push these into an internal transaction report?
+        let mut tempids: BTreeMap<TempId, KnownEntid> = BTreeMap::default();
+
+        // Pipeline stage 3: upsert tempids -> terms without tempids or lookup refs.
+        // Now we can collect upsert populations.
+        let (mut generation, inert_terms) = Generation::from(terms, &self.schema)?;
+
+        // And evolve them forward.
+        while generation.can_evolve() {
+            debug!("generation {:?}", generation);
+
+            let tempid_avs = generation.temp_id_avs();
+            debug!("trying to resolve avs {:?}", tempid_avs);
+
+            // Evolve further.
+            let temp_id_map: TempIdMap = self.resolve_temp_id_avs(&tempid_avs[..])?;
+
+            debug!("resolved avs for tempids {:?}", temp_id_map);
+
+            generation = generation.evolve_one_step(&temp_id_map);
+
+            // Errors.  BTree* since we want deterministic results.
+            let mut conflicting_upserts: BTreeMap<TempId, BTreeSet<KnownEntid>> = BTreeMap::default();
+
+            // Report each tempid that resolves via upsert.
+            for (tempid, entid) in temp_id_map {
+                // Since `UpsertEV` instances always transition to `UpsertE` instances, it might be
+                // that a tempid resolves in two generations, and those resolutions might conflict.
+                tempids.insert((*tempid).clone(), entid).map(|previous| {
+                    if entid != previous {
+                        conflicting_upserts.entry((*tempid).clone()).or_insert_with(|| once(previous).collect::<BTreeSet<_>>()).insert(entid);
+                    }
+                });
+            }
+
+            if !conflicting_upserts.is_empty() {
+                bail!(DbError::SchemaConstraintViolation(errors::SchemaConstraintViolation::ConflictingUpserts { conflicting_upserts }));
+            }
+
+            debug!("tempids {:?}", tempids);
+        }
+
+        generation.allocate_unresolved_upserts()?;
+
+        debug!("final generation {:?}", generation);
+
+        // Allocate entids for tempids that didn't upsert.  BTreeMap so this is deterministic.
+        let unresolved_temp_ids: BTreeMap<TempIdHandle, usize> = generation.temp_ids_in_allocations(&self.schema)?;
+
+        debug!("unresolved tempids {:?}", unresolved_temp_ids);
+
+        // TODO: track partitions for temporary IDs.
+        let entids = self.partition_map.allocate_entids(":db.part/user", unresolved_temp_ids.len());
+
+        let temp_id_allocations = unresolved_temp_ids
+            .into_iter()
+            .map(|(tempid, index)| (tempid, KnownEntid(entids.start + (index as i64))))
+            .collect();
+
+        debug!("tempid allocations {:?}", temp_id_allocations);
+
+        let final_populations = generation.into_final_populations(&temp_id_allocations)?;
+
+        // Report each tempid that is allocated.
+        for (tempid, &entid) in &temp_id_allocations {
+            // Every tempid should be allocated at most once.
+            assert!(!tempids.contains_key(&**tempid));
+            tempids.insert((**tempid).clone(), entid);
+        }
+
+        // Verify that every tempid we interned either resolved or has been allocated.
+        assert_eq!(tempids.len(), tempid_set.inner.len());
+        for tempid in &tempid_set.inner {
+            assert!(tempids.contains_key(&**tempid));
+        }
+
+        // Any internal tempid has been allocated by the system and is a private implementation
+        // detail; it shouldn't be exposed in the final transaction report.
+        let tempids = tempids.into_iter().filter_map(|(tempid, e)| tempid.into_external().map(|s| (s, e.0))).collect();
+
+        // A transaction might try to add or retract :db/ident assertions or other metadata mutating
+        // assertions , but those assertions might not make it to the store.  If we see a possible
+        // metadata mutation, we will figure out if any assertions made it through later.  This is
+        // strictly an optimization: it would be correct to _always_ check what made it to the
+        // store.
+        let mut tx_might_update_metadata = false;
+
+        // Mutable so that we can add the transaction :db/txInstant.
+        let mut aev_trie = into_aev_trie(&self.schema, final_populations, inert_terms)?;
+
+        let tx_instant;
+        { // TODO: Don't use this block to scope borrowing the schema; instead, extract a helper function.
+
+        // Assertions that are :db.cardinality/one and not :db.fulltext.
+        let mut non_fts_one: Vec<db::ReducedEntity> = vec![];
+
+        // Assertions that are :db.cardinality/many and not :db.fulltext.
+        let mut non_fts_many: Vec<db::ReducedEntity> = vec![];
+
+        // Assertions that are :db.cardinality/one and :db.fulltext.
+        let mut fts_one: Vec<db::ReducedEntity> = vec![];
+
+        // Assertions that are :db.cardinality/many and :db.fulltext.
+        let mut fts_many: Vec<db::ReducedEntity> = vec![];
+
+        // We need to ensure that callers can't blindly transact entities that haven't been
+        // allocated by this store.
+
+        let errors = tx_checking::type_disagreements(&aev_trie);
+        if !errors.is_empty() {
+            bail!(DbError::SchemaConstraintViolation(errors::SchemaConstraintViolation::TypeDisagreements { conflicting_datoms: errors }));
+        }
+
+        let errors = tx_checking::cardinality_conflicts(&aev_trie);
+        if !errors.is_empty() {
+            bail!(DbError::SchemaConstraintViolation(errors::SchemaConstraintViolation::CardinalityConflicts { conflicts: errors }));
+        }
+
+        // Pipeline stage 4: final terms (after rewriting) -> DB insertions.
+        // Collect into non_fts_*.
+
+        tx_instant = get_or_insert_tx_instant(&mut aev_trie, &self.schema, self.tx_id)?;
+
+        for ((a, attribute), evs) in aev_trie {
+            if entids::might_update_metadata(a) {
+                tx_might_update_metadata = true;
+            }
+
+            let mut queue = match (attribute.fulltext, attribute.multival) {
+                (false, true) => &mut non_fts_many,
+                (false, false) => &mut non_fts_one,
+                (true, false) => &mut fts_one,
+                (true, true) => &mut fts_many,
+            };
+
+            for (e, ars) in evs {
+                for (added, v) in ars.add.into_iter().map(|v| (true, v)).chain(ars.retract.into_iter().map(|v| (false, v))) {
+                    let op = match added {
+                        true => OpType::Add,
+                        false => OpType::Retract,
+                    };
+                    self.watcher.datom(op, e, a, &v);
+                    queue.push((e, a, attribute, v, added));
+                }
+            }
+        }
+
+        if !non_fts_one.is_empty() {
+            self.store.insert_non_fts_searches(&non_fts_one[..], db::SearchType::Inexact)?;
+        }
+
+        if !non_fts_many.is_empty() {
+            self.store.insert_non_fts_searches(&non_fts_many[..], db::SearchType::Exact)?;
+        }
+
+        if !fts_one.is_empty() {
+            self.store.insert_fts_searches(&fts_one[..], db::SearchType::Inexact)?;
+        }
+
+        if !fts_many.is_empty() {
+            self.store.insert_fts_searches(&fts_many[..], db::SearchType::Exact)?;
+        }
+
+        self.store.commit_transaction(self.tx_id)?;
+        }
+
+        db::update_partition_map(self.store, &self.partition_map)?;
+        self.watcher.done(&self.tx_id, self.schema)?;
+
+        if tx_might_update_metadata {
+            // Extract changes to metadata from the store.
+            let metadata_assertions = self.store.committed_metadata_assertions(self.tx_id)?;
+
+            let mut new_schema = (*self.schema_for_mutation).clone(); // Clone the underlying Schema for modification.
+            let metadata_report = metadata::update_schema_from_entid_quadruples(&mut new_schema, metadata_assertions)?;
+
+            // We might not have made any changes to the schema, even though it looked like we
+            // would.  This should not happen, even during bootstrapping: we mutate an empty
+            // `Schema` in this case specifically to run the bootstrapped assertions through the
+            // regular transactor code paths, updating the schema and materialized views uniformly.
+            // But, belt-and-braces: handle it gracefully.
+            if new_schema != *self.schema_for_mutation {
+                let old_schema = (*self.schema_for_mutation).clone(); // Clone the original Schema for comparison.
+                *self.schema_for_mutation.to_mut() = new_schema; // Store the new Schema.
+                db::update_metadata(self.store, &old_schema, &*self.schema_for_mutation, &metadata_report)?;
+            }
+        }
+
+        Ok(TxReport {
+            tx_id: self.tx_id,
+            tx_instant,
+            tempids: tempids,
+        })
+    }
+}
+
+/// Initialize a new Tx object with a new tx id and a tx instant. Kick off the SQLite conn, too.
+fn start_tx<'conn, 'a, W>(conn: &'conn rusqlite::Connection,
+                       mut partition_map: PartitionMap,
+                       schema_for_mutation: &'a Schema,
+                       schema: &'a Schema,
+                       watcher: W) -> Result<Tx<'conn, 'a, W>>
+    where W: TransactWatcher {
+    let tx_id = partition_map.allocate_entid(":db.part/tx");
+    conn.begin_tx_application()?;
+
+    Ok(Tx::new(conn, partition_map, schema_for_mutation, schema, watcher, tx_id))
+}
+
+fn conclude_tx<W>(tx: Tx<W>, report: TxReport) -> Result<(TxReport, PartitionMap, Option<Schema>, W)>
+where W: TransactWatcher {
+    // If the schema has moved on, return it.
+    let next_schema = match tx.schema_for_mutation {
+        Cow::Borrowed(_) => None,
+        Cow::Owned(next_schema) => Some(next_schema),
+    };
+    Ok((report, tx.partition_map, next_schema, tx.watcher))
+}
+
+/// Transact the given `entities` against the given SQLite `conn`, using the given metadata.
+/// If you want this work to occur inside a SQLite transaction, establish one on the connection
+/// prior to calling this function.
+///
+/// This approach is explained in https://github.com/mozilla/mentat/wiki/Transacting.
+// TODO: move this to the transactor layer.
+pub fn transact<'conn, 'a, I, V, W>(conn: &'conn rusqlite::Connection,
+                                 partition_map: PartitionMap,
+                                 schema_for_mutation: &'a Schema,
+                                 schema: &'a Schema,
+                                 watcher: W,
+                                 entities: I) -> Result<(TxReport, PartitionMap, Option<Schema>, W)>
+    where I: IntoIterator<Item=Entity<V>>,
+          V: TransactableValue,
+          W: TransactWatcher {
+
+    let mut tx = start_tx(conn, partition_map, schema_for_mutation, schema, watcher)?;
+    let report = tx.transact_entities(entities)?;
+    conclude_tx(tx, report)
+}
+
+/// Just like `transact`, but accepts lower-level inputs to allow bypassing the parser interface.
+pub fn transact_terms<'conn, 'a, I, W>(conn: &'conn rusqlite::Connection,
+                                       partition_map: PartitionMap,
+                                       schema_for_mutation: &'a Schema,
+                                       schema: &'a Schema,
+                                       watcher: W,
+                                       terms: I,
+                                       tempid_set: InternSet<TempId>) -> Result<(TxReport, PartitionMap, Option<Schema>, W)>
+    where I: IntoIterator<Item=TermWithTempIds>,
+          W: TransactWatcher {
+
+    let mut tx = start_tx(conn, partition_map, schema_for_mutation, schema, watcher)?;
+    let report = tx.transact_simple_terms(terms, tempid_set)?;
+    conclude_tx(tx, report)
+}
+
+fn extend_aev_trie<'schema, I>(schema: &'schema Schema, terms: I, trie: &mut AEVTrie<'schema>) -> Result<()>
+where I: IntoIterator<Item=TermWithoutTempIds>
+{
+    for Term::AddOrRetract(op, KnownEntid(e), a, v) in terms.into_iter() {
+        let attribute: &Attribute = schema.require_attribute_for_entid(a)?;
+
+        let a_and_r = trie
+            .entry((a, attribute)).or_insert(BTreeMap::default())
+            .entry(e).or_insert(AddAndRetract::default());
+
+        match op {
+            OpType::Add => a_and_r.add.insert(v),
+            OpType::Retract => a_and_r.retract.insert(v),
+        };
+    }
+
+    Ok(())
+}
+
+pub(crate) fn into_aev_trie<'schema>(schema: &'schema Schema, final_populations: FinalPopulations, inert_terms: Vec<TermWithTempIds>) -> Result<AEVTrie<'schema>> {
+    let mut trie = AEVTrie::default();
+    extend_aev_trie(schema, final_populations.resolved, &mut trie)?;
+    extend_aev_trie(schema, final_populations.allocated, &mut trie)?;
+    // Inert terms need to be unwrapped.  It is a coding error if a term can't be unwrapped.
+    extend_aev_trie(schema, inert_terms.into_iter().map(|term| term.unwrap()), &mut trie)?;
+
+    Ok(trie)
+}
+
+/// Transact [:db/add :db/txInstant tx_instant (transaction-tx)] if the trie doesn't contain it
+/// already.  Return the instant from the input or the instant inserted.
+fn get_or_insert_tx_instant<'schema>(aev_trie: &mut AEVTrie<'schema>, schema: &'schema Schema, tx_id: Entid) -> Result<DateTime<Utc>> {
+    let ars = aev_trie
+        .entry((entids::DB_TX_INSTANT, schema.require_attribute_for_entid(entids::DB_TX_INSTANT)?))
+        .or_insert(BTreeMap::default())
+        .entry(tx_id)
+        .or_insert(AddAndRetract::default());
+    if !ars.retract.is_empty() {
+        // Cannot retract :db/txInstant!
+    }
+
+    // Otherwise we have a coding error -- we should have cardinality checked this already.
+    assert!(ars.add.len() <= 1);
+
+    let first = ars.add.iter().next().cloned();
+    match first {
+        Some(TypedValue::Instant(instant)) => Ok(instant),
+        Some(_) => unreachable!(), // This is a coding error -- we should have typechecked this already.
+        None => {
+            let instant = now();
+            ars.add.insert(instant.into());
+            Ok(instant)
+        },
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/tx_checking.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/tx_checking.rs.html new file mode 100644 index 00000000..e3da2fc5 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/tx_checking.rs.html @@ -0,0 +1,292 @@ + + + + + + + + + + tx_checking.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::collections::{
+    BTreeSet,
+    BTreeMap,
+};
+
+use mentat_core::{
+    Entid,
+    TypedValue,
+    ValueType,
+};
+
+use errors::{
+    CardinalityConflict,
+};
+
+use internal_types::{
+    AEVTrie,
+};
+
+/// Map from found [e a v] to expected type.
+pub(crate) type TypeDisagreements = BTreeMap<(Entid, Entid, TypedValue), ValueType>;
+
+/// Ensure that the given terms type check.
+///
+/// We try to be maximally helpful by yielding every malformed datom, rather than only the first.
+/// In the future, we might change this choice, or allow the consumer to specify the robustness of
+/// the type checking desired, since there is a cost to providing helpful diagnostics.
+pub(crate) fn type_disagreements<'schema>(aev_trie: &AEVTrie<'schema>) -> TypeDisagreements {
+    let mut errors: TypeDisagreements = TypeDisagreements::default();
+
+    for (&(a, attribute), evs) in aev_trie {
+        for (&e, ref ars) in evs {
+            for v in ars.add.iter().chain(ars.retract.iter()) {
+                if attribute.value_type != v.value_type() {
+                    errors.insert((e, a, v.clone()), attribute.value_type);
+                }
+            }
+        }
+    }
+
+    errors
+}
+
+/// Ensure that the given terms obey the cardinality restrictions of the given schema.
+///
+/// That is, ensure that any cardinality one attribute is added with at most one distinct value for
+/// any specific entity (although that one value may be repeated for the given entity).
+/// It is an error to:
+///
+/// - add two distinct values for the same cardinality one attribute and entity in a single transaction
+/// - add and remove the same values for the same attribute and entity in a single transaction
+///
+/// We try to be maximally helpful by yielding every malformed set of datoms, rather than just the
+/// first set, or even the first conflict.  In the future, we might change this choice, or allow the
+/// consumer to specify the robustness of the cardinality checking desired.
+pub(crate) fn cardinality_conflicts<'schema>(aev_trie: &AEVTrie<'schema>) -> Vec<CardinalityConflict> {
+    let mut errors = vec![];
+
+    for (&(a, attribute), evs) in aev_trie {
+        for (&e, ref ars) in evs {
+            if !attribute.multival && ars.add.len() > 1 {
+                let vs = ars.add.clone();
+                errors.push(CardinalityConflict::CardinalityOneAddConflict { e, a, vs });
+            }
+
+            let vs: BTreeSet<_> = ars.retract.intersection(&ars.add).cloned().collect();
+            if !vs.is_empty() {
+                errors.push(CardinalityConflict::AddRetractConflict { e, a, vs })
+            }
+        }
+    }
+
+    errors
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/tx_observer.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/tx_observer.rs.html new file mode 100644 index 00000000..46b72897 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/tx_observer.rs.html @@ -0,0 +1,556 @@ + + + + + + + + + + tx_observer.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::sync::{
+    Arc,
+    Weak,
+};
+
+use std::sync::mpsc::{
+    channel,
+    Receiver,
+    RecvError,
+    Sender,
+};
+
+use std::thread;
+
+use indexmap::{
+    IndexMap,
+};
+
+use mentat_core::{
+    Entid,
+    Schema,
+    TypedValue,
+};
+
+use edn::entities::{
+    OpType,
+};
+
+use errors::{
+    Result,
+};
+
+use types::{
+    AttributeSet,
+};
+
+use watcher::TransactWatcher;
+
+pub struct TxObserver {
+    notify_fn: Arc<Box<Fn(&str, IndexMap<&Entid, &AttributeSet>) + Send + Sync>>,
+    attributes: AttributeSet,
+}
+
+impl TxObserver {
+    pub fn new<F>(attributes: AttributeSet, notify_fn: F) -> TxObserver where F: Fn(&str, IndexMap<&Entid, &AttributeSet>) + 'static + Send + Sync {
+        TxObserver {
+            notify_fn: Arc::new(Box::new(notify_fn)),
+            attributes,
+        }
+    }
+
+    pub fn applicable_reports<'r>(&self, reports: &'r IndexMap<Entid, AttributeSet>) -> IndexMap<&'r Entid, &'r AttributeSet> {
+        reports.into_iter()
+               .filter(|&(_txid, attrs)| !self.attributes.is_disjoint(attrs))
+               .collect()
+    }
+
+    fn notify(&self, key: &str, reports: IndexMap<&Entid, &AttributeSet>) {
+        (*self.notify_fn)(key, reports);
+    }
+}
+
+pub trait Command {
+    fn execute(&mut self);
+}
+
+pub struct TxCommand {
+    reports: IndexMap<Entid, AttributeSet>,
+    observers: Weak<IndexMap<String, Arc<TxObserver>>>,
+}
+
+impl TxCommand {
+    fn new(observers: &Arc<IndexMap<String, Arc<TxObserver>>>, reports: IndexMap<Entid, AttributeSet>) -> Self {
+        TxCommand {
+            reports,
+            observers: Arc::downgrade(observers),
+        }
+    }
+}
+
+impl Command for TxCommand {
+    fn execute(&mut self) {
+        self.observers.upgrade().map(|observers| {
+            for (key, observer) in observers.iter() {
+                let applicable_reports = observer.applicable_reports(&self.reports);
+                if !applicable_reports.is_empty() {
+                    observer.notify(&key, applicable_reports);
+                }
+            }
+        });
+    }
+}
+
+pub struct TxObservationService {
+    observers: Arc<IndexMap<String, Arc<TxObserver>>>,
+    executor: Option<Sender<Box<Command + Send>>>,
+}
+
+impl TxObservationService {
+    pub fn new() -> Self {
+        TxObservationService {
+            observers: Arc::new(IndexMap::new()),
+            executor: None,
+        }
+    }
+
+    // For testing purposes
+    pub fn is_registered(&self, key: &String) -> bool {
+        self.observers.contains_key(key)
+    }
+
+    pub fn register(&mut self, key: String, observer: Arc<TxObserver>) {
+        Arc::make_mut(&mut self.observers).insert(key, observer);
+    }
+
+    pub fn deregister(&mut self, key: &String) {
+        Arc::make_mut(&mut self.observers).remove(key);
+    }
+
+    pub fn has_observers(&self) -> bool {
+        !self.observers.is_empty()
+    }
+
+    pub fn in_progress_did_commit(&mut self, txes: IndexMap<Entid, AttributeSet>) {
+        // Don't spawn a thread only to say nothing.
+        if !self.has_observers() {
+            return;
+        }
+
+        let executor = self.executor.get_or_insert_with(|| {
+            let (tx, rx): (Sender<Box<Command + Send>>, Receiver<Box<Command + Send>>) = channel();
+            let mut worker = CommandExecutor::new(rx);
+
+            thread::spawn(move || {
+                worker.main();
+            });
+
+            tx
+        });
+
+        let cmd = Box::new(TxCommand::new(&self.observers, txes));
+        executor.send(cmd).unwrap();
+    }
+}
+
+impl Drop for TxObservationService {
+    fn drop(&mut self) {
+        self.executor = None;
+    }
+}
+
+pub struct InProgressObserverTransactWatcher {
+    collected_attributes: AttributeSet,
+    pub txes: IndexMap<Entid, AttributeSet>,
+}
+
+impl InProgressObserverTransactWatcher {
+    pub fn new() -> InProgressObserverTransactWatcher {
+        InProgressObserverTransactWatcher {
+            collected_attributes: Default::default(),
+            txes: Default::default(),
+        }
+    }
+}
+
+impl TransactWatcher for InProgressObserverTransactWatcher {
+    fn datom(&mut self, _op: OpType, _e: Entid, a: Entid, _v: &TypedValue) {
+        self.collected_attributes.insert(a);
+    }
+
+    fn done(&mut self, t: &Entid, _schema: &Schema) -> Result<()> {
+        let collected_attributes = ::std::mem::replace(&mut self.collected_attributes, Default::default());
+        self.txes.insert(*t, collected_attributes);
+        Ok(())
+    }
+}
+
+struct CommandExecutor {
+    receiver: Receiver<Box<Command + Send>>,
+}
+
+impl CommandExecutor {
+    fn new(rx: Receiver<Box<Command + Send>>) -> Self {
+        CommandExecutor {
+            receiver: rx,
+        }
+    }
+
+    fn main(&mut self) {
+        loop {
+            match self.receiver.recv() {
+                Err(RecvError) => {
+                    // "The recv operation can only fail if the sending half of a channel (or
+                    // sync_channel) is disconnected, implying that no further messages will ever be
+                    // received."
+                    // No need to log here.
+                    return
+                },
+
+                Ok(mut cmd) => {
+                    cmd.execute()
+                },
+            }
+        }
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/types.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/types.rs.html new file mode 100644 index 00000000..dd3a8bdb --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/types.rs.html @@ -0,0 +1,380 @@ + + + + + + + + + + types.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+use std::collections::HashMap;
+use std::collections::{
+    BTreeMap,
+    BTreeSet,
+};
+
+extern crate mentat_core;
+
+pub use self::mentat_core::{
+    Attribute,
+    AttributeBitFlags,
+    DateTime,
+    Entid,
+    Schema,
+    TypedValue,
+    Utc,
+    ValueType,
+};
+
+use edn::entities::{
+    EntityPlace,
+    TempId,
+};
+
+use errors;
+
+/// Represents one partition of the entid space.
+#[derive(Clone,Debug,Eq,Hash,Ord,PartialOrd,PartialEq)]
+pub struct Partition {
+    /// The first entid in the partition.
+    pub start: i64,
+    /// The next entid to be allocated in the partition.
+    pub index: i64,
+}
+
+impl Partition {
+    pub fn new(start: i64, next: i64) -> Partition {
+        assert!(start <= next, "A partition represents a monotonic increasing sequence of entids.");
+        Partition { start: start, index: next }
+    }
+
+    pub fn contains_entid(&self, e: i64) -> bool {
+        (e >= self.start) && (e < self.index)
+    }
+}
+
+/// Map partition names to `Partition` instances.
+pub type PartitionMap = BTreeMap<String, Partition>;
+
+/// Represents the metadata required to query from, or apply transactions to, a Mentat store.
+///
+/// See https://github.com/mozilla/mentat/wiki/Thoughts:-modeling-db-conn-in-Rust.
+#[derive(Clone,Debug,Default,Eq,Hash,Ord,PartialOrd,PartialEq)]
+pub struct DB {
+    /// Map partition name->`Partition`.
+    ///
+    /// TODO: represent partitions as entids.
+    pub partition_map: PartitionMap,
+
+    /// The schema of the store.
+    pub schema: Schema,
+}
+
+impl DB {
+    pub fn new(partition_map: PartitionMap, schema: Schema) -> DB {
+        DB {
+            partition_map: partition_map,
+            schema: schema
+        }
+    }
+}
+
+/// A pair [a v] in the store.
+///
+/// Used to represent lookup-refs and [TEMPID a v] upserts as they are resolved.
+pub type AVPair = (Entid, TypedValue);
+
+/// Map [a v] pairs to existing entids.
+///
+/// Used to resolve lookup-refs and upserts.
+pub type AVMap<'a> = HashMap<&'a AVPair, Entid>;
+
+// represents a set of entids that are correspond to attributes
+pub type AttributeSet = BTreeSet<Entid>;
+
+/// A transaction report summarizes an applied transaction.
+#[derive(Clone, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]
+pub struct TxReport {
+    /// The transaction ID of the transaction.
+    pub tx_id: Entid,
+
+    /// The timestamp when the transaction began to be committed.
+    pub tx_instant: DateTime<Utc>,
+
+    /// A map from string literal tempid to resolved or allocated entid.
+    ///
+    /// Every string literal tempid presented to the transactor either resolves via upsert to an
+    /// existing entid, or is allocated a new entid.  (It is possible for multiple distinct string
+    /// literal tempids to all unify to a single freshly allocated entid.)
+    pub tempids: BTreeMap<String, Entid>,
+}
+
+/// The transactor is tied to `edn::ValueAndSpan` right now, but in the future we'd like to support
+/// `TypedValue` directly for programmatic use.  `TransactableValue` encapsulates the interface
+/// value types (i.e., values in the value place) need to support to be transacted.
+pub trait TransactableValue: Clone {
+    /// Coerce this value place into the given type.  This is where we perform schema-aware
+    /// coercion, for example coercing an integral value into a ref where appropriate.
+    fn into_typed_value(self, schema: &Schema, value_type: ValueType) -> errors::Result<TypedValue>;
+
+    /// Make an entity place out of this value place.  This is where we limit values in nested maps
+    /// to valid entity places.
+    fn into_entity_place(self) -> errors::Result<EntityPlace<Self>>;
+
+    fn as_tempid(&self) -> Option<TempId>;
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/upsert_resolution.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/upsert_resolution.rs.html new file mode 100644 index 00000000..4275d0e3 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/upsert_resolution.rs.html @@ -0,0 +1,840 @@ + + + + + + + + + + upsert_resolution.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+//! This module implements the upsert resolution algorithm described at
+//! https://github.com/mozilla/mentat/wiki/Transacting:-upsert-resolution-algorithm.
+
+use std::collections::{
+    BTreeMap,
+    BTreeSet,
+};
+
+use indexmap;
+use petgraph::unionfind;
+
+use errors::{
+    DbError,
+    Result,
+};
+use types::{
+    AVPair,
+};
+use internal_types::{
+    Population,
+    TempIdHandle,
+    TempIdMap,
+    Term,
+    TermWithoutTempIds,
+    TermWithTempIds,
+    TypedValueOr,
+};
+
+use mentat_core::util::Either::*;
+
+use mentat_core::{
+    attribute,
+    Attribute,
+    Entid,
+    Schema,
+    TypedValue,
+};
+use edn::entities::OpType;
+use schema::SchemaBuilding;
+
+/// A "Simple upsert" that looks like [:db/add TEMPID a v], where a is :db.unique/identity.
+#[derive(Clone,Debug,Eq,Hash,Ord,PartialOrd,PartialEq)]
+struct UpsertE(TempIdHandle, Entid, TypedValue);
+
+/// A "Complex upsert" that looks like [:db/add TEMPID a OTHERID], where a is :db.unique/identity
+#[derive(Clone,Debug,Eq,Hash,Ord,PartialOrd,PartialEq)]
+struct UpsertEV(TempIdHandle, Entid, TempIdHandle);
+
+/// A generation collects entities into populations at a single evolutionary step in the upsert
+/// resolution evolution process.
+///
+/// The upsert resolution process is only concerned with [:db/add ...] entities until the final
+/// entid allocations.  That's why we separate into special simple and complex upsert types
+/// immediately, and then collect the more general term types for final resolution.
+#[derive(Clone,Debug,Default,Eq,Hash,Ord,PartialOrd,PartialEq)]
+pub(crate) struct Generation {
+    /// "Simple upserts" that look like [:db/add TEMPID a v], where a is :db.unique/identity.
+    upserts_e: Vec<UpsertE>,
+
+    /// "Complex upserts" that look like [:db/add TEMPID a OTHERID], where a is :db.unique/identity
+    upserts_ev: Vec<UpsertEV>,
+
+    /// Entities that look like:
+    /// - [:db/add TEMPID b OTHERID].  b may be :db.unique/identity if it has failed to upsert.
+    /// - [:db/add TEMPID b v].  b may be :db.unique/identity if it has failed to upsert.
+    /// - [:db/add e b OTHERID].
+    allocations: Vec<TermWithTempIds>,
+
+    /// Entities that upserted and no longer reference tempids.  These assertions are guaranteed to
+    /// be in the store.
+    upserted: Vec<TermWithoutTempIds>,
+
+    /// Entities that resolved due to other upserts and no longer reference tempids.  These
+    /// assertions may or may not be in the store.
+    resolved: Vec<TermWithoutTempIds>,
+}
+
+#[derive(Clone,Debug,Default,Eq,Hash,Ord,PartialOrd,PartialEq)]
+pub(crate) struct FinalPopulations {
+    /// Upserts that upserted.
+    pub upserted: Vec<TermWithoutTempIds>,
+
+    /// Allocations that resolved due to other upserts.
+    pub resolved: Vec<TermWithoutTempIds>,
+
+    /// Allocations that required new entid allocations.
+    pub allocated: Vec<TermWithoutTempIds>,
+}
+
+impl Generation {
+    /// Split entities into a generation of populations that need to evolve to have their tempids
+    /// resolved or allocated, and a population of inert entities that do not reference tempids.
+    pub(crate) fn from<I>(terms: I, schema: &Schema) -> Result<(Generation, Population)> where I: IntoIterator<Item=TermWithTempIds> {
+        let mut generation = Generation::default();
+        let mut inert = vec![];
+
+        let is_unique = |a: Entid| -> Result<bool> {
+            let attribute: &Attribute = schema.require_attribute_for_entid(a)?;
+            Ok(attribute.unique == Some(attribute::Unique::Identity))
+        };
+
+        for term in terms.into_iter() {
+            match term {
+                Term::AddOrRetract(op, Right(e), a, Right(v)) => {
+                    if op == OpType::Add && is_unique(a)? {
+                        generation.upserts_ev.push(UpsertEV(e, a, v));
+                    } else {
+                        generation.allocations.push(Term::AddOrRetract(op, Right(e), a, Right(v)));
+                    }
+                },
+                Term::AddOrRetract(op, Right(e), a, Left(v)) => {
+                    if op == OpType::Add && is_unique(a)? {
+                        generation.upserts_e.push(UpsertE(e, a, v));
+                    } else {
+                        generation.allocations.push(Term::AddOrRetract(op, Right(e), a, Left(v)));
+                    }
+                },
+                Term::AddOrRetract(op, Left(e), a, Right(v)) => {
+                    generation.allocations.push(Term::AddOrRetract(op, Left(e), a, Right(v)));
+                },
+                Term::AddOrRetract(op, Left(e), a, Left(v)) => {
+                    inert.push(Term::AddOrRetract(op, Left(e), a, Left(v)));
+                },
+            }
+        }
+
+        Ok((generation, inert))
+    }
+
+    /// Return true if it's possible to evolve this generation further.
+    ///
+    /// Note that there can be complex upserts but no simple upserts to help resolve them, and in
+    /// this case, we cannot evolve further.
+    pub(crate) fn can_evolve(&self) -> bool {
+        !self.upserts_e.is_empty()
+    }
+
+    /// Evolve this generation one step further by rewriting the existing :db/add entities using the
+    /// given temporary IDs.
+    ///
+    /// TODO: Considering doing this in place; the function already consumes `self`.
+    pub(crate) fn evolve_one_step(self, temp_id_map: &TempIdMap) -> Generation {
+        let mut next = Generation::default();
+
+        // We'll iterate our own allocations to resolve more things, but terms that have already
+        // resolved stay resolved.
+        next.resolved = self.resolved;
+
+        for UpsertE(t, a, v) in self.upserts_e {
+            match temp_id_map.get(&*t) {
+                Some(&n) => next.upserted.push(Term::AddOrRetract(OpType::Add, n, a, v)),
+                None => next.allocations.push(Term::AddOrRetract(OpType::Add, Right(t), a, Left(v))),
+            }
+        }
+
+        for UpsertEV(t1, a, t2) in self.upserts_ev {
+            match (temp_id_map.get(&*t1), temp_id_map.get(&*t2)) {
+                (Some(_), Some(&n2)) => {
+                    // Even though we can resolve entirely, it's possible that the remaining upsert
+                    // could conflict.  Moving straight to resolved doesn't give us a chance to
+                    // search the store for the conflict.
+                    next.upserts_e.push(UpsertE(t1, a, TypedValue::Ref(n2.0)))
+                },
+                (None, Some(&n2)) => next.upserts_e.push(UpsertE(t1, a, TypedValue::Ref(n2.0))),
+                (Some(&n1), None) => next.allocations.push(Term::AddOrRetract(OpType::Add, Left(n1), a, Right(t2))),
+                (None, None) => next.upserts_ev.push(UpsertEV(t1, a, t2))
+            }
+        }
+
+        // There's no particular need to separate resolved from allocations right here and right
+        // now, although it is convenient.
+        for term in self.allocations {
+            // TODO: find an expression that destructures less?  I still expect this to be efficient
+            // but it's a little verbose.
+            match term {
+                Term::AddOrRetract(op, Right(t1), a, Right(t2)) => {
+                    match (temp_id_map.get(&*t1), temp_id_map.get(&*t2)) {
+                        (Some(&n1), Some(&n2)) => next.resolved.push(Term::AddOrRetract(op, n1, a, TypedValue::Ref(n2.0))),
+                        (None, Some(&n2)) => next.allocations.push(Term::AddOrRetract(op, Right(t1), a, Left(TypedValue::Ref(n2.0)))),
+                        (Some(&n1), None) => next.allocations.push(Term::AddOrRetract(op, Left(n1), a, Right(t2))),
+                        (None, None) => next.allocations.push(Term::AddOrRetract(op, Right(t1), a, Right(t2))),
+                    }
+                },
+                Term::AddOrRetract(op, Right(t), a, Left(v)) => {
+                    match temp_id_map.get(&*t) {
+                        Some(&n) => next.resolved.push(Term::AddOrRetract(op, n, a, v)),
+                        None => next.allocations.push(Term::AddOrRetract(op, Right(t), a, Left(v))),
+                    }
+                },
+                Term::AddOrRetract(op, Left(e), a, Right(t)) => {
+                    match temp_id_map.get(&*t) {
+                        Some(&n) => next.resolved.push(Term::AddOrRetract(op, e, a, TypedValue::Ref(n.0))),
+                        None => next.allocations.push(Term::AddOrRetract(op, Left(e), a, Right(t))),
+                    }
+                },
+                Term::AddOrRetract(_, Left(_), _, Left(_)) => unreachable!(),
+            }
+        }
+
+        next
+    }
+
+    // Collect id->[a v] pairs that might upsert at this evolutionary step.
+    pub(crate) fn temp_id_avs<'a>(&'a self) -> Vec<(TempIdHandle, AVPair)> {
+        let mut temp_id_avs: Vec<(TempIdHandle, AVPair)> = vec![];
+        // TODO: map/collect.
+        for &UpsertE(ref t, ref a, ref v) in &self.upserts_e {
+            // TODO: figure out how to make this less expensive, i.e., don't require
+            // clone() of an arbitrary value.
+            temp_id_avs.push((t.clone(), (*a, v.clone())));
+        }
+        temp_id_avs
+    }
+
+    /// Evolve potential upserts that haven't resolved into allocations.
+    pub(crate) fn allocate_unresolved_upserts(&mut self) -> Result<()> {
+        let mut upserts_ev = vec![];
+        ::std::mem::swap(&mut self.upserts_ev, &mut upserts_ev);
+
+        self.allocations.extend(upserts_ev.into_iter().map(|UpsertEV(t1, a, t2)| Term::AddOrRetract(OpType::Add, Right(t1), a, Right(t2))));
+
+        Ok(())
+    }
+
+    /// After evolution is complete, yield the set of tempids that require entid allocation.
+    ///
+    /// Some of the tempids may be identified, so we also provide a map from tempid to a dense set
+    /// of contiguous integer labels.
+    pub(crate) fn temp_ids_in_allocations(&self, schema: &Schema) -> Result<BTreeMap<TempIdHandle, usize>> {
+        assert!(self.upserts_e.is_empty(), "All upserts should have been upserted, resolved, or moved to the allocated population!");
+        assert!(self.upserts_ev.is_empty(), "All upserts should have been upserted, resolved, or moved to the allocated population!");
+
+        let mut temp_ids: BTreeSet<TempIdHandle> = BTreeSet::default();
+        let mut tempid_avs: BTreeMap<(Entid, TypedValueOr<TempIdHandle>), Vec<TempIdHandle>> = BTreeMap::default();
+
+        for term in self.allocations.iter() {
+            match term {
+                &Term::AddOrRetract(OpType::Add, Right(ref t1), a, Right(ref t2)) => {
+                    temp_ids.insert(t1.clone());
+                    temp_ids.insert(t2.clone());
+                    let attribute: &Attribute = schema.require_attribute_for_entid(a)?;
+                    if attribute.unique == Some(attribute::Unique::Identity) {
+                        tempid_avs.entry((a, Right(t2.clone()))).or_insert(vec![]).push(t1.clone());
+                    }
+                },
+                &Term::AddOrRetract(OpType::Add, Right(ref t), a, ref x @ Left(_)) => {
+                    temp_ids.insert(t.clone());
+                    let attribute: &Attribute = schema.require_attribute_for_entid(a)?;
+                    if attribute.unique == Some(attribute::Unique::Identity) {
+                        tempid_avs.entry((a, x.clone())).or_insert(vec![]).push(t.clone());
+                    }
+                },
+                &Term::AddOrRetract(OpType::Add, Left(_), _, Right(ref t)) => {
+                    temp_ids.insert(t.clone());
+                },
+                &Term::AddOrRetract(OpType::Add, Left(_), _, Left(_)) => unreachable!(),
+                &Term::AddOrRetract(OpType::Retract, _, _, _) => {
+                    // [:db/retract ...] entities never allocate entids; they have to resolve due to
+                    // other upserts (or they fail the transaction).
+                },
+            }
+        }
+
+        // Now we union-find all the known tempids.  Two tempids are unioned if they both appear as
+        // the entity of an `[a v]` upsert, including when the value column `v` is itself a tempid.
+        let mut uf = unionfind::UnionFind::new(temp_ids.len());
+
+        // The union-find implementation from petgraph operates on contiguous indices, so we need to
+        // maintain the map from our tempids to indices ourselves.
+        let temp_ids: BTreeMap<TempIdHandle, usize> = temp_ids.into_iter().enumerate().map(|(i, tempid)| (tempid, i)).collect();
+
+        debug!("need to label tempids aggregated using tempid_avs {:?}", tempid_avs);
+
+        for vs in tempid_avs.values() {
+            vs.first().and_then(|first| temp_ids.get(first)).map(|&first_index| {
+                for tempid in vs {
+                    temp_ids.get(tempid).map(|&i| uf.union(first_index, i));
+                }
+            });
+        }
+
+        debug!("union-find aggregation {:?}", uf.clone().into_labeling());
+
+        // Now that we have aggregated tempids, we need to label them using the smallest number of
+        // contiguous labels possible.
+        let mut tempid_map: BTreeMap<TempIdHandle, usize> = BTreeMap::default();
+
+        let mut dense_labels: indexmap::IndexSet<usize> = indexmap::IndexSet::default();
+
+        // We want to produce results that are as deterministic as possible, so we allocate labels
+        // for tempids in sorted order.  This has the effect of making "a" allocate before "b",
+        // which is pleasant for testing.
+        for (tempid, tempid_index) in temp_ids {
+            let rep = uf.find_mut(tempid_index);
+            dense_labels.insert(rep);
+            dense_labels.get_full(&rep).map(|(dense_index, _)| tempid_map.insert(tempid.clone(), dense_index));
+        }
+
+        debug!("labeled tempids using {} labels: {:?}", dense_labels.len(), tempid_map);
+
+        Ok(tempid_map)
+    }
+
+    /// After evolution is complete, use the provided allocated entids to segment `self` into
+    /// populations, each with no references to tempids.
+    pub(crate) fn into_final_populations(self, temp_id_map: &TempIdMap) -> Result<FinalPopulations> {
+        assert!(self.upserts_e.is_empty());
+        assert!(self.upserts_ev.is_empty());
+
+        let mut populations = FinalPopulations::default();
+
+        populations.upserted = self.upserted;
+        populations.resolved = self.resolved;
+
+        for term in self.allocations {
+            let allocated = match term {
+                // TODO: consider require implementing require on temp_id_map.
+                Term::AddOrRetract(op, Right(t1), a, Right(t2)) => {
+                    match (op, temp_id_map.get(&*t1), temp_id_map.get(&*t2)) {
+                        (op, Some(&n1), Some(&n2)) => Term::AddOrRetract(op, n1, a, TypedValue::Ref(n2.0)),
+                        (OpType::Add, _, _) => unreachable!(), // This is a coding error -- every tempid in a :db/add entity should resolve or be allocated.
+                        (OpType::Retract, _, _) => bail!(DbError::NotYetImplemented(format!("[:db/retract ...] entity referenced tempid that did not upsert: one of {}, {}", t1, t2))),
+                    }
+                },
+                Term::AddOrRetract(op, Right(t), a, Left(v)) => {
+                    match (op, temp_id_map.get(&*t)) {
+                        (op, Some(&n)) => Term::AddOrRetract(op, n, a, v),
+                        (OpType::Add, _) => unreachable!(), // This is a coding error.
+                        (OpType::Retract, _) => bail!(DbError::NotYetImplemented(format!("[:db/retract ...] entity referenced tempid that did not upsert: {}", t))),
+                    }
+                },
+                Term::AddOrRetract(op, Left(e), a, Right(t)) => {
+                    match (op, temp_id_map.get(&*t)) {
+                        (op, Some(&n)) => Term::AddOrRetract(op, e, a, TypedValue::Ref(n.0)),
+                        (OpType::Add, _) => unreachable!(), // This is a coding error.
+                        (OpType::Retract, _) => bail!(DbError::NotYetImplemented(format!("[:db/retract ...] entity referenced tempid that did not upsert: {}", t))),
+                    }
+                },
+                Term::AddOrRetract(_, Left(_), _, Left(_)) => unreachable!(), // This is a coding error -- these should not be in allocations.
+            };
+            populations.allocated.push(allocated);
+        }
+
+        Ok(populations)
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_db/watcher.rs.html b/docs/apis/rust/0.7.0/src/mentat_db/watcher.rs.html new file mode 100644 index 00000000..8e1dc4da --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_db/watcher.rs.html @@ -0,0 +1,230 @@ + + + + + + + + + + watcher.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+// A trivial interface for extracting information from a transact as it happens.
+// We have two situations in which we need to do this:
+//
+// - InProgress and Conn both have attribute caches. InProgress's is different from Conn's,
+//   because it needs to be able to roll back. These wish to see changes in a certain set of
+//   attributes in order to synchronously update the cache during a write.
+// - When observers are registered we want to flip some flags as writes occur so that we can
+//   notifying them outside the transaction.
+
+use mentat_core::{
+    Entid,
+    Schema,
+    TypedValue,
+};
+
+use edn::entities::{
+    OpType,
+};
+
+use errors::{
+    Result,
+};
+
+pub trait TransactWatcher {
+    fn datom(&mut self, op: OpType, e: Entid, a: Entid, v: &TypedValue);
+
+    /// Only return an error if you want to interrupt the transact!
+    /// Called with the schema _prior to_ the transact -- any attributes or
+    /// attribute changes transacted during this transact are not reflected in
+    /// the schema.
+    fn done(&mut self, t: &Entid, schema: &Schema) -> Result<()>;
+}
+
+pub struct NullWatcher();
+
+impl TransactWatcher for NullWatcher {
+    fn datom(&mut self, _op: OpType, _e: Entid, _a: Entid, _v: &TypedValue) {
+    }
+
+    fn done(&mut self, _t: &Entid, _schema: &Schema) -> Result<()> {
+        Ok(())
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_ffi/android.rs.html b/docs/apis/rust/0.7.0/src/mentat_ffi/android.rs.html new file mode 100644 index 00000000..227b085f --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_ffi/android.rs.html @@ -0,0 +1,172 @@ + + + + + + + + + + android.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+// TODO just use https://github.com/tomaka/android-rs-glue somehow?
+
+use std::os::raw::c_char;
+use std::os::raw::c_int;
+
+// Logging
+pub enum LogLevel {
+    Debug = 3,
+    Info = 4,
+    Warn = 5,
+    Error = 6,
+}
+
+extern { pub fn __android_log_write(prio: c_int, tag: *const c_char, text: *const c_char) -> c_int; }
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_ffi/lib.rs.html b/docs/apis/rust/0.7.0/src/mentat_ffi/lib.rs.html new file mode 100644 index 00000000..77af983c --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_ffi/lib.rs.html @@ -0,0 +1,3832 @@ + + + + + + + + + + lib.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+//! This module exposes an Foreign Function Interface (FFI) that allows Mentat to be
+//! called from other languages.
+//!
+//! Functions that are available to other languages in this module are defined as
+//! extern "C" functions which allow them to be layed out correctly for the
+//! platform's C ABI. They all have a `#[no_mangle]` decorator to ensure
+//! Rust's name mangling is turned off, so that it is easier to link to.
+//!
+//! Mentat's FFI contains unsafe code. As it is an interface between foreign code
+//! and native Rust code, Rust cannot guarantee that the types and data that have been passed
+//! to it from another language are present and in the format it is expecting.
+//! This interface is designed to ensure that nothing unsafe passes through this module
+//! and enters Mentat proper
+//!
+//! Structs defined with `#[repr(C)]` are guaranteed to have a layout that is compatible
+//! with the platform's representation in C.
+//!
+//! This API passes pointers in two ways, depending on the lifetime of the value and
+//! what value owns it.
+//! Pointers to values that are guaranteed to live beyond the lifetime of the function,
+//! are passed over the FFI as a raw pointer.
+//!
+//! `value as *const Binding`
+//!
+//! Pointers to values that cannot be guaranteed to live beyond the lifetime of the function
+//! are first `Box`ed so that they live on the heap, and the raw pointer passed this way.
+//!
+//! `Box::into_raw(Box::new(value))`
+//!
+//! The memory for a value that is moved onto the heap before being passed over the FFI
+//! is no longer managed by Rust, but Rust still owns the value. Therefore the pointer
+//! must be returned to Rust in order to be released. To this effect a number of `destructor`
+//! functions are provided for each Rust value type that is passed, as is a catch all destructor
+//! to release memory for `#[repr(C)]` values.
+//! The destructors reclaim the memory via [Box](std::boxed::Box) and then drop the reference, causing the
+//! memory to be released.
+//!
+//! A macro has been provided to make defining destructors easier.
+//!
+//! `define_destructor!(query_builder_destroy, QueryBuilder);`
+//!
+//! Passing a pointer to memory that has already been released will cause Mentat to crash,
+//! so callers have to be careful to ensure they manage their pointers properly.
+//! Failure to call a destructor for a value on the heap will cause a memory leak.
+//!
+//! Generally, the functions exposed in this module have a direct mapping to existing Mentat APIs,
+//! in order to keep application logic to a minumum and provide the greatest flexibility
+//! for callers using the interface. However, in some cases a single convenience function
+//! has been provided in order to make the interface easier to use and reduce the number
+//! of calls that have to be made over the FFI to perform a task. An example of this is
+//! `store_register_observer`, which takes a single native callback function that is then
+//! wrapped inside a Rust closure and added to a [TxObserver](mentat::TxObserver) struct. This is then used to
+//! register the observer with the store.
+//!
+//! [Result](std::result::Result) and [Option](std::option::Option) Rust types have `repr(C)` structs that mirror them. This is to provide a more
+//! native access pattern to callers and to enable easier passing of optional types and error
+//! propogation. These types have implemented [From](std::convert::From) such that conversion from the Rust type
+//! to the C type is as painless as possible.
+
+extern crate core;
+extern crate libc;
+extern crate mentat;
+
+use core::fmt::Display;
+
+use std::collections::{
+    BTreeSet,
+};
+use std::os::raw::{
+    c_char,
+    c_int,
+    c_longlong,
+    c_void,
+};
+use std::slice;
+use std::sync::{
+    Arc,
+};
+use std::vec;
+
+pub use mentat::{
+    Binding,
+    CacheDirection,
+    Entid,
+    FindSpec,
+    HasSchema,
+    InProgress,
+    KnownEntid,
+    Queryable,
+    QueryBuilder,
+    QueryInputs,
+    QueryOutput,
+    QueryResults,
+    RelResult,
+    Store,
+    Syncable,
+    TypedValue,
+    TxObserver,
+    TxReport,
+    Uuid,
+    ValueType,
+    Variable,
+};
+
+pub use mentat::entity_builder::{
+    BuildTerms,
+    EntityBuilder,
+    InProgressBuilder,
+    IntoThing,
+};
+
+pub mod android;
+pub mod utils;
+
+pub use utils::strings::{
+    c_char_to_string,
+    kw_from_string,
+    string_to_c_char,
+};
+
+pub use utils::log;
+
+// type aliases for iterator types.
+pub type BindingIterator = vec::IntoIter<Binding>;
+pub type BindingListIterator = std::slice::Chunks<'static, mentat::Binding>;
+
+/// A C representation of the change provided by the transaction observers
+/// from a single transact.
+/// Holds a transaction identifier, the changes as a set of affected attributes
+/// and the length of the list of changes.
+///
+/// #Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `destroy` is provided for releasing the memory for this
+/// pointer type.
+#[repr(C)]
+#[derive(Debug, Clone)]
+pub struct TransactionChange {
+    pub txid: Entid,
+    pub changes_len: usize,
+    pub changes: Box<[Entid]>,
+}
+
+ /// A C representation of the list of changes provided by the transaction observers.
+ /// Provides the list of changes as the length of the list.
+///
+/// #Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `destroy` is provided for releasing the memory for this
+/// pointer type.
+#[repr(C)]
+#[derive(Debug)]
+pub struct TxChangeList {
+    pub reports: Box<[TransactionChange]>,
+    pub len: usize,
+}
+
+/// A C representation Rust's [Option](std::option::Option).
+/// A value of `Some` results in `value` containing a raw pointer as a `c_void`.
+/// A value of `None` results in `value` containing a null pointer.
+///
+/// #Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `destroy` is provided for releasing the memory for this
+/// pointer type.
+#[repr(C)]
+#[derive(Debug)]
+pub struct ExternOption {
+    pub value: *mut c_void,
+}
+
+impl<T> From<Option<T>> for ExternOption {
+    fn from(option: Option<T>) -> Self {
+        ExternOption {
+            value: option.map_or(std::ptr::null_mut(), |v| Box::into_raw(Box::new(v)) as *mut _ as *mut c_void)
+        }
+    }
+}
+
+/// A C representation Rust's [Result](std::result::Result).
+/// A value of `Ok` results in `ok` containing a raw pointer as a `c_void`
+/// and `err` containing a null pointer.
+/// A value of `Err` results in `value` containing a null pointer and `err` containing an error message.
+///
+/// #Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `destroy` is provided for releasing the memory for this
+/// pointer type.
+#[repr(C)]
+#[derive(Debug)]
+pub struct ExternResult {
+    pub ok: *const c_void,
+    pub err: *const c_char,
+}
+
+impl<T, E> From<Result<T, E>> for ExternResult where E: Display {
+    fn from(result: Result<T, E>) -> Self {
+        match result {
+            Ok(value) => {
+                ExternResult {
+                    err: std::ptr::null(),
+                    ok: Box::into_raw(Box::new(value)) as *const _ as *const c_void,
+                }
+            },
+            Err(e) => {
+                ExternResult {
+                    err: string_to_c_char(e.to_string()),
+                    ok: std::ptr::null(),
+                }
+            }
+        }
+    }
+}
+
+#[repr(C)]
+#[derive(Debug)]
+pub struct InProgressTransactResult<'a, 'c> {
+    pub in_progress: *mut InProgress<'a, 'c>,
+    pub result: *mut ExternResult,
+}
+
+/// A store cannot be opened twice to the same location.
+/// Once created, the reference to the store is held by the caller and not Rust,
+/// therefore the caller is responsible for calling `destroy` to release the memory
+/// used by the [Store](mentat::Store) in order to avoid a memory leak.
+// TODO: Start returning `ExternResult`s rather than crashing on error.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `store_destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub extern "C" fn store_open(uri: *const c_char) -> *mut Store {
+    let uri = c_char_to_string(uri);
+    let store = Store::open(&uri).expect("expected a store");
+    Box::into_raw(Box::new(store))
+}
+
+/// Variant of store_open that opens an encrypted database.
+#[cfg(feature = "sqlcipher")]
+#[no_mangle]
+pub extern "C" fn store_open_encrypted(uri: *const c_char, key: *const c_char) -> *mut Store {
+    let uri = c_char_to_string(uri);
+    let key = c_char_to_string(key);
+    let store = Store::open_with_key(&uri, &key).expect("expected a store");
+    Box::into_raw(Box::new(store))
+}
+
+// TODO: open empty
+
+// TODO: dismantle
+
+// TODO: conn
+
+// TODO: begin_read
+
+/// Starts a new transaction to allow multiple transacts to be
+/// performed together. This is more efficient than performing
+/// a large set of individual commits.
+///
+/// Returns a [Result<TxReport>](mentat::TxReport) as an [ExternResult](ExternResult).
+///
+/// # Safety
+///
+/// Callers must ensure that the pointer to the [Store](mentat::Store) is not dangling.
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `tx_report_destroy` is provided for releasing the memory for this
+/// pointer type.
+///
+/// TODO: Document the errors that can result from begin_transaction
+#[no_mangle]
+pub unsafe extern "C" fn store_begin_transaction(store: *mut Store) -> *mut ExternResult {
+    let store = &mut *store;
+    Box::into_raw(Box::new(store.begin_transaction().into()))
+}
+
+/// Perform a single transact operation using the current in progress
+/// transaction. Takes edn as a string to transact.
+///
+/// Returns a [Result<TxReport>](mentat::TxReport) as an [ExternResult](ExternResult).
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `tx_report_destroy` is provided for releasing the memory for this
+/// pointer type.
+///
+/// TODO: Document the errors that can result from transact
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_transact<'m>(in_progress: *mut InProgress<'m, 'm>, transaction: *const c_char) -> *mut ExternResult {
+    let in_progress = &mut *in_progress;
+    let transaction = c_char_to_string(transaction);
+    Box::into_raw(Box::new(in_progress.transact(transaction).into()))
+}
+
+/// Commit all the transacts that have been performed using this
+/// in progress transaction.
+///
+/// Returns a [Result<()>](std::result::Result) as an [ExternResult](ExternResult).
+///
+/// TODO: Document the errors that can result from transact
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_commit<'m>(in_progress: *mut InProgress<'m, 'm>) -> *mut ExternResult {
+    let in_progress = Box::from_raw(in_progress);
+    Box::into_raw(Box::new(in_progress.commit().into()))
+}
+
+/// Rolls back all the transacts that have been performed using this
+/// in progress transaction.
+///
+/// Returns a [Result<()>](std::result::Result) as an [ExternResult](ExternResult).
+///
+/// TODO: Document the errors that can result from rollback
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_rollback<'m>(in_progress: *mut InProgress<'m, 'm>) -> *mut ExternResult {
+    let in_progress = Box::from_raw(in_progress);
+    Box::into_raw(Box::new(in_progress.rollback().into()))
+}
+
+/// Creates a builder using the in progress transaction to allow for programmatic
+/// assertion of values.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `in_progress_builder_destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder<'m>(in_progress: *mut InProgress<'m, 'm>) -> *mut InProgressBuilder {
+    let in_progress = Box::from_raw(in_progress);
+    Box::into_raw(Box::new(in_progress.builder()))
+}
+
+/// Creates a builder for an entity with `tempid` using the in progress transaction to
+/// allow for programmatic assertion of values for that entity.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `entity_builder_destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_entity_builder_from_temp_id<'m>(in_progress: *mut InProgress<'m, 'm>, temp_id: *const c_char) -> *mut EntityBuilder<InProgressBuilder> {
+    let in_progress = Box::from_raw(in_progress);
+    let temp_id = c_char_to_string(temp_id);
+    Box::into_raw(Box::new(in_progress.builder().describe_tempid(&temp_id)))
+}
+
+/// Creates a builder for an entity with `entid` using the in progress transaction to
+/// allow for programmatic assertion of values for that entity.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `entity_builder_destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_entity_builder_from_entid<'m>(in_progress: *mut InProgress<'m, 'm>, entid: c_longlong) -> *mut EntityBuilder<InProgressBuilder> {
+    let in_progress = Box::from_raw(in_progress);
+    Box::into_raw(Box::new(in_progress.builder().describe(&KnownEntid(entid))))
+}
+
+/// Starts a new transaction and creates a builder using the transaction
+/// to allow for programmatic assertion of values.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `in_progress_builder_destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn store_in_progress_builder(store: *mut Store) -> *mut ExternResult {
+    let store = &mut *store;
+    let result = store.begin_transaction().and_then(|in_progress| {
+        Ok(in_progress.builder())
+    });
+    Box::into_raw(Box::new(result.into()))
+}
+
+/// Starts a new transaction and creates a builder for an entity with `tempid`
+/// using the transaction to allow for programmatic assertion of values for that entity.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `entity_builder_destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn store_entity_builder_from_temp_id(store: *mut Store, temp_id: *const c_char) -> *mut ExternResult {
+    let store = &mut *store;
+    let temp_id = c_char_to_string(temp_id);
+    let result = store.begin_transaction().and_then(|in_progress| {
+        Ok(in_progress.builder().describe_tempid(&temp_id))
+    });
+    Box::into_raw(Box::new(result.into()))
+}
+
+/// Starts a new transaction and creates a builder for an entity with `entid`
+/// using the transaction to allow for programmatic assertion of values for that entity.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `entity_builder_destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn store_entity_builder_from_entid(store: *mut Store, entid: c_longlong) -> *mut ExternResult {
+    let store = &mut *store;
+    let result = store.begin_transaction().and_then(|in_progress| {
+        Ok(in_progress.builder().describe(&KnownEntid(entid)))
+    });
+    Box::into_raw(Box::new(result.into()))
+}
+
+/// Uses `builder` to assert `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/string`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_add_string<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>, entid: c_longlong, kw: *const c_char, value: *const c_char) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = c_char_to_string(value).into();
+    Box::into_raw(Box::new(builder.add_kw(KnownEntid(entid), &kw, value).into()))
+}
+
+/// Uses `builder` to assert `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/long`.
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_add_long<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>, entid: c_longlong, kw: *const c_char, value: c_longlong) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = TypedValue::Long(value);
+    Box::into_raw(Box::new(builder.add_kw(KnownEntid(entid), &kw, value).into()))
+}
+
+/// Uses `builder` to assert `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If `value` is not present as an Entid in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/ref`.
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_add_ref<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>, entid: c_longlong, kw: *const c_char, value: c_longlong) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = TypedValue::Ref(value);
+    Box::into_raw(Box::new(builder.add_kw(KnownEntid(entid), &kw, value).into()))
+}
+
+/// Uses `builder` to assert `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If `value` is not present as an attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/keyword`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_add_keyword<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>, entid: c_longlong, kw: *const c_char, value: *const c_char) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = kw_from_string(c_char_to_string(value)).into();
+    Box::into_raw(Box::new(builder.add_kw(KnownEntid(entid), &kw, value).into()))
+}
+
+/// Uses `builder` to assert `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/boolean`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_add_boolean<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>, entid: c_longlong, kw: *const c_char, value: bool) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = value.into();
+    Box::into_raw(Box::new(builder.add_kw(KnownEntid(entid), &kw, value).into()))
+}
+
+/// Uses `builder` to assert `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/double`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_add_double<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>, entid: c_longlong, kw: *const c_char, value: f64) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = value.into();
+    Box::into_raw(Box::new(builder.add_kw(KnownEntid(entid), &kw, value).into()))
+}
+
+/// Uses `builder` to assert `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/instant`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_add_timestamp<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>, entid: c_longlong, kw: *const c_char, value: c_longlong) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = TypedValue::instant(value);
+    Box::into_raw(Box::new(builder.add_kw(KnownEntid(entid), &kw, value).into()))
+}
+
+/// Uses `builder` to assert `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/uuid`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_add_uuid<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>, entid: c_longlong, kw: *const c_char, value: *mut [u8; 16]) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value = &*value;
+    let value = Uuid::from_bytes(value).expect("valid uuid");
+    let value: TypedValue = value.into();
+    Box::into_raw(Box::new(builder.add_kw(KnownEntid(entid), &kw, value).into()))
+}
+
+/// Uses `builder` to retract `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/string`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_retract_string<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>, entid: c_longlong, kw: *const c_char, value: *const c_char) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = c_char_to_string(value).into();
+    Box::into_raw(Box::new(builder.retract_kw(KnownEntid(entid), &kw, value).into()))
+}
+
+/// Uses `builder` to retract `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/long`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_retract_long<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>, entid: c_longlong, kw: *const c_char, value: c_longlong) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = TypedValue::Long(value);
+    Box::into_raw(Box::new(builder.retract_kw(KnownEntid(entid), &kw, value).into()))
+}
+
+/// Uses `builder` to retract `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/ref`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_retract_ref<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>, entid: c_longlong, kw: *const c_char, value: c_longlong) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = TypedValue::Ref(value);
+    Box::into_raw(Box::new(builder.retract_kw(KnownEntid(entid), &kw, value).into()))
+}
+
+
+/// Uses `builder` to retract `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/keyword`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_retract_keyword<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>, entid: c_longlong, kw: *const c_char, value: *const c_char) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = kw_from_string(c_char_to_string(value)).into();
+    Box::into_raw(Box::new(builder.retract_kw(KnownEntid(entid), &kw, value).into()))
+}
+
+/// Uses `builder` to retract `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/boolean`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_retract_boolean<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>, entid: c_longlong, kw: *const c_char, value: bool) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = value.into();
+    Box::into_raw(Box::new(builder.retract_kw(KnownEntid(entid), &kw, value).into()))
+}
+
+/// Uses `builder` to retract `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/double`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_retract_double<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>, entid: c_longlong, kw: *const c_char, value: f64) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = value.into();
+    Box::into_raw(Box::new(builder.retract_kw(KnownEntid(entid), &kw, value).into()))
+}
+
+/// Uses `builder` to retract `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/instant`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_retract_timestamp<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>, entid: c_longlong, kw: *const c_char, value: c_longlong) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = TypedValue::instant(value);
+    Box::into_raw(Box::new(builder.retract_kw(KnownEntid(entid), &kw, value).into()))
+}
+
+/// Uses `builder` to retract `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/uuid`.
+///
+// TODO don't panic if the UUID is not valid - return result instead.
+//
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_retract_uuid<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>, entid: c_longlong, kw: *const c_char, value: *mut [u8; 16]) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value = &*value;
+    let value = Uuid::from_bytes(value).expect("valid uuid");
+    let value: TypedValue = value.into();
+    Box::into_raw(Box::new(builder.retract_kw(KnownEntid(entid), &kw, value).into()))
+}
+
+/// Transacts and commits all the assertions and retractions that have been performed
+/// using this builder.
+///
+/// This consumes the builder and the enclosed [InProgress](mentat::InProgress) transaction.
+///
+/// Returns a [Result<()>(std::result::Result) as an [ExternResult](ExternResult).
+///
+// TODO: Document the errors that can result from transact
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_commit<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>) -> *mut ExternResult {
+    let builder = Box::from_raw(builder);
+    Box::into_raw(Box::new(builder.commit().into()))
+}
+
+/// Transacts all the assertions and retractions that have been performed
+/// using this builder.
+///
+/// This consumes the builder and returns the enclosed [InProgress](mentat::InProgress) transaction
+/// inside the [InProgressTransactResult](mentat::InProgressTransactResult) alongside the [TxReport](mentat::TxReport) generated
+/// by the transact.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// The destructors `in_progress_destroy` and `tx_report_destroy` arew provided for
+/// releasing the memory for these pointer types.
+///
+// TODO: Document the errors that can result from transact
+#[no_mangle]
+pub unsafe extern "C" fn in_progress_builder_transact<'a, 'c>(builder: *mut InProgressBuilder<'a, 'c>) -> *mut InProgressTransactResult<'a, 'c> {
+    let builder = Box::from_raw(builder);
+    let (in_progress, tx_report) = builder.transact();
+    let result = InProgressTransactResult { in_progress: Box::into_raw(Box::new(in_progress)), result: Box::into_raw(Box::new(tx_report.into())) };
+    Box::into_raw(Box::new(result))
+}
+
+/// Uses `builder` to assert `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/string`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_add_string<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>, kw: *const c_char, value: *const c_char) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = c_char_to_string(value).into();
+    Box::into_raw(Box::new(builder.add_kw(&kw, value).into()))
+}
+
+/// Uses `builder` to assert `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/long`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_add_long<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>, kw: *const c_char, value: c_longlong) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = TypedValue::Long(value);
+    Box::into_raw(Box::new(builder.add_kw(&kw, value).into()))
+}
+
+/// Uses `builder` to assert `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/ref`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_add_ref<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>, kw: *const c_char, value: c_longlong) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = TypedValue::Ref(value);
+    Box::into_raw(Box::new(builder.add_kw(&kw, value).into()))
+}
+
+/// Uses `builder` to assert `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/keyword`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_add_keyword<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>, kw: *const c_char, value: *const c_char) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = kw_from_string(c_char_to_string(value)).into();
+    Box::into_raw(Box::new(builder.add_kw(&kw, value).into()))
+}
+
+/// Uses `builder` to assert `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/boolean`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_add_boolean<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>, kw: *const c_char, value: bool) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = value.into();
+    Box::into_raw(Box::new(builder.add_kw(&kw, value).into()))
+}
+
+/// Uses `builder` to assert `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/double`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_add_double<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>, kw: *const c_char, value: f64) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = value.into();
+    Box::into_raw(Box::new(builder.add_kw(&kw, value).into()))
+}
+
+/// Uses `builder` to assert `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/instant`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_add_timestamp<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>, kw: *const c_char, value: c_longlong) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = TypedValue::instant(value);
+    Box::into_raw(Box::new(builder.add_kw(&kw, value).into()))
+}
+
+/// Uses `builder` to assert `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/uuid`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_add_uuid<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>, kw: *const c_char, value: *mut [u8; 16]) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value = &*value;
+    let value = Uuid::from_bytes(value).expect("valid uuid");
+    let value: TypedValue = value.into();
+    Box::into_raw(Box::new(builder.add_kw(&kw, value).into()))
+}
+
+/// Uses `builder` to retract `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/string`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_retract_string<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>, kw: *const c_char, value: *const c_char) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = c_char_to_string(value).into();
+    Box::into_raw(Box::new(builder.retract_kw(&kw, value).into()))
+}
+
+/// Uses `builder` to retract `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/long`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_retract_long<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>, kw: *const c_char, value: c_longlong) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = TypedValue::Long(value);
+    Box::into_raw(Box::new(builder.retract_kw(&kw, value).into()))
+}
+
+/// Uses `builder` to retract `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/ref`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_retract_ref<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>, kw: *const c_char, value: c_longlong) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = TypedValue::Ref(value);
+    Box::into_raw(Box::new(builder.retract_kw(&kw, value).into()))
+}
+
+/// Uses `builder` to retract `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/keyword`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_retract_keyword<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>, kw: *const c_char, value: *const c_char) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = kw_from_string(c_char_to_string(value)).into();
+    Box::into_raw(Box::new(builder.retract_kw(&kw, value).into()))
+}
+
+/// Uses `builder` to retract `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/boolean`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_retract_boolean<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>, kw: *const c_char, value: bool) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = value.into();
+    Box::into_raw(Box::new(builder.retract_kw(&kw, value).into()))
+}
+
+/// Uses `builder` to retract `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/double`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_retract_double<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>, kw: *const c_char, value: f64) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = value.into();
+    Box::into_raw(Box::new(builder.retract_kw(&kw, value).into()))
+}
+
+/// Uses `builder` to retract `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/instant`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_retract_timestamp<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>, kw: *const c_char, value: c_longlong) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value: TypedValue = TypedValue::instant(value);
+    Box::into_raw(Box::new(builder.retract_kw(&kw, value).into()))
+}
+
+/// Uses `builder` to retract `value` for `kw` on entity `entid`.
+///
+/// # Errors
+///
+/// If `entid` is not present in the store.
+/// If `kw` is not a valid attribute in the store.
+/// If the `:db/type` of the attribute described by `kw` is not `:db.type/uuid`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+// TODO don't panic if the UUID is not valid - return result instead.
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_retract_uuid<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>, kw: *const c_char, value: *mut [u8; 16]) -> *mut ExternResult {
+    let builder = &mut *builder;
+    let kw = kw_from_string(c_char_to_string(kw));
+    let value = &*value;
+    let value = Uuid::from_bytes(value).expect("valid uuid");
+    let value: TypedValue = value.into();
+    Box::into_raw(Box::new(builder.retract_kw(&kw, value).into()))
+}
+
+/// Transacts all the assertions and retractions that have been performed
+/// using this builder.
+///
+/// This consumes the builder and returns the enclosed [InProgress](mentat::InProgress) transaction
+/// inside the [InProgressTransactResult][::InProgressTransactResult] alongside the [TxReport](mentat::TxReport) generated
+/// by the transact.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// The destructors `in_progress_destroy` and `tx_report_destroy` are provided for
+/// releasing the memory for these pointer types.
+///
+/// TODO: Document the errors that can result from transact
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_transact<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>) -> *mut InProgressTransactResult<'a, 'c> {
+    let builder = Box::from_raw(builder);
+    let (in_progress, tx_report) = builder.transact();
+    let result = InProgressTransactResult { in_progress: Box::into_raw(Box::new(in_progress)), result: Box::into_raw(Box::new(tx_report.into())) };
+    Box::into_raw(Box::new(result))
+}
+
+/// Transacts and commits all the assertions and retractions that have been performed
+/// using this builder.
+///
+/// This consumes the builder and the enclosed [InProgress](mentat::InProgress) transaction.
+///
+/// Returns a [Result](std::result::Result) as an [ExternResult](::ExternResult).
+///
+/// TODO: Document the errors that can result from transact
+#[no_mangle]
+pub unsafe extern "C" fn entity_builder_commit<'a, 'c>(builder: *mut EntityBuilder<InProgressBuilder<'a, 'c>>) -> *mut ExternResult {
+    let builder = Box::from_raw(builder);
+    Box::into_raw(Box::new(builder.commit().into()))
+}
+
+/// Performs a single transaction against the store.
+///
+/// Returns a [TxReport](mentat::TxReport) as an [ExternResult](::ExternResult).
+/// TODO: Document the errors that can result from transact
+#[no_mangle]
+pub unsafe extern "C" fn store_transact(store: *mut Store, transaction: *const c_char) -> *mut ExternResult {
+    let store = &mut *store;
+    let transaction = c_char_to_string(transaction);
+    let result = store.begin_transaction().and_then(|mut in_progress| {
+        in_progress.transact(transaction).and_then(|tx_report| {
+            in_progress.commit()
+                       .map(|_| tx_report)
+        })
+    });
+    Box::into_raw(Box::new(result.into()))
+}
+
+/// Fetches the `tx_id` for the given [TxReport](mentat::TxReport)`.
+#[no_mangle]
+pub unsafe extern "C" fn tx_report_get_entid(tx_report: *mut TxReport) -> c_longlong {
+    let tx_report = &*tx_report;
+    tx_report.tx_id as c_longlong
+}
+
+/// Fetches the `tx_instant` for the given [TxReport](mentat::TxReport).
+#[no_mangle]
+pub unsafe extern "C" fn tx_report_get_tx_instant(tx_report: *mut TxReport) -> c_longlong {
+    let tx_report = &*tx_report;
+    tx_report.tx_instant.timestamp() as c_longlong
+}
+
+/// Fetches the [Entid](mentat::Entid) assigned to the `tempid` during the transaction represented
+/// by the given [TxReport](mentat::TxReport).
+#[no_mangle]
+pub unsafe extern "C" fn tx_report_entity_for_temp_id(tx_report: *mut TxReport, tempid: *const c_char) -> *mut c_longlong {
+    let tx_report = &*tx_report;
+    let key = c_char_to_string(tempid);
+    if let Some(entid) = tx_report.tempids.get(key) {
+        Box::into_raw(Box::new(entid.clone() as c_longlong))
+    } else {
+        std::ptr::null_mut()
+    }
+}
+
+/// Adds an attribute to the cache.
+/// `store_cache_attribute_forward` caches values for an attribute keyed by entity
+/// (i.e. find values and entities that have this attribute, or find values of attribute for an entity)
+#[no_mangle]
+pub extern "C" fn store_cache_attribute_forward(store: *mut Store, attribute: *const c_char) -> *mut ExternResult {
+    let store = unsafe { &mut *store };
+    let kw = kw_from_string(c_char_to_string(attribute));
+    Box::into_raw(Box::new(store.cache(&kw, CacheDirection::Forward).into()))
+}
+
+/// Adds an attribute to the cache.
+/// `store_cache_attribute_reverse` caches entities for an attribute keyed by value.
+/// (i.e. find entities that have a particular value for an attribute).
+#[no_mangle]
+pub extern "C" fn store_cache_attribute_reverse(store: *mut Store, attribute: *const c_char) -> *mut ExternResult {
+    let store = unsafe { &mut *store };
+    let kw = kw_from_string(c_char_to_string(attribute));
+    Box::into_raw(Box::new(store.cache(&kw, CacheDirection::Reverse).into()))
+}
+
+/// Adds an attribute to the cache.
+/// `store_cache_attribute_bi_directional` caches entity in both available directions, forward and reverse.
+///
+/// `Forward` caches values for an attribute keyed by entity
+/// (i.e. find values and entities that have this attribute, or find values of attribute for an entity)
+///
+/// `Reverse` caches entities for an attribute keyed by value.
+/// (i.e. find entities that have a particular value for an attribute).
+#[no_mangle]
+pub extern "C" fn store_cache_attribute_bi_directional(store: *mut Store, attribute: *const c_char) -> *mut ExternResult {
+    let store = unsafe { &mut *store };
+    let kw = kw_from_string(c_char_to_string(attribute));
+    Box::into_raw(Box::new(store.cache(&kw, CacheDirection::Both).into()))
+}
+
+/// Creates a [QueryBuilder](mentat::QueryBuilder) from the given store to execute the provided query.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `query_builder_destroy` is provided for releasing the memory for this
+/// pointer type.
+///
+/// TODO: Update QueryBuilder so it only takes a [Store](mentat::Store)  pointer on execution
+#[no_mangle]
+pub unsafe extern "C" fn store_query<'a>(store: *mut Store, query: *const c_char) -> *mut QueryBuilder<'a> {
+    let query = c_char_to_string(query);
+    let store = &mut *store;
+    let query_builder = QueryBuilder::new(store, query);
+    Box::into_raw(Box::new(query_builder))
+}
+
+/// Binds a [TypedValue::Long](mentat::TypedValue::Long) to a [Variable](mentat::Variable) with the given name.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn query_builder_bind_long(query_builder: *mut QueryBuilder, var: *const c_char, value: c_longlong) {
+    let var = c_char_to_string(var);
+    let query_builder = &mut *query_builder;
+   query_builder.bind_long(&var, value);
+}
+
+/// Binds a [TypedValue::Ref](mentat::TypedValue::Ref) to a [Variable](mentat::Variable) with the given name.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn query_builder_bind_ref(query_builder: *mut QueryBuilder, var: *const c_char, value: c_longlong) {
+    let var = c_char_to_string(var);
+    let query_builder = &mut *query_builder;
+    query_builder.bind_ref(&var, value);
+}
+
+/// Binds a [TypedValue::Ref](mentat::TypedValue::Ref) to a [Variable](mentat::Variable) with the given name. Takes a keyword as a c string in the format
+/// `:namespace/name` and converts it into an [NamespacedKeyworf](mentat::NamespacedKeyword).
+///
+/// # Panics
+///
+/// If the provided keyword does not map to a valid keyword in the schema.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn query_builder_bind_ref_kw(query_builder: *mut QueryBuilder, var: *const c_char, value: *const c_char) {
+    let var = c_char_to_string(var);
+    let kw = kw_from_string(c_char_to_string(value));
+    let query_builder = &mut *query_builder;
+    if let Some(err) = query_builder.bind_ref_from_kw(&var, kw).err() {
+        panic!(err);
+    }
+}
+
+/// Binds a [TypedValue::Ref](mentat::TypedValue::Ref) to a [Variable](mentat::Variable) with the given name. Takes a keyword as a c string in the format
+/// `:namespace/name` and converts it into an [NamespacedKeyworf](mentat::NamespacedKeyword).
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn query_builder_bind_kw(query_builder: *mut QueryBuilder, var: *const c_char, value: *const c_char) {
+    let var = c_char_to_string(var);
+    let query_builder = &mut *query_builder;
+    let kw = kw_from_string(c_char_to_string(value));
+    query_builder.bind_value(&var, kw);
+}
+
+/// Binds a [TypedValue::Boolean](mentat::TypedValue::Boolean) to a [Variable](mentat::Variable) with the given name.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn query_builder_bind_boolean(query_builder: *mut QueryBuilder, var: *const c_char, value: bool) {
+    let var = c_char_to_string(var);
+    let query_builder = &mut *query_builder;
+    query_builder.bind_value(&var, value);
+}
+
+/// Binds a [TypedValue::Double](mentat::TypedValue::Double) to a [Variable](mentat::Variable) with the given name.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn query_builder_bind_double(query_builder: *mut QueryBuilder, var: *const c_char, value: f64) {
+    let var = c_char_to_string(var);
+    let query_builder = &mut *query_builder;
+    query_builder.bind_value(&var, value);
+}
+
+/// Binds a [TypedValue::Instant](mentat::TypedValue::Instant) to a [Variable](mentat::Variable) with the given name.
+/// Takes a timestamp in microseconds.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn query_builder_bind_timestamp(query_builder: *mut QueryBuilder, var: *const c_char, value: c_longlong) {
+    let var = c_char_to_string(var);
+    let query_builder = &mut *query_builder;
+    query_builder.bind_instant(&var, value);
+}
+
+/// Binds a [TypedValue::String](mentat::TypedValue::String) to a [Variable](mentat::Variable) with the given name.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn query_builder_bind_string(query_builder: *mut QueryBuilder, var: *const c_char, value: *const c_char) {
+    let var = c_char_to_string(var);
+    let value = c_char_to_string(value);
+    let query_builder = &mut *query_builder;
+    query_builder.bind_value(&var, value);
+}
+
+/// Binds a [TypedValue::Uuid](mentat::TypedValue::Uuid) to a [Variable](mentat::Variable) with the given name.
+/// Takes a `UUID` as a byte slice of length 16. This maps directly to the `uuid_t` C type.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn query_builder_bind_uuid(query_builder: *mut QueryBuilder, var: *const c_char, value: *mut [u8; 16]) {
+    let var = c_char_to_string(var);
+    let value = &*value;
+    let value = Uuid::from_bytes(value).expect("valid uuid");
+    let query_builder = &mut *query_builder;
+    query_builder.bind_value(&var, value);
+}
+
+/// Executes a query and returns the results as a [Scalar](mentat::QueryResults::Scalar).
+///
+/// # Panics
+///
+/// If the find set of the query executed is not structured `[:find ?foo . :where ...]`.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn query_builder_execute_scalar(query_builder: *mut QueryBuilder) -> *mut ExternResult {
+    let query_builder = &mut *query_builder;
+    let results = query_builder.execute_scalar();
+    let extern_result = match results {
+        Ok(Some(v)) => ExternResult { err: std::ptr::null(), ok: Box::into_raw(Box::new(v)) as *const _ as *const c_void, },
+        Ok(None) => ExternResult { err: std::ptr::null(), ok: std::ptr::null(), },
+        Err(e) => ExternResult { err: string_to_c_char(e.to_string()), ok: std::ptr::null(), }
+    };
+    Box::into_raw(Box::new(extern_result))
+}
+
+/// Executes a query and returns the results as a [Coll](mentat::QueryResults::Coll).
+///
+/// # Panics
+///
+/// If the find set of the query executed is not structured `[:find [?foo ...] :where ...]`.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn query_builder_execute_coll(query_builder: *mut QueryBuilder) -> *mut ExternResult {
+    let query_builder = &mut *query_builder;
+    let results = query_builder.execute_coll();
+    Box::into_raw(Box::new(results.into()))
+}
+
+/// Executes a query and returns the results as a [Tuple](mentat::QueryResults::Tuple).
+///
+/// # Panics
+///
+/// If the find set of the query executed is not structured `[:find [?foo ?bar] :where ...]`.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn query_builder_execute_tuple(query_builder: *mut QueryBuilder) -> *mut ExternResult {
+    let query_builder = &mut *query_builder;
+    let results = query_builder.execute_tuple();
+    let extern_result = match results {
+        Ok(Some(v)) => ExternResult { err: std::ptr::null(), ok: Box::into_raw(Box::new(v)) as *const _ as *const c_void, },
+        Ok(None) => ExternResult { err: std::ptr::null(), ok: std::ptr::null(), },
+        Err(e) => ExternResult { err: string_to_c_char(e.to_string()), ok: std::ptr::null(), }
+    };
+    Box::into_raw(Box::new(extern_result))
+}
+
+/// Executes a query and returns the results as a [Rel](mentat::QueryResults::Rel).
+///
+/// # Panics
+///
+/// If the find set of the query executed is not structured `[:find ?foo ?bar :where ...]`.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn query_builder_execute(query_builder: *mut QueryBuilder) -> *mut ExternResult {
+    let query_builder = &mut *query_builder;
+    let results = query_builder.execute_rel();
+    Box::into_raw(Box::new(results.into()))
+}
+
+fn unwrap_conversion<T>(value: Option<T>, expected_type: ValueType) -> T {
+    match value {
+        Some(v) => v,
+        None => panic!("Typed value cannot be coerced into a {}", expected_type)
+    }
+}
+
+/// Consumes a [Binding](mentat::Binding) and returns the value as a C `long`.
+///
+/// # Panics
+///
+/// If the [ValueType](mentat::ValueType) of the [Binding](mentat::Binding) is not [ValueType::Long](mentat::ValueType::Long).
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn typed_value_into_long(typed_value: *mut Binding) -> c_longlong {
+    let typed_value = Box::from_raw(typed_value);
+    unwrap_conversion(typed_value.into_long(), ValueType::Long)
+}
+
+/// Consumes a [Binding](mentat::Binding) and returns the value as an [Entid](mentat::Entid).
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+///
+/// # Panics
+///
+/// If the [ValueType](mentat::ValueType) of the [Binding](mentat::Binding) is not [ValueType::Ref](mentat::ValueType::Ref).
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn typed_value_into_entid(typed_value: *mut Binding) -> Entid {
+    let typed_value = Box::from_raw(typed_value);
+    println!("typed value as entid {:?}", typed_value);
+    unwrap_conversion(typed_value.into_entid(), ValueType::Ref)
+}
+
+/// Consumes a [Binding](mentat::Binding) and returns the value as an keyword C `String`.
+///
+/// # Panics
+///
+/// If the [ValueType](mentat::ValueType) of the [Binding](mentat::Binding) is not [ValueType::Ref](mentat::ValueType::Ref).
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn typed_value_into_kw(typed_value: *mut Binding) -> *const c_char {
+    let typed_value = Box::from_raw(typed_value);
+    unwrap_conversion(typed_value.into_kw_c_string(), ValueType::Keyword) as *const c_char
+}
+
+/// Consumes a [Binding](mentat::Binding) and returns the value as a boolean represented as an `i32`.
+/// If the value of the boolean is `true` the value returned is 1.
+/// If the value of the boolean is `false` the value returned is 0.
+///
+/// # Panics
+///
+/// If the [ValueType](mentat::ValueType) of the [Binding](mentat::Binding) is not [ValueType::Long](mentat::ValueType::Boolean).
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn typed_value_into_boolean(typed_value: *mut Binding) -> i32 {
+    let typed_value = Box::from_raw(typed_value);
+    if unwrap_conversion(typed_value.into_boolean(), ValueType::Boolean) { 1 } else { 0 }
+}
+
+/// Consumes a [Binding](mentat::Binding) and returns the value as a `f64`.
+///
+/// # Panics
+///
+/// If the [ValueType](mentat::ValueType) of the [Binding](mentat::Binding) is not [ValueType::Long](mentat::ValueType::Double).
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn typed_value_into_double(typed_value: *mut Binding) -> f64 {
+    let typed_value = Box::from_raw(typed_value);
+    unwrap_conversion(typed_value.into_double(), ValueType::Double)
+}
+
+/// Consumes a [Binding](mentat::Binding) and returns the value as a microsecond timestamp.
+///
+/// # Panics
+///
+/// If the [ValueType](mentat::ValueType) of the [Binding](mentat::Binding) is not [ValueType::Long](mentat::ValueType::Instant).
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn typed_value_into_timestamp(typed_value: *mut Binding) -> c_longlong {
+    let typed_value = Box::from_raw(typed_value);
+    unwrap_conversion(typed_value.into_timestamp(), ValueType::Instant)
+}
+
+/// Consumes a [Binding](mentat::Binding) and returns the value as a C `String`.
+///
+/// # Panics
+///
+/// If the [ValueType](mentat::ValueType) of the [Binding](mentat::Binding) is not [ValueType::Long](mentat::ValueType::String).
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn typed_value_into_string(typed_value: *mut Binding) -> *const c_char {
+    let typed_value = Box::from_raw(typed_value);
+    unwrap_conversion(typed_value.into_c_string(), ValueType::String) as *const c_char
+}
+
+/// Consumes a [Binding](mentat::Binding) and returns the value as a UUID byte slice of length 16.
+///
+/// # Panics
+///
+/// If the [ValueType](mentat::ValueType) of the [Binding](mentat::Binding) is not [ValueType::Long](mentat::ValueType::Uuid).
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn typed_value_into_uuid(typed_value: *mut Binding) -> *mut [u8; 16] {
+    let typed_value = Box::from_raw(typed_value);
+    let value = unwrap_conversion(typed_value.into_uuid(), ValueType::Uuid);
+    Box::into_raw(Box::new(*value.as_bytes()))
+}
+
+/// Returns the [ValueType](mentat::ValueType) of this [Binding](mentat::Binding).
+#[no_mangle]
+pub unsafe extern "C" fn typed_value_value_type(typed_value: *mut Binding) -> ValueType {
+    let typed_value = &*typed_value;
+    typed_value.value_type().unwrap_or_else(|| panic!("Binding is not Scalar and has no ValueType"))
+}
+
+/// Returns the value at the provided `index` as a `Vec<ValueType>`.
+/// If there is no value present at the `index`, a null pointer is returned.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `typed_value_result_set_destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn row_at_index(rows: *mut RelResult<Binding>, index: c_int) -> *mut Vec<Binding> {
+    let result = &*rows;
+    result.row(index as usize).map_or_else(std::ptr::null_mut, |v| Box::into_raw(Box::new(v.to_vec())))
+}
+
+/// Consumes the `RelResult<Binding>` and returns an iterator over the values.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `typed_value_result_set_iter_destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn typed_value_result_set_into_iter(rows: *mut RelResult<Binding>) -> *mut BindingListIterator {
+    let result = &*rows;
+    let rows = result.rows();
+    Box::into_raw(Box::new(rows))
+}
+
+/// Returns the next value in the `iter` as a `Vec<ValueType>`.
+/// If there is no value next value, a null pointer is returned.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `typed_value_list_destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn typed_value_result_set_iter_next(iter: *mut BindingListIterator) -> *mut Vec<Binding> {
+    let iter = &mut *iter;
+    iter.next().map_or(std::ptr::null_mut(), |v| Box::into_raw(Box::new(v.to_vec())))
+}
+
+/// Consumes the `Vec<Binding>` and returns an iterator over the values.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `typed_value_list_iter_destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn typed_value_list_into_iter(values: *mut Vec<Binding>) -> *mut BindingIterator {
+    let result = Box::from_raw(values);
+    Box::into_raw(Box::new(result.into_iter()))
+}
+
+/// Returns the next value in the `iter` as a [Binding](mentat::Binding).
+/// If there is no value next value, a null pointer is returned.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `typed_value_destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn typed_value_list_iter_next(iter: *mut BindingIterator) -> *mut Binding {
+    let iter = &mut *iter;
+    iter.next().map_or(std::ptr::null_mut(), |v| Box::into_raw(Box::new(v)))
+}
+
+/// Returns the value at the provided `index` as a [Binding](mentat::Binding).
+/// If there is no value present at the `index`, a null pointer is returned.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `typed_value_destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn value_at_index(values: *mut Vec<Binding>, index: c_int) -> *const Binding {
+    let result = &*values;
+    result.get(index as usize).expect("No value at index") as *const Binding
+}
+
+/// Returns the value of the [Binding](mentat::Binding) at `index` as a `long`.
+///
+/// # Panics
+///
+/// If the [ValueType](mentat::ValueType) of the [Binding](mentat::Binding) is not `ValueType::Long`.
+/// If there is no value at `index`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn value_at_index_into_long(values: *mut Vec<Binding>, index: c_int) -> c_longlong {
+    let result = &*values;
+    let value = result.get(index as usize).expect("No value at index");
+    unwrap_conversion(value.clone().into_long(), ValueType::Long)
+}
+
+/// Returns the value of the [Binding](mentat::Binding) at `index` as an [Entid](mentat::Entid).
+///
+/// # Panics
+///
+/// If the [ValueType](mentat::ValueType) of the [Binding](mentat::Binding) is not `ValueType::Ref`.
+/// If there is no value at `index`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn value_at_index_into_entid(values: *mut Vec<Binding>, index: c_int) -> Entid {
+    let result = &*values;
+    let value = result.get(index as usize).expect("No value at index");
+    unwrap_conversion(value.clone().into_entid(), ValueType::Ref)
+}
+
+/// Returns the value of the [Binding](mentat::Binding) at `index` as a keyword C `String`.
+///
+/// # Panics
+///
+/// If the [ValueType](mentat::ValueType) of the [Binding](mentat::Binding) is not [ValueType::Ref](mentat::ValueType::Ref).
+/// If there is no value at `index`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn value_at_index_into_kw(values: *mut Vec<Binding>, index: c_int) -> *const c_char {
+    let result = &*values;
+    let value = result.get(index as usize).expect("No value at index");
+    unwrap_conversion(value.clone().into_kw_c_string(), ValueType::Keyword) as *const c_char
+}
+
+/// Returns the value of the [Binding](mentat::Binding) at `index` as a boolean represented by a `i32`.
+/// If the value of the `boolean` is `true` then the value returned is 1.
+/// If the value of the `boolean` is `false` then the value returned is 0.
+///
+/// # Panics
+///
+/// If the [ValueType](mentat::ValueType) of the [Binding](mentat::Binding) is not [ValueType::Long](mentat::ValueType::Long).
+/// If there is no value at `index`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn value_at_index_into_boolean(values: *mut Vec<Binding>, index: c_int) -> i32 {
+    let result = &*values;
+    let value = result.get(index as usize).expect("No value at index");
+    if unwrap_conversion(value.clone().into_boolean(), ValueType::Boolean) { 1 } else { 0 }
+}
+
+/// Returns the value of the [Binding](mentat::Binding) at `index` as an `f64`.
+///
+/// # Panics
+///
+/// If the [ValueType](mentat::ValueType) of the [Binding](mentat::Binding) is not [ValueType::Double](mentat::ValueType::Double).
+/// If there is no value at `index`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn value_at_index_into_double(values: *mut Vec<Binding>, index: c_int) -> f64 {
+    let result = &*values;
+    let value = result.get(index as usize).expect("No value at index");
+    unwrap_conversion(value.clone().into_double(), ValueType::Double)
+}
+
+/// Returns the value of the [Binding](mentat::Binding) at `index` as a microsecond timestamp.
+///
+/// # Panics
+///
+/// If the [ValueType](mentat::ValueType) of the [Binding](mentat::Binding) is not [ValueType::Instant](mentat::ValueType::Instant).
+/// If there is no value at `index`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn value_at_index_into_timestamp(values: *mut Vec<Binding>, index: c_int) -> c_longlong {
+    let result = &*values;
+    let value = result.get(index as usize).expect("No value at index");
+    unwrap_conversion(value.clone().into_timestamp(), ValueType::Instant)
+}
+
+/// Returns the value of the [Binding](mentat::Binding) at `index` as a C `String`.
+///
+/// # Panics
+///
+/// If the [ValueType](mentat::ValueType) of the [Binding](mentat::Binding) is not [ValueType::String](mentat::ValueType::String).
+/// If there is no value at `index`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn value_at_index_into_string(values: *mut Vec<Binding>, index: c_int) -> *const c_char {
+    let result = &*values;
+    let value = result.get(index as usize).expect("No value at index");
+    unwrap_conversion(value.clone().into_c_string(), ValueType::String) as *const c_char
+}
+
+/// Returns the value of the [Binding](mentat::Binding) at `index` as a UUID byte slice of length 16.
+///
+/// # Panics
+///
+/// If the [ValueType](mentat::ValueType) of the [Binding](mentat::Binding) is not [ValueType::Uuid](mentat::ValueType::Uuid).
+/// If there is no value at `index`.
+///
+// TODO Generalise with macro https://github.com/mozilla/mentat/issues/703
+#[no_mangle]
+pub unsafe extern "C" fn value_at_index_into_uuid(values: *mut Vec<Binding>, index: c_int) -> *mut [u8; 16] {
+    let result = &*values;
+    let value = result.get(index as usize).expect("No value at index");
+    let uuid = unwrap_conversion(value.clone().into_uuid(), ValueType::Uuid);
+    Box::into_raw(Box::new(*uuid.as_bytes()))
+}
+
+/// Returns an [ExternResult](ExternResult) containing the [Binding](mentat::Binding) associated with the `attribute` as `:namespace/name`
+/// for the given `entid`.
+/// If there is a value for that `attribute` on the entity with id `entid` then the value is returned in `ok`.
+/// If there no value for that `attribute` on the entity with id `entid` but the attribute is value,
+/// then a null pointer is returned in `ok`.
+/// If there is no [Attribute](mentat::Attribute) in the [Schema](mentat::Schema) for the given `attribute` then an error is returned in `err`.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `destroy` is provided for releasing the memory for this
+/// pointer type.
+///
+/// TODO: list the types of error that can be caused by this function
+#[no_mangle]
+pub unsafe extern "C" fn store_value_for_attribute(store: *mut Store, entid: c_longlong, attribute: *const c_char) -> *mut ExternResult {
+    let store = &*store;
+    let kw = kw_from_string(c_char_to_string(attribute));
+    let value = match store.lookup_value_for_attribute(entid, &kw) {
+        Ok(Some(v)) => {
+            let value: Binding = v.into();
+            ExternResult { ok: Box::into_raw(Box::new(value)) as *const _ as *const c_void, err: std::ptr::null() }
+        },
+        Ok(None) => ExternResult { ok: std::ptr::null(), err: std::ptr::null() },
+        Err(e) => ExternResult { ok: std::ptr::null(), err: string_to_c_char(e.to_string()) },
+    };
+    Box::into_raw(Box::new(value))
+}
+
+/// Registers a [TxObserver](mentat::TxObserver) with the `key` to observe changes to `attributes`
+/// on this `store`.
+/// Calls `callback` is a relevant transaction occurs.
+///
+/// # Panics
+///
+/// If there is no [Attribute](mentat::Attribute)  in the [Schema](mentat::Schema)  for a given `attribute`.
+///
+#[no_mangle]
+pub unsafe extern "C" fn store_register_observer(store: *mut Store,
+                                                   key: *const c_char,
+                                            attributes: *const Entid,
+                                        attributes_len: usize,
+                                              callback: extern fn(key: *const c_char, reports: &TxChangeList)) {
+    let store = &mut *store;
+    let mut attribute_set = BTreeSet::new();
+    let slice = slice::from_raw_parts(attributes, attributes_len);
+    attribute_set.extend(slice.iter());
+    let key = c_char_to_string(key);
+    let tx_observer = Arc::new(TxObserver::new(attribute_set, move |obs_key, batch| {
+        let extern_reports: Vec<TransactionChange> = batch.into_iter().map(|(tx_id, changes)| {
+            let changes: Vec<Entid> = changes.into_iter().map(|i|*i).collect();
+            let len = changes.len();
+            TransactionChange {
+                txid: *tx_id,
+                changes: changes.into_boxed_slice(),
+                changes_len: len,
+            }
+        }).collect();
+        let len = extern_reports.len();
+        let reports = TxChangeList {
+            reports: extern_reports.into_boxed_slice(),
+            len: len,
+        };
+        callback(string_to_c_char(obs_key), &reports);
+    }));
+    store.register_observer(key.to_string(), tx_observer);
+}
+
+/// Unregisters a [TxObserver](mentat::TxObserver)  with the `key` to observe changes on this `store`.
+#[no_mangle]
+pub unsafe extern "C" fn store_unregister_observer(store: *mut Store, key: *const c_char) {
+    let store = &mut *store;
+    let key = c_char_to_string(key).to_string();
+    store.unregister_observer(&key);
+}
+
+/// Returns the [Entid](mentat::Entid)  associated with the `attr` as `:namespace/name`.
+///
+/// # Panics
+///
+/// If there is no [Attribute](mentat::Attribute)  in the [Schema](mentat::Schema)  for `attr`.
+#[no_mangle]
+pub unsafe extern "C" fn store_entid_for_attribute(store: *mut Store, attr: *const c_char) -> Entid {
+    let store = &mut *store;
+    let keyword_string = c_char_to_string(attr);
+    let kw = kw_from_string(keyword_string);
+    let conn = store.conn();
+    let current_schema = conn.current_schema();
+    current_schema.get_entid(&kw).expect("Unable to find entid for invalid attribute").into()
+}
+
+/// Returns the value at the provided `index` as a [TransactionChange](TransactionChange) .
+///
+/// # Panics
+///
+/// If there is no value present at the `index`.
+///
+/// # Safety
+///
+/// Callers are responsible for managing the memory for the return value.
+/// A destructor `typed_value_destroy` is provided for releasing the memory for this
+/// pointer type.
+#[no_mangle]
+pub unsafe extern "C" fn tx_change_list_entry_at(tx_report_list: *mut TxChangeList, index: c_int) -> *const TransactionChange {
+    let tx_report_list = &*tx_report_list;
+    let index = index as usize;
+    let report = Box::new(tx_report_list.reports[index].clone());
+    Box::into_raw(report)
+}
+
+/// Returns the value at the provided `index` as a [Entid](mentat::Entid) .
+///
+/// # Panics
+///
+/// If there is no value present at the `index`.
+#[no_mangle]
+pub unsafe extern "C" fn changelist_entry_at(tx_report: *mut TransactionChange, index: c_int) -> Entid {
+    let tx_report = &*tx_report;
+    let index = index as usize;
+    tx_report.changes[index].clone()
+}
+
+/// Creates a function with a given `$name` that releases the memory for a type `$t`.
+macro_rules! define_destructor (
+    ($name:ident, $t:ty) => (
+        #[no_mangle]
+        pub unsafe extern "C" fn $name(obj: *mut $t) {
+            let _ = Box::from_raw(obj);
+        }
+    )
+);
+
+/// Creates a function with a given `$name` that releases the memory
+/// for a type `$t` with lifetimes <'a, 'c>.
+/// TODO: Move to using `macro_rules` lifetime specifier when it lands in stable
+/// This will enable us to specialise `define_destructor` and use repetitions
+/// to allow more generic lifetime handling instead of having two functions.
+/// https://github.com/rust-lang/rust/issues/34303
+/// https://github.com/mozilla/mentat/issues/702
+macro_rules! define_destructor_with_lifetimes (
+    ($name:ident, $t:ty) => (
+        #[no_mangle]
+        pub unsafe extern "C" fn $name<'a, 'c>(obj: *mut $t) {
+            let _ = Box::from_raw(obj);
+        }
+    )
+);
+
+/// destroy function for releasing the memory for `repr(C)` structs.
+define_destructor!(destroy, c_void);
+
+/// Destructor for releasing the memory of [InProgressBuilder](mentat::InProgressBuilder).
+define_destructor_with_lifetimes!(in_progress_builder_destroy, InProgressBuilder<'a, 'c>);
+
+/// Destructor for releasing the memory of [EntityBuilder](mentat::EntityBuilder).
+define_destructor_with_lifetimes!(entity_builder_destroy, EntityBuilder<InProgressBuilder<'a, 'c>>);
+
+/// Destructor for releasing the memory of [QueryBuilder](mentat::QueryBuilder) .
+define_destructor!(query_builder_destroy, QueryBuilder);
+
+/// Destructor for releasing the memory of [Store](mentat::Store) .
+define_destructor!(store_destroy, Store);
+
+/// Destructor for releasing the memory of [TxReport](mentat::TxReport) .
+define_destructor!(tx_report_destroy, TxReport);
+
+/// Destructor for releasing the memory of [Binding](mentat::Binding).
+define_destructor!(typed_value_destroy, Binding);
+
+/// Destructor for releasing the memory of [Vec<Binding>][mentat::Binding].
+define_destructor!(typed_value_list_destroy, Vec<Binding>);
+
+/// Destructor for releasing the memory of [BindingIterator](BindingIterator) .
+define_destructor!(typed_value_list_iter_destroy, BindingIterator);
+
+/// Destructor for releasing the memory of [RelResult<Binding>](mentat::RelResult).
+define_destructor!(typed_value_result_set_destroy, RelResult<Binding>);
+
+/// Destructor for releasing the memory of [BindingListIterator](::BindingListIterator).
+define_destructor!(typed_value_result_set_iter_destroy, BindingListIterator);
+
+/// Destructor for releasing the memory of [InProgress](mentat::InProgress).
+define_destructor!(in_progress_destroy, InProgress);
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_ffi/utils.rs.html b/docs/apis/rust/0.7.0/src/mentat_ffi/utils.rs.html new file mode 100644 index 00000000..14906820 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_ffi/utils.rs.html @@ -0,0 +1,250 @@ + + + + + + + + + + utils.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+pub mod strings {
+    use std::ffi::{
+        CString,
+        CStr
+    };
+    use std::os::raw::c_char;
+
+    use mentat::{
+        Keyword,
+    };
+
+    pub fn c_char_to_string(cchar: *const c_char) -> &'static str {
+        let c_str = unsafe { CStr::from_ptr(cchar) };
+        c_str.to_str().unwrap_or("")
+    }
+
+    pub fn string_to_c_char<T>(r_string: T) -> *mut c_char where T: Into<String> {
+        CString::new(r_string.into()).unwrap().into_raw()
+    }
+
+    pub fn kw_from_string(keyword_string: &'static str) -> Keyword {
+        // TODO: validate. The input might not be a keyword!
+        let attr_name = keyword_string.trim_left_matches(":");
+        let parts: Vec<&str> = attr_name.split("/").collect();
+        Keyword::namespaced(parts[0], parts[1])
+    }
+}
+
+pub mod log {
+    #[cfg(all(target_os="android", not(test)))]
+    use std::ffi::CString;
+
+    #[cfg(all(target_os="android", not(test)))]
+    use android;
+
+    // TODO far from ideal. And, we might actually want to println in tests.
+    #[cfg(all(not(target_os="android"), not(target_os="ios")))]
+    pub fn d(_: &str) {}
+
+    #[cfg(all(target_os="ios", not(test)))]
+    pub fn d(message: &str) {
+        eprintln!("{}", message);
+    }
+
+    #[cfg(all(target_os="android", not(test)))]
+    pub fn d(message: &str) {
+        let message = CString::new(message).unwrap();
+        let message = message.as_ptr();
+        let tag = CString::new("Mentat").unwrap();
+        let tag = tag.as_ptr();
+        unsafe { android::__android_log_write(android::LogLevel::Debug as i32, tag, message) };
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_parser_utils/lib.rs.html b/docs/apis/rust/0.7.0/src/mentat_parser_utils/lib.rs.html new file mode 100644 index 00000000..5a0ad302 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_parser_utils/lib.rs.html @@ -0,0 +1,268 @@ + + + + + + + + + + lib.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+extern crate combine;
+extern crate edn;
+extern crate itertools;
+
+/// A `ValueParseError` is a `combine::primitives::ParseError`-alike that implements the `Debug`,
+/// `Display`, and `std::error::Error` traits.  In addition, it doesn't capture references.
+///
+/// This is achieved by wrapping slices of type `&'a [edn::Value]` in an owning type that implements
+/// `Display`; rather than introducing a newtype like `DisplayVec`, we re-use `edn::Value::Vector`.
+#[derive(PartialEq)]
+pub struct ValueParseError {
+    pub position: edn::Span,
+    // Think of this as `Vec<Error<edn::Value, DisplayVec<edn::Value>>>`; see above.
+    pub errors: Vec<combine::primitives::Error<edn::ValueAndSpan, edn::ValueAndSpan>>,
+}
+
+#[macro_use]
+pub mod macros;
+
+pub use macros::{
+    KeywordMapParser,
+    ResultParser,
+};
+
+pub mod log;
+pub mod value_and_span;
+pub use value_and_span::{
+    Stream,
+};
+
+impl std::fmt::Debug for ValueParseError {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        write!(f,
+               "ParseError {{ position: {:?}, errors: {:?} }}",
+               self.position,
+               self.errors)
+    }
+}
+
+impl std::fmt::Display for ValueParseError {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        try!(writeln!(f, "Parse error at {:?}", self.position));
+        combine::primitives::Error::fmt_errors(&self.errors, f)
+    }
+}
+
+impl std::error::Error for ValueParseError {
+    fn description(&self) -> &str {
+        "parse error parsing EDN values"
+    }
+}
+
+impl<'a> From<combine::primitives::ParseError<Stream<'a>>> for ValueParseError {
+    fn from(e: combine::primitives::ParseError<Stream<'a>>) -> ValueParseError {
+        ValueParseError {
+            position: e.position.0,
+            errors: e.errors.into_iter()
+                .map(|e| e.map_token(|t| t.clone()).map_range(|r| r.clone()))
+                .collect(),
+        }
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_parser_utils/log.rs.html b/docs/apis/rust/0.7.0/src/mentat_parser_utils/log.rs.html new file mode 100644 index 00000000..85dae9eb --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_parser_utils/log.rs.html @@ -0,0 +1,266 @@ + + + + + + + + + + log.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use combine::{
+    ParseError,
+    Parser,
+    ParseResult,
+    Stream,
+};
+
+#[derive(Clone)]
+pub(crate) struct Log<P, T>(P, T)
+    where P: Parser,
+          T: ::std::fmt::Debug;
+
+impl<I, P, T> Parser for Log<P, T>
+    where I: Stream,
+          I::Item: ::std::fmt::Debug,
+          P: Parser<Input = I>,
+          P::Output: ::std::fmt::Debug,
+          T: ::std::fmt::Debug,
+{
+    type Input = I;
+    type Output = P::Output;
+
+    fn parse_stream(&mut self, input: I) -> ParseResult<Self::Output, I> {
+        let head = input.clone().uncons();
+        let result = self.0.parse_stream(input.clone());
+        match result {
+            Ok((ref value, _)) => eprintln!("{:?}: [{:?} ...] => Ok({:?})", self.1, head.ok(), value),
+            Err(_) => eprintln!("{:?}: [{:?} ...] => Err(_)", self.1, head.ok()),
+        }
+        result
+    }
+
+    fn add_error(&mut self, errors: &mut ParseError<Self::Input>) {
+        self.0.add_error(errors);
+    }
+}
+
+#[inline(always)]
+pub(crate) fn log<P, T>(p: P, msg: T) -> Log<P, T>
+    where P: Parser,
+          T: ::std::fmt::Debug,
+{
+    Log(p, msg)
+}
+
+/// We need a trait to define `Parser.log` and have it live outside of the `combine` crate.
+pub(crate) trait LogParsing: Parser + Sized {
+    fn log<T>(self, msg: T) -> Log<Self, T>
+        where Self: Sized,
+              T: ::std::fmt::Debug;
+}
+
+impl<P> LogParsing for P
+    where P: Parser,
+{
+    fn log<T>(self, msg: T) -> Log<Self, T>
+        where T: ::std::fmt::Debug,
+    {
+        log(self, msg)
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_parser_utils/macros.rs.html b/docs/apis/rust/0.7.0/src/mentat_parser_utils/macros.rs.html new file mode 100644 index 00000000..2c24b995 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_parser_utils/macros.rs.html @@ -0,0 +1,398 @@ + + + + + + + + + + macros.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+// use combine::{
+//     ParseResult,
+// };
+// use combine::combinator::{
+//     Expected,
+//     FnParser,
+// };
+
+use combine::{
+    ParseResult,
+};
+// use combine::primitives; // To not shadow Error.
+// use combine::primitives::{
+//     Consumed,
+//     FastResult,
+// };
+use combine::combinator::{
+    Expected,
+    FnParser,
+};
+
+/// A type definition for a function parser that either parses an `O` from an input stream of type
+/// `I`, or fails with an "expected" failure.
+/// See <https://docs.rs/combine/2.2.1/combine/trait.Parser.html#method.expected> for more
+/// illumination.
+/// Nothing about this is specific to the result type of the parser.
+pub type ResultParser<O, I> = Expected<FnParser<I, fn(I) -> ParseResult<O, I>>>;
+
+pub struct KeywordMapParser<T>(pub T);
+
+/// `satisfy_unwrap!` makes it a little easier to implement a `satisfy_map`
+/// body that matches a particular `Value` enum case, otherwise returning `None`.
+#[macro_export]
+macro_rules! satisfy_unwrap {
+    ( $cas: path, $var: ident, $body: block ) => {
+        satisfy_map(|x: edn::Value| if let $cas($var) = x $body else { None })
+    }
+}
+
+/// Generate a `satisfy_map` expression that matches a `PlainSymbol`
+/// value with the given name.
+///
+/// We do this rather than using `combine::token` so that we don't
+/// need to allocate a new `String` inside a `PlainSymbol` inside a `Value`
+/// just to match input.
+#[macro_export]
+macro_rules! matches_plain_symbol {
+    ($name: expr, $input: ident) => {
+        satisfy_map(|x: edn::Value| {
+            if let edn::Value::PlainSymbol(ref s) = x {
+                if s.name() == $name {
+                    return Some(());
+                }
+            }
+            return None;
+        }).parse_stream($input)
+    }
+}
+
+#[macro_export]
+macro_rules! def_parser {
+    ( $parser: ident, $name: ident, $result_type: ty, $body: block ) => {
+        impl<'p> $parser<'p> {
+            fn $name<'a>() -> ResultParser<$result_type, $crate::value_and_span::Stream<'a>> {
+                fn inner<'a>(input: $crate::value_and_span::Stream<'a>) -> ParseResult<$result_type, $crate::value_and_span::Stream<'a>> {
+                    $body.parse_lazy(input).into()
+                }
+                parser(inner as fn($crate::value_and_span::Stream<'a>) -> ParseResult<$result_type, $crate::value_and_span::Stream<'a>>).expected(stringify!($name))
+            }
+        }
+    }
+}
+
+/// `assert_parses_to!` simplifies some of the boilerplate around running a
+/// parser function against input and expecting a certain result.
+#[macro_export]
+macro_rules! assert_parses_to {
+    ( $parser: expr, $input: expr, $expected: expr ) => {{
+        let input = $input.with_spans();
+        let par = $parser();
+        let stream = input.atom_stream();
+        let result = par.skip(eof()).parse(stream).map(|x| x.0);
+        assert_eq!(result, Ok($expected));
+    }}
+}
+
+/// `assert_edn_parses_to!` simplifies some of the boilerplate around running a parser function
+/// against string input and expecting a certain result.
+#[macro_export]
+macro_rules! assert_edn_parses_to {
+    ( $parser: expr, $input: expr, $expected: expr ) => {{
+        let input = edn::parse::value($input).expect("to be able to parse input as EDN");
+        let par = $parser();
+        let stream = input.atom_stream();
+        let result = par.skip(eof()).parse(stream).map(|x| x.0);
+        assert_eq!(result, Ok($expected));
+    }}
+}
+
+/// `assert_parse_failure_contains!` simplifies running a parser function against string input and
+/// expecting a certain failure.  This is working around the complexity of pattern matching parse
+/// errors that contain spans.
+#[macro_export]
+macro_rules! assert_parse_failure_contains {
+    ( $parser: expr, $input: expr, $expected: expr ) => {{
+        let input = edn::parse::value($input).expect("to be able to parse input as EDN");
+        let par = $parser();
+        let stream = input.atom_stream();
+        let result = par.skip(eof()).parse(stream).map(|x| x.0).map_err(|e| -> $crate::ValueParseError { e.into() });
+        assert!(format!("{:?}", result).contains($expected), "Expected {:?} to contain {:?}", result, $expected);
+    }}
+}
+
+#[macro_export]
+macro_rules! keyword_map_of {
+    ($(($keyword:expr, $value:expr)),+) => {{
+        let mut seen = std::collections::BTreeSet::default();
+
+        $(
+            if !seen.insert($keyword) {
+                panic!("keyword map has repeated key: {}", stringify!($keyword));
+            }
+        )+
+
+        KeywordMapParser(($(($keyword, $value)),+))
+    }}
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_parser_utils/value_and_span.rs.html b/docs/apis/rust/0.7.0/src/mentat_parser_utils/value_and_span.rs.html new file mode 100644 index 00000000..f67f4b00 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_parser_utils/value_and_span.rs.html @@ -0,0 +1,1714 @@ + + + + + + + + + + value_and_span.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+use std;
+use std::cmp::Ordering;
+use std::fmt::{
+    Debug,
+    Display,
+    Formatter,
+};
+
+use combine::{
+    ConsumedResult,
+    ParseError,
+    Parser,
+    ParseResult,
+    StreamOnce,
+    parser,
+    satisfy_map,
+};
+use combine::primitives; // To not shadow Error.
+use combine::primitives::{
+    FastResult,
+};
+use combine::combinator::{
+    Expected,
+    FnParser,
+};
+
+use edn;
+
+use macros::{
+    KeywordMapParser,
+};
+
+/// A wrapper to let us order `edn::Span` in whatever way is appropriate for parsing with `combine`.
+#[derive(Clone, Copy, Debug)]
+pub struct SpanPosition(pub edn::Span);
+
+impl Display for SpanPosition {
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        self.0.fmt(f)
+    }
+}
+
+impl PartialEq for SpanPosition {
+    fn eq(&self, other: &Self) -> bool {
+        self.cmp(other) == Ordering::Equal
+    }
+}
+
+impl Eq for SpanPosition { }
+
+impl PartialOrd for SpanPosition {
+    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+        Some(self.cmp(other))
+    }
+}
+
+impl Ord for SpanPosition {
+    fn cmp(&self, other: &Self) -> Ordering {
+        (self.0).0.cmp(&(other.0).0)
+    }
+}
+
+/// An iterator specifically for iterating `edn::ValueAndSpan` instances in various ways.
+///
+/// Enumerating each iteration type allows us to have a single `combine::Stream` implementation
+/// yielding `ValueAndSpan` items, which allows us to yield uniform `combine::ParseError` types from
+/// disparate parsers.
+#[derive(Clone)]
+pub enum Iter<'a> {
+    Empty,
+    Atom(std::iter::Once<&'a edn::ValueAndSpan>),
+    Vector(std::slice::Iter<'a, edn::ValueAndSpan>),
+    List(std::collections::linked_list::Iter<'a, edn::ValueAndSpan>),
+    /// Iterates a map {:k1 v1, :k2 v2, ...} as a single `flat_map` slice [k1, v1, k2, v2, ...].
+    Map(std::iter::FlatMap<std::collections::btree_map::Iter<'a, edn::ValueAndSpan, edn::ValueAndSpan>,
+                           std::iter::Chain<std::iter::Once<&'a edn::ValueAndSpan>, std::iter::Once<&'a edn::ValueAndSpan>>,
+                           fn((&'a edn::ValueAndSpan, &'a edn::ValueAndSpan)) -> std::iter::Chain<std::iter::Once<&'a edn::ValueAndSpan>, std::iter::Once<&'a edn::ValueAndSpan>>>),
+    /// Iterates a map with vector values {:k1 [v11 v12 ...], :k2 [v21 v22 ...], ...} as a single
+    /// flattened map [k1, v11, v12, ..., k2, v21, v22, ...].
+    KeywordMap(std::iter::FlatMap<std::collections::btree_map::Iter<'a, edn::ValueAndSpan, edn::ValueAndSpan>,
+                                  std::iter::Chain<std::iter::Once<&'a edn::ValueAndSpan>, Box<Iter<'a>>>,
+                                  fn((&'a edn::ValueAndSpan, &'a edn::ValueAndSpan)) -> std::iter::Chain<std::iter::Once<&'a edn::ValueAndSpan>, Box<Iter<'a>>>>),
+    // TODO: Support Set and Map more naturally.  This is significantly more work because the
+    // existing BTreeSet and BTreeMap iterators do not implement Clone, and implementing Clone for
+    // them is involved.  Since we don't really need to parse sets and maps at this time, this will
+    // do for now.
+}
+
+impl<'a> Iterator for Iter<'a> {
+    type Item = &'a edn::ValueAndSpan;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        match *self {
+            Iter::Empty => None,
+            Iter::Atom(ref mut i) => i.next(),
+            Iter::Vector(ref mut i) => i.next(),
+            Iter::List(ref mut i) => i.next(),
+            Iter::Map(ref mut i) => i.next(),
+            Iter::KeywordMap(ref mut i) => i.next(),
+        }
+    }
+}
+
+/// A single `combine::Stream` implementation iterating `edn::ValueAndSpan` instances.  Equivalent
+/// to `combine::IteratorStream` as produced by `combine::from_iter`, but specialized to
+/// `edn::ValueAndSpan`.
+#[derive(Clone)]
+pub struct Stream<'a>(Iter<'a>, SpanPosition);
+
+/// Things specific to parsing with `combine` and our `Stream` that need a trait to live outside of
+/// the `edn` crate.
+pub trait Item<'a>: Clone + PartialEq + Sized {
+    /// Position could be specialized to `SpanPosition`.
+    type Position: Clone + Ord + std::fmt::Display;
+
+    /// A slight generalization of `combine::Positioner` that allows to set the position based on
+    /// the `edn::ValueAndSpan` being iterated.
+    fn start(&self) -> Self::Position;
+    fn update_position(&self, &mut Self::Position);
+
+    fn child_iter(&'a self) -> Iter<'a>;
+    fn child_stream(&'a self) -> Stream<'a>;
+    fn atom_iter(&'a self) -> Iter<'a>;
+    fn atom_stream(&'a self) -> Stream<'a>;
+
+    fn keyword_map_iter(&'a self) -> Iter<'a>;
+    fn keyword_map_stream(&'a self) -> Stream<'a>;
+}
+
+impl<'a> Item<'a> for edn::ValueAndSpan {
+    type Position = SpanPosition;
+
+    fn start(&self) -> Self::Position {
+        SpanPosition(self.span.clone())
+    }
+
+    fn update_position(&self, position: &mut Self::Position) {
+        *position = SpanPosition(self.span.clone())
+    }
+
+    fn keyword_map_iter(&'a self) -> Iter<'a> {
+        fn flatten_k_vector<'a>((k, v): (&'a edn::ValueAndSpan, &'a edn::ValueAndSpan)) -> std::iter::Chain<std::iter::Once<&'a edn::ValueAndSpan>, Box<Iter<'a>>> {
+            std::iter::once(k).chain(Box::new(v.child_iter()))
+        }
+
+        match self.inner.as_map() {
+            Some(ref map) => Iter::KeywordMap(map.iter().flat_map(flatten_k_vector)),
+            None => Iter::Empty
+        }
+    }
+
+    fn keyword_map_stream(&'a self) -> Stream<'a> {
+        let span = self.span.clone();
+        Stream(self.keyword_map_iter(), SpanPosition(span))
+    }
+
+    fn child_iter(&'a self) -> Iter<'a> {
+        fn flatten_k_v<'a>((k, v): (&'a edn::ValueAndSpan, &'a edn::ValueAndSpan)) -> std::iter::Chain<std::iter::Once<&'a edn::ValueAndSpan>, std::iter::Once<&'a edn::ValueAndSpan>> {
+            std::iter::once(k).chain(std::iter::once(v))
+        }
+
+        match self.inner {
+            edn::SpannedValue::Vector(ref values) => Iter::Vector(values.iter()),
+            edn::SpannedValue::List(ref values) => Iter::List(values.iter()),
+            // Parsing pairs with `combine` is tricky; parsing sequences is easy.
+            edn::SpannedValue::Map(ref map) => Iter::Map(map.iter().flat_map(flatten_k_v)),
+            _ => Iter::Empty,
+        }
+    }
+
+    fn child_stream(&'a self) -> Stream<'a> {
+        let span = self.span.clone();
+        Stream(self.child_iter(), SpanPosition(span))
+    }
+
+    fn atom_iter(&'a self) -> Iter<'a> {
+        Iter::Atom(std::iter::once(self))
+    }
+
+    fn atom_stream(&'a self) -> Stream<'a> {
+        let span = self.span.clone();
+        Stream(self.atom_iter(), SpanPosition(span))
+    }
+}
+
+/// `OfExactly` and `of_exactly` allow us to express nested parsers naturally.
+///
+/// For example, `vector().of_exactly(many(list()))` parses a vector-of-lists, like [(1 2) (:a :b) ("test") ()].
+///
+/// The "outer" parser `P` and the "nested" parser `N` must be compatible: `P` must produce an
+/// output `edn::ValueAndSpan` which can itself be turned into a stream of child elements; and `N`
+/// must accept the resulting input `Stream`.  This compatibility allows us to lift errors from the
+/// nested parser to the outer parser, which is part of what has made parsing `&'a [edn::Value]`
+/// difficult.
+#[derive(Clone)]
+pub struct OfExactly<P, N>(P, N);
+
+pub trait Streaming<'a> {
+    fn as_stream(self) -> Stream<'a>;
+}
+
+impl<'a> Streaming<'a> for &'a edn::ValueAndSpan {
+    fn as_stream(self) -> Stream<'a> {
+        self.child_stream()
+    }
+}
+
+impl<'a> Streaming<'a> for Stream<'a> {
+    fn as_stream(self) -> Stream<'a> {
+        self
+    }
+}
+
+impl<'a, P, N, M, O> Parser for OfExactly<P, N>
+    where P: Parser<Input=Stream<'a>, Output=M>,
+          N: Parser<Input=Stream<'a>, Output=O>,
+          M: 'a + Streaming<'a>,
+{
+    type Input = P::Input;
+    type Output = O;
+    #[inline]
+    fn parse_lazy(&mut self, input: Self::Input) -> ConsumedResult<Self::Output, Self::Input> {
+        use self::FastResult::*;
+
+        match self.0.parse_lazy(input) {
+            ConsumedOk((outer_value, outer_input)) => {
+                match self.1.parse_lazy(outer_value.as_stream()) {
+                    ConsumedOk((inner_value, mut inner_input)) | EmptyOk((inner_value, mut inner_input)) => {
+                        match inner_input.uncons() {
+                            Err(ref err) if *err == primitives::Error::end_of_input() => ConsumedOk((inner_value, outer_input)),
+                            _ => EmptyErr(ParseError::empty(inner_input.position())),
+                        }
+                    },
+                    // TODO: Improve the error output to reference the nested value (or span) in
+                    // some way.  This seems surprisingly difficult to do, so we just surface the
+                    // inner error message right now.  See also the comment below.
+                    EmptyErr(e) | ConsumedErr(e) => ConsumedErr(e),
+                }
+            },
+            EmptyOk((outer_value, outer_input)) => {
+                match self.1.parse_lazy(outer_value.as_stream()) {
+                    ConsumedOk((inner_value, mut inner_input)) | EmptyOk((inner_value, mut inner_input)) => {
+                        match inner_input.uncons() {
+                            Err(ref err) if *err == primitives::Error::end_of_input() => EmptyOk((inner_value, outer_input)),
+                            _ => EmptyErr(ParseError::empty(inner_input.position())),
+                        }
+                    },
+                    // TODO: Improve the error output.  See the comment above.
+                    EmptyErr(e) | ConsumedErr(e) => EmptyErr(e),
+                }
+            },
+            ConsumedErr(e) => ConsumedErr(e),
+            EmptyErr(e) => EmptyErr(e),
+        }
+    }
+
+    fn add_error(&mut self, errors: &mut ParseError<Self::Input>) {
+        self.0.add_error(errors);
+    }
+}
+
+#[inline(always)]
+pub fn of_exactly<'a, P, N, M, O>(p: P, n: N) -> OfExactly<P, N>
+    where P: Parser<Input=Stream<'a>, Output=M>,
+          N: Parser<Input=Stream<'a>, Output=O>,
+          M: 'a + Streaming<'a>,
+{
+    OfExactly(p, n)
+}
+
+/// We need a trait to define `Parser.of` and have it live outside of the `combine` crate.
+pub trait OfExactlyParsing: Parser + Sized {
+    fn of_exactly<N, O>(self, n: N) -> OfExactly<Self, N>
+        where Self: Sized,
+              N: Parser<Input = Self::Input, Output=O>;
+}
+
+impl<'a, P, M> OfExactlyParsing for P
+    where P: Parser<Input=Stream<'a>, Output=M>,
+          M: 'a + Streaming<'a>,
+{
+    fn of_exactly<N, O>(self, n: N) -> OfExactly<P, N>
+        where N: Parser<Input = Self::Input, Output=O>
+    {
+        of_exactly(self, n)
+    }
+}
+
+/// Equivalent to `combine::IteratorStream`.
+impl<'a> StreamOnce for Stream<'a>
+{
+    type Item = &'a edn::ValueAndSpan;
+    type Range = &'a edn::ValueAndSpan;
+    type Position = SpanPosition;
+
+    #[inline]
+    fn uncons(&mut self) -> std::result::Result<Self::Item, primitives::Error<Self::Item, Self::Item>> {
+        match self.0.next() {
+            Some(x) => {
+                x.update_position(&mut self.1);
+                Ok(x)
+            },
+            None => Err(primitives::Error::end_of_input()),
+        }
+    }
+
+    #[inline(always)]
+    fn position(&self) -> Self::Position {
+        self.1.clone()
+    }
+}
+
+/// Shorthands, just enough to convert the `mentat_db` crate for now.  Written using `Box` for now:
+/// it's simple and we can address allocation issues if and when they surface.
+pub fn vector_<'a>(input: Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>> {
+    satisfy_map(|v: &'a edn::ValueAndSpan| {
+        if v.inner.is_vector() {
+            Some(v.child_stream())
+        } else {
+            None
+        }
+    })
+        .parse_lazy(input)
+        .into()
+}
+
+pub fn vector<'a>() -> Expected<FnParser<Stream<'a>, fn(Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>>> {
+    parser(vector_ as fn(Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>).expected("vector")
+}
+
+pub fn list_<'a>(input: Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>> {
+    satisfy_map(|v: &'a edn::ValueAndSpan| {
+        if v.inner.is_list() {
+            Some(v.child_stream())
+        } else {
+            None
+        }
+    })
+        .parse_lazy(input)
+        .into()
+}
+
+pub fn list<'a>() -> Expected<FnParser<Stream<'a>, fn(Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>>> {
+    parser(list_ as fn(Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>).expected("list")
+}
+
+pub fn seq_<'a>(input: Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>> {
+    satisfy_map(|v: &'a edn::ValueAndSpan| {
+        if v.inner.is_list() || v.inner.is_vector() {
+            Some(v.child_stream())
+        } else {
+            None
+        }
+    })
+        .parse_lazy(input)
+        .into()
+}
+
+pub fn seq<'a>() -> Expected<FnParser<Stream<'a>, fn(Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>>> {
+    parser(seq_ as fn(Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>).expected("vector|list")
+}
+
+pub fn map_<'a>(input: Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>> {
+    satisfy_map(|v: &'a edn::ValueAndSpan| {
+        if v.inner.is_map() {
+            Some(v.child_stream())
+        } else {
+            None
+        }
+    })
+        .parse_lazy(input)
+        .into()
+}
+
+pub fn map<'a>() -> Expected<FnParser<Stream<'a>, fn(Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>>> {
+    parser(map_ as fn(Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>).expected("map")
+}
+
+/// A `[k v]` pair in the map form of a keyword map must have the shape `[:k, [v1, v2, ...]]`, with
+/// none of `v1`, `v2`, ... a keyword: without loss of generality, we cannot represent the case
+/// where `vn` is a keyword `:l`, since `[:k v1 v2 ... :l]`, isn't a valid keyword map in vector
+/// form.  This function tests that a `[k v]` pair obeys these constraints.
+///
+/// If we didn't test this, then we might flatten a map `[:k [:l]] to `[:k :l]`, which isn't a valid
+/// keyword map in vector form.
+pub fn is_valid_keyword_map_k_v<'a>((k, v): (&'a edn::ValueAndSpan, &'a edn::ValueAndSpan)) -> bool {
+    if !k.inner.is_keyword() {
+        return false;
+    }
+    match v.inner.as_vector() {
+        None => {
+            return false;
+        },
+        Some(ref vs) => {
+            if !vs.iter().all(|vv| !vv.inner.is_keyword()) {
+                return false;
+            }
+        },
+    }
+    return true;
+}
+
+pub fn keyword_map_<'a>(input: Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>> {
+    satisfy_map(|v: &'a edn::ValueAndSpan| {
+        v.inner.as_map().and_then(|map| {
+            if map.iter().all(is_valid_keyword_map_k_v) {
+                println!("yes {:?}", map);
+                Some(v.keyword_map_stream())
+            } else {
+                println!("no {:?}", map);
+                None
+            }
+        })
+    })
+        .parse_lazy(input)
+        .into()
+}
+
+pub fn keyword_map<'a>() -> Expected<FnParser<Stream<'a>, fn(Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>>> {
+    parser(keyword_map_ as fn(Stream<'a>) -> ParseResult<Stream<'a>, Stream<'a>>).expected("keyword map")
+}
+
+pub fn integer_<'a>(input: Stream<'a>) -> ParseResult<i64, Stream<'a>> {
+    satisfy_map(|v: &'a edn::ValueAndSpan| v.inner.as_integer())
+        .parse_lazy(input)
+        .into()
+}
+
+pub fn integer<'a>() -> Expected<FnParser<Stream<'a>, fn(Stream<'a>) -> ParseResult<i64, Stream<'a>>>> {
+    parser(integer_ as fn(Stream<'a>) -> ParseResult<i64, Stream<'a>>).expected("integer")
+}
+
+pub fn any_keyword_<'a>(input: Stream<'a>) -> ParseResult<&'a edn::Keyword, Stream<'a>> {
+    satisfy_map(|v: &'a edn::ValueAndSpan| v.inner.as_keyword())
+        .parse_lazy(input)
+        .into()
+}
+
+pub fn namespaced_keyword_<'a>(input: Stream<'a>) -> ParseResult<&'a edn::Keyword, Stream<'a>> {
+    satisfy_map(|v: &'a edn::ValueAndSpan| v.inner.as_namespaced_keyword())
+        .parse_lazy(input)
+        .into()
+}
+
+pub fn any_keyword<'a>() -> Expected<FnParser<Stream<'a>, fn(Stream<'a>) -> ParseResult<&'a edn::Keyword, Stream<'a>>>> {
+    parser(any_keyword_ as fn(Stream<'a>) -> ParseResult<&'a edn::Keyword, Stream<'a>>).expected("any_keyword")
+}
+
+pub fn namespaced_keyword<'a>() -> Expected<FnParser<Stream<'a>, fn(Stream<'a>) -> ParseResult<&'a edn::Keyword, Stream<'a>>>> {
+    parser(namespaced_keyword_ as fn(Stream<'a>) -> ParseResult<&'a edn::Keyword, Stream<'a>>).expected("namespaced_keyword")
+}
+
+pub fn forward_any_keyword_<'a>(input: Stream<'a>) -> ParseResult<&'a edn::Keyword, Stream<'a>> {
+    satisfy_map(|v: &'a edn::ValueAndSpan| v.inner.as_keyword().and_then(|k| if k.is_forward() { Some(k) } else { None }))
+        .parse_lazy(input)
+        .into()
+}
+
+pub fn forward_any_keyword<'a>() -> Expected<FnParser<Stream<'a>, fn(Stream<'a>) -> ParseResult<&'a edn::Keyword, Stream<'a>>>> {
+    parser(forward_any_keyword_ as fn(Stream<'a>) -> ParseResult<&'a edn::Keyword, Stream<'a>>).expected("forward_any_keyword")
+}
+
+pub fn forward_namespaced_keyword_<'a>(input: Stream<'a>) -> ParseResult<&'a edn::Keyword, Stream<'a>> {
+    satisfy_map(|v: &'a edn::ValueAndSpan| v.inner.as_namespaced_keyword().and_then(|k| if k.is_forward() { Some(k) } else { None }))
+        .parse_lazy(input)
+        .into()
+}
+
+pub fn forward_namespaced_keyword<'a>() -> Expected<FnParser<Stream<'a>, fn(Stream<'a>) -> ParseResult<&'a edn::Keyword, Stream<'a>>>> {
+    parser(forward_namespaced_keyword_ as fn(Stream<'a>) -> ParseResult<&'a edn::Keyword, Stream<'a>>).expected("forward_namespaced_keyword")
+}
+
+pub fn backward_namespaced_keyword_<'a>(input: Stream<'a>) -> ParseResult<&'a edn::Keyword, Stream<'a>> {
+    satisfy_map(|v: &'a edn::ValueAndSpan| v.inner.as_namespaced_keyword().and_then(|k| if k.is_backward() { Some(k) } else { None }))
+        .parse_lazy(input)
+        .into()
+}
+
+pub fn backward_namespaced_keyword<'a>() -> Expected<FnParser<Stream<'a>, fn(Stream<'a>) -> ParseResult<&'a edn::Keyword, Stream<'a>>>> {
+    parser(backward_namespaced_keyword_ as fn(Stream<'a>) -> ParseResult<&'a edn::Keyword, Stream<'a>>).expected("backward_namespaced_keyword")
+}
+
+/// Generate a `satisfy` expression that matches a `PlainSymbol` value with the given name.
+///
+/// We do this rather than using `combine::token` so that we don't need to allocate a new `String`
+/// inside a `PlainSymbol` inside a `SpannedValue` inside a `ValueAndSpan` just to match input.
+#[macro_export]
+macro_rules! def_matches_plain_symbol {
+    ( $parser: ident, $name: ident, $input: expr ) => {
+        def_parser!($parser, $name, &'a edn::ValueAndSpan, {
+            satisfy(|v: &'a edn::ValueAndSpan| {
+                match v.inner {
+                    edn::SpannedValue::PlainSymbol(ref s) => s.name() == $input,
+                    _ => false,
+                }
+            })
+        });
+    }
+}
+
+/// Generate a `satisfy` expression that matches a `Keyword` value with the given name.
+///
+/// We do this rather than using `combine::token` to save allocations.
+#[macro_export]
+macro_rules! def_matches_keyword {
+    ( $parser: ident, $name: ident, $input: expr ) => {
+        def_parser!($parser, $name, &'a edn::ValueAndSpan, {
+            satisfy(|v: &'a edn::ValueAndSpan| {
+                match v.inner {
+                    edn::SpannedValue::Keyword(ref s) if !s.is_namespaced() => s.name() == $input,
+                    _ => false,
+                }
+            })
+        });
+    }
+}
+
+/// Generate a `satisfy` expression that matches a `Keyword` value with the given
+/// namespace and name.
+///
+/// We do this rather than using `combine::token` to save allocations.
+#[macro_export]
+macro_rules! def_matches_namespaced_keyword {
+    ( $parser: ident, $name: ident, $input_namespace: expr, $input_name: expr ) => {
+        def_parser!($parser, $name, &'a edn::ValueAndSpan, {
+            satisfy(|v: &'a edn::ValueAndSpan| {
+                match v.inner {
+                    edn::SpannedValue::Keyword(ref s) if s.is_namespaced() => {
+                        let (ns, n) = s.components();
+                        ns == $input_namespace && n == $input_name
+                    },
+                    _ => false,
+                }
+            })
+        });
+    }
+}
+
+use combine::primitives::{
+    Error,
+    Info,
+};
+use combine::primitives::FastResult::*;
+
+/// Compare to `tuple_parser!` in `combine`.
+///
+/// This uses edge cases in Rust's hygienic macro system to represent arbitrary values.  That is,
+/// `$value: ident` represents both a type in the tuple parameterizing `KeywordMapParser` (since
+/// `(A, B, C)` is a valid type declaration) and also a variable value extracted from the underlying
+/// instance value.  `$tmp: ident` represents an optional value to return.
+///
+/// This unrolls the cases.  Each loop iteration reads a token.  It then unrolls the known cases,
+/// checking if any case matches the keyword string.  If yes, we parse further.  If no, we move on
+/// to the next case.  If no case matches, we fail.
+macro_rules! keyword_map_parser {
+    ($(($keyword:ident, $value:ident, $tmp:ident)),+) => {
+        impl <'a, $($value:),+> Parser for KeywordMapParser<($((&'static str, $value)),+)>
+            where $($value: Parser<Input=Stream<'a>>),+
+        {
+            type Input = Stream<'a>;
+            type Output = ($(Option<$value::Output>),+);
+
+            #[allow(non_snake_case)]
+            fn parse_lazy(&mut self,
+                          mut input: Stream<'a>)
+                          -> ConsumedResult<($(Option<$value::Output>),+), Stream<'a>> {
+                let ($((ref $keyword, ref mut $value)),+) = (*self).0;
+                let mut consumed = false;
+
+                $(
+                    let mut $tmp = None;
+                )+
+
+                loop {
+                    match input.uncons() {
+                        Ok(value) => {
+                            $(
+                                if let Some(ref keyword) = value.inner.as_plain_keyword() {
+                                    if &keyword.name() == $keyword {
+                                        if $tmp.is_some() {
+                                            // Repeated match -- bail out!  Providing good error
+                                            // messages is hard; this will do for now.
+                                            return ConsumedErr(ParseError::new(input.position(), Error::Unexpected(Info::Token(value))));
+                                        }
+
+                                        consumed = true;
+
+                                        $tmp = match $value.parse_lazy(input.clone()) {
+                                            ConsumedOk((x, new_input)) => {
+                                                input = new_input;
+                                                Some(x)
+                                            }
+                                            EmptyErr(mut err) => {
+                                                if let Ok(t) = input.uncons() {
+                                                    err.add_error(Error::Unexpected(Info::Token(t)));
+                                                }
+                                                if consumed {
+                                                    return ConsumedErr(err)
+                                                } else {
+                                                    return EmptyErr(err)
+                                                }
+                                            }
+                                            ConsumedErr(err) => return ConsumedErr(err),
+                                            EmptyOk((x, new_input)) => {
+                                                input = new_input;
+                                                Some(x)
+                                            }
+                                        };
+
+                                        continue
+                                    }
+                                }
+                            )+
+
+                            // No keyword matched!  Bail out.
+                            return ConsumedErr(ParseError::new(input.position(), Error::Unexpected(Info::Token(value))));
+                        },
+                        Err(err) => {
+                            if consumed {
+                                return ConsumedOk((($($tmp),+), input))
+                            } else {
+                                if err == Error::end_of_input() {
+                                    return EmptyOk((($($tmp),+), input));
+                                }
+                                return EmptyErr(ParseError::new(input.position(), err))
+                            }
+                        },
+                    }
+                }
+            }
+        }
+    }
+}
+
+keyword_map_parser!((Ak, Av, At), (Bk, Bv, Bt));
+keyword_map_parser!((Ak, Av, At), (Bk, Bv, Bt), (Ck, Cv, Ct));
+keyword_map_parser!((Ak, Av, At), (Bk, Bv, Bt), (Ck, Cv, Ct), (Dk, Dv, Dt));
+keyword_map_parser!((Ak, Av, At), (Bk, Bv, Bt), (Ck, Cv, Ct), (Dk, Dv, Dt), (Ek, Ev, Et));
+keyword_map_parser!((Ak, Av, At), (Bk, Bv, Bt), (Ck, Cv, Ct), (Dk, Dv, Dt), (Ek, Ev, Et), (Fk, Fv, Ft));
+keyword_map_parser!((Ak, Av, At), (Bk, Bv, Bt), (Ck, Cv, Ct), (Dk, Dv, Dt), (Ek, Ev, Et), (Fk, Fv, Ft), (Gk, Gv, Gt));
+
+#[cfg(test)]
+mod tests {
+    use combine::{
+        eof,
+        many,
+        satisfy,
+    };
+
+    use super::*;
+
+    use macros::{
+        ResultParser,
+    };
+
+    /// A little test parser.
+    pub struct Test<'a>(std::marker::PhantomData<&'a ()>);
+
+    def_matches_namespaced_keyword!(Test, add, "db", "add");
+
+    def_parser!(Test, entid, i64, {
+        integer()
+            .map(|x| x)
+            .or(namespaced_keyword().map(|_| -1))
+    });
+
+    #[test]
+    #[should_panic(expected = r#"keyword map has repeated key: "x""#)]
+    fn test_keyword_map_of() {
+        keyword_map_of!(("x", Test::entid()),
+                        ("x", Test::entid()));
+    }
+
+    #[test]
+    fn test_iter() {
+        // A vector and a map iterated as a keyword map produce the same elements.
+        let input = edn::parse::value("[:y 3 4 :x 1 2]").expect("to be able to parse input as EDN");
+        assert_eq!(input.child_iter().cloned().map(|x| x.without_spans()).into_iter().collect::<Vec<_>>(),
+                   edn::parse::value("[:y 3 4 :x 1 2]").expect("to be able to parse input as EDN").without_spans().into_vector().expect("an EDN vector"));
+
+        let input = edn::parse::value("{:x [1 2] :y [3 4]}").expect("to be able to parse input as EDN");
+        assert_eq!(input.keyword_map_iter().cloned().map(|x| x.without_spans()).into_iter().collect::<Vec<_>>(),
+                   edn::parse::value("[:y 3 4 :x 1 2]").expect("to be able to parse input as EDN").without_spans().into_vector().expect("an EDN vector"));
+
+        // Parsing a keyword map in map and vector form produces the same elements.  The order (:y
+        // before :x) is a foible of our EDN implementation and could be easily changed.
+        assert_edn_parses_to!(|| keyword_map().or(vector()).map(|x| x.0.map(|x| x.clone().without_spans()).into_iter().collect::<Vec<_>>()),
+                              "{:x [1] :y [2]}",
+                              edn::parse::value("[:y 2 :x 1]").expect("to be able to parse input as EDN").without_spans().into_vector().expect("an EDN vector"));
+
+        assert_edn_parses_to!(|| keyword_map().or(vector()).map(|x| x.0.map(|x| x.clone().without_spans()).into_iter().collect::<Vec<_>>()),
+                              "[:y 2 :x 1]",
+                              edn::parse::value("[:y 2 :x 1]").expect("to be able to parse input as EDN").without_spans().into_vector().expect("an EDN vector"));
+    }
+
+    #[test]
+    fn test_keyword_map() {
+        assert_edn_parses_to!(|| vector().of_exactly(keyword_map_of!(("x", Test::entid()), ("y", Test::entid()))),
+                              "[:y 2 :x 1]",
+                              (Some(1), Some(2)));
+
+        assert_edn_parses_to!(|| vector().of_exactly(keyword_map_of!(("x", Test::entid()), ("y", Test::entid()))),
+                              "[:x 1 :y 2]",
+                              (Some(1), Some(2)));
+
+        assert_edn_parses_to!(|| vector().of_exactly(keyword_map_of!(("x", Test::entid()), ("y", Test::entid()))),
+                              "[:x 1]",
+                              (Some(1), None));
+
+        assert_edn_parses_to!(|| vector().of_exactly(keyword_map_of!(("x", vector().of_exactly(many::<Vec<_>, _>(Test::entid()))),
+                                                                     ("y", vector().of_exactly(many::<Vec<_>, _>(Test::entid()))))),
+                              "[:x [] :y [1 2]]",
+                              (Some(vec![]), Some(vec![1, 2])));
+
+        assert_edn_parses_to!(|| vector().of_exactly(keyword_map_of!(("x", vector().of_exactly(many::<Vec<_>, _>(Test::entid()))),
+                                                                     ("y", vector().of_exactly(many::<Vec<_>, _>(Test::entid()))))),
+                              "[]",
+                              (None, None));
+    }
+
+    #[test]
+    fn test_keyword_map_failures() {
+        assert_parse_failure_contains!(|| vector().of_exactly(keyword_map_of!(("x", Test::entid()), ("y", Test::entid()))),
+                              "[:x 1 :x 2]",
+                              r#"errors: [Unexpected(Token(ValueAndSpan { inner: Keyword(Keyword(NamespaceableName { namespace: None, name: "x" }))"#);
+    }
+
+
+      // assert_edn_parses_to!(|| keyword_map().or(vector()).map(|x| x.0.map(|x| x.clone().without_spans()).into_iter().collect::<Vec<_>>()), "{:x [1] :y [2]}", vec![]);
+
+        // assert_edn_parses_to!(|| keyword_map().or(vector()).of_exactly((Test::entid(), Test::entid())), "{:x [1] :y [2]}", (-1, 1));
+
+        // assert_edn_parses_to!(|| kw_map().of_exactly((Test::entid(), Test::entid())), "[:a 0 :b 0 1]", (1, 1));
+
+        // assert_edn_parses_to!(|| keyword_map_of(&[(":kw1", Test::entid()),
+        //                                           (":kw2", (Test::entid(), Test::entid())),]),
+        //                       "{:kw1 0 :kw2 1 :x/y}", ((Some(0), Some((0, 1)))));
+
+
+
+
+        // let input = edn::parse::value("[:x/y]").expect("to be able to parse input as EDN");
+        // let par = vector().of_exactly(Test::entid());
+        // let stream: Stream = (&input).atom_stream();
+        // let result = par.skip(eof()).parse(stream).map(|x| x.0);
+        // assert_eq!(result, Ok(1));
+    // }
+
+    // #[test]
+    // fn test_keyword_map() {
+    //     assert_keyword_map_eq!(
+    //         "[:foo 1 2 3 :bar 4]",
+    //         Some("{:foo [1 2 3] :bar [4]}"));
+
+    //     // Trailing keywords aren't allowed.
+    //     assert_keyword_map_eq!(
+    //         "[:foo]",
+    //         None);
+    //     assert_keyword_map_eq!(
+    //         "[:foo 2 :bar]",
+    //         None);
+
+    //     // Duplicate keywords aren't allowed.
+    //     assert_keyword_map_eq!(
+    //         "[:foo 2 :foo 1]",
+    //         None);
+
+    //     // Starting with anything but a keyword isn't allowed.
+    //     assert_keyword_map_eq!(
+    //         "[2 :foo 1]",
+    //         None);
+
+    //     // Consecutive keywords aren't allowed.
+    //     assert_keyword_map_eq!(
+    //         "[:foo :bar 1]",
+    //         None);
+
+    //     // Empty lists return an empty map.
+    //     assert_keyword_map_eq!(
+    //         "[]",
+    //         Some("{}"));
+    // }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query/lib.rs.html b/docs/apis/rust/0.7.0/src/mentat_query/lib.rs.html new file mode 100644 index 00000000..5af16ee7 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query/lib.rs.html @@ -0,0 +1,148 @@ + + + + + + + + + + lib.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+extern crate edn;
+pub use edn::query::*;
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/convert.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/convert.rs.html new file mode 100644 index 00000000..ea2c8153 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/convert.rs.html @@ -0,0 +1,600 @@ + + + + + + + + + + convert.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use mentat_core::{
+    HasSchema,
+    Schema,
+    SQLValueType,
+    TypedValue,
+    ValueType,
+    ValueTypeSet,
+};
+
+use mentat_query::{
+    FnArg,
+    NonIntegerConstant,
+    Variable,
+};
+
+use clauses::{
+    ConjoiningClauses,
+};
+
+use errors::{
+    AlgebrizerError,
+    Result,
+};
+
+use types::{
+    EmptyBecause,
+};
+
+macro_rules! coerce_to_typed_value {
+    ($var: ident, $val: ident, $types: expr, $type: path, $constructor: path) => { {
+        Ok(if !$types.contains($type) {
+               Impossible(EmptyBecause::TypeMismatch {
+                   var: $var.clone(),
+                   existing: $types,
+                   desired: ValueTypeSet::of_one($type),
+               })
+           } else {
+               Val($constructor($val).into())
+           })
+    } }
+}
+
+pub(crate) trait ValueTypes {
+    fn potential_types(&self, schema: &Schema) -> Result<ValueTypeSet>;
+}
+
+impl ValueTypes for FnArg {
+    fn potential_types(&self, schema: &Schema) -> Result<ValueTypeSet> {
+        Ok(match self {
+                &FnArg::EntidOrInteger(x) => {
+                    if ValueType::Ref.accommodates_integer(x) {
+                        // TODO: also see if it's a valid entid?
+                        ValueTypeSet::of_longs()
+                    } else {
+                        ValueTypeSet::of_one(ValueType::Long)
+                    }
+                },
+
+                &FnArg::IdentOrKeyword(ref x) => {
+                    if schema.get_entid(x).is_some() {
+                        ValueTypeSet::of_keywords()
+                    } else {
+                        ValueTypeSet::of_one(ValueType::Keyword)
+                    }
+                },
+
+                &FnArg::Variable(_) => {
+                    ValueTypeSet::any()
+                },
+
+                &FnArg::Constant(NonIntegerConstant::BigInteger(_)) => {
+                    // Not yet implemented.
+                    bail!(AlgebrizerError::UnsupportedArgument)
+                },
+
+                // These don't make sense here. TODO: split FnArg into scalar and non-scalar…
+                &FnArg::Vector(_) |
+                &FnArg::SrcVar(_) => bail!(AlgebrizerError::UnsupportedArgument),
+
+                // These are all straightforward.
+                &FnArg::Constant(NonIntegerConstant::Boolean(_)) => ValueTypeSet::of_one(ValueType::Boolean),
+                &FnArg::Constant(NonIntegerConstant::Instant(_)) => ValueTypeSet::of_one(ValueType::Instant),
+                &FnArg::Constant(NonIntegerConstant::Uuid(_)) => ValueTypeSet::of_one(ValueType::Uuid),
+                &FnArg::Constant(NonIntegerConstant::Float(_)) => ValueTypeSet::of_one(ValueType::Double),
+                &FnArg::Constant(NonIntegerConstant::Text(_)) => ValueTypeSet::of_one(ValueType::String),
+            })
+    }
+}
+
+pub(crate) enum ValueConversion {
+    Val(TypedValue),
+    Impossible(EmptyBecause),
+}
+
+/// Conversion of FnArgs to TypedValues.
+impl ConjoiningClauses {
+    /// Convert the provided `FnArg` to a `TypedValue`.
+    /// The conversion depends on, and can fail because of:
+    /// - Existing known types of a variable to which this arg will be bound.
+    /// - Existing bindings of a variable `FnArg`.
+    pub(crate) fn typed_value_from_arg<'s>(&self, schema: &'s Schema, var: &Variable, arg: FnArg, known_types: ValueTypeSet) -> Result<ValueConversion> {
+        use self::ValueConversion::*;
+        if known_types.is_empty() {
+            // If this happens, it likely means the pattern has already failed!
+            return Ok(Impossible(EmptyBecause::TypeMismatch {
+                var: var.clone(),
+                existing: known_types,
+                desired: ValueTypeSet::any(),
+            }));
+        }
+
+        let constrained_types;
+        if let Some(required) = self.required_types.get(var) {
+            constrained_types = known_types.intersection(required);
+        } else {
+            constrained_types = known_types;
+        }
+
+        match arg {
+            // Longs are potentially ambiguous: they might be longs or entids.
+            FnArg::EntidOrInteger(x) => {
+                match (ValueType::Ref.accommodates_integer(x),
+                       constrained_types.contains(ValueType::Ref),
+                       constrained_types.contains(ValueType::Long)) {
+                    (true, true, true) => {
+                        // Ambiguous: this arg could be an entid or a long.
+                        // We default to long.
+                        Ok(Val(TypedValue::Long(x)))
+                    },
+                    (true, true, false) => {
+                        // This can only be a ref.
+                        Ok(Val(TypedValue::Ref(x)))
+                    },
+                    (_, false, true) => {
+                        // This can only be a long.
+                        Ok(Val(TypedValue::Long(x)))
+                    },
+                    (false, true, _) => {
+                        // This isn't a valid ref, but that's the type to which this must conform!
+                        Ok(Impossible(EmptyBecause::TypeMismatch {
+                            var: var.clone(),
+                            existing: known_types,
+                            desired: ValueTypeSet::of_longs(),
+                        }))
+                    },
+                    (_, false, false) => {
+                        // Non-overlapping type sets.
+                        Ok(Impossible(EmptyBecause::TypeMismatch {
+                            var: var.clone(),
+                            existing: known_types,
+                            desired: ValueTypeSet::of_longs(),
+                        }))
+                    },
+                }
+            },
+
+            // If you definitely want to look up an ident, do it before running the query.
+            FnArg::IdentOrKeyword(x) => {
+                match (constrained_types.contains(ValueType::Ref),
+                       constrained_types.contains(ValueType::Keyword)) {
+                    (true, true) => {
+                        // Ambiguous: this could be a keyword or an ident.
+                        // Default to keyword.
+                        Ok(Val(x.into()))
+                    },
+                    (true, false) => {
+                        // This can only be an ident. Look it up!
+                        match schema.get_entid(&x).map(|k| k.into()) {
+                            Some(e) => Ok(Val(e)),
+                            None => Ok(Impossible(EmptyBecause::UnresolvedIdent(x.clone()))),
+                        }
+                    },
+                    (false, true) => {
+                        Ok(Val(TypedValue::Keyword(x.into())))
+                    },
+                    (false, false) => {
+                        Ok(Impossible(EmptyBecause::TypeMismatch {
+                            var: var.clone(),
+                            existing: known_types,
+                            desired: ValueTypeSet::of_keywords(),
+                        }))
+                    },
+                }
+            },
+
+            FnArg::Variable(in_var) => {
+                // TODO: technically you could ground an existing variable inside the query….
+                if !self.input_variables.contains(&in_var) {
+                    bail!(AlgebrizerError::UnboundVariable((*in_var.0).clone()))
+                }
+                match self.bound_value(&in_var) {
+                    // The type is already known if it's a bound variable….
+                    Some(ref in_value) => Ok(Val(in_value.clone())),
+                    None => {
+                        // The variable is present in `:in`, but it hasn't yet been provided.
+                        // This is a restriction we will eventually relax: we don't yet have a way
+                        // to collect variables as part of a computed table or substitution.
+                        bail!(AlgebrizerError::UnboundVariable((*in_var.0).clone()))
+                    },
+                }
+            },
+
+            // This isn't implemented yet.
+            FnArg::Constant(NonIntegerConstant::BigInteger(_)) => unimplemented!(),
+
+            // These don't make sense here.
+            FnArg::Vector(_) |
+            FnArg::SrcVar(_) => bail!(AlgebrizerError::InvalidGroundConstant),
+
+            // These are all straightforward.
+            FnArg::Constant(NonIntegerConstant::Boolean(x)) => {
+                coerce_to_typed_value!(var, x, known_types, ValueType::Boolean, TypedValue::Boolean)
+            },
+            FnArg::Constant(NonIntegerConstant::Instant(x)) => {
+                coerce_to_typed_value!(var, x, known_types, ValueType::Instant, TypedValue::Instant)
+            },
+            FnArg::Constant(NonIntegerConstant::Uuid(x)) => {
+                coerce_to_typed_value!(var, x, known_types, ValueType::Uuid, TypedValue::Uuid)
+            },
+            FnArg::Constant(NonIntegerConstant::Float(x)) => {
+                coerce_to_typed_value!(var, x, known_types, ValueType::Double, TypedValue::Double)
+            },
+            FnArg::Constant(NonIntegerConstant::Text(x)) => {
+                coerce_to_typed_value!(var, x, known_types, ValueType::String, TypedValue::String)
+            },
+        }
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/fulltext.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/fulltext.rs.html new file mode 100644 index 00000000..be0805a4 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/fulltext.rs.html @@ -0,0 +1,886 @@ + + + + + + + + + + fulltext.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use mentat_core::{
+    HasSchema,
+    TypedValue,
+    ValueType,
+};
+
+use mentat_core::util::Either;
+
+use mentat_query::{
+    Binding,
+    FnArg,
+    NonIntegerConstant,
+    SrcVar,
+    VariableOrPlaceholder,
+    WhereFn,
+};
+
+use clauses::{
+    ConjoiningClauses,
+};
+
+use errors::{
+    AlgebrizerError,
+    BindingError,
+    InvalidBinding,
+    Result,
+};
+
+use types::{
+    Column,
+    ColumnConstraint,
+    DatomsColumn,
+    DatomsTable,
+    EmptyBecause,
+    FulltextColumn,
+    QualifiedAlias,
+    QueryValue,
+    SourceAlias,
+};
+
+use Known;
+
+impl ConjoiningClauses {
+    #[allow(unused_variables)]
+    pub(crate) fn apply_fulltext(&mut self, known: Known, where_fn: WhereFn) -> Result<()> {
+        if where_fn.args.len() != 3 {
+            bail!(AlgebrizerError::InvalidNumberOfArguments(where_fn.operator.clone(), where_fn.args.len(), 3));
+        }
+
+        if where_fn.binding.is_empty() {
+            // The binding must introduce at least one bound variable.
+            bail!(InvalidBinding::new(where_fn.operator.clone(), BindingError::NoBoundVariable));
+        }
+
+        if !where_fn.binding.is_valid() {
+            // The binding must not duplicate bound variables.
+            bail!(InvalidBinding::new(where_fn.operator.clone(), BindingError::RepeatedBoundVariable));
+        }
+
+        // We should have exactly four bindings. Destructure them now.
+        let bindings = match where_fn.binding {
+            Binding::BindRel(bindings) => {
+                let bindings_count = bindings.len();
+                if bindings_count < 1 || bindings_count > 4 {
+                    bail!(InvalidBinding::new(where_fn.operator.clone(),
+                        BindingError::InvalidNumberOfBindings {
+                            number: bindings.len(),
+                            expected: 4,
+                        })
+                    );
+                }
+                bindings
+            },
+            Binding::BindScalar(_) |
+            Binding::BindTuple(_) |
+            Binding::BindColl(_) => bail!(InvalidBinding::new(where_fn.operator.clone(), BindingError::ExpectedBindRel)),
+        };
+        let mut bindings = bindings.into_iter();
+        let b_entity = bindings.next().unwrap();
+        let b_value = bindings.next().unwrap_or(VariableOrPlaceholder::Placeholder);
+        let b_tx = bindings.next().unwrap_or(VariableOrPlaceholder::Placeholder);
+        let b_score = bindings.next().unwrap_or(VariableOrPlaceholder::Placeholder);
+
+        let mut args = where_fn.args.into_iter();
+
+        // TODO: process source variables.
+        match args.next().unwrap() {
+            FnArg::SrcVar(SrcVar::DefaultSrc) => {},
+            _ => bail!(AlgebrizerError::InvalidArgument(where_fn.operator.clone(), "source variable", 0)),
+        }
+
+        let schema = known.schema;
+
+        // TODO: accept placeholder and set of attributes.  Alternately, consider putting the search
+        // term before the attribute arguments and collect the (variadic) attributes into a set.
+        // let a: Entid  = self.resolve_attribute_argument(&where_fn.operator, 1, args.next().unwrap())?;
+        //
+        // TODO: improve the expression of this matching, possibly by using attribute_for_* uniformly.
+        let a = match args.next().unwrap() {
+            FnArg::IdentOrKeyword(i) => schema.get_entid(&i).map(|k| k.into()),
+            // Must be an entid.
+            FnArg::EntidOrInteger(e) => Some(e),
+            FnArg::Variable(v) => {
+                // If it's already bound, then let's expand the variable.
+                // TODO: allow non-constant attributes.
+                match self.bound_value(&v) {
+                    Some(TypedValue::Ref(entid)) => Some(entid),
+                    Some(tv) => {
+                        bail!(AlgebrizerError::InputTypeDisagreement(v.name().clone(), ValueType::Ref, tv.value_type()))
+                    },
+                    None => {
+                        bail!(AlgebrizerError::UnboundVariable((*v.0).clone()))
+                    }
+                }
+            },
+            _ => None,
+        };
+
+        // An unknown ident, or an entity that isn't present in the store, or isn't a fulltext
+        // attribute, is likely enough to be a coding error that we choose to bail instead of
+        // marking the pattern as known-empty.
+        let a = a.ok_or(AlgebrizerError::InvalidArgument(where_fn.operator.clone(), "attribute", 1))?;
+        let attribute = schema.attribute_for_entid(a)
+                              .cloned()
+                              .ok_or(AlgebrizerError::InvalidArgument(where_fn.operator.clone(),
+                                                                "attribute", 1))?;
+
+        if !attribute.fulltext {
+            // We can never get results from a non-fulltext attribute!
+            println!("Can't run fulltext on non-fulltext attribute {}.", a);
+            self.mark_known_empty(EmptyBecause::NonFulltextAttribute(a));
+            return Ok(());
+        }
+
+        let fulltext_values_alias = self.next_alias_for_table(DatomsTable::FulltextValues);
+        let datoms_table_alias = self.next_alias_for_table(DatomsTable::Datoms);
+
+        // We do a fulltext lookup by joining the fulltext values table against datoms -- just
+        // like applying a pattern, but two tables contribute instead of one.
+        self.from.push(SourceAlias(DatomsTable::FulltextValues, fulltext_values_alias.clone()));
+        self.from.push(SourceAlias(DatomsTable::Datoms, datoms_table_alias.clone()));
+
+        // TODO: constrain the type in the more general cases (e.g., `a` is a var).
+        self.constrain_attribute(datoms_table_alias.clone(), a);
+
+        // Join the datoms table to the fulltext values table.
+        self.wheres.add_intersection(ColumnConstraint::Equals(
+            QualifiedAlias(datoms_table_alias.clone(), Column::Fixed(DatomsColumn::Value)),
+            QueryValue::Column(QualifiedAlias(fulltext_values_alias.clone(), Column::Fulltext(FulltextColumn::Rowid)))));
+
+        // `search` is either text or a variable.
+        // If it's simple text, great.
+        // If it's a variable, it'll be in one of three states:
+        // - It's already bound, either by input or by a previous pattern like `ground`.
+        // - It's not already bound, but it's a defined input of type Text. Not yet implemented: TODO.
+        // - It's not bound. The query cannot be algebrized.
+        let search: Either<TypedValue, QualifiedAlias> = match args.next().unwrap() {
+            FnArg::Constant(NonIntegerConstant::Text(s)) => {
+                Either::Left(TypedValue::String(s))
+            },
+            FnArg::Variable(in_var) => {
+                match self.bound_value(&in_var) {
+                    Some(t @ TypedValue::String(_)) => Either::Left(t),
+                    Some(_) => bail!(AlgebrizerError::InvalidArgument(where_fn.operator.clone(), "string", 2)),
+                    None => {
+                        // Regardless of whether we'll be providing a string later, or the value
+                        // comes from a column, it must be a string.
+                        if self.known_type(&in_var) != Some(ValueType::String) {
+                            bail!(AlgebrizerError::InvalidArgument(where_fn.operator.clone(), "string", 2))
+                        }
+
+                        if self.input_variables.contains(&in_var) {
+                            // Sorry, we haven't implemented late binding.
+                            // TODO: implement this.
+                            bail!(AlgebrizerError::UnboundVariable((*in_var.0).clone()))
+                        } else {
+                            // It must be bound earlier in the query. We already established that
+                            // it must be a string column.
+                            if let Some(binding) = self.column_bindings
+                                                       .get(&in_var)
+                                                       .and_then(|bindings| bindings.get(0).cloned()) {
+                                Either::Right(binding)
+                            } else {
+                                bail!(AlgebrizerError::UnboundVariable((*in_var.0).clone()))
+                            }
+                        }
+                    },
+                }
+            },
+            _ => bail!(AlgebrizerError::InvalidArgument(where_fn.operator.clone(), "string", 2)),
+        };
+
+        let qv = match search {
+            Either::Left(tv) => QueryValue::TypedValue(tv),
+            Either::Right(qa) => QueryValue::Column(qa),
+        };
+
+        let constraint = ColumnConstraint::Matches(QualifiedAlias(fulltext_values_alias.clone(),
+                                                                  Column::Fulltext(FulltextColumn::Text)),
+                                                   qv);
+        self.wheres.add_intersection(constraint);
+
+        if let VariableOrPlaceholder::Variable(ref var) = b_entity {
+            // It must be a ref.
+            self.constrain_var_to_type(var.clone(), ValueType::Ref);
+            if self.is_known_empty() {
+                return Ok(());
+            }
+
+            self.bind_column_to_var(schema, datoms_table_alias.clone(), DatomsColumn::Entity, var.clone());
+        }
+
+        if let VariableOrPlaceholder::Variable(ref var) = b_value {
+            // This'll be bound to strings.
+            self.constrain_var_to_type(var.clone(), ValueType::String);
+            if self.is_known_empty() {
+                return Ok(());
+            }
+
+            self.bind_column_to_var(schema, fulltext_values_alias.clone(), Column::Fulltext(FulltextColumn::Text), var.clone());
+        }
+
+        if let VariableOrPlaceholder::Variable(ref var) = b_tx {
+            // Txs must be refs.
+            self.constrain_var_to_type(var.clone(), ValueType::Ref);
+            if self.is_known_empty() {
+                return Ok(());
+            }
+
+            self.bind_column_to_var(schema, datoms_table_alias.clone(), DatomsColumn::Tx, var.clone());
+        }
+
+        if let VariableOrPlaceholder::Variable(ref var) = b_score {
+            // Scores are doubles.
+            self.constrain_var_to_type(var.clone(), ValueType::Double);
+
+            // We do not allow the score to be bound.
+            if self.value_bindings.contains_key(var) || self.input_variables.contains(var) {
+                bail!(InvalidBinding::new(var.name(), BindingError::UnexpectedBinding));
+            }
+
+            // We bind the value ourselves. This handily takes care of substituting into existing uses.
+            // TODO: produce real scores using SQLite's matchinfo.
+            self.bind_value(var, TypedValue::Double(0.0.into()));
+        }
+
+        Ok(())
+    }
+}
+
+#[cfg(test)]
+mod testing {
+    use super::*;
+
+    use mentat_core::{
+        Attribute,
+        Schema,
+        ValueType,
+    };
+
+    use mentat_query::{
+        Binding,
+        FnArg,
+        Keyword,
+        PlainSymbol,
+        Variable,
+    };
+
+    use clauses::{
+        add_attribute,
+        associate_ident,
+    };
+
+    #[test]
+    fn test_apply_fulltext() {
+        let mut cc = ConjoiningClauses::default();
+        let mut schema = Schema::default();
+
+        associate_ident(&mut schema, Keyword::namespaced("foo", "bar"), 101);
+        add_attribute(&mut schema, 101, Attribute {
+            value_type: ValueType::String,
+            fulltext: false,
+            ..Default::default()
+        });
+
+        associate_ident(&mut schema, Keyword::namespaced("foo", "fts"), 100);
+        add_attribute(&mut schema, 100, Attribute {
+            value_type: ValueType::String,
+            index: true,
+            fulltext: true,
+            ..Default::default()
+        });
+
+        let known = Known::for_schema(&schema);
+
+        let op = PlainSymbol::plain("fulltext");
+        cc.apply_fulltext(known, WhereFn {
+            operator: op,
+            args: vec![
+                FnArg::SrcVar(SrcVar::DefaultSrc),
+                FnArg::IdentOrKeyword(Keyword::namespaced("foo", "fts")),
+                FnArg::Constant("needle".into()),
+            ],
+            binding: Binding::BindRel(vec![VariableOrPlaceholder::Variable(Variable::from_valid_name("?entity")),
+                                           VariableOrPlaceholder::Variable(Variable::from_valid_name("?value")),
+                                           VariableOrPlaceholder::Variable(Variable::from_valid_name("?tx")),
+                                           VariableOrPlaceholder::Variable(Variable::from_valid_name("?score"))]),
+        }).expect("to be able to apply_fulltext");
+
+        assert!(!cc.is_known_empty());
+
+        // Finally, expand column bindings.
+        cc.expand_column_bindings();
+        assert!(!cc.is_known_empty());
+
+        let clauses = cc.wheres;
+        assert_eq!(clauses.len(), 3);
+
+        assert_eq!(clauses.0[0], ColumnConstraint::Equals(QualifiedAlias("datoms01".to_string(), Column::Fixed(DatomsColumn::Attribute)),
+                                                          QueryValue::Entid(100)).into());
+        assert_eq!(clauses.0[1], ColumnConstraint::Equals(QualifiedAlias("datoms01".to_string(), Column::Fixed(DatomsColumn::Value)),
+                                                          QueryValue::Column(QualifiedAlias("fulltext_values00".to_string(), Column::Fulltext(FulltextColumn::Rowid)))).into());
+        assert_eq!(clauses.0[2], ColumnConstraint::Matches(QualifiedAlias("fulltext_values00".to_string(), Column::Fulltext(FulltextColumn::Text)),
+                                                           QueryValue::TypedValue("needle".into())).into());
+
+        let bindings = cc.column_bindings;
+        assert_eq!(bindings.len(), 3);
+
+        assert_eq!(bindings.get(&Variable::from_valid_name("?entity")).expect("column binding for ?entity").clone(),
+                   vec![QualifiedAlias("datoms01".to_string(), Column::Fixed(DatomsColumn::Entity))]);
+        assert_eq!(bindings.get(&Variable::from_valid_name("?value")).expect("column binding for ?value").clone(),
+                   vec![QualifiedAlias("fulltext_values00".to_string(), Column::Fulltext(FulltextColumn::Text))]);
+        assert_eq!(bindings.get(&Variable::from_valid_name("?tx")).expect("column binding for ?tx").clone(),
+                   vec![QualifiedAlias("datoms01".to_string(), Column::Fixed(DatomsColumn::Tx))]);
+
+        // Score is a value binding.
+        let values = cc.value_bindings;
+        assert_eq!(values.get(&Variable::from_valid_name("?score")).expect("column binding for ?score").clone(),
+                   TypedValue::Double(0.0.into()));
+
+        let known_types = cc.known_types;
+        assert_eq!(known_types.len(), 4);
+
+        assert_eq!(known_types.get(&Variable::from_valid_name("?entity")).expect("known types for ?entity").clone(),
+                   vec![ValueType::Ref].into_iter().collect());
+        assert_eq!(known_types.get(&Variable::from_valid_name("?value")).expect("known types for ?value").clone(),
+                   vec![ValueType::String].into_iter().collect());
+        assert_eq!(known_types.get(&Variable::from_valid_name("?tx")).expect("known types for ?tx").clone(),
+                   vec![ValueType::Ref].into_iter().collect());
+        assert_eq!(known_types.get(&Variable::from_valid_name("?score")).expect("known types for ?score").clone(),
+                   vec![ValueType::Double].into_iter().collect());
+
+        let mut cc = ConjoiningClauses::default();
+        let op = PlainSymbol::plain("fulltext");
+        cc.apply_fulltext(known, WhereFn {
+            operator: op,
+            args: vec![
+                FnArg::SrcVar(SrcVar::DefaultSrc),
+                FnArg::IdentOrKeyword(Keyword::namespaced("foo", "bar")),
+                FnArg::Constant("needle".into()),
+            ],
+            binding: Binding::BindRel(vec![VariableOrPlaceholder::Variable(Variable::from_valid_name("?entity")),
+                                           VariableOrPlaceholder::Variable(Variable::from_valid_name("?value")),
+                                           VariableOrPlaceholder::Variable(Variable::from_valid_name("?tx")),
+                                           VariableOrPlaceholder::Variable(Variable::from_valid_name("?score"))]),
+        }).expect("to be able to apply_fulltext");
+
+        // It's not a fulltext attribute, so the CC cannot yield results.
+        assert!(cc.is_known_empty());
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/ground.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/ground.rs.html new file mode 100644 index 00000000..2e368c8d --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/ground.rs.html @@ -0,0 +1,910 @@ + + + + + + + + + + ground.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use mentat_core::{
+    Schema,
+    TypedValue,
+    ValueType,
+    ValueTypeSet,
+};
+
+use mentat_query::{
+    Binding,
+    FnArg,
+    Variable,
+    VariableOrPlaceholder,
+    WhereFn,
+};
+
+use clauses::{
+    ConjoiningClauses,
+    PushComputed,
+};
+
+use clauses::convert::ValueConversion;
+
+use errors::{
+    AlgebrizerError,
+    BindingError,
+    InvalidBinding,
+    Result,
+};
+
+use types::{
+    ComputedTable,
+    EmptyBecause,
+    SourceAlias,
+    VariableColumn,
+};
+
+use Known;
+
+impl ConjoiningClauses {
+    /// Take a relation: a matrix of values which will successively bind to named variables of
+    /// the provided types.
+    /// Construct a computed table to yield this relation.
+    /// This function will panic if some invariants are not met.
+    fn collect_named_bindings<'s>(&mut self, schema: &'s Schema, names: Vec<Variable>, types: Vec<ValueType>, values: Vec<TypedValue>) {
+        if values.is_empty() {
+            return;
+        }
+
+        assert!(!names.is_empty());
+        assert_eq!(names.len(), types.len());
+        assert!(values.len() >= names.len());
+        assert_eq!(values.len() % names.len(), 0);      // It's an exact multiple.
+
+        let named_values = ComputedTable::NamedValues {
+            names: names.clone(),
+            values: values,
+        };
+
+        let table = self.computed_tables.push_computed(named_values);
+        let alias = self.next_alias_for_table(table);
+
+        // Stitch the computed table into column_bindings, so we get cross-linking.
+        for (name, ty) in names.iter().zip(types.into_iter()) {
+            self.constrain_var_to_type(name.clone(), ty);
+            self.bind_column_to_var(schema, alias.clone(), VariableColumn::Variable(name.clone()), name.clone());
+        }
+
+        self.from.push(SourceAlias(table, alias));
+    }
+
+    fn apply_ground_place<'s>(&mut self, schema: &'s Schema, var: VariableOrPlaceholder, arg: FnArg) -> Result<()> {
+        match var {
+            VariableOrPlaceholder::Placeholder => Ok(()),
+            VariableOrPlaceholder::Variable(var) => self.apply_ground_var(schema, var, arg),
+        }
+    }
+
+    /// Constrain the CC to associate the given var with the given ground argument.
+    /// Marks known-empty on failure.
+    fn apply_ground_var<'s>(&mut self, schema: &'s Schema, var: Variable, arg: FnArg) -> Result<()> {
+        let known_types = self.known_type_set(&var);
+        match self.typed_value_from_arg(schema, &var, arg, known_types)? {
+            ValueConversion::Val(value) => self.apply_ground_value(var, value),
+            ValueConversion::Impossible(because) => {
+                self.mark_known_empty(because);
+                Ok(())
+            },
+        }
+    }
+
+    /// Marks known-empty on failure.
+    fn apply_ground_value(&mut self, var: Variable, value: TypedValue) -> Result<()> {
+        if let Some(existing) = self.bound_value(&var) {
+            if existing != value {
+                self.mark_known_empty(EmptyBecause::ConflictingBindings {
+                    var: var.clone(),
+                    existing: existing.clone(),
+                    desired: value,
+                });
+                return Ok(())
+            }
+        } else {
+            self.bind_value(&var, value.clone());
+        }
+
+        Ok(())
+    }
+
+    pub(crate) fn apply_ground(&mut self, known: Known, where_fn: WhereFn) -> Result<()> {
+        if where_fn.args.len() != 1 {
+            bail!(AlgebrizerError::InvalidNumberOfArguments(where_fn.operator.clone(), where_fn.args.len(), 1));
+        }
+
+        let mut args = where_fn.args.into_iter();
+
+        if where_fn.binding.is_empty() {
+            // The binding must introduce at least one bound variable.
+            bail!(InvalidBinding::new(where_fn.operator.clone(), BindingError::NoBoundVariable));
+        }
+
+        if !where_fn.binding.is_valid() {
+            // The binding must not duplicate bound variables.
+            bail!(InvalidBinding::new(where_fn.operator.clone(), BindingError::RepeatedBoundVariable));
+        }
+
+        let schema = known.schema;
+
+        // Scalar and tuple bindings are a little special: because there's only one value,
+        // we can immediately substitute the value as a known value in the CC, additionally
+        // generating a WHERE clause if columns have already been bound.
+        match (where_fn.binding, args.next().unwrap()) {
+            (Binding::BindScalar(var), constant) =>
+                self.apply_ground_var(schema, var, constant),
+
+            (Binding::BindTuple(places), FnArg::Vector(children)) => {
+                // Just the same, but we bind more than one column at a time.
+                if children.len() != places.len() {
+                    // Number of arguments don't match the number of values. TODO: better error message.
+                    bail!(AlgebrizerError::GroundBindingsMismatch)
+                }
+                for (place, arg) in places.into_iter().zip(children.into_iter()) {
+                    self.apply_ground_place(schema, place, arg)?  // TODO: short-circuit on impossible.
+                }
+                Ok(())
+            },
+
+            // Collection bindings and rel bindings are similar in that they are both
+            // implemented as a subquery with a projection list and a set of values.
+            // The difference is that BindColl has only a single variable, and its values
+            // are all in a single structure. That makes it substantially simpler!
+            (Binding::BindColl(var), FnArg::Vector(children)) => {
+                if children.is_empty() {
+                    bail!(AlgebrizerError::InvalidGroundConstant)
+                }
+
+                // Turn a collection of arguments into a Vec of `TypedValue`s of the same type.
+                let known_types = self.known_type_set(&var);
+                // Check that every value has the same type.
+                let mut accumulated_types = ValueTypeSet::none();
+                let mut skip: Option<EmptyBecause> = None;
+                let values = children.into_iter()
+                                     .filter_map(|arg| -> Option<Result<TypedValue>> {
+                                         // We need to get conversion errors out.
+                                         // We also want to mark known-empty on impossibilty, but
+                                         // still detect serious errors.
+                                         match self.typed_value_from_arg(schema, &var, arg, known_types) {
+                                             Ok(ValueConversion::Val(tv)) => {
+                                                 if accumulated_types.insert(tv.value_type()) &&
+                                                    !accumulated_types.is_unit() {
+                                                     // Values not all of the same type.
+                                                     Some(Err(AlgebrizerError::InvalidGroundConstant.into()))
+                                                 } else {
+                                                     Some(Ok(tv))
+                                                 }
+                                             },
+                                             Ok(ValueConversion::Impossible(because)) => {
+                                                 // Skip this value.
+                                                 skip = Some(because);
+                                                 None
+                                             },
+                                             Err(e) => Some(Err(e.into())),
+                                         }
+                                     })
+                                     .collect::<Result<Vec<TypedValue>>>()?;
+
+                if values.is_empty() {
+                    let because = skip.expect("we skipped all rows for a reason");
+                    self.mark_known_empty(because);
+                    return Ok(());
+                }
+
+                // Otherwise, we now have the values and the type.
+                let types = vec![accumulated_types.exemplar().unwrap()];
+                let names = vec![var.clone()];
+
+                self.collect_named_bindings(schema, names, types, values);
+                Ok(())
+            },
+
+            (Binding::BindRel(places), FnArg::Vector(rows)) => {
+                if rows.is_empty() {
+                    bail!(AlgebrizerError::InvalidGroundConstant)
+                }
+
+                // Grab the known types to which these args must conform, and track
+                // the places that won't be bound in the output.
+                let template: Vec<Option<(Variable, ValueTypeSet)>> =
+                    places.iter()
+                          .map(|x| match x {
+                              &VariableOrPlaceholder::Placeholder     => None,
+                              &VariableOrPlaceholder::Variable(ref v) => Some((v.clone(), self.known_type_set(v))),
+                          })
+                          .collect();
+
+                // The expected 'width' of the matrix is the number of named variables.
+                let full_width = places.len();
+                let names: Vec<Variable> = places.into_iter().filter_map(|x| x.into_var()).collect();
+                let expected_width = names.len();
+                let expected_rows = rows.len();
+
+                if expected_width == 0 {
+                    // They can't all be placeholders.
+                    bail!(AlgebrizerError::InvalidGroundConstant)
+                }
+
+                // Accumulate values into `matrix` and types into `a_t_f_c`.
+                // This representation of a rectangular matrix is more efficient than one composed
+                // of N separate vectors.
+                let mut matrix = Vec::with_capacity(expected_width * expected_rows);
+                let mut accumulated_types_for_columns = vec![ValueTypeSet::none(); expected_width];
+
+                // Loop so we can bail out.
+                let mut skipped_all: Option<EmptyBecause> = None;
+                for row in rows.into_iter() {
+                    match row {
+                        FnArg::Vector(cols) => {
+                            // Make sure that every row is the same length.
+                            if cols.len() != full_width {
+                                bail!(AlgebrizerError::InvalidGroundConstant)
+                            }
+
+                            // TODO: don't accumulate twice.
+                            let mut vals = Vec::with_capacity(expected_width);
+                            let mut skip: Option<EmptyBecause> = None;
+                            for (col, pair) in cols.into_iter().zip(template.iter()) {
+                                // Now we have (val, Option<(name, known_types)>). Silly,
+                                // but this is how we iter!
+                                // Convert each item in the row.
+                                // If any value in the row is impossible, then skip the row.
+                                // If all rows are impossible, fail the entire CC.
+                                if let &Some(ref pair) = pair {
+                                    match self.typed_value_from_arg(schema, &pair.0, col, pair.1)? {
+                                        ValueConversion::Val(tv) => vals.push(tv),
+                                        ValueConversion::Impossible(because) => {
+                                            // Skip this row. It cannot produce bindings.
+                                            skip = Some(because);
+                                            break;
+                                        },
+                                    }
+                                }
+                            }
+
+                            if skip.is_some() {
+                                // Skip this row and record why, in case we skip all.
+                                skipped_all = skip;
+                                continue;
+                            }
+
+                            // Accumulate the values into the matrix and the types into the type set.
+                            for (val, acc) in vals.into_iter().zip(accumulated_types_for_columns.iter_mut()) {
+                                let inserted = acc.insert(val.value_type());
+                                if inserted && !acc.is_unit() {
+                                    // Heterogeneous types.
+                                    bail!(AlgebrizerError::InvalidGroundConstant)
+                                }
+                                matrix.push(val);
+                            }
+
+                        },
+                        _ => bail!(AlgebrizerError::InvalidGroundConstant),
+                    }
+                }
+
+                // Do we have rows? If not, the CC cannot succeed.
+                if matrix.is_empty() {
+                    // We will either have bailed or will have accumulated *something* into the matrix,
+                    // so we can safely unwrap here.
+                    self.mark_known_empty(skipped_all.expect("we skipped for a reason"));
+                    return Ok(());
+                }
+
+                // Take the single type from each set. We know there's only one: we got at least one
+                // type, 'cos we bailed out for zero rows, and we also bailed out each time we
+                // inserted a second type.
+                // By restricting to homogeneous columns, we greatly simplify projection. In the
+                // future, we could loosen this restriction, at the cost of projecting (some) value
+                // type tags. If and when we want to algebrize in two phases and allow for
+                // late-binding input variables, we'll probably be able to loosen this restriction
+                // with little penalty.
+                let types = accumulated_types_for_columns.into_iter()
+                                                         .map(|x| x.exemplar().unwrap())
+                                                         .collect();
+                self.collect_named_bindings(schema, names, types, matrix);
+                Ok(())
+            },
+            (_, _) => bail!(AlgebrizerError::InvalidGroundConstant),
+        }
+    }
+}
+
+#[cfg(test)]
+mod testing {
+    use super::*;
+
+    use mentat_core::{
+        Attribute,
+        ValueType,
+    };
+
+    use mentat_query::{
+        Binding,
+        FnArg,
+        Keyword,
+        PlainSymbol,
+        Variable,
+    };
+
+    use clauses::{
+        add_attribute,
+        associate_ident,
+    };
+
+    #[test]
+    fn test_apply_ground() {
+        let vz = Variable::from_valid_name("?z");
+
+        let mut cc = ConjoiningClauses::default();
+        let mut schema = Schema::default();
+
+        associate_ident(&mut schema, Keyword::namespaced("foo", "fts"), 100);
+        add_attribute(&mut schema, 100, Attribute {
+            value_type: ValueType::String,
+            index: true,
+            fulltext: true,
+            ..Default::default()
+        });
+
+        let known = Known::for_schema(&schema);
+
+        // It's awkward enough to write these expansions that we give the details for the simplest
+        // case only.  See the tests of the translator for more extensive (albeit looser) coverage.
+        let op = PlainSymbol::plain("ground");
+        cc.apply_ground(known, WhereFn {
+            operator: op,
+            args: vec![
+                FnArg::EntidOrInteger(10),
+            ],
+            binding: Binding::BindScalar(vz.clone()),
+        }).expect("to be able to apply_ground");
+
+        assert!(!cc.is_known_empty());
+
+        // Finally, expand column bindings.
+        cc.expand_column_bindings();
+        assert!(!cc.is_known_empty());
+
+        let clauses = cc.wheres;
+        assert_eq!(clauses.len(), 0);
+
+        let column_bindings = cc.column_bindings;
+        assert_eq!(column_bindings.len(), 0);           // Scalar doesn't need this.
+
+        let known_types = cc.known_types;
+        assert_eq!(known_types.len(), 1);
+        assert_eq!(known_types.get(&vz).expect("to know the type of ?z"),
+                   &ValueTypeSet::of_one(ValueType::Long));
+
+        let value_bindings = cc.value_bindings;
+        assert_eq!(value_bindings.len(), 1);
+        assert_eq!(value_bindings.get(&vz).expect("to have a value for ?z"),
+                   &TypedValue::Long(10));        // We default to Long instead of entid.
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/inputs.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/inputs.rs.html new file mode 100644 index 00000000..0dd208af --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/inputs.rs.html @@ -0,0 +1,286 @@ + + + + + + + + + + inputs.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::collections::BTreeMap;
+
+use mentat_core::{
+    TypedValue,
+    ValueType,
+};
+
+use mentat_query::{
+    Variable,
+};
+
+use errors::{
+    AlgebrizerError,
+    Result,
+};
+
+/// Define the inputs to a query. This is in two parts: a set of values known now, and a set of
+/// types known now.
+/// The separate map of types is to allow queries to be algebrized without full knowledge of
+/// the bindings that will be used at execution time.
+/// When built correctly, `types` is guaranteed to contain the types of `values` -- use
+/// `QueryInputs::new` or `QueryInputs::with_values` to construct an instance.
+pub struct QueryInputs {
+    pub(crate) types: BTreeMap<Variable, ValueType>,
+    pub(crate) values: BTreeMap<Variable, TypedValue>,
+}
+
+impl Default for QueryInputs {
+    fn default() -> Self {
+        QueryInputs {
+            types: BTreeMap::default(),
+            values: BTreeMap::default(),
+        }
+    }
+}
+
+impl QueryInputs {
+    pub fn with_value_sequence(vals: Vec<(Variable, TypedValue)>) -> QueryInputs {
+        let values: BTreeMap<Variable, TypedValue> = vals.into_iter().collect();
+        QueryInputs::with_values(values)
+    }
+
+    pub fn with_type_sequence(types: Vec<(Variable, ValueType)>) -> QueryInputs {
+        QueryInputs {
+            types: types.into_iter().collect(),
+            values: BTreeMap::default(),
+        }
+    }
+
+    pub fn with_values(values: BTreeMap<Variable, TypedValue>) -> QueryInputs {
+        QueryInputs {
+            types: values.iter().map(|(var, val)| (var.clone(), val.value_type())).collect(),
+            values: values,
+        }
+    }
+
+    pub fn new(mut types: BTreeMap<Variable, ValueType>,
+               values: BTreeMap<Variable, TypedValue>) -> Result<QueryInputs> {
+        // Make sure that the types of the values agree with those in types, and collect.
+        for (var, v) in values.iter() {
+            let t = v.value_type();
+            let old = types.insert(var.clone(), t);
+            if let Some(old) = old {
+                if old != t {
+                    bail!(AlgebrizerError::InputTypeDisagreement(var.name(), old, t));
+                }
+            }
+        }
+        Ok(QueryInputs { types: types, values: values })
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/mod.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/mod.rs.html new file mode 100644 index 00000000..ac3841e1 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/mod.rs.html @@ -0,0 +1,2538 @@ + + + + + + + + + + mod.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::cmp;
+
+use std::collections::{
+    BTreeMap,
+    BTreeSet,
+    VecDeque,
+};
+
+use std::collections::btree_map::{
+    Entry,
+};
+
+use std::fmt::{
+    Debug,
+    Formatter,
+};
+
+use mentat_core::{
+    Attribute,
+    Cloned,
+    Entid,
+    HasSchema,
+    KnownEntid,
+    Schema,
+    TypedValue,
+    ValueType,
+    ValueTypeSet,
+};
+
+use mentat_core::counter::RcCounter;
+
+use mentat_query::{
+    Element,
+    FindSpec,
+    Keyword,
+    Pull,
+    Variable,
+    WhereClause,
+};
+
+use mentat_query::{
+    PatternNonValuePlace,
+};
+
+use errors::{
+    AlgebrizerError,
+    Result,
+};
+
+use types::{
+    ColumnConstraint,
+    ColumnIntersection,
+    ComputedTable,
+    Column,
+    DatomsColumn,
+    DatomsTable,
+    EmptyBecause,
+    EvolvedNonValuePlace,
+    EvolvedPattern,
+    EvolvedValuePlace,
+    FulltextColumn,
+    PlaceOrEmpty,
+    QualifiedAlias,
+    QueryValue,
+    SourceAlias,
+    TableAlias,
+};
+
+mod convert;              // Converting args to values.
+mod inputs;
+mod or;
+mod not;
+mod pattern;
+mod predicate;
+mod resolve;
+
+mod ground;
+mod fulltext;
+mod tx_log_api;
+mod where_fn;
+
+use validate::{
+    validate_not_join,
+    validate_or_join,
+};
+
+pub use self::inputs::QueryInputs;
+
+use Known;
+
+trait Contains<K, T> {
+    fn when_contains<F: FnOnce() -> T>(&self, k: &K, f: F) -> Option<T>;
+}
+
+trait Intersection<K> {
+    fn with_intersected_keys(&self, ks: &BTreeSet<K>) -> Self;
+    fn keep_intersected_keys(&mut self, ks: &BTreeSet<K>);
+}
+
+impl<K: Ord, T> Contains<K, T> for BTreeSet<K> {
+    fn when_contains<F: FnOnce() -> T>(&self, k: &K, f: F) -> Option<T> {
+        if self.contains(k) {
+            Some(f())
+        } else {
+            None
+        }
+    }
+}
+
+impl<K: Clone + Ord, V: Clone> Intersection<K> for BTreeMap<K, V> {
+    /// Return a clone of the map with only keys that are present in `ks`.
+    fn with_intersected_keys(&self, ks: &BTreeSet<K>) -> Self {
+        self.iter()
+            .filter_map(|(k, v)| ks.when_contains(k, || (k.clone(), v.clone())))
+            .collect()
+    }
+
+    /// Remove all keys from the map that are not present in `ks`.
+    /// This implementation is terrible because there's no mutable iterator for BTreeMap.
+    fn keep_intersected_keys(&mut self, ks: &BTreeSet<K>) {
+        if self.is_empty() {
+            return;
+        }
+        if ks.is_empty() {
+            self.clear();
+        }
+
+        let expected_remaining = cmp::max(0, self.len() - ks.len());
+        let mut to_remove = Vec::with_capacity(expected_remaining);
+        for k in self.keys() {
+            if !ks.contains(k) {
+                to_remove.push(k.clone())
+            }
+        }
+        for k in to_remove.into_iter() {
+            self.remove(&k);
+        }
+    }
+}
+
+pub type VariableBindings = BTreeMap<Variable, TypedValue>;
+
+/// A `ConjoiningClauses` (CC) is a collection of clauses that are combined with `JOIN`.
+/// The topmost form in a query is a `ConjoiningClauses`.
+///
+/// - Ordinary pattern clauses turn into `FROM` parts and `WHERE` parts using `=`.
+/// - Predicate clauses turn into the same, but with other functions.
+/// - Function clauses turn into `WHERE` parts using function-specific comparisons.
+/// - `not` turns into `NOT EXISTS` with `WHERE` clauses inside the subquery to
+///   bind it to the outer variables, or adds simple `WHERE` clauses to the outer
+///   clause.
+/// - `not-join` is similar, but with explicit binding.
+/// - `or` turns into a collection of `UNION`s inside a subquery, or a simple
+///   alternation.
+///   `or`'s documentation states that all clauses must include the same vars,
+///   but that's an over-simplification: all clauses must refer to the external
+///   unification vars.
+///   The entire `UNION`-set is `JOIN`ed to any surrounding expressions per the `rule-vars`
+///   clause, or the intersection of the vars in the two sides of the `JOIN`.
+///
+/// Not yet done:
+/// - Function clauses with bindings turn into:
+///   * Subqueries. Perhaps less efficient? Certainly clearer.
+///   * Projection expressions, if only used for output.
+///   * Inline expressions?
+///---------------------------------------------------------------------------------------
+pub struct ConjoiningClauses {
+    /// `Some` if this set of clauses cannot yield results in the context of the current schema.
+    pub empty_because: Option<EmptyBecause>,
+
+    /// A data source used to generate an alias for a table -- e.g., from "datoms" to "datoms123".
+    alias_counter: RcCounter,
+
+    /// A vector of source/alias pairs used to construct a SQL `FROM` list.
+    pub from: Vec<SourceAlias>,
+
+    /// A vector of computed tables (typically subqueries). The index into this vector is used as
+    /// an identifier in a `DatomsTable::Computed(c)` table reference.
+    pub computed_tables: Vec<ComputedTable>,
+
+    /// A list of fragments that can be joined by `AND`.
+    pub wheres: ColumnIntersection,
+
+    /// A map from var to qualified columns. Used to project.
+    pub column_bindings: BTreeMap<Variable, Vec<QualifiedAlias>>,
+
+    /// A list of variables mentioned in the enclosing query's :in clause. These must all be bound
+    /// before the query can be executed. TODO: clarify what this means for nested CCs.
+    pub input_variables: BTreeSet<Variable>,
+
+    /// In some situations -- e.g., when a query is being run only once -- we know in advance the
+    /// values bound to some or all variables. These can be substituted directly when the query is
+    /// algebrized.
+    ///
+    /// Value bindings must agree with `known_types`. If you write a query like
+    /// ```edn
+    /// [:find ?x :in $ ?val :where [?x :foo/int ?val]]
+    /// ```
+    ///
+    /// and for `?val` provide `TypedValue::String("foo".to_string())`, the query will be known at
+    /// algebrizing time to be empty.
+    value_bindings: VariableBindings,
+
+    /// A map from var to type. Whenever a var maps unambiguously to two different types, it cannot
+    /// yield results, so we don't represent that case here. If a var isn't present in the map, it
+    /// means that its type is not known in advance.
+    /// Usually that state should be represented by `ValueTypeSet::Any`.
+    pub known_types: BTreeMap<Variable, ValueTypeSet>,
+
+    /// A mapping, similar to `column_bindings`, but used to pull type tags out of the store at runtime.
+    /// If a var isn't unit in `known_types`, it should be present here.
+    pub extracted_types: BTreeMap<Variable, QualifiedAlias>,
+
+    /// Map of variables to the set of type requirements we have for them.
+    required_types: BTreeMap<Variable, ValueTypeSet>,
+}
+
+impl PartialEq for ConjoiningClauses {
+    fn eq(&self, other: &ConjoiningClauses) -> bool {
+        self.empty_because.eq(&other.empty_because) &&
+        self.from.eq(&other.from) &&
+        self.computed_tables.eq(&other.computed_tables) &&
+        self.wheres.eq(&other.wheres) &&
+        self.column_bindings.eq(&other.column_bindings) &&
+        self.input_variables.eq(&other.input_variables) &&
+        self.value_bindings.eq(&other.value_bindings) &&
+        self.known_types.eq(&other.known_types) &&
+        self.extracted_types.eq(&other.extracted_types) &&
+        self.required_types.eq(&other.required_types)
+    }
+}
+
+impl Eq for ConjoiningClauses {}
+
+impl Debug for ConjoiningClauses {
+    fn fmt(&self, fmt: &mut Formatter) -> ::std::fmt::Result {
+        fmt.debug_struct("ConjoiningClauses")
+            .field("empty_because", &self.empty_because)
+            .field("from", &self.from)
+            .field("computed_tables", &self.computed_tables)
+            .field("wheres", &self.wheres)
+            .field("column_bindings", &self.column_bindings)
+            .field("input_variables", &self.input_variables)
+            .field("value_bindings", &self.value_bindings)
+            .field("known_types", &self.known_types)
+            .field("extracted_types", &self.extracted_types)
+            .field("required_types", &self.required_types)
+            .finish()
+    }
+}
+
+/// Basics.
+impl Default for ConjoiningClauses {
+    fn default() -> ConjoiningClauses {
+        ConjoiningClauses {
+            empty_because: None,
+            alias_counter: RcCounter::new(),
+            from: vec![],
+            computed_tables: vec![],
+            wheres: ColumnIntersection::default(),
+            required_types: BTreeMap::new(),
+            input_variables: BTreeSet::new(),
+            column_bindings: BTreeMap::new(),
+            value_bindings: BTreeMap::new(),
+            known_types: BTreeMap::new(),
+            extracted_types: BTreeMap::new(),
+        }
+    }
+}
+
+pub struct VariableIterator<'a>(
+    ::std::collections::btree_map::Keys<'a, Variable, TypedValue>,
+);
+
+impl<'a> Iterator for VariableIterator<'a> {
+    type Item = &'a Variable;
+
+    fn next(&mut self) -> Option<&'a Variable> {
+        self.0.next()
+    }
+}
+
+impl ConjoiningClauses {
+    /// Construct a new `ConjoiningClauses` with the provided alias counter. This allows a caller
+    /// to share a counter with an enclosing scope, and to start counting at a particular offset
+    /// for testing.
+    pub(crate) fn with_alias_counter(counter: RcCounter) -> ConjoiningClauses {
+        ConjoiningClauses {
+            alias_counter: counter,
+            ..Default::default()
+        }
+    }
+
+    #[cfg(test)]
+    pub fn with_inputs<T>(in_variables: BTreeSet<Variable>, inputs: T) -> ConjoiningClauses
+    where T: Into<Option<QueryInputs>> {
+        ConjoiningClauses::with_inputs_and_alias_counter(in_variables, inputs, RcCounter::new())
+    }
+
+    pub(crate) fn with_inputs_and_alias_counter<T>(in_variables: BTreeSet<Variable>,
+                                                   inputs: T,
+                                                   alias_counter: RcCounter) -> ConjoiningClauses
+    where T: Into<Option<QueryInputs>> {
+        match inputs.into() {
+            None => ConjoiningClauses::with_alias_counter(alias_counter),
+            Some(QueryInputs { mut types, mut values }) => {
+                // Discard any bindings not mentioned in our :in clause.
+                types.keep_intersected_keys(&in_variables);
+                values.keep_intersected_keys(&in_variables);
+
+                let mut cc = ConjoiningClauses {
+                    alias_counter: alias_counter,
+                    input_variables: in_variables,
+                    value_bindings: values,
+                    ..Default::default()
+                };
+
+                // Pre-fill our type mappings with the types of the input bindings.
+                cc.known_types
+                  .extend(types.iter()
+                               .map(|(k, v)| (k.clone(), ValueTypeSet::of_one(*v))));
+                cc
+            },
+        }
+    }
+}
+
+/// Early-stage query handling.
+impl ConjoiningClauses {
+    pub(crate) fn derive_types_from_find_spec(&mut self, find_spec: &FindSpec) {
+        for spec in find_spec.columns() {
+            match spec {
+                &Element::Pull(Pull { ref var, patterns: _ }) => {
+                    self.constrain_var_to_type(var.clone(), ValueType::Ref);
+                },
+                _ => {
+                },
+            }
+        }
+    }
+}
+
+/// Cloning.
+impl ConjoiningClauses {
+    fn make_receptacle(&self) -> ConjoiningClauses {
+        ConjoiningClauses {
+            alias_counter: self.alias_counter.clone(),
+            empty_because: self.empty_because.clone(),
+            input_variables: self.input_variables.clone(),
+            value_bindings: self.value_bindings.clone(),
+            known_types: self.known_types.clone(),
+            extracted_types: self.extracted_types.clone(),
+            required_types: self.required_types.clone(),
+            ..Default::default()
+        }
+    }
+
+    /// Make a new CC populated with the relevant variable associations in this CC.
+    /// The CC shares an alias count with all of its copies.
+    fn use_as_template(&self, vars: &BTreeSet<Variable>) -> ConjoiningClauses {
+        ConjoiningClauses {
+            alias_counter: self.alias_counter.clone(),
+            empty_because: self.empty_because.clone(),
+            input_variables: self.input_variables.intersection(vars).cloned().collect(),
+            value_bindings: self.value_bindings.with_intersected_keys(&vars),
+            known_types: self.known_types.with_intersected_keys(&vars),
+            extracted_types: self.extracted_types.with_intersected_keys(&vars),
+            required_types: self.required_types.with_intersected_keys(&vars),
+            ..Default::default()
+        }
+    }
+}
+
+impl ConjoiningClauses {
+    /// Be careful with this. It'll overwrite existing bindings.
+    pub fn bind_value(&mut self, var: &Variable, value: TypedValue) {
+        let vt = value.value_type();
+        self.constrain_var_to_type(var.clone(), vt);
+
+        // Are there any existing column bindings for this variable?
+        // If so, generate a constraint against the primary column.
+        if let Some(vec) = self.column_bindings.get(var) {
+            if let Some(col) = vec.first() {
+                self.wheres.add_intersection(ColumnConstraint::Equals(col.clone(), QueryValue::TypedValue(value.clone())));
+            }
+        }
+
+        // Are we also trying to figure out the type of the value when the query runs?
+        // If so, constrain that!
+        if let Some(qa) = self.extracted_types.get(&var) {
+            self.wheres.add_intersection(ColumnConstraint::has_unit_type(qa.0.clone(), vt));
+        }
+
+        // Finally, store the binding for future use.
+        self.value_bindings.insert(var.clone(), value);
+    }
+
+    pub fn bound_value(&self, var: &Variable) -> Option<TypedValue> {
+        self.value_bindings.get(var).cloned()
+    }
+
+    pub fn is_value_bound(&self, var: &Variable) -> bool {
+        self.value_bindings.contains_key(var)
+    }
+
+    pub fn value_bindings(&self, variables: &BTreeSet<Variable>) -> VariableBindings {
+        self.value_bindings.with_intersected_keys(variables)
+    }
+
+    /// Return an iterator over the variables externally bound to values.
+    pub fn value_bound_variables(&self) -> VariableIterator {
+        VariableIterator(self.value_bindings.keys())
+    }
+
+    /// Return a set of the variables externally bound to values.
+    pub fn value_bound_variable_set(&self) -> BTreeSet<Variable> {
+        self.value_bound_variables().cloned().collect()
+    }
+
+    /// Return a single `ValueType` if the given variable is known to have a precise type.
+    /// Returns `None` if the type of the variable is unknown.
+    /// Returns `None` if the type of the variable is known but not precise -- "double
+    /// or integer" isn't good enough.
+    pub fn known_type(&self, var: &Variable) -> Option<ValueType> {
+        match self.known_types.get(var) {
+            Some(set) if set.is_unit() => set.exemplar(),
+            _ => None,
+        }
+    }
+
+    pub fn known_type_set(&self, var: &Variable) -> ValueTypeSet {
+        self.known_types.get(var).cloned().unwrap_or(ValueTypeSet::any())
+    }
+
+    pub(crate) fn bind_column_to_var<C: Into<Column>>(&mut self, schema: &Schema, table: TableAlias, column: C, var: Variable) {
+        let column = column.into();
+        // Do we have an external binding for this?
+        if let Some(bound_val) = self.bound_value(&var) {
+            // Great! Use that instead.
+            // We expect callers to do things like bind keywords here; we need to translate these
+            // before they hit our constraints.
+            match column {
+                Column::Variable(_) => {
+                    // We don't need to handle expansion of attributes here. The subquery that
+                    // produces the variable projection will do so.
+                    self.constrain_column_to_constant(table, column, bound_val);
+                },
+
+                Column::Transactions(_) => {
+                    self.constrain_column_to_constant(table, column, bound_val);
+                },
+
+                Column::Fulltext(FulltextColumn::Rowid) |
+                Column::Fulltext(FulltextColumn::Text) => {
+                    // We never expose `rowid` via queries.  We do expose `text`, but only
+                    // indirectly, by joining against `datoms`.  Therefore, these are meaningless.
+                    unimplemented!()
+                },
+
+                Column::Fixed(DatomsColumn::ValueTypeTag) => {
+                    // I'm pretty sure this is meaningless right now, because we will never bind
+                    // a type tag to a variable -- there's no syntax for doing so.
+                    // In the future we might expose a way to do so, perhaps something like:
+                    // ```
+                    // [:find ?x
+                    //  :where [?x _ ?y]
+                    //         [(= (typeof ?y) :db.valueType/double)]]
+                    // ```
+                    unimplemented!();
+                },
+
+                // TODO: recognize when the valueType might be a ref and also translate entids there.
+                Column::Fixed(DatomsColumn::Value) => {
+                    self.constrain_column_to_constant(table, column, bound_val);
+                },
+
+                // These columns can only be entities, so attempt to translate keywords. If we can't
+                // get an entity out of the bound value, the pattern cannot produce results.
+                Column::Fixed(DatomsColumn::Attribute) |
+                Column::Fixed(DatomsColumn::Entity) |
+                Column::Fixed(DatomsColumn::Tx) => {
+                    match bound_val {
+                        TypedValue::Keyword(ref kw) => {
+                            if let Some(entid) = self.entid_for_ident(schema, kw) {
+                                self.constrain_column_to_entity(table, column, entid.into());
+                            } else {
+                                // Impossible.
+                                // For attributes this shouldn't occur, because we check the binding in
+                                // `table_for_places`/`alias_table`, and if it didn't resolve to a valid
+                                // attribute then we should have already marked the pattern as empty.
+                                self.mark_known_empty(EmptyBecause::UnresolvedIdent(kw.cloned()));
+                            }
+                        },
+                        TypedValue::Ref(entid) => {
+                            self.constrain_column_to_entity(table, column, entid);
+                        },
+                        _ => {
+                            // One can't bind an e, a, or tx to something other than an entity.
+                            self.mark_known_empty(EmptyBecause::InvalidBinding(column, bound_val));
+                        },
+                    }
+                }
+            }
+
+            return;
+        }
+
+        // Will we have an external binding for this?
+        // If so, we don't need to extract its type. We'll know it later.
+        let late_binding = self.input_variables.contains(&var);
+
+        // If this is a value, and we don't already know its type or where
+        // to get its type, record that we can get it from this table.
+        let needs_type_extraction =
+            !late_binding &&                                // Never need to extract for bound vars.
+            self.known_type(&var).is_none() &&              // Don't need to extract if we know a single type.
+            !self.extracted_types.contains_key(&var);       // We're already extracting the type.
+
+        let alias = QualifiedAlias(table, column);
+
+        // If we subsequently find out its type, we'll remove this later -- see
+        // the removal in `constrain_var_to_type`.
+        if needs_type_extraction {
+            if let Some(tag_alias) = alias.for_associated_type_tag() {
+                self.extracted_types.insert(var.clone(), tag_alias);
+            }
+        }
+
+        self.column_bindings.entry(var).or_insert(vec![]).push(alias);
+    }
+
+    pub(crate) fn constrain_column_to_constant<C: Into<Column>>(&mut self, table: TableAlias, column: C, constant: TypedValue) {
+        match constant {
+            // Be a little more explicit.
+            TypedValue::Ref(entid) => self.constrain_column_to_entity(table, column, entid),
+            _ => {
+                let column = column.into();
+                self.wheres.add_intersection(ColumnConstraint::Equals(QualifiedAlias(table, column), QueryValue::TypedValue(constant)))
+            },
+        }
+    }
+
+    pub(crate) fn constrain_column_to_entity<C: Into<Column>>(&mut self, table: TableAlias, column: C, entity: Entid) {
+        let column = column.into();
+        self.wheres.add_intersection(ColumnConstraint::Equals(QualifiedAlias(table, column), QueryValue::Entid(entity)))
+    }
+
+    pub(crate) fn constrain_attribute(&mut self, table: TableAlias, attribute: Entid) {
+        self.constrain_column_to_entity(table, DatomsColumn::Attribute, attribute)
+    }
+
+    pub(crate) fn constrain_value_to_numeric(&mut self, table: TableAlias, value: i64) {
+        self.wheres.add_intersection(ColumnConstraint::Equals(
+            QualifiedAlias(table, Column::Fixed(DatomsColumn::Value)),
+            QueryValue::PrimitiveLong(value)))
+    }
+
+    /// Mark the given value as a long.
+    pub(crate) fn constrain_var_to_long(&mut self, variable: Variable) {
+        self.narrow_types_for_var(variable, ValueTypeSet::of_one(ValueType::Long));
+    }
+
+    /// Mark the given value as one of the set of numeric types.
+    fn constrain_var_to_numeric(&mut self, variable: Variable) {
+        self.narrow_types_for_var(variable, ValueTypeSet::of_numeric_types());
+    }
+
+    pub(crate) fn can_constrain_var_to_type(&self, var: &Variable, this_type: ValueType) -> Option<EmptyBecause> {
+        self.can_constrain_var_to_types(var, ValueTypeSet::of_one(this_type))
+    }
+
+    fn can_constrain_var_to_types(&self, var: &Variable, these_types: ValueTypeSet) -> Option<EmptyBecause> {
+        if let Some(existing) = self.known_types.get(var) {
+            if existing.intersection(&these_types).is_empty() {
+                return Some(EmptyBecause::TypeMismatch {
+                    var: var.clone(),
+                    existing: existing.clone(),
+                    desired: these_types,
+                });
+            }
+        }
+        None
+    }
+
+    /// Constrains the var if there's no existing type.
+    /// Marks as known-empty if it's impossible for this type to apply because there's a conflicting
+    /// type already known.
+    fn constrain_var_to_type(&mut self, var: Variable, this_type: ValueType) {
+        // Is there an existing mapping for this variable?
+        // Any known inputs have already been added to known_types, and so if they conflict we'll
+        // spot it here.
+        let this_type_set = ValueTypeSet::of_one(this_type);
+        if let Some(existing) = self.known_types.insert(var.clone(), this_type_set) {
+            // There was an existing mapping. Does this type match?
+            if !existing.contains(this_type) {
+                self.mark_known_empty(EmptyBecause::TypeMismatch { var, existing, desired: this_type_set });
+            }
+        }
+    }
+
+    /// Require that `var` be one of the types in `types`. If any existing
+    /// type requirements exist for `var`, the requirement after this
+    /// function returns will be the intersection of the requested types and
+    /// the type requirements in place prior to calling `add_type_requirement`.
+    ///
+    /// If the intersection will leave the variable so that it cannot be any
+    /// type, we'll call `mark_known_empty`.
+    pub(crate) fn add_type_requirement(&mut self, var: Variable, types: ValueTypeSet) {
+        if types.is_empty() {
+            // This shouldn't happen, but if it does…
+            self.mark_known_empty(EmptyBecause::NoValidTypes(var));
+            return;
+        }
+
+        // Optimize for the empty case.
+        let empty_because = match self.required_types.entry(var.clone()) {
+            Entry::Vacant(entry) => {
+                entry.insert(types);
+                return;
+            },
+            Entry::Occupied(mut entry) => {
+                // We have an existing requirement. The new requirement will be
+                // the intersection, but we'll `mark_known_empty` if that's empty.
+                let existing = *entry.get();
+                let intersection = types.intersection(&existing);
+                entry.insert(intersection);
+
+                if !intersection.is_empty() {
+                    return;
+                }
+
+                EmptyBecause::TypeMismatch {
+                    var: var,
+                    existing: existing,
+                    desired: types,
+                }
+            },
+        };
+        self.mark_known_empty(empty_because);
+    }
+
+    /// Like `constrain_var_to_type` but in reverse: this expands the set of types
+    /// with which a variable is associated.
+    ///
+    /// N.B.,: if we ever call `broaden_types` after `empty_because` has been set, we might
+    /// actually move from a state in which a variable can have no type to one that can
+    /// yield results! We never do so at present -- we carefully set-union types before we
+    /// set-intersect them -- but this is worth bearing in mind.
+    pub(crate) fn broaden_types(&mut self, additional_types: BTreeMap<Variable, ValueTypeSet>) {
+        for (var, new_types) in additional_types {
+            match self.known_types.entry(var) {
+                Entry::Vacant(e) => {
+                    if new_types.is_unit() {
+                        self.extracted_types.remove(e.key());
+                    }
+                    e.insert(new_types);
+                },
+                Entry::Occupied(mut e) => {
+                    let new;
+                    // Scoped borrow of `e`.
+                    {
+                        let existing_types = e.get();
+                        if existing_types.is_empty() &&  // The set is empty: no types are possible.
+                           self.empty_because.is_some() {
+                            panic!("Uh oh: we failed this pattern, probably because {:?} couldn't match, but now we're broadening its type.",
+                                   e.key());
+                        }
+                        new = existing_types.union(&new_types);
+                    }
+                    e.insert(new);
+                },
+            }
+        }
+    }
+
+    /// Restrict the known types for `var` to intersect with `types`.
+    /// If no types are already known -- `var` could have any type -- then this is equivalent to
+    /// simply setting the known types to `types`.
+    /// If the known types don't intersect with `types`, mark the pattern as known-empty.
+    fn narrow_types_for_var(&mut self, var: Variable, types: ValueTypeSet) {
+        if types.is_empty() {
+            // We hope this never occurs; we should catch this case earlier.
+            self.mark_known_empty(EmptyBecause::NoValidTypes(var));
+            return;
+        }
+
+        // We can't mutate `empty_because` while we're working with the `Entry`, so do this instead.
+        let mut empty_because: Option<EmptyBecause> = None;
+        match self.known_types.entry(var) {
+            Entry::Vacant(e) => {
+                e.insert(types);
+            },
+            Entry::Occupied(mut e) => {
+                let intersected: ValueTypeSet = types.intersection(e.get());
+                if intersected.is_empty() {
+                    let reason = EmptyBecause::TypeMismatch { var: e.key().clone(),
+                                                              existing: e.get().clone(),
+                                                              desired: types };
+                    empty_because = Some(reason);
+                }
+                // Always insert, even if it's empty!
+                e.insert(intersected);
+            },
+        }
+
+        if let Some(e) = empty_because {
+            self.mark_known_empty(e);
+        }
+    }
+
+    /// Restrict the sets of types for the provided vars to the provided types.
+    /// See `narrow_types_for_var`.
+    pub(crate) fn narrow_types(&mut self, additional_types: BTreeMap<Variable, ValueTypeSet>) {
+        if additional_types.is_empty() {
+            return;
+        }
+        for (var, new_types) in additional_types {
+            self.narrow_types_for_var(var, new_types);
+        }
+    }
+
+    /// Ensure that the given place has the correct types to be a tx-id.
+    fn constrain_to_tx(&mut self, tx: &EvolvedNonValuePlace) {
+        self.constrain_to_ref(tx);
+    }
+
+    /// Ensure that the given place can be an entity, and is congruent with existing types.
+    /// This is used for `entity` and `attribute` places in a pattern.
+    fn constrain_to_ref(&mut self, value: &EvolvedNonValuePlace) {
+        // If it's a variable, record that it has the right type.
+        // Ident or attribute resolution errors (the only other check we need to do) will be done
+        // by the caller.
+        if let &EvolvedNonValuePlace::Variable(ref v) = value {
+            self.constrain_var_to_type(v.clone(), ValueType::Ref)
+        }
+    }
+
+    #[inline]
+    pub fn is_known_empty(&self) -> bool {
+        self.empty_because.is_some()
+    }
+
+    fn mark_known_empty(&mut self, why: EmptyBecause) {
+        if self.empty_because.is_some() {
+            return;
+        }
+        println!("CC known empty: {:?}.", &why);                   // TODO: proper logging.
+        self.empty_because = Some(why);
+    }
+
+    fn entid_for_ident<'s, 'a>(&self, schema: &'s Schema, ident: &'a Keyword) -> Option<KnownEntid> {
+        schema.get_entid(&ident)
+    }
+
+    fn table_for_attribute_and_value<'s, 'a>(&self, attribute: &'s Attribute, value: &'a EvolvedValuePlace) -> ::std::result::Result<DatomsTable, EmptyBecause> {
+        if attribute.fulltext {
+            match value {
+                &EvolvedValuePlace::Placeholder =>
+                    Ok(DatomsTable::Datoms),            // We don't need the value.
+
+                // TODO: an existing non-string binding can cause this pattern to fail.
+                &EvolvedValuePlace::Variable(_) =>
+                    Ok(DatomsTable::FulltextDatoms),
+
+                &EvolvedValuePlace::Value(TypedValue::String(_)) =>
+                    Ok(DatomsTable::FulltextDatoms),
+
+                _ => {
+                    // We can't succeed if there's a non-string constant value for a fulltext
+                    // field.
+                    Err(EmptyBecause::NonStringFulltextValue)
+                },
+            }
+        } else {
+            Ok(DatomsTable::Datoms)
+        }
+    }
+
+    fn table_for_unknown_attribute<'s, 'a>(&self, value: &'a EvolvedValuePlace) -> ::std::result::Result<DatomsTable, EmptyBecause> {
+        // If the value is known to be non-textual, we can simply use the regular datoms
+        // table (TODO: and exclude on `index_fulltext`!).
+        //
+        // If the value is a placeholder too, then we can walk the non-value-joined view,
+        // because we don't care about retrieving the fulltext value.
+        //
+        // If the value is a variable or string, we must use `all_datoms`, or do the join
+        // ourselves, because we'll need to either extract or compare on the string.
+        Ok(
+            match value {
+                // TODO: see if the variable is projected, aggregated, or compared elsewhere in
+                // the query. If it's not, we don't need to use all_datoms here.
+                &EvolvedValuePlace::Variable(ref v) => {
+                    // If `required_types` and `known_types` don't exclude strings,
+                    // we need to query `all_datoms`.
+                    if self.required_types.get(v).map_or(true, |s| s.contains(ValueType::String)) &&
+                       self.known_types.get(v).map_or(true, |s| s.contains(ValueType::String)) {
+                        DatomsTable::AllDatoms
+                    } else {
+                        DatomsTable::Datoms
+                    }
+                }
+                &EvolvedValuePlace::Value(TypedValue::String(_)) =>
+                    DatomsTable::AllDatoms,
+                _ =>
+                    DatomsTable::Datoms,
+            })
+    }
+
+    /// Decide which table to use for the provided attribute and value.
+    /// If the attribute input or value binding doesn't name an attribute, or doesn't name an
+    /// attribute that is congruent with the supplied value, we return an `EmptyBecause`.
+    /// The caller is responsible for marking the CC as known-empty if this is a fatal failure.
+    fn table_for_places<'s, 'a>(&self, schema: &'s Schema, attribute: &'a EvolvedNonValuePlace, value: &'a EvolvedValuePlace) -> ::std::result::Result<DatomsTable, EmptyBecause> {
+        match attribute {
+            &EvolvedNonValuePlace::Entid(id) =>
+                schema.attribute_for_entid(id)
+                      .ok_or_else(|| EmptyBecause::InvalidAttributeEntid(id))
+                      .and_then(|attribute| self.table_for_attribute_and_value(attribute, value)),
+            // TODO: In a prepared context, defer this decision until a second algebrizing phase.
+            // #278.
+            &EvolvedNonValuePlace::Placeholder =>
+                self.table_for_unknown_attribute(value),
+            &EvolvedNonValuePlace::Variable(ref v) => {
+                // See if we have a binding for the variable.
+                match self.bound_value(v) {
+                    // TODO: In a prepared context, defer this decision until a second algebrizing phase.
+                    // #278.
+                    None =>
+                        self.table_for_unknown_attribute(value),
+                    Some(TypedValue::Ref(id)) =>
+                        // Recurse: it's easy.
+                        self.table_for_places(schema, &EvolvedNonValuePlace::Entid(id), value),
+                    Some(TypedValue::Keyword(ref kw)) =>
+                        // Don't recurse: avoid needing to clone the keyword.
+                        schema.attribute_for_ident(kw)
+                              .ok_or_else(|| EmptyBecause::InvalidAttributeIdent(kw.cloned()))
+                              .and_then(|(attribute, _entid)| self.table_for_attribute_and_value(attribute, value)),
+                    Some(v) => {
+                        // This pattern cannot match: the caller has bound a non-entity value to an
+                        // attribute place.
+                        Err(EmptyBecause::InvalidBinding(Column::Fixed(DatomsColumn::Attribute), v.clone()))
+                    },
+                }
+            },
+        }
+    }
+
+    pub(crate) fn next_alias_for_table(&mut self, table: DatomsTable) -> TableAlias {
+        match table {
+            DatomsTable::Computed(u) =>
+                format!("{}{:02}", table.name(), u),
+            _ =>
+                format!("{}{:02}", table.name(), self.alias_counter.next()),
+        }
+    }
+
+    /// Produce a (table, alias) pair to handle the provided pattern.
+    /// This is a mutating method because it mutates the aliaser function!
+    /// Note that if this function decides that a pattern cannot match, it will flip
+    /// `empty_because`.
+    fn alias_table<'s, 'a>(&mut self, schema: &'s Schema, pattern: &'a EvolvedPattern) -> Option<SourceAlias> {
+        self.table_for_places(schema, &pattern.attribute, &pattern.value)
+            .map_err(|reason| {
+                self.mark_known_empty(reason);
+            })
+            .map(|table: DatomsTable| SourceAlias(table, self.next_alias_for_table(table)))
+            .ok()
+    }
+
+    fn get_attribute_for_value<'s>(&self, schema: &'s Schema, value: &TypedValue) -> Option<&'s Attribute> {
+        match value {
+            // We know this one is known if the attribute lookup succeeds…
+            &TypedValue::Ref(id) => schema.attribute_for_entid(id),
+            &TypedValue::Keyword(ref kw) => schema.attribute_for_ident(kw).map(|(a, _id)| a),
+            _ => None,
+        }
+    }
+
+    fn get_attribute<'s, 'a>(&self, schema: &'s Schema, pattern: &'a EvolvedPattern) -> Option<&'s Attribute> {
+        match pattern.attribute {
+            EvolvedNonValuePlace::Entid(id) =>
+                // We know this one is known if the attribute lookup succeeds…
+                schema.attribute_for_entid(id),
+            EvolvedNonValuePlace::Variable(ref var) =>
+                // If the pattern has a variable, we've already determined that the binding -- if
+                // any -- is acceptable and yields a table. Here, simply look to see if it names
+                // an attribute so we can find out the type.
+                self.value_bindings.get(var)
+                                   .and_then(|val| self.get_attribute_for_value(schema, val)),
+            EvolvedNonValuePlace::Placeholder => None,
+        }
+    }
+
+    fn get_value_type<'s, 'a>(&self, schema: &'s Schema, pattern: &'a EvolvedPattern) -> Option<ValueType> {
+        self.get_attribute(schema, pattern).map(|a| a.value_type)
+    }
+}
+
+/// Expansions.
+impl ConjoiningClauses {
+
+    /// Take the contents of `column_bindings` and generate inter-constraints for the appropriate
+    /// columns into `wheres`.
+    ///
+    /// For example, a bindings map associating a var to three places in the query, like
+    ///
+    /// ```edn
+    ///   {?foo [datoms12.e datoms13.v datoms14.e]}
+    /// ```
+    ///
+    /// produces two additional constraints:
+    ///
+    /// ```example
+    ///    datoms12.e = datoms13.v
+    ///    datoms12.e = datoms14.e
+    /// ```
+    pub(crate) fn expand_column_bindings(&mut self) {
+        for cols in self.column_bindings.values() {
+            if cols.len() > 1 {
+                let ref primary = cols[0];
+                let secondaries = cols.iter().skip(1);
+                for secondary in secondaries {
+                    // TODO: if both primary and secondary are .v, should we make sure
+                    // the type tag columns also match?
+                    // We don't do so in the ClojureScript version.
+                    self.wheres.add_intersection(ColumnConstraint::Equals(primary.clone(), QueryValue::Column(secondary.clone())));
+                }
+            }
+        }
+    }
+
+    /// Eliminate any type extractions for variables whose types are definitely known.
+    pub(crate) fn prune_extracted_types(&mut self) {
+        if self.extracted_types.is_empty() || self.known_types.is_empty() {
+            return;
+        }
+        for (var, types) in self.known_types.iter() {
+            if types.is_unit() {
+                self.extracted_types.remove(var);
+            }
+        }
+    }
+
+    /// When we're done with all patterns, we might have a set of type requirements that will
+    /// be used to add additional constraints to the execution plan.
+    ///
+    /// This function does so.
+    ///
+    /// Furthermore, those type requirements will not yet be present in `known_types`, which
+    /// means they won't be used by the projector or translator.
+    ///
+    /// This step also updates `known_types` to match.
+    pub(crate) fn process_required_types(&mut self) -> Result<()> {
+        if self.empty_because.is_some() {
+            return Ok(())
+        }
+
+        // We can't call `mark_known_empty` inside the loop since it would be a
+        // mutable borrow on self while we're using fields on `self`.
+        // We still need to clone `required_types` 'cos we're mutating in
+        // `narrow_types_for_var`.
+        let mut empty_because: Option<EmptyBecause> = None;
+        for (var, types) in self.required_types.clone().into_iter() {
+            if let Some(already_known) = self.known_types.get(&var) {
+                if already_known.is_disjoint(&types) {
+                    // If we know the constraint can't be one of the types
+                    // the variable could take, then we know we're empty.
+                    empty_because = Some(EmptyBecause::TypeMismatch {
+                        var: var,
+                        existing: *already_known,
+                        desired: types,
+                    });
+                    break;
+                }
+
+                if already_known.is_subset(&types) {
+                    // TODO: I'm not convinced that we can do nothing here.
+                    //
+                    // Consider `[:find ?x ?v :where [_ _ ?v] [(> ?v 10)] [?x :foo/long ?v]]`.
+                    //
+                    // That will produce SQL like:
+                    //
+                    // ```
+                    // SELECT datoms01.e AS `?x`, datoms00.v AS `?v`
+                    // FROM datoms datoms00, datoms01
+                    // WHERE datoms00.v > 10
+                    //  AND datoms01.v = datoms00.v
+                    //  AND datoms01.value_type_tag = datoms00.value_type_tag
+                    //  AND datoms01.a = 65537
+                    // ```
+                    //
+                    // Which is not optimal — the left side of the join will
+                    // produce lots of spurious bindings for datoms00.v.
+                    //
+                    // See https://github.com/mozilla/mentat/issues/520, and
+                    // https://github.com/mozilla/mentat/issues/293.
+                    continue;
+                }
+            }
+
+            // Update known types.
+            self.narrow_types_for_var(var.clone(), types);
+
+            let qa = self.extracted_types
+                         .get(&var)
+                         .ok_or_else(|| AlgebrizerError::UnboundVariable(var.name()))?;
+            self.wheres.add_intersection(ColumnConstraint::HasTypes {
+                value: qa.0.clone(),
+                value_types: types,
+                check_value: true,
+            });
+        }
+
+        if let Some(reason) = empty_because {
+            self.mark_known_empty(reason);
+        }
+
+        Ok(())
+    }
+
+    /// When a CC has accumulated all patterns, generate value_type_tag entries in `wheres`
+    /// to refine value types for which two things are true:
+    ///
+    /// - There are two or more different types with the same SQLite representation. E.g.,
+    ///   ValueType::Boolean shares a representation with Integer and Ref.
+    /// - There is no attribute constraint present in the CC.
+    ///
+    /// It's possible at this point for the space of acceptable type tags to not intersect: e.g.,
+    /// for the query
+    ///
+    /// ```edn
+    /// [:find ?x :where
+    ///  [?x ?y true]
+    ///  [?z ?y ?x]]
+    /// ```
+    ///
+    /// where `?y` must simultaneously be a ref-typed attribute and a boolean-typed attribute. This
+    /// function deduces that and calls `self.mark_known_empty`. #293.
+    #[allow(dead_code)]
+    pub(crate) fn expand_type_tags(&mut self) {
+        // TODO.
+    }
+}
+
+impl ConjoiningClauses {
+    fn apply_evolved_patterns(&mut self, known: Known, mut patterns: VecDeque<EvolvedPattern>) -> Result<()> {
+        while let Some(pattern) = patterns.pop_front() {
+            match self.evolve_pattern(known, pattern) {
+                PlaceOrEmpty::Place(re_evolved) => self.apply_pattern(known, re_evolved),
+                PlaceOrEmpty::Empty(because) => {
+                    self.mark_known_empty(because);
+                    patterns.clear();
+                },
+            }
+        }
+        Ok(())
+    }
+
+    fn mark_as_ref(&mut self, pos: &PatternNonValuePlace) {
+        if let &PatternNonValuePlace::Variable(ref var) = pos {
+            self.constrain_var_to_type(var.clone(), ValueType::Ref)
+        }
+    }
+
+    pub(crate) fn apply_clauses(&mut self, known: Known, where_clauses: Vec<WhereClause>) -> Result<()> {
+        // We apply (top level) type predicates first as an optimization.
+        for clause in where_clauses.iter() {
+            match clause {
+                &WhereClause::TypeAnnotation(ref anno) => {
+                    self.apply_type_anno(anno)?;
+                },
+
+                // Patterns are common, so let's grab as much type information from
+                // them as we can.
+                &WhereClause::Pattern(ref p) => {
+                    self.mark_as_ref(&p.entity);
+                    self.mark_as_ref(&p.attribute);
+                    self.mark_as_ref(&p.tx);
+                },
+
+                // TODO: if we wish we can include other kinds of clauses in this type
+                // extraction phase.
+                _ => {},
+            }
+        }
+
+        // Then we apply everything else.
+        // Note that we collect contiguous runs of patterns so that we can evolve them
+        // together to take advantage of mutual partial evaluation.
+        let mut remaining = where_clauses.len();
+        let mut patterns: VecDeque<EvolvedPattern> = VecDeque::with_capacity(remaining);
+        for clause in where_clauses {
+            remaining -= 1;
+            if let &WhereClause::TypeAnnotation(_) = &clause {
+                continue;
+            }
+            match clause {
+                WhereClause::Pattern(p) => {
+                    match self.make_evolved_pattern(known, p) {
+                        PlaceOrEmpty::Place(evolved) => patterns.push_back(evolved),
+                        PlaceOrEmpty::Empty(because) => {
+                            self.mark_known_empty(because);
+                            return Ok(());
+                        }
+                    }
+                },
+                _ => {
+                    if !patterns.is_empty() {
+                        self.apply_evolved_patterns(known, patterns)?;
+                        patterns = VecDeque::with_capacity(remaining);
+                    }
+                    self.apply_clause(known, clause)?;
+                },
+            }
+        }
+        self.apply_evolved_patterns(known, patterns)
+    }
+
+    // This is here, rather than in `lib.rs`, because it's recursive: `or` can contain `or`,
+    // and so on.
+    pub(crate) fn apply_clause(&mut self, known: Known, where_clause: WhereClause) -> Result<()> {
+        match where_clause {
+            WhereClause::Pattern(p) => {
+                match self.make_evolved_pattern(known, p) {
+                    PlaceOrEmpty::Place(evolved) => self.apply_pattern(known, evolved),
+                    PlaceOrEmpty::Empty(because) => self.mark_known_empty(because),
+                }
+                Ok(())
+            },
+            WhereClause::Pred(p) => {
+                self.apply_predicate(known, p)
+            },
+            WhereClause::WhereFn(f) => {
+                self.apply_where_fn(known, f)
+            },
+            WhereClause::OrJoin(o) => {
+                validate_or_join(&o)?;
+                self.apply_or_join(known, o)
+            },
+            WhereClause::NotJoin(n) => {
+                validate_not_join(&n)?;
+                self.apply_not_join(known, n)
+            },
+            WhereClause::TypeAnnotation(anno) => {
+                self.apply_type_anno(&anno)
+            },
+            _ => unimplemented!(),
+        }
+    }
+}
+
+pub(crate) trait PushComputed {
+    fn push_computed(&mut self, item: ComputedTable) -> DatomsTable;
+}
+
+impl PushComputed for Vec<ComputedTable> {
+    fn push_computed(&mut self, item: ComputedTable) -> DatomsTable {
+        let next_index = self.len();
+        self.push(item);
+        DatomsTable::Computed(next_index)
+    }
+}
+
+// These are helpers that tests use to build Schema instances.
+#[cfg(test)]
+fn associate_ident(schema: &mut Schema, i: Keyword, e: Entid) {
+    schema.entid_map.insert(e, i.clone());
+    schema.ident_map.insert(i.clone(), e);
+}
+
+#[cfg(test)]
+fn add_attribute(schema: &mut Schema, e: Entid, a: Attribute) {
+    schema.attribute_map.insert(e, a);
+}
+
+#[cfg(test)]
+pub(crate) fn ident(ns: &str, name: &str) -> PatternNonValuePlace {
+    Keyword::namespaced(ns, name).into()
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    // Our alias counter is shared between CCs.
+    #[test]
+    fn test_aliasing_through_template() {
+        let mut starter = ConjoiningClauses::default();
+        let alias_zero = starter.next_alias_for_table(DatomsTable::Datoms);
+        let mut first = starter.use_as_template(&BTreeSet::new());
+        let mut second = starter.use_as_template(&BTreeSet::new());
+        let alias_one = first.next_alias_for_table(DatomsTable::Datoms);
+        let alias_two = second.next_alias_for_table(DatomsTable::Datoms);
+        assert!(alias_zero != alias_one);
+        assert!(alias_one != alias_two);
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/not.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/not.rs.html new file mode 100644 index 00000000..c07e1eb6 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/not.rs.html @@ -0,0 +1,1246 @@ + + + + + + + + + + not.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use mentat_query::{
+    ContainsVariables,
+    NotJoin,
+    UnifyVars,
+};
+
+use clauses::ConjoiningClauses;
+
+use errors::{
+    AlgebrizerError,
+    Result,
+};
+
+use types::{
+    ColumnConstraint,
+    ComputedTable,
+};
+
+use Known;
+
+impl ConjoiningClauses {
+    pub(crate) fn apply_not_join(&mut self, known: Known, not_join: NotJoin) -> Result<()> {
+        let unified = match not_join.unify_vars {
+            UnifyVars::Implicit => not_join.collect_mentioned_variables(),
+            UnifyVars::Explicit(vs) => vs,
+        };
+
+        let mut template = self.use_as_template(&unified);
+
+        for v in unified.iter() {
+            if self.value_bindings.contains_key(&v) {
+                let val = self.value_bindings.get(&v).unwrap().clone();
+                template.value_bindings.insert(v.clone(), val);
+            } else if self.column_bindings.contains_key(&v) {
+                let col = self.column_bindings.get(&v).unwrap()[0].clone();
+                template.column_bindings.insert(v.clone(), vec![col]);
+            } else {
+                bail!(AlgebrizerError::UnboundVariable(v.name()));
+            }
+        }
+
+        template.apply_clauses(known, not_join.clauses)?;
+
+        if template.is_known_empty() {
+            return Ok(());
+        }
+
+        template.expand_column_bindings();
+        if template.is_known_empty() {
+            return Ok(());
+        }
+
+        template.prune_extracted_types();
+        if template.is_known_empty() {
+            return Ok(());
+        }
+
+        template.process_required_types()?;
+        if template.is_known_empty() {
+            return Ok(());
+        }
+
+        // If we don't impose any constraints on the output, we might as well
+        // not exist.
+        if template.wheres.is_empty() {
+            return Ok(());
+        }
+
+        let subquery = ComputedTable::Subquery(template);
+
+        self.wheres.add_intersection(ColumnConstraint::NotExists(subquery));
+
+        Ok(())
+    }
+}
+
+#[cfg(test)]
+mod testing {
+    use std::collections::BTreeSet;
+
+    use super::*;
+
+    use mentat_core::{
+        Attribute,
+        Schema,
+        TypedValue,
+        ValueType,
+        ValueTypeSet,
+    };
+
+    use mentat_query::{
+        Keyword,
+        PlainSymbol,
+        Variable
+    };
+
+    use clauses::{
+        QueryInputs,
+        add_attribute,
+        associate_ident,
+    };
+
+    use errors::{
+        AlgebrizerError,
+    };
+
+    use types::{
+        ColumnAlternation,
+        ColumnConstraint,
+        ColumnConstraintOrAlternation,
+        ColumnIntersection,
+        DatomsColumn,
+        DatomsTable,
+        Inequality,
+        QualifiedAlias,
+        QueryValue,
+        SourceAlias,
+    };
+
+    use {
+        algebrize,
+        algebrize_with_inputs,
+        parse_find_string,
+    };
+
+    fn alg(schema: &Schema, input: &str) -> ConjoiningClauses {
+        let known = Known::for_schema(schema);
+        let parsed = parse_find_string(input).expect("parse failed");
+        algebrize(known, parsed).expect("algebrize failed").cc
+    }
+
+    fn alg_with_inputs(schema: &Schema, input: &str, inputs: QueryInputs) -> ConjoiningClauses {
+        let known = Known::for_schema(schema);
+        let parsed = parse_find_string(input).expect("parse failed");
+        algebrize_with_inputs(known, parsed, 0, inputs).expect("algebrize failed").cc
+    }
+
+    fn prepopulated_schema() -> Schema {
+        let mut schema = Schema::default();
+        associate_ident(&mut schema, Keyword::namespaced("foo", "name"), 65);
+        associate_ident(&mut schema, Keyword::namespaced("foo", "knows"), 66);
+        associate_ident(&mut schema, Keyword::namespaced("foo", "parent"), 67);
+        associate_ident(&mut schema, Keyword::namespaced("foo", "age"), 68);
+        associate_ident(&mut schema, Keyword::namespaced("foo", "height"), 69);
+        add_attribute(&mut schema,
+                      65,
+                      Attribute {
+                          value_type: ValueType::String,
+                          multival: false,
+                          ..Default::default()
+                      });
+        add_attribute(&mut schema,
+                      66,
+                      Attribute {
+                          value_type: ValueType::String,
+                          multival: true,
+                          ..Default::default()
+                      });
+        add_attribute(&mut schema,
+                      67,
+                      Attribute {
+                          value_type: ValueType::String,
+                          multival: true,
+                          ..Default::default()
+                      });
+        add_attribute(&mut schema,
+                      68,
+                      Attribute {
+                          value_type: ValueType::Long,
+                          multival: false,
+                          ..Default::default()
+                      });
+        add_attribute(&mut schema,
+                      69,
+                      Attribute {
+                          value_type: ValueType::Long,
+                          multival: false,
+                          ..Default::default()
+                      });
+        schema
+    }
+
+    fn compare_ccs(left: ConjoiningClauses, right: ConjoiningClauses) {
+        assert_eq!(left.wheres, right.wheres);
+        assert_eq!(left.from, right.from);
+    }
+
+    // not.
+    #[test]
+    fn test_successful_not() {
+        let schema = prepopulated_schema();
+        let query = r#"
+            [:find ?x
+             :where [?x :foo/knows "John"]
+                    (not [?x :foo/parent "Ámbar"]
+                         [?x :foo/knows "Daphne"])]"#;
+        let cc = alg(&schema, query);
+
+        let vx = Variable::from_valid_name("?x");
+
+        let d0 = "datoms00".to_string();
+        let d0e = QualifiedAlias::new(d0.clone(), DatomsColumn::Entity);
+        let d0a = QualifiedAlias::new(d0.clone(), DatomsColumn::Attribute);
+        let d0v = QualifiedAlias::new(d0.clone(), DatomsColumn::Value);
+
+        let d1 = "datoms01".to_string();
+        let d1e = QualifiedAlias::new(d1.clone(), DatomsColumn::Entity);
+        let d1a = QualifiedAlias::new(d1.clone(), DatomsColumn::Attribute);
+        let d1v = QualifiedAlias::new(d1.clone(), DatomsColumn::Value);
+
+        let d2 = "datoms02".to_string();
+        let d2e = QualifiedAlias::new(d2.clone(), DatomsColumn::Entity);
+        let d2a = QualifiedAlias::new(d2.clone(), DatomsColumn::Attribute);
+        let d2v = QualifiedAlias::new(d2.clone(), DatomsColumn::Value);
+
+        let knows = QueryValue::Entid(66);
+        let parent = QueryValue::Entid(67);
+
+        let john = QueryValue::TypedValue(TypedValue::typed_string("John"));
+        let ambar = QueryValue::TypedValue(TypedValue::typed_string("Ámbar"));
+        let daphne = QueryValue::TypedValue(TypedValue::typed_string("Daphne"));
+
+        let mut subquery = ConjoiningClauses::default();
+        subquery.from = vec![SourceAlias(DatomsTable::Datoms, d1),
+                             SourceAlias(DatomsTable::Datoms, d2)];
+        subquery.column_bindings.insert(vx.clone(), vec![d0e.clone(), d1e.clone(), d2e.clone()]);
+        subquery.wheres = ColumnIntersection(vec![ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1a.clone(), parent)),
+                               ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1v.clone(), ambar)),
+                               ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d2a.clone(), knows.clone())),
+                               ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d2v.clone(), daphne)),
+                               ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0e.clone(), QueryValue::Column(d1e.clone()))),
+                               ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0e.clone(), QueryValue::Column(d2e.clone())))]);
+
+        subquery.known_types.insert(vx.clone(), ValueTypeSet::of_one(ValueType::Ref));
+
+        assert!(!cc.is_known_empty());
+        assert_eq!(cc.wheres, ColumnIntersection(vec![
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0a.clone(), knows.clone())),
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0v.clone(), john)),
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::NotExists(ComputedTable::Subquery(subquery))),
+            ]));
+        assert_eq!(cc.column_bindings.get(&vx), Some(&vec![d0e]));
+        assert_eq!(cc.from, vec![SourceAlias(DatomsTable::Datoms, d0)]);
+    }
+
+    // not-join.
+    #[test]
+    fn test_successful_not_join() {
+        let schema = prepopulated_schema();
+        let query = r#"
+            [:find ?x
+             :where [?x :foo/knows ?y]
+                    [?x :foo/age 11]
+                    [?x :foo/name "John"]
+                    (not-join [?x ?y]
+                              [?x :foo/parent ?y])]"#;
+        let cc = alg(&schema, query);
+
+        let vx = Variable::from_valid_name("?x");
+        let vy = Variable::from_valid_name("?y");
+
+        let d0 = "datoms00".to_string();
+        let d0e = QualifiedAlias::new(d0.clone(), DatomsColumn::Entity);
+        let d0a = QualifiedAlias::new(d0.clone(), DatomsColumn::Attribute);
+        let d0v = QualifiedAlias::new(d0.clone(), DatomsColumn::Value);
+
+        let d1 = "datoms01".to_string();
+        let d1e = QualifiedAlias::new(d1.clone(), DatomsColumn::Entity);
+        let d1a = QualifiedAlias::new(d1.clone(), DatomsColumn::Attribute);
+        let d1v = QualifiedAlias::new(d1.clone(), DatomsColumn::Value);
+
+        let d2 = "datoms02".to_string();
+        let d2e = QualifiedAlias::new(d2.clone(), DatomsColumn::Entity);
+        let d2a = QualifiedAlias::new(d2.clone(), DatomsColumn::Attribute);
+        let d2v = QualifiedAlias::new(d2.clone(), DatomsColumn::Value);
+
+        let d3 = "datoms03".to_string();
+        let d3e = QualifiedAlias::new(d3.clone(), DatomsColumn::Entity);
+        let d3a = QualifiedAlias::new(d3.clone(), DatomsColumn::Attribute);
+        let d3v = QualifiedAlias::new(d3.clone(), DatomsColumn::Value);
+
+        let name = QueryValue::Entid(65);
+        let knows = QueryValue::Entid(66);
+        let parent = QueryValue::Entid(67);
+        let age = QueryValue::Entid(68);
+
+        let john = QueryValue::TypedValue(TypedValue::typed_string("John"));
+        let eleven = QueryValue::TypedValue(TypedValue::Long(11));
+
+        let mut subquery = ConjoiningClauses::default();
+        subquery.from = vec![SourceAlias(DatomsTable::Datoms, d3)];
+        subquery.column_bindings.insert(vx.clone(), vec![d0e.clone(), d3e.clone()]);
+        subquery.column_bindings.insert(vy.clone(), vec![d0v.clone(), d3v.clone()]);
+        subquery.wheres = ColumnIntersection(vec![ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d3a.clone(), parent)),
+                               ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0e.clone(), QueryValue::Column(d3e.clone()))),
+                               ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0v.clone(), QueryValue::Column(d3v.clone())))]);
+
+        subquery.known_types.insert(vx.clone(), ValueTypeSet::of_one(ValueType::Ref));
+        subquery.known_types.insert(vy.clone(), ValueTypeSet::of_one(ValueType::String));
+
+        assert!(!cc.is_known_empty());
+        let expected_wheres = ColumnIntersection(vec![
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0a.clone(), knows)),
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1a.clone(), age.clone())),
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1v.clone(), eleven)),
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d2a.clone(), name.clone())),
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d2v.clone(), john)),
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::NotExists(ComputedTable::Subquery(subquery))),
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0e.clone(), QueryValue::Column(d1e.clone()))),
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0e.clone(), QueryValue::Column(d2e.clone()))),
+            ]);
+        assert_eq!(cc.wheres, expected_wheres);
+        assert_eq!(cc.column_bindings.get(&vx), Some(&vec![d0e, d1e, d2e]));
+        assert_eq!(cc.from, vec![SourceAlias(DatomsTable::Datoms, d0),
+                                 SourceAlias(DatomsTable::Datoms, d1),
+                                 SourceAlias(DatomsTable::Datoms, d2)]);
+    }
+
+    // Not with a pattern and a predicate.
+    #[test]
+    fn test_not_with_pattern_and_predicate() {
+        let schema = prepopulated_schema();
+        let query = r#"
+            [:find ?x ?age
+             :where
+             [?x :foo/age ?age]
+             [(< ?age 30)]
+             (not [?x :foo/knows "John"]
+                  [?x :foo/knows "Daphne"])]"#;
+        let cc = alg(&schema, query);
+
+        let vx = Variable::from_valid_name("?x");
+
+        let d0 = "datoms00".to_string();
+        let d0e = QualifiedAlias::new(d0.clone(), DatomsColumn::Entity);
+        let d0a = QualifiedAlias::new(d0.clone(), DatomsColumn::Attribute);
+        let d0v = QualifiedAlias::new(d0.clone(), DatomsColumn::Value);
+
+        let d1 = "datoms01".to_string();
+        let d1e = QualifiedAlias::new(d1.clone(), DatomsColumn::Entity);
+        let d1a = QualifiedAlias::new(d1.clone(), DatomsColumn::Attribute);
+        let d1v = QualifiedAlias::new(d1.clone(), DatomsColumn::Value);
+
+        let d2 = "datoms02".to_string();
+        let d2e = QualifiedAlias::new(d2.clone(), DatomsColumn::Entity);
+        let d2a = QualifiedAlias::new(d2.clone(), DatomsColumn::Attribute);
+        let d2v = QualifiedAlias::new(d2.clone(), DatomsColumn::Value);
+
+        let knows = QueryValue::Entid(66);
+        let age = QueryValue::Entid(68);
+
+        let john = QueryValue::TypedValue(TypedValue::typed_string("John"));
+        let daphne = QueryValue::TypedValue(TypedValue::typed_string("Daphne"));
+
+        let mut subquery = ConjoiningClauses::default();
+        subquery.from = vec![SourceAlias(DatomsTable::Datoms, d1),
+                             SourceAlias(DatomsTable::Datoms, d2)];
+        subquery.column_bindings.insert(vx.clone(), vec![d0e.clone(), d1e.clone(), d2e.clone()]);
+        subquery.wheres = ColumnIntersection(vec![ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1a.clone(), knows.clone())),
+                                                  ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1v.clone(), john.clone())),
+                                                  ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d2a.clone(), knows.clone())),
+                                                  ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d2v.clone(), daphne.clone())),
+                                                  ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0e.clone(), QueryValue::Column(d1e.clone()))),
+                                                  ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0e.clone(), QueryValue::Column(d2e.clone())))]);
+
+        subquery.known_types.insert(vx.clone(), ValueTypeSet::of_one(ValueType::Ref));
+
+        assert!(!cc.is_known_empty());
+        assert_eq!(cc.wheres, ColumnIntersection(vec![
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0a.clone(), age.clone())),
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Inequality {
+                    operator: Inequality::LessThan,
+                    left: QueryValue::Column(d0v.clone()),
+                    right: QueryValue::TypedValue(TypedValue::Long(30)),
+                }),
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::NotExists(ComputedTable::Subquery(subquery))),
+            ]));
+        assert_eq!(cc.column_bindings.get(&vx), Some(&vec![d0e]));
+        assert_eq!(cc.from, vec![SourceAlias(DatomsTable::Datoms, d0)]);
+    }
+
+    // not with an or
+    #[test]
+    fn test_not_with_or() {
+        let schema = prepopulated_schema();
+        let query = r#"
+            [:find ?x
+             :where [?x :foo/knows "Bill"]
+                    (not (or [?x :foo/knows "John"]
+                             [?x :foo/knows "Ámbar"])
+                        [?x :foo/parent "Daphne"])]"#;
+        let cc = alg(&schema, query);
+
+        let d0 = "datoms00".to_string();
+        let d0e = QualifiedAlias::new(d0.clone(), DatomsColumn::Entity);
+        let d0a = QualifiedAlias::new(d0.clone(), DatomsColumn::Attribute);
+        let d0v = QualifiedAlias::new(d0.clone(), DatomsColumn::Value);
+
+        let d1 = "datoms01".to_string();
+        let d1e = QualifiedAlias::new(d1.clone(), DatomsColumn::Entity);
+        let d1a = QualifiedAlias::new(d1.clone(), DatomsColumn::Attribute);
+        let d1v = QualifiedAlias::new(d1.clone(), DatomsColumn::Value);
+
+        let d2 = "datoms02".to_string();
+        let d2e = QualifiedAlias::new(d2.clone(), DatomsColumn::Entity);
+        let d2a = QualifiedAlias::new(d2.clone(), DatomsColumn::Attribute);
+        let d2v = QualifiedAlias::new(d2.clone(), DatomsColumn::Value);
+
+        let vx = Variable::from_valid_name("?x");
+
+        let knows = QueryValue::Entid(66);
+        let parent = QueryValue::Entid(67);
+
+        let bill = QueryValue::TypedValue(TypedValue::typed_string("Bill"));
+        let john = QueryValue::TypedValue(TypedValue::typed_string("John"));
+        let ambar = QueryValue::TypedValue(TypedValue::typed_string("Ámbar"));
+        let daphne = QueryValue::TypedValue(TypedValue::typed_string("Daphne"));
+
+
+        let mut subquery = ConjoiningClauses::default();
+        subquery.from = vec![SourceAlias(DatomsTable::Datoms, d1),
+                             SourceAlias(DatomsTable::Datoms, d2)];
+        subquery.column_bindings.insert(vx.clone(), vec![d0e.clone(), d1e.clone(), d2e.clone()]);
+        subquery.wheres = ColumnIntersection(vec![ColumnConstraintOrAlternation::Alternation(ColumnAlternation(vec![
+                                                    ColumnIntersection(vec![
+                                                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1a.clone(), knows.clone())),
+                                                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1v.clone(), john))]),
+                                                    ColumnIntersection(vec![
+                                                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1a.clone(), knows.clone())),
+                                                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1v.clone(), ambar))]),
+                                                    ])),
+                                                    ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d2a.clone(), parent)),
+                                                    ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d2v.clone(), daphne)),
+                                                    ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0e.clone(), QueryValue::Column(d1e.clone()))),
+                                                    ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0e.clone(), QueryValue::Column(d2e.clone())))]);
+
+        subquery.known_types.insert(vx.clone(), ValueTypeSet::of_one(ValueType::Ref));
+
+        assert!(!cc.is_known_empty());
+        assert_eq!(cc.wheres, ColumnIntersection(vec![
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0a.clone(), knows)),
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0v.clone(), bill)),
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::NotExists(ComputedTable::Subquery(subquery))),
+            ]));
+    }
+
+    // not-join with an input variable
+    #[test]
+    fn test_not_with_in() {
+        let schema = prepopulated_schema();
+        let query = r#"
+            [:find ?x
+             :in ?y
+             :where [?x :foo/knows "Bill"]
+                    (not [?x :foo/knows ?y])]"#;
+
+        let inputs = QueryInputs::with_value_sequence(vec![
+            (Variable::from_valid_name("?y"), "John".into())
+        ]);
+        let cc = alg_with_inputs(&schema, query, inputs);
+
+        let vx = Variable::from_valid_name("?x");
+        let vy = Variable::from_valid_name("?y");
+
+        let knows = QueryValue::Entid(66);
+
+        let bill = QueryValue::TypedValue(TypedValue::typed_string("Bill"));
+        let john = QueryValue::TypedValue(TypedValue::typed_string("John"));
+
+        let d0 = "datoms00".to_string();
+        let d0e = QualifiedAlias::new(d0.clone(), DatomsColumn::Entity);
+        let d0a = QualifiedAlias::new(d0.clone(), DatomsColumn::Attribute);
+        let d0v = QualifiedAlias::new(d0.clone(), DatomsColumn::Value);
+
+        let d1 = "datoms01".to_string();
+        let d1e = QualifiedAlias::new(d1.clone(), DatomsColumn::Entity);
+        let d1a = QualifiedAlias::new(d1.clone(), DatomsColumn::Attribute);
+        let d1v = QualifiedAlias::new(d1.clone(), DatomsColumn::Value);
+
+        let mut subquery = ConjoiningClauses::default();
+        subquery.from = vec![SourceAlias(DatomsTable::Datoms, d1)];
+        subquery.column_bindings.insert(vx.clone(), vec![d0e.clone(), d1e.clone()]);
+        subquery.wheres = ColumnIntersection(vec![ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1a.clone(), knows.clone())),
+                                                  ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1v.clone(), john)),
+                                                  ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0e.clone(), QueryValue::Column(d1e.clone())))]);
+
+        subquery.known_types.insert(vx.clone(), ValueTypeSet::of_one(ValueType::Ref));
+        subquery.known_types.insert(vy.clone(), ValueTypeSet::of_one(ValueType::String));
+
+        let mut input_vars: BTreeSet<Variable> = BTreeSet::default();
+        input_vars.insert(vy.clone());
+        subquery.input_variables = input_vars;
+        subquery.value_bindings.insert(vy.clone(), TypedValue::typed_string("John"));
+
+        assert!(!cc.is_known_empty());
+        assert_eq!(cc.wheres, ColumnIntersection(vec![
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0a.clone(), knows)),
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0v.clone(), bill)),
+                ColumnConstraintOrAlternation::Constraint(ColumnConstraint::NotExists(ComputedTable::Subquery(subquery))),
+            ]));
+    }
+
+    // Test that if any single clause in the `not` fails to resolve the whole clause is considered empty
+    #[test]
+    fn test_fails_if_any_clause_invalid() {
+        let schema = prepopulated_schema();
+        let query = r#"
+            [:find ?x
+             :where [?x :foo/knows "Bill"]
+                    (not [?x :foo/nope "John"]
+                         [?x :foo/parent "Ámbar"]
+                         [?x :foo/nope "Daphne"])]"#;
+        let cc = alg(&schema, query);
+        assert!(!cc.is_known_empty());
+        compare_ccs(cc,
+                    alg(&schema,
+                        r#"[:find ?x :where [?x :foo/knows "Bill"]]"#));
+    }
+
+    /// Test that if all the attributes in an `not` fail to resolve, the `cc` isn't considered empty.
+    #[test]
+    fn test_no_clauses_succeed() {
+        let schema = prepopulated_schema();
+        let query = r#"
+            [:find ?x
+             :where [?x :foo/knows "John"]
+                    (not [?x :foo/nope "Ámbar"]
+                         [?x :foo/nope "Daphne"])]"#;
+        let cc = alg(&schema, query);
+        assert!(!cc.is_known_empty());
+        compare_ccs(cc,
+                    alg(&schema, r#"[:find ?x :where [?x :foo/knows "John"]]"#));
+
+    }
+
+    #[test]
+    fn test_unbound_var_fails() {
+        let schema = prepopulated_schema();
+        let known = Known::for_schema(&schema);
+        let query = r#"
+        [:find ?x
+         :in ?y
+         :where (not [?x :foo/knows ?y])]"#;
+        let parsed = parse_find_string(query).expect("parse failed");
+        let err = algebrize(known, parsed).expect_err("algebrization should have failed");
+        match err.downcast().expect("expected AlgebrizerError") {
+            AlgebrizerError::UnboundVariable(var) => { assert_eq!(var, PlainSymbol("?x".to_string())); },
+            x => panic!("expected Unbound Variable error, got {:?}", x),
+        }
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/or.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/or.rs.html new file mode 100644 index 00000000..186f2cd3 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/or.rs.html @@ -0,0 +1,2420 @@ + + + + + + + + + + or.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::collections::btree_map::Entry;
+use std::collections::{
+    BTreeMap,
+    BTreeSet,
+};
+
+use mentat_core::{
+    ValueTypeSet,
+};
+
+use mentat_query::{
+    OrJoin,
+    OrWhereClause,
+    Pattern,
+    PatternValuePlace,
+    PatternNonValuePlace,
+    UnifyVars,
+    Variable,
+    WhereClause,
+};
+
+use clauses::{
+    ConjoiningClauses,
+    PushComputed,
+};
+
+use errors::{
+    Result,
+};
+
+use types::{
+    ColumnConstraintOrAlternation,
+    ColumnAlternation,
+    ColumnIntersection,
+    ComputedTable,
+    DatomsTable,
+    EmptyBecause,
+    EvolvedPattern,
+    PlaceOrEmpty,
+    QualifiedAlias,
+    SourceAlias,
+    VariableColumn,
+};
+
+use Known;
+
+/// Return true if both left and right are the same variable or both are non-variable.
+fn _simply_matches_place(left: &PatternNonValuePlace, right: &PatternNonValuePlace) -> bool {
+    match (left, right) {
+        (&PatternNonValuePlace::Variable(ref a), &PatternNonValuePlace::Variable(ref b)) => a == b,
+        (&PatternNonValuePlace::Placeholder, &PatternNonValuePlace::Placeholder) => true,
+        (&PatternNonValuePlace::Entid(_), &PatternNonValuePlace::Entid(_))       => true,
+        (&PatternNonValuePlace::Entid(_), &PatternNonValuePlace::Ident(_))       => true,
+        (&PatternNonValuePlace::Ident(_), &PatternNonValuePlace::Ident(_))       => true,
+        (&PatternNonValuePlace::Ident(_), &PatternNonValuePlace::Entid(_))       => true,
+        _ => false,
+    }
+}
+
+/// Return true if both left and right are the same variable or both are non-variable.
+fn _simply_matches_value_place(left: &PatternValuePlace, right: &PatternValuePlace) -> bool {
+    match (left, right) {
+        (&PatternValuePlace::Variable(ref a), &PatternValuePlace::Variable(ref b)) => a == b,
+        (&PatternValuePlace::Placeholder, &PatternValuePlace::Placeholder) => true,
+        (&PatternValuePlace::Variable(_), _) => false,
+        (_, &PatternValuePlace::Variable(_)) => false,
+        (&PatternValuePlace::Placeholder, _) => false,
+        (_, &PatternValuePlace::Placeholder) => false,
+        _ => true,
+    }
+}
+
+pub enum DeconstructedOrJoin {
+    KnownSuccess,
+    KnownEmpty(EmptyBecause),
+    Unit(OrWhereClause),
+    UnitPattern(Pattern),
+    Simple(Vec<Pattern>, BTreeSet<Variable>),
+    Complex(OrJoin),
+}
+
+/// Application of `or`. Note that this is recursive!
+impl ConjoiningClauses {
+    fn apply_or_where_clause(&mut self, known: Known, clause: OrWhereClause) -> Result<()> {
+        match clause {
+            OrWhereClause::Clause(clause) => self.apply_clause(known, clause),
+
+            // A query might be:
+            // [:find ?x :where (or (and [?x _ 5] [?x :foo/bar 7]))]
+            // which is equivalent to dropping the `or` _and_ the `and`!
+            OrWhereClause::And(clauses) => {
+                self.apply_clauses(known, clauses)?;
+                Ok(())
+            },
+        }
+    }
+
+    pub(crate) fn apply_or_join(&mut self, known: Known, mut or_join: OrJoin) -> Result<()> {
+        // Simple optimization. Empty `or` clauses disappear. Unit `or` clauses
+        // are equivalent to just the inner clause.
+
+        // Pre-cache mentioned variables. We use these in a few places.
+        or_join.mentioned_variables();
+
+        match or_join.clauses.len() {
+            0 => Ok(()),
+            1 if or_join.is_fully_unified() => {
+                let clause = or_join.clauses.pop().expect("there's a clause");
+                self.apply_or_where_clause(known, clause)
+            },
+            // Either there's only one clause pattern, and it's not fully unified, or we
+            // have multiple clauses.
+            // In the former case we can't just apply it: it includes a variable that we don't want
+            // to join with the rest of the query.
+            // Notably, this clause might be an `and`, making this a complex pattern, so we can't
+            // necessarily rewrite it in place.
+            // In the latter case, we still need to do a bit more work.
+            _ => self.apply_non_trivial_or_join(known, or_join),
+        }
+    }
+
+    /// Find out if the `OrJoin` is simple. A simple `or` is one in
+    /// which:
+    /// - Every arm is a pattern, so that we can use a single table alias for all.
+    /// - Each pattern should run against the same table, for the same reason.
+    /// - Each pattern uses the same variables. (That's checked by validation.)
+    /// - Each pattern has the same shape, so we can extract bindings from the same columns
+    ///   regardless of which clause matched.
+    ///
+    /// Like this:
+    ///
+    /// ```edn
+    /// [:find ?x
+    ///  :where (or [?x :foo/knows "John"]
+    ///             [?x :foo/parent "Ámbar"]
+    ///             [?x :foo/knows "Daphne"])]
+    /// ```
+    ///
+    /// While we're doing this diagnosis, we'll also find out if:
+    /// - No patterns can match: the enclosing CC is known-empty.
+    /// - Some patterns can't match: they are discarded.
+    /// - Only one pattern can match: the `or` can be simplified away.
+    fn deconstruct_or_join(&self, known: Known, or_join: OrJoin) -> DeconstructedOrJoin {
+        // If we have explicit non-maximal unify-vars, we *can't* simply run this as a
+        // single pattern --
+        // ```
+        // [:find ?x :where [?x :foo/bar ?y] (or-join [?x] [?x :foo/baz ?y])]
+        // ```
+        // is *not* equivalent to
+        // ```
+        // [:find ?x :where [?x :foo/bar ?y] [?x :foo/baz ?y]]
+        // ```
+        if !or_join.is_fully_unified() {
+            // It's complex because we need to make sure that non-unified vars
+            // mentioned in the body of the `or-join` do not unify with variables
+            // outside the `or-join`. We can't naïvely collect clauses into the
+            // same CC. TODO: pay attention to the unify list when generating
+            // constraints. Temporarily shadow variables within each `or` branch.
+            return DeconstructedOrJoin::Complex(or_join);
+        }
+
+        match or_join.clauses.len() {
+            0 => DeconstructedOrJoin::KnownSuccess,
+
+            // It's safe to simply 'leak' the entire clause, because we know every var in it is
+            // supposed to unify with the enclosing form.
+            1 => DeconstructedOrJoin::Unit(or_join.clauses.into_iter().next().unwrap()),
+            _ => self._deconstruct_or_join(known, or_join),
+        }
+    }
+
+    /// This helper does the work of taking a known-non-trivial `or` or `or-join`,
+    /// walking the contained patterns to decide whether it can be translated simply
+    /// -- as a collection of constraints on a single table alias -- or if it needs to
+    /// be implemented as a `UNION`.
+    ///
+    /// See the description of `deconstruct_or_join` for more details. This method expects
+    /// to be called _only_ by `deconstruct_or_join`.
+    fn _deconstruct_or_join(&self, known: Known, or_join: OrJoin) -> DeconstructedOrJoin {
+        // Preconditions enforced by `deconstruct_or_join`.
+        // Note that a fully unified explicit `or-join` can arrive here, and might leave as
+        // an implicit `or`.
+        assert!(or_join.is_fully_unified());
+        assert!(or_join.clauses.len() >= 2);
+
+        // We're going to collect into this.
+        // If at any point we hit something that's not a suitable pattern, we'll
+        // reconstruct and return a complex `OrJoin`.
+        let mut patterns: Vec<Pattern> = Vec::with_capacity(or_join.clauses.len());
+
+        // Keep track of the table we need every pattern to use.
+        let mut expected_table: Option<DatomsTable> = None;
+
+        // Technically we might have several reasons, but we take the last -- that is, that's the
+        // reason we don't have at least one pattern!
+        // We'll return this as our reason if no pattern can return results.
+        let mut empty_because: Option<EmptyBecause> = None;
+
+        // Walk each clause in turn, bailing as soon as we know this can't be simple.
+        let (join_clauses, _unify_vars, mentioned_vars) = or_join.dismember();
+        let mut clauses = join_clauses.into_iter();
+        while let Some(clause) = clauses.next() {
+            // If we fail half-way through processing, we want to reconstitute the input.
+            // Keep a handle to the clause itself here to smooth over the moved `if let` below.
+            let last: OrWhereClause;
+
+            if let OrWhereClause::Clause(WhereClause::Pattern(p)) = clause {
+                // Compute the table for the pattern. If we can't figure one out, it means
+                // the pattern cannot succeed; we drop it.
+                // Inside an `or` it's not a failure for a pattern to be unable to match, which
+                use self::PlaceOrEmpty::*;
+                let table = match self.make_evolved_attribute(&known, p.attribute.clone()) {
+                    Place((aaa, value_type)) => {
+                        match self.make_evolved_value(&known, value_type, p.value.clone()) {
+                            Place(v) => {
+                                self.table_for_places(known.schema, &aaa, &v)
+                            },
+                            Empty(e) => Err(e),
+                        }
+                    },
+                    Empty(e) => Err(e),
+                };
+
+                match table {
+                    Err(e) => {
+                        empty_because = Some(e);
+
+                        // Do not accumulate this pattern at all. Add lightness!
+                        continue;
+                    },
+                    Ok(table) => {
+                        // Check the shape of the pattern against a previous pattern.
+                        let same_shape =
+                            if let Some(template) = patterns.get(0) {
+                                template.source == p.source &&     // or-arms all use the same source anyway.
+                                _simply_matches_place(&template.entity, &p.entity) &&
+                                _simply_matches_place(&template.attribute, &p.attribute) &&
+                                _simply_matches_value_place(&template.value, &p.value) &&
+                                _simply_matches_place(&template.tx, &p.tx)
+                            } else {
+                                // No previous pattern.
+                                true
+                            };
+
+                        // All of our clauses that _do_ yield a table -- that are possible --
+                        // must use the same table in order for this to be a simple `or`!
+                        if same_shape {
+                            if expected_table == Some(table) {
+                                patterns.push(p);
+                                continue;
+                            }
+                            if expected_table.is_none() {
+                                expected_table = Some(table);
+                                patterns.push(p);
+                                continue;
+                            }
+                        }
+
+                        // Otherwise, we need to keep this pattern so we can reconstitute.
+                        // We'll fall through to reconstruction.
+                    }
+                }
+                last = OrWhereClause::Clause(WhereClause::Pattern(p));
+            } else {
+                last = clause;
+            }
+
+            // If we get here, it means one of our checks above failed. Reconstruct and bail.
+            let reconstructed: Vec<OrWhereClause> =
+                // Non-empty patterns already collected…
+                patterns.into_iter()
+                        .map(|p| OrWhereClause::Clause(WhereClause::Pattern(p)))
+                // … then the clause we just considered…
+                        .chain(::std::iter::once(last))
+                // … then the rest of the iterator.
+                        .chain(clauses)
+                        .collect();
+
+            return DeconstructedOrJoin::Complex(OrJoin::new(
+                UnifyVars::Implicit,
+                reconstructed,
+            ));
+        }
+
+        // If we got here without returning, then `patterns` is what we're working with.
+        // If `patterns` is empty, it means _none_ of the clauses in the `or` could succeed.
+        match patterns.len() {
+            0 => {
+                assert!(empty_because.is_some());
+                DeconstructedOrJoin::KnownEmpty(empty_because.unwrap())
+            },
+            1 => DeconstructedOrJoin::UnitPattern(patterns.pop().unwrap()),
+            _ => DeconstructedOrJoin::Simple(patterns, mentioned_vars),
+        }
+    }
+
+    fn apply_non_trivial_or_join(&mut self, known: Known, or_join: OrJoin) -> Result<()> {
+        match self.deconstruct_or_join(known, or_join) {
+            DeconstructedOrJoin::KnownSuccess => {
+                // The pattern came to us empty -- `(or)`. Do nothing.
+                Ok(())
+            },
+            DeconstructedOrJoin::KnownEmpty(reason) => {
+                // There were no arms of the join that could be mapped to a table.
+                // The entire `or`, and thus the CC, cannot yield results.
+                self.mark_known_empty(reason);
+                Ok(())
+            },
+            DeconstructedOrJoin::Unit(clause) => {
+                // There was only one clause. We're unifying all variables, so we can just apply here.
+                self.apply_or_where_clause(known, clause)
+            },
+            DeconstructedOrJoin::UnitPattern(pattern) => {
+                // Same, but simpler.
+                match self.make_evolved_pattern(known, pattern) {
+                    PlaceOrEmpty::Empty(e) => {
+                        self.mark_known_empty(e);
+                    },
+                    PlaceOrEmpty::Place(pattern) => {
+                        self.apply_pattern(known, pattern);
+                    },
+                };
+                Ok(())
+            },
+            DeconstructedOrJoin::Simple(patterns, mentioned_vars) => {
+                // Hooray! Fully unified and plain ol' patterns that all use the same table.
+                // Go right ahead and produce a set of constraint alternations that we can collect,
+                // using a single table alias.
+                self.apply_simple_or_join(known, patterns, mentioned_vars)
+            },
+            DeconstructedOrJoin::Complex(or_join) => {
+                // Do this the hard way.
+                self.apply_complex_or_join(known, or_join)
+            },
+        }
+    }
+
+
+    /// A simple `or` join is effectively a single pattern in which an individual column's bindings
+    /// are not a single value. Rather than a pattern like
+    ///
+    /// ```edn
+    /// [?x :foo/knows "John"]
+    /// ```
+    ///
+    /// we have
+    ///
+    /// ```edn
+    /// (or [?x :foo/knows "John"]
+    ///     [?x :foo/hates "Peter"])
+    /// ```
+    ///
+    /// but the generated SQL is very similar: the former is
+    ///
+    /// ```sql
+    /// WHERE datoms00.a = 99 AND datoms00.v = 'John'
+    /// ```
+    ///
+    /// with the latter growing to
+    ///
+    /// ```sql
+    /// WHERE (datoms00.a = 99 AND datoms00.v = 'John')
+    ///    OR (datoms00.a = 98 AND datoms00.v = 'Peter')
+    /// ```
+    ///
+    fn apply_simple_or_join(&mut self,
+                            known: Known,
+                            patterns: Vec<Pattern>,
+                            mentioned_vars: BTreeSet<Variable>)
+                            -> Result<()> {
+        if self.is_known_empty() {
+            return Ok(())
+        }
+
+        assert!(patterns.len() >= 2);
+
+        let patterns: Vec<EvolvedPattern> = patterns.into_iter().filter_map(|pattern| {
+            match self.make_evolved_pattern(known, pattern) {
+                PlaceOrEmpty::Empty(_e) => {
+                    // Never mind.
+                    None
+                },
+                PlaceOrEmpty::Place(p) => Some(p),
+            }
+        }).collect();
+
+
+        // Begin by building a base CC that we'll use to produce constraints from each pattern.
+        // Populate this base CC with whatever variables are already known from the CC to which
+        // we're applying this `or`.
+        // This will give us any applicable type constraints or column mappings.
+        // Then generate a single table alias, based on the first pattern, and use that to make any
+        // new variable mappings we will need to extract values.
+        let template = self.use_as_template(&mentioned_vars);
+
+        // We expect this to always work: if it doesn't, it means we should never have got to this
+        // point.
+        let source_alias = self.alias_table(known.schema, &patterns[0]).expect("couldn't get table");
+
+        // This is where we'll collect everything we eventually add to the destination CC.
+        let mut folded = ConjoiningClauses::default();
+
+        // Scoped borrow of source_alias.
+        {
+            // Clone this CC once for each pattern.
+            // Apply each pattern to its CC with the _same_ table alias.
+            // Each pattern's derived types are intersected with any type constraints in the
+            // template, sourced from the destination CC. If a variable cannot satisfy both type
+            // constraints, the new CC cannot match. This prunes the 'or' arms:
+            //
+            // ```edn
+            // [:find ?x
+            //  :where [?a :some/int ?x]
+            //         (or [_ :some/otherint ?x]
+            //             [_ :some/string ?x])]
+            // ```
+            //
+            // can simplify to
+            //
+            // ```edn
+            // [:find ?x
+            //  :where [?a :some/int ?x]
+            //         [_ :some/otherint ?x]]
+            // ```
+            let mut receptacles =
+                patterns.into_iter()
+                        .map(|pattern| {
+                            let mut receptacle = template.make_receptacle();
+                            receptacle.apply_pattern_clause_for_alias(known, &pattern, &source_alias);
+                            receptacle
+                        })
+                        .peekable();
+
+            // Let's see if we can grab a reason if every pattern failed.
+            // If every pattern failed, we can just take the first!
+            let reason = receptacles.peek()
+                                    .map(|r| r.empty_because.clone())
+                                    .unwrap_or(None);
+
+            // Filter out empties.
+            let mut receptacles = receptacles.filter(|receptacle| !receptacle.is_known_empty())
+                                             .peekable();
+
+            // We need to copy the column bindings from one of the receptacles. Because this is a simple
+            // or, we know that they're all the same.
+            // Because we just made an empty template, and created a new alias from the destination CC,
+            // we know that we can blindly merge: collisions aren't possible.
+            if let Some(first) = receptacles.peek() {
+                for (v, cols) in &first.column_bindings {
+                    match self.column_bindings.entry(v.clone()) {
+                        Entry::Vacant(e) => {
+                            e.insert(cols.clone());
+                        },
+                        Entry::Occupied(mut e) => {
+                            e.get_mut().append(&mut cols.clone());
+                        },
+                    }
+                }
+            } else {
+                // No non-empty receptacles? The destination CC is known-empty, because or([]) is false.
+                self.mark_known_empty(reason.unwrap_or(EmptyBecause::AttributeLookupFailed));
+                return Ok(());
+            }
+
+            // Otherwise, we fold together the receptacles.
+            //
+            // Merge together the constraints from each receptacle. Each bundle of constraints is
+            // combined into a `ConstraintIntersection`, and the collection of intersections is
+            // combined into a `ConstraintAlternation`. (As an optimization, this collection can be
+            // simplified.)
+            //
+            // Each receptacle's known types are _unioned_. Strictly speaking this is a weakening:
+            // we might know that if `?x` is an integer then `?y` is a string, or vice versa, but at
+            // this point we'll simply state that `?x` and `?y` can both be integers or strings.
+
+            fn vec_for_iterator<T, I, U>(iter: &I) -> Vec<T> where I: Iterator<Item=U> {
+                match iter.size_hint().1 {
+                    None => Vec::new(),
+                    Some(expected) => Vec::with_capacity(expected),
+                }
+            }
+
+            let mut alternates: Vec<ColumnIntersection> = vec_for_iterator(&receptacles);
+            for r in receptacles {
+                folded.broaden_types(r.known_types);
+                alternates.push(r.wheres);
+            }
+
+            if alternates.len() == 1 {
+                // Simplify.
+                folded.wheres = alternates.pop().unwrap();
+            } else {
+                let alternation = ColumnAlternation(alternates);
+                let mut container = ColumnIntersection::default();
+                container.add(ColumnConstraintOrAlternation::Alternation(alternation));
+                folded.wheres = container;
+            }
+        }
+
+        // Collect the source alias: we use a single table join to represent the entire `or`.
+        self.from.push(source_alias);
+
+        // Add in the known types and constraints.
+        // Each constant attribute might _expand_ the set of possible types of the value-place
+        // variable. We thus generate a set of possible types, and we intersect it with the
+        // types already possible in the CC. If the resultant set is empty, the pattern cannot
+        // match. If the final set isn't unit, we must project a type tag column.
+        self.intersect(folded)
+    }
+
+    fn intersect(&mut self, mut cc: ConjoiningClauses) -> Result<()> {
+        if cc.is_known_empty() {
+            self.empty_because = cc.empty_because;
+        }
+        self.wheres.append(&mut cc.wheres);
+        self.narrow_types(cc.known_types);
+        Ok(())
+    }
+
+    /// Apply a provided `or` or `or-join` to this `ConjoiningClauses`. If you're calling this
+    /// rather than another `or`-applier, it's assumed that the contents of the `or` are relatively
+    /// complex: perhaps its arms consist of more than just patterns, or perhaps each arm includes
+    /// different variables in different places.
+    ///
+    /// Step one (not yet implemented): any clauses that are standalone patterns might differ only
+    /// in attribute. In that case, we can treat them as a 'simple or' -- a single pattern with a
+    /// WHERE clause that alternates on the attribute. Pull those out first.
+    ///
+    /// Step two: for each cluster of patterns, and for each `and`, recursively build a CC and
+    /// simple projection. The projection must be the same for each CC, because we will concatenate
+    /// these with a `UNION`. This is one reason why we require each pattern in the `or` to unify
+    /// the same variables!
+    ///
+    /// Finally, we alias this entire UNION block as a FROM; it can be stitched into the outer query
+    /// by looking at the projection.
+    ///
+    /// For example,
+    ///
+    /// ```edn
+    ///   [:find ?page :in $ ?string :where
+    ///    (or [?page :page/title ?string]
+    ///        [?page :page/excerpt ?string]
+    ///        (and [?save :save/string ?string]
+    ///             [?page :page/save ?save]))]
+    /// ```edn
+    ///
+    /// would expand to something like
+    ///
+    /// ```sql
+    /// SELECT or123.page AS page FROM
+    ///  (SELECT datoms124.e AS page FROM datoms AS datoms124
+    ///   WHERE datoms124.v = ? AND
+    ///         (datoms124.a = :page/title OR
+    ///          datoms124.a = :page/excerpt)
+    ///   UNION
+    ///   SELECT datoms126.e AS page FROM datoms AS datoms125, datoms AS datoms126
+    ///   WHERE datoms125.a = :save/string AND
+    ///         datoms125.v = ? AND
+    ///         datoms126.v = datoms125.e AND
+    ///         datoms126.a = :page/save)
+    ///  AS or123
+    /// ```
+    ///
+    /// Note that a top-level standalone `or` doesn't really need to be aliased, but
+    /// it shouldn't do any harm.
+    fn apply_complex_or_join(&mut self, known: Known, or_join: OrJoin) -> Result<()> {
+        // N.B., a solitary pattern here *cannot* be simply applied to the enclosing CC. We don't
+        // want to join all the vars, and indeed if it were safe to do so, we wouldn't have ended up
+        // in this function!
+        let (join_clauses, unify_vars, mentioned_vars) = or_join.dismember();
+        let projected = match unify_vars {
+            UnifyVars::Implicit => mentioned_vars.into_iter().collect(),
+            UnifyVars::Explicit(vs) => vs,
+        };
+
+        let template = self.use_as_template(&projected);
+
+        let mut acc = Vec::with_capacity(join_clauses.len());
+        let mut empty_because: Option<EmptyBecause> = None;
+
+        for clause in join_clauses.into_iter() {
+            let mut receptacle = template.make_receptacle();
+            match clause {
+                OrWhereClause::And(clauses) => {
+                    receptacle.apply_clauses(known, clauses)?;
+                },
+                OrWhereClause::Clause(clause) => {
+                    receptacle.apply_clause(known, clause)?;
+                },
+            }
+            if receptacle.is_known_empty() {
+                empty_because = receptacle.empty_because;
+            } else {
+                receptacle.expand_column_bindings();
+                receptacle.prune_extracted_types();
+                receptacle.process_required_types()?;
+                acc.push(receptacle);
+            }
+        }
+
+        if acc.is_empty() {
+            self.mark_known_empty(empty_because.expect("empty for a reason"));
+            return Ok(());
+        }
+
+        // TODO: optimize the case of a single element in `acc`?
+
+        // Now `acc` contains a sequence of CCs that were all prepared with the same types,
+        // each ready to project the same variables.
+        // At this point we can lift out any common type information (and even constraints) to the
+        // destination CC.
+        // We must also contribute type extraction information for any variables that aren't
+        // concretely typed for all union arms.
+        //
+        // We walk the list of variables to unify -- which will become our projection
+        // list -- to find out its type info in each CC. We might:
+        //
+        // 1. Know the type concretely from the enclosing CC. Don't project a type tag from the
+        //    union. Example:
+        //    ```
+        //    [:find ?x ?y
+        //     :where [?x :foo/int ?y]
+        //            (or [(< ?y 10)]
+        //                [_ :foo/verified ?y])]
+        //    ```
+        // 2. Not know the type, but every CC bound it to the same single type. Don't project a type
+        //    tag; we simply contribute the single type to the enclosing CC. Example:
+        //    ```
+        //    [:find ?x ?y
+        //     :where (or [?x :foo/length ?y]
+        //                [?x :foo/width ?y])]
+        //    ```
+        // 3. (a) Have every CC come up with a non-unit type set for the var. Every CC will project
+        //        a type tag column from one of its internal bindings, and the union will project it
+        //        onwards. Example:
+        //        ```
+        //        [:find ?x ?y ?z
+        //         :where [?x :foo/knows ?y]
+        //                (or [?x _ ?z]
+        //                    [?y _ ?z])]
+        //        ```
+        // 3. (b) Have some or all CCs come up with a unit type set. Every CC will project a type
+        //        tag column, and those with a unit type set will project a fixed constant value.
+        //        Again, the union will pass this on.
+        //        ```
+        //        [:find ?x ?y
+        //         :where (or [?x :foo/length ?y]
+        //                    [?x _ ?y])]
+        //        ```
+        let projection: BTreeSet<Variable> = projected.into_iter().collect();
+        let mut type_needed: BTreeSet<Variable> = BTreeSet::default();
+
+        // For any variable which has an imprecise type anywhere in the UNION, add it to the
+        // set that needs type extraction. All UNION arms must project the same columns.
+        for var in projection.iter() {
+            if acc.iter().any(|cc| !cc.known_type(var).is_some()) {
+                type_needed.insert(var.clone());
+            }
+        }
+
+        // Hang on to these so we can stuff them in our column bindings.
+        let var_associations: Vec<Variable>;
+        let type_associations: Vec<Variable>;
+        {
+            var_associations = projection.iter().cloned().collect();
+            type_associations = type_needed.iter().cloned().collect();
+        }
+
+        // Collect the new type information from the arms. There's some redundant work here --
+        // they already have all of the information from the parent.
+        // Note that we start with the first clause's type information.
+        {
+            let mut clauses = acc.iter();
+            let mut additional_types = clauses.next()
+                                              .expect("there to be at least one clause")
+                                              .known_types
+                                              .clone();
+            for cc in clauses {
+                union_types(&mut additional_types, &cc.known_types);
+            }
+            self.broaden_types(additional_types);
+        }
+
+        let union = ComputedTable::Union {
+            projection: projection,
+            type_extraction: type_needed,
+            arms: acc,
+        };
+        let table = self.computed_tables.push_computed(union);
+        let alias = self.next_alias_for_table(table);
+
+        // Stitch the computed table into column_bindings, so we get cross-linking.
+        let schema = known.schema;
+        for var in var_associations.into_iter() {
+            self.bind_column_to_var(schema, alias.clone(), VariableColumn::Variable(var.clone()), var);
+        }
+        for var in type_associations.into_iter() {
+            self.extracted_types.insert(var.clone(), QualifiedAlias::new(alias.clone(), VariableColumn::VariableTypeTag(var)));
+        }
+        self.from.push(SourceAlias(table, alias));
+        Ok(())
+    }
+}
+
+/// Helper to fold together a set of type maps.
+fn union_types(into: &mut BTreeMap<Variable, ValueTypeSet>,
+               additional_types: &BTreeMap<Variable, ValueTypeSet>) {
+    // We want the exclusive disjunction -- any variable not mentioned in both sets -- to default
+    // to ValueTypeSet::Any.
+    // This is necessary because we lazily populate known_types, so sometimes the type set will
+    // be missing a `ValueTypeSet::Any` for a variable, and we want to broaden rather than
+    // accidentally taking the other side's word for it!
+    // The alternative would be to exhaustively pre-fill `known_types` with all mentioned variables
+    // in the whole query, which is daunting.
+    let mut any: BTreeMap<Variable, ValueTypeSet>;
+    // Scoped borrow of `into`.
+    {
+        let i: BTreeSet<&Variable> = into.keys().collect();
+        let a: BTreeSet<&Variable> = additional_types.keys().collect();
+        any = i.symmetric_difference(&a)
+               .map(|v| ((*v).clone(), ValueTypeSet::any()))
+               .collect();
+    }
+
+    // Collect the additional types.
+    for (var, new_types) in additional_types {
+        match into.entry(var.clone()) {
+            Entry::Vacant(e) => {
+                e.insert(new_types.clone());
+            },
+            Entry::Occupied(mut e) => {
+                let new = e.get().union(&new_types);
+                e.insert(new);
+            },
+        }
+    }
+
+    // Blat in those that are disjoint.
+    into.append(&mut any);
+}
+
+#[cfg(test)]
+mod testing {
+    use super::*;
+
+    use mentat_core::{
+        Attribute,
+        Schema,
+        TypedValue,
+        ValueType,
+    };
+
+    use mentat_query::{
+        Keyword,
+        Variable,
+    };
+
+    use clauses::{
+        add_attribute,
+        associate_ident,
+    };
+
+    use types::{
+        ColumnConstraint,
+        DatomsColumn,
+        DatomsTable,
+        Inequality,
+        QualifiedAlias,
+        QueryValue,
+        SourceAlias,
+    };
+
+    use {
+        algebrize,
+        algebrize_with_counter,
+        parse_find_string,
+    };
+
+    fn alg(known: Known, input: &str) -> ConjoiningClauses {
+        let parsed = parse_find_string(input).expect("parse failed");
+        algebrize(known, parsed).expect("algebrize failed").cc
+    }
+
+    /// Algebrize with a starting counter, so we can compare inner queries by algebrizing a
+    /// simpler version.
+    fn alg_c(known: Known, counter: usize, input: &str) -> ConjoiningClauses {
+        let parsed = parse_find_string(input).expect("parse failed");
+        algebrize_with_counter(known, parsed, counter).expect("algebrize failed").cc
+    }
+
+    fn compare_ccs(left: ConjoiningClauses, right: ConjoiningClauses) {
+        assert_eq!(left.wheres, right.wheres);
+        assert_eq!(left.from, right.from);
+    }
+
+    fn prepopulated_schema() -> Schema {
+        let mut schema = Schema::default();
+        associate_ident(&mut schema, Keyword::namespaced("foo", "name"), 65);
+        associate_ident(&mut schema, Keyword::namespaced("foo", "knows"), 66);
+        associate_ident(&mut schema, Keyword::namespaced("foo", "parent"), 67);
+        associate_ident(&mut schema, Keyword::namespaced("foo", "age"), 68);
+        associate_ident(&mut schema, Keyword::namespaced("foo", "height"), 69);
+        add_attribute(&mut schema, 65, Attribute {
+            value_type: ValueType::String,
+            multival: false,
+            ..Default::default()
+        });
+        add_attribute(&mut schema, 66, Attribute {
+            value_type: ValueType::String,
+            multival: true,
+            ..Default::default()
+        });
+        add_attribute(&mut schema, 67, Attribute {
+            value_type: ValueType::String,
+            multival: true,
+            ..Default::default()
+        });
+        add_attribute(&mut schema, 68, Attribute {
+            value_type: ValueType::Long,
+            multival: false,
+            ..Default::default()
+        });
+        add_attribute(&mut schema, 69, Attribute {
+            value_type: ValueType::Long,
+            multival: false,
+            ..Default::default()
+        });
+        schema
+    }
+
+    /// Test that if all the attributes in an `or` fail to resolve, the entire thing fails.
+    #[test]
+    fn test_schema_based_failure() {
+        let schema = Schema::default();
+        let known = Known::for_schema(&schema);
+        let query = r#"
+            [:find ?x
+             :where (or [?x :foo/nope1 "John"]
+                        [?x :foo/nope2 "Ámbar"]
+                        [?x :foo/nope3 "Daphne"])]"#;
+        let cc = alg(known, query);
+        assert!(cc.is_known_empty());
+        assert_eq!(cc.empty_because, Some(EmptyBecause::UnresolvedIdent(Keyword::namespaced("foo", "nope3"))));
+    }
+
+    /// Test that if only one of the attributes in an `or` resolves, it's equivalent to a simple query.
+    #[test]
+    fn test_only_one_arm_succeeds() {
+        let schema = prepopulated_schema();
+        let known = Known::for_schema(&schema);
+        let query = r#"
+            [:find ?x
+             :where (or [?x :foo/nope "John"]
+                        [?x :foo/parent "Ámbar"]
+                        [?x :foo/nope "Daphne"])]"#;
+        let cc = alg(known, query);
+        assert!(!cc.is_known_empty());
+        compare_ccs(cc, alg(known, r#"[:find ?x :where [?x :foo/parent "Ámbar"]]"#));
+    }
+
+    // Simple alternation.
+    #[test]
+    fn test_simple_alternation() {
+        let schema = prepopulated_schema();
+        let known = Known::for_schema(&schema);
+        let query = r#"
+            [:find ?x
+             :where (or [?x :foo/knows "John"]
+                        [?x :foo/parent "Ámbar"]
+                        [?x :foo/knows "Daphne"])]"#;
+        let cc = alg(known, query);
+        let vx = Variable::from_valid_name("?x");
+        let d0 = "datoms00".to_string();
+        let d0e = QualifiedAlias::new(d0.clone(), DatomsColumn::Entity);
+        let d0a = QualifiedAlias::new(d0.clone(), DatomsColumn::Attribute);
+        let d0v = QualifiedAlias::new(d0.clone(), DatomsColumn::Value);
+        let knows = QueryValue::Entid(66);
+        let parent = QueryValue::Entid(67);
+        let john = QueryValue::TypedValue(TypedValue::typed_string("John"));
+        let ambar = QueryValue::TypedValue(TypedValue::typed_string("Ámbar"));
+        let daphne = QueryValue::TypedValue(TypedValue::typed_string("Daphne"));
+
+        assert!(!cc.is_known_empty());
+        assert_eq!(cc.wheres, ColumnIntersection(vec![
+            ColumnConstraintOrAlternation::Alternation(
+                ColumnAlternation(vec![
+                    ColumnIntersection(vec![
+                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0a.clone(), knows.clone())),
+                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0v.clone(), john))]),
+                    ColumnIntersection(vec![
+                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0a.clone(), parent)),
+                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0v.clone(), ambar))]),
+                    ColumnIntersection(vec![
+                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0a.clone(), knows)),
+                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0v.clone(), daphne))]),
+                    ]))]));
+        assert_eq!(cc.column_bindings.get(&vx), Some(&vec![d0e]));
+        assert_eq!(cc.from, vec![SourceAlias(DatomsTable::Datoms, d0)]);
+    }
+
+    // Alternation with a pattern.
+    #[test]
+    fn test_alternation_with_pattern() {
+        let schema = prepopulated_schema();
+        let known = Known::for_schema(&schema);
+        let query = r#"
+            [:find [?x ?name]
+             :where
+             [?x :foo/name ?name]
+             (or [?x :foo/knows "John"]
+                 [?x :foo/parent "Ámbar"]
+                 [?x :foo/knows "Daphne"])]"#;
+        let cc = alg(known, query);
+        let vx = Variable::from_valid_name("?x");
+        let d0 = "datoms00".to_string();
+        let d1 = "datoms01".to_string();
+        let d0e = QualifiedAlias::new(d0.clone(), DatomsColumn::Entity);
+        let d0a = QualifiedAlias::new(d0.clone(), DatomsColumn::Attribute);
+        let d1e = QualifiedAlias::new(d1.clone(), DatomsColumn::Entity);
+        let d1a = QualifiedAlias::new(d1.clone(), DatomsColumn::Attribute);
+        let d1v = QualifiedAlias::new(d1.clone(), DatomsColumn::Value);
+        let name = QueryValue::Entid(65);
+        let knows = QueryValue::Entid(66);
+        let parent = QueryValue::Entid(67);
+        let john = QueryValue::TypedValue(TypedValue::typed_string("John"));
+        let ambar = QueryValue::TypedValue(TypedValue::typed_string("Ámbar"));
+        let daphne = QueryValue::TypedValue(TypedValue::typed_string("Daphne"));
+
+        assert!(!cc.is_known_empty());
+        assert_eq!(cc.wheres, ColumnIntersection(vec![
+            ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0a.clone(), name.clone())),
+            ColumnConstraintOrAlternation::Alternation(
+                ColumnAlternation(vec![
+                    ColumnIntersection(vec![
+                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1a.clone(), knows.clone())),
+                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1v.clone(), john))]),
+                    ColumnIntersection(vec![
+                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1a.clone(), parent)),
+                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1v.clone(), ambar))]),
+                    ColumnIntersection(vec![
+                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1a.clone(), knows)),
+                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1v.clone(), daphne))]),
+                    ])),
+            // The outer pattern joins against the `or`.
+            ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0e.clone(), QueryValue::Column(d1e.clone()))),
+        ]));
+        assert_eq!(cc.column_bindings.get(&vx), Some(&vec![d0e, d1e]));
+        assert_eq!(cc.from, vec![SourceAlias(DatomsTable::Datoms, d0),
+                                 SourceAlias(DatomsTable::Datoms, d1)]);
+    }
+
+    // Alternation with a pattern and a predicate.
+    #[test]
+    fn test_alternation_with_pattern_and_predicate() {
+        let schema = prepopulated_schema();
+        let known = Known::for_schema(&schema);
+        let query = r#"
+            [:find ?x ?age
+             :where
+             [?x :foo/age ?age]
+             [(< ?age 30)]
+             (or [?x :foo/knows "John"]
+                 [?x :foo/knows "Daphne"])]"#;
+        let cc = alg(known, query);
+        let vx = Variable::from_valid_name("?x");
+        let d0 = "datoms00".to_string();
+        let d1 = "datoms01".to_string();
+        let d0e = QualifiedAlias::new(d0.clone(), DatomsColumn::Entity);
+        let d0a = QualifiedAlias::new(d0.clone(), DatomsColumn::Attribute);
+        let d0v = QualifiedAlias::new(d0.clone(), DatomsColumn::Value);
+        let d1e = QualifiedAlias::new(d1.clone(), DatomsColumn::Entity);
+        let d1a = QualifiedAlias::new(d1.clone(), DatomsColumn::Attribute);
+        let d1v = QualifiedAlias::new(d1.clone(), DatomsColumn::Value);
+        let knows = QueryValue::Entid(66);
+        let age = QueryValue::Entid(68);
+        let john = QueryValue::TypedValue(TypedValue::typed_string("John"));
+        let daphne = QueryValue::TypedValue(TypedValue::typed_string("Daphne"));
+
+        assert!(!cc.is_known_empty());
+        assert_eq!(cc.wheres, ColumnIntersection(vec![
+            ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0a.clone(), age.clone())),
+            ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Inequality {
+                operator: Inequality::LessThan,
+                left: QueryValue::Column(d0v.clone()),
+                right: QueryValue::TypedValue(TypedValue::Long(30)),
+            }),
+            ColumnConstraintOrAlternation::Alternation(
+                ColumnAlternation(vec![
+                    ColumnIntersection(vec![
+                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1a.clone(), knows.clone())),
+                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1v.clone(), john))]),
+                    ColumnIntersection(vec![
+                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1a.clone(), knows)),
+                        ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d1v.clone(), daphne))]),
+                    ])),
+            // The outer pattern joins against the `or`.
+            ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0e.clone(), QueryValue::Column(d1e.clone()))),
+        ]));
+        assert_eq!(cc.column_bindings.get(&vx), Some(&vec![d0e, d1e]));
+        assert_eq!(cc.from, vec![SourceAlias(DatomsTable::Datoms, d0),
+                                 SourceAlias(DatomsTable::Datoms, d1)]);
+    }
+
+    // These two are not equivalent:
+    // [:find ?x :where [?x :foo/bar ?y] (or-join [?x] [?x :foo/baz ?y])]
+    // [:find ?x :where [?x :foo/bar ?y] [?x :foo/baz ?y]]
+    #[test]
+    fn test_unit_or_join_doesnt_flatten() {
+        let schema = prepopulated_schema();
+        let known = Known::for_schema(&schema);
+        let query = r#"[:find ?x
+                        :where [?x :foo/knows ?y]
+                               (or-join [?x] [?x :foo/parent ?y])]"#;
+        let cc = alg(known, query);
+        let vx = Variable::from_valid_name("?x");
+        let vy = Variable::from_valid_name("?y");
+        let d0 = "datoms00".to_string();
+        let c0 = "c00".to_string();
+        let c0x = QualifiedAlias::new(c0.clone(), VariableColumn::Variable(vx.clone()));
+        let d0e = QualifiedAlias::new(d0.clone(), DatomsColumn::Entity);
+        let d0a = QualifiedAlias::new(d0.clone(), DatomsColumn::Attribute);
+        let d0v = QualifiedAlias::new(d0.clone(), DatomsColumn::Value);
+        let knows = QueryValue::Entid(66);
+
+        assert!(!cc.is_known_empty());
+        assert_eq!(cc.wheres, ColumnIntersection(vec![
+            ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0a.clone(), knows.clone())),
+            // The outer pattern joins against the `or` on the entity, but not value -- ?y means
+            // different things in each place.
+            ColumnConstraintOrAlternation::Constraint(ColumnConstraint::Equals(d0e.clone(), QueryValue::Column(c0x.clone()))),
+        ]));
+        assert_eq!(cc.column_bindings.get(&vx), Some(&vec![d0e, c0x]));
+
+        // ?y does not have a binding in the `or-join` pattern.
+        assert_eq!(cc.column_bindings.get(&vy), Some(&vec![d0v]));
+        assert_eq!(cc.from, vec![SourceAlias(DatomsTable::Datoms, d0),
+                                 SourceAlias(DatomsTable::Computed(0), c0)]);
+    }
+
+    // These two are equivalent:
+    // [:find ?x :where [?x :foo/bar ?y] (or [?x :foo/baz ?y])]
+    // [:find ?x :where [?x :foo/bar ?y] [?x :foo/baz ?y]]
+    #[test]
+    fn test_unit_or_does_flatten() {
+        let schema = prepopulated_schema();
+        let known = Known::for_schema(&schema);
+        let or_query =   r#"[:find ?x
+                             :where [?x :foo/knows ?y]
+                                    (or [?x :foo/parent ?y])]"#;
+        let flat_query = r#"[:find ?x
+                             :where [?x :foo/knows ?y]
+                                    [?x :foo/parent ?y]]"#;
+        compare_ccs(alg(known, or_query),
+                    alg(known, flat_query));
+    }
+
+    // Elision of `and`.
+    #[test]
+    fn test_unit_or_and_does_flatten() {
+        let schema = prepopulated_schema();
+        let known = Known::for_schema(&schema);
+        let or_query =   r#"[:find ?x
+                             :where (or (and [?x :foo/parent ?y]
+                                             [?x :foo/age 7]))]"#;
+        let flat_query =   r#"[:find ?x
+                               :where [?x :foo/parent ?y]
+                                      [?x :foo/age 7]]"#;
+        compare_ccs(alg(known, or_query),
+                    alg(known, flat_query));
+    }
+
+    // Alternation with `and`.
+    /// [:find ?x
+    ///  :where (or (and [?x :foo/knows "John"]
+    ///                  [?x :foo/parent "Ámbar"])
+    ///             [?x :foo/knows "Daphne"])]
+    /// Strictly speaking this can be implemented with a `NOT EXISTS` clause for the second pattern,
+    /// but that would be a fair amount of analysis work, I think.
+    #[test]
+    fn test_alternation_with_and() {
+        let schema = prepopulated_schema();
+        let known = Known::for_schema(&schema);
+        let query = r#"
+            [:find ?x
+             :where (or (and [?x :foo/knows "John"]
+                             [?x :foo/parent "Ámbar"])
+                        [?x :foo/knows "Daphne"])]"#;
+        let cc = alg(known, query);
+        let mut tables = cc.computed_tables.into_iter();
+        match (tables.next(), tables.next()) {
+            (Some(ComputedTable::Union { projection, type_extraction, arms }), None) => {
+                assert_eq!(projection, vec![Variable::from_valid_name("?x")].into_iter().collect());
+                assert!(type_extraction.is_empty());
+
+                let mut arms = arms.into_iter();
+                match (arms.next(), arms.next(), arms.next()) {
+                    (Some(and), Some(pattern), None) => {
+                        let expected_and = alg_c(known,
+                                                 0,  // The first pattern to be processed.
+                                                 r#"[:find ?x :where [?x :foo/knows "John"] [?x :foo/parent "Ámbar"]]"#);
+                        compare_ccs(and, expected_and);
+
+                        let expected_pattern = alg_c(known,
+                                                     2,      // Two aliases taken by the other arm.
+                                                     r#"[:find ?x :where [?x :foo/knows "Daphne"]]"#);
+                        compare_ccs(pattern, expected_pattern);
+                    },
+                    _ => {
+                        panic!("Expected two arms");
+                    }
+                }
+            },
+            _ => {
+                panic!("Didn't get two inner tables.");
+            },
+        }
+    }
+
+    #[test]
+    fn test_type_based_or_pruning() {
+        let schema = prepopulated_schema();
+        let known = Known::for_schema(&schema);
+        // This simplifies to:
+        // [:find ?x
+        //  :where [?a :some/int ?x]
+        //         [_ :some/otherint ?x]]
+        let query = r#"
+            [:find ?x
+             :where [?a :foo/age ?x]
+                    (or [_ :foo/height ?x]
+                        [_ :foo/name ?x])]"#;
+        let simple = r#"
+            [:find ?x
+             :where [?a :foo/age ?x]
+                    [_ :foo/height ?x]]"#;
+        compare_ccs(alg(known, query), alg(known, simple));
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/pattern.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/pattern.rs.html new file mode 100644 index 00000000..c01cc0b0 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/pattern.rs.html @@ -0,0 +1,2660 @@ + + + + + + + + + + pattern.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use mentat_core::{
+    Cloned,
+    Entid,
+    HasSchema,
+    TypedValue,
+    ValueType,
+    ValueTypeSet,
+};
+
+use mentat_query::{
+    NonIntegerConstant,
+    Pattern,
+    PatternValuePlace,
+    PatternNonValuePlace,
+    SrcVar,
+    Variable,
+};
+
+use clauses::{
+    ConjoiningClauses,
+};
+
+use types::{
+    ColumnConstraint,
+    DatomsColumn,
+    EmptyBecause,
+    EvolvedNonValuePlace,
+    EvolvedPattern,
+    EvolvedValuePlace,
+    PlaceOrEmpty,
+    SourceAlias,
+};
+
+use Known;
+
+pub fn into_typed_value(nic: NonIntegerConstant) -> TypedValue {
+    match nic {
+        NonIntegerConstant::BigInteger(_) => unimplemented!(),     // TODO: #280.
+        NonIntegerConstant::Boolean(v) => TypedValue::Boolean(v),
+        NonIntegerConstant::Float(v) => TypedValue::Double(v),
+        NonIntegerConstant::Text(v) => v.into(),
+        NonIntegerConstant::Instant(v) => TypedValue::Instant(v),
+        NonIntegerConstant::Uuid(v) => TypedValue::Uuid(v),
+    }
+}
+
+/// Application of patterns.
+impl ConjoiningClauses {
+
+    /// Apply the constraints in the provided pattern to this CC.
+    ///
+    /// This is a single-pass process, which means it is naturally incomplete, failing to take into
+    /// account all information spread across two patterns.
+    ///
+    /// If the constraints cannot be satisfied -- for example, if this pattern includes a numeric
+    /// attribute and a string value -- then the `empty_because` field on the CC is flipped and
+    /// the function returns.
+    ///
+    /// A pattern being impossible to satisfy isn't necessarily a bad thing -- this query might
+    /// have branched clauses that apply to different knowledge bases, and might refer to
+    /// vocabulary that isn't (yet) used in this one.
+    ///
+    /// Most of the work done by this function depends on the schema and ident maps in the DB. If
+    /// these change, then any work done is invalid.
+    ///
+    /// There's a lot more we can do here and later by examining the
+    /// attribute:
+    ///
+    /// - If it's unique, and we have patterns like
+    ///
+    ///     [?x :foo/unique 5] [?x :foo/unique ?y]
+    ///
+    ///   then we can either prove impossibility (the two objects must
+    ///   be equal) or deduce identity and simplify the query.
+    ///
+    /// - The same, if it's cardinality-one and the entity is known.
+    ///
+    /// - If there's a value index on this attribute, we might want to
+    ///   run this pattern early in the query.
+    ///
+    /// - A unique-valued attribute can sometimes be rewritten into an
+    ///   existence subquery instead of a join.
+    ///
+    /// This method is only public for use from `or.rs`.
+    pub(crate) fn apply_pattern_clause_for_alias(&mut self, known: Known, pattern: &EvolvedPattern, alias: &SourceAlias) {
+        if self.is_known_empty() {
+            return;
+        }
+
+        // Process each place in turn, applying constraints.
+        // Both `e` and `a` must be entities, which is equivalent here
+        // to being typed as Ref.
+        // Sorry for the duplication; Rust makes it a pain to abstract this.
+
+        // The transaction part of a pattern must be an entid, variable, or placeholder.
+        self.constrain_to_tx(&pattern.tx);
+        self.constrain_to_ref(&pattern.entity);
+        self.constrain_to_ref(&pattern.attribute);
+
+        let ref col = alias.1;
+
+        let schema = known.schema;
+        match pattern.entity {
+            EvolvedNonValuePlace::Placeholder =>
+                // Placeholders don't contribute any column bindings, nor do
+                // they constrain the query -- there's no need to produce
+                // IS NOT NULL, because we don't store nulls in our schema.
+                (),
+            EvolvedNonValuePlace::Variable(ref v) =>
+                self.bind_column_to_var(schema, col.clone(), DatomsColumn::Entity, v.clone()),
+            EvolvedNonValuePlace::Entid(entid) =>
+                self.constrain_column_to_entity(col.clone(), DatomsColumn::Entity, entid),
+        }
+
+        match pattern.attribute {
+            EvolvedNonValuePlace::Placeholder =>
+                (),
+            EvolvedNonValuePlace::Variable(ref v) =>
+                self.bind_column_to_var(schema, col.clone(), DatomsColumn::Attribute, v.clone()),
+            EvolvedNonValuePlace::Entid(entid) => {
+                if !schema.is_attribute(entid) {
+                    // Furthermore, that entid must resolve to an attribute. If it doesn't, this
+                    // query is meaningless.
+                    self.mark_known_empty(EmptyBecause::InvalidAttributeEntid(entid));
+                    return;
+                }
+                self.constrain_attribute(col.clone(), entid)
+            },
+        }
+
+        // Determine if the pattern's value type is known.
+        // We do so by examining the value place and the attribute.
+        // At this point it's possible that the type of the value is
+        // inconsistent with the attribute; in that case this pattern
+        // cannot return results, and we short-circuit.
+        let value_type = self.get_value_type(schema, pattern);
+
+        match pattern.value {
+            EvolvedValuePlace::Placeholder =>
+                (),
+
+            EvolvedValuePlace::Variable(ref v) => {
+                if let Some(this_type) = value_type {
+                    // Wouldn't it be nice if we didn't need to clone in the found case?
+                    // It doesn't matter too much: collisons won't be too frequent.
+                    self.constrain_var_to_type(v.clone(), this_type);
+                    if self.is_known_empty() {
+                        return;
+                    }
+                }
+
+                self.bind_column_to_var(schema, col.clone(), DatomsColumn::Value, v.clone());
+            },
+            EvolvedValuePlace::Entid(i) => {
+                match value_type {
+                    Some(ValueType::Ref) | None => {
+                        self.constrain_column_to_entity(col.clone(), DatomsColumn::Value, i);
+                    },
+                    Some(value_type) => {
+                        self.mark_known_empty(EmptyBecause::ValueTypeMismatch(value_type, TypedValue::Ref(i)));
+                    },
+                }
+            },
+
+            EvolvedValuePlace::EntidOrInteger(i) =>
+                // If we know the valueType, then we can determine whether this is an entid or an
+                // integer. If we don't, then we must generate a more general query with a
+                // value_type_tag.
+                if let Some(ValueType::Ref) = value_type {
+                    self.constrain_column_to_entity(col.clone(), DatomsColumn::Value, i);
+                } else {
+                    // If we have a pattern like:
+                    //
+                    //   `[123 ?a 1]`
+                    //
+                    // then `1` could be an entid (ref), a long, a boolean, or an instant.
+                    //
+                    // We represent these constraints during execution:
+                    //
+                    // - Constraining the value column to the plain numeric value '1'.
+                    // - Constraining its type column to one of a set of types.
+                    //
+                    // TODO: isn't there a bug here? We'll happily take a numeric value
+                    // for a non-numeric attribute!
+                    self.constrain_value_to_numeric(col.clone(), i);
+                },
+            EvolvedValuePlace::IdentOrKeyword(ref kw) => {
+                // If we know the valueType, then we can determine whether this is an ident or a
+                // keyword. If we don't, then we must generate a more general query with a
+                // value_type_tag.
+                // We can also speculatively try to resolve it as an ident; if we fail, then we
+                // know it can only return results if treated as a keyword, and we can treat it as
+                // such.
+                if let Some(ValueType::Ref) = value_type {
+                    if let Some(entid) = self.entid_for_ident(schema, kw) {
+                        self.constrain_column_to_entity(col.clone(), DatomsColumn::Value, entid.into())
+                    } else {
+                        // A resolution failure means we're done here: this attribute must have an
+                        // entity value.
+                        self.mark_known_empty(EmptyBecause::UnresolvedIdent(kw.cloned()));
+                        return;
+                    }
+                } else {
+                    // It must be a keyword.
+                    self.constrain_column_to_constant(col.clone(), DatomsColumn::Value, TypedValue::Keyword(kw.clone()));
+                    self.wheres.add_intersection(ColumnConstraint::has_unit_type(col.clone(), ValueType::Keyword));
+                };
+            },
+            EvolvedValuePlace::Value(ref c) => {
+                // TODO: don't allocate.
+                let typed_value = c.clone();
+                if !typed_value.is_congruent_with(value_type) {
+                    // If the attribute and its value don't match, the pattern must fail.
+                    // We can never have a congruence failure if `value_type` is `None`, so we
+                    // forcibly unwrap here.
+                    let value_type = value_type.expect("Congruence failure but couldn't unwrap");
+                    let why = EmptyBecause::ValueTypeMismatch(value_type, typed_value);
+                    self.mark_known_empty(why);
+                    return;
+                }
+
+                // TODO: if we don't know the type of the attribute because we don't know the
+                // attribute, we can actually work backwards to the set of appropriate attributes
+                // from the type of the value itself! #292.
+                let typed_value_type = typed_value.value_type();
+                self.constrain_column_to_constant(col.clone(), DatomsColumn::Value, typed_value);
+
+                // If we can't already determine the range of values in the DB from the attribute,
+                // then we must also constrain the type tag.
+                //
+                // Input values might be:
+                //
+                // - A long. This is handled by EntidOrInteger.
+                // - A boolean. This is unambiguous.
+                // - A double. This is currently unambiguous, though note that SQLite will equate 5.0 with 5.
+                // - A string. This is unambiguous.
+                // - A keyword. This is unambiguous.
+                //
+                // Because everything we handle here is unambiguous, we generate a single type
+                // restriction from the value type of the typed value.
+                if value_type.is_none() {
+                    self.wheres.add_intersection(
+                        ColumnConstraint::has_unit_type(col.clone(), typed_value_type));
+                }
+            },
+        }
+
+        match pattern.tx {
+            EvolvedNonValuePlace::Placeholder => (),
+            EvolvedNonValuePlace::Variable(ref v) => {
+                self.bind_column_to_var(schema, col.clone(), DatomsColumn::Tx, v.clone());
+            },
+            EvolvedNonValuePlace::Entid(entid) => {
+                self.constrain_column_to_entity(col.clone(), DatomsColumn::Tx, entid);
+            },
+        }
+    }
+
+    fn reverse_lookup(&mut self, known: Known, var: &Variable, attr: Entid, val: &TypedValue) -> bool {
+        if let Some(attribute) = known.schema.attribute_for_entid(attr) {
+            let unique = attribute.unique.is_some();
+            if unique {
+                match known.get_entid_for_value(attr, val) {
+                    None => {
+                        self.mark_known_empty(EmptyBecause::CachedAttributeHasNoEntity {
+                            value: val.clone(),
+                            attr: attr,
+                        });
+                        true
+                    },
+                    Some(item) => {
+                        self.bind_value(var, TypedValue::Ref(item));
+                        true
+                    },
+                }
+            } else {
+                match known.get_entids_for_value(attr, val) {
+                    None => {
+                        self.mark_known_empty(EmptyBecause::CachedAttributeHasNoEntity {
+                            value: val.clone(),
+                            attr: attr,
+                        });
+                        true
+                    },
+                    Some(items) => {
+                        if items.len() == 1 {
+                            let item = items.iter().next().cloned().unwrap();
+                            self.bind_value(var, TypedValue::Ref(item));
+                            true
+                        } else {
+                            // Oh well.
+                            // TODO: handle multiple values.
+                            false
+                        }
+                    },
+                }
+            }
+        } else {
+            self.mark_known_empty(EmptyBecause::InvalidAttributeEntid(attr));
+            true
+        }
+    }
+
+    // TODO: generalize.
+    // TODO: use constant values -- extract transformation code from apply_pattern_clause_for_alias.
+    // TODO: loop over all patterns until no more cache values apply?
+    fn attempt_cache_lookup(&mut self, known: Known, pattern: &EvolvedPattern) -> bool {
+        // Precondition: default source. If it's not default, don't call this.
+        assert!(pattern.source == SrcVar::DefaultSrc);
+
+        let schema = known.schema;
+
+        if pattern.tx != EvolvedNonValuePlace::Placeholder {
+            return false;
+        }
+
+        // See if we can use the cache.
+        match pattern.attribute {
+            EvolvedNonValuePlace::Entid(attr) => {
+                if !schema.is_attribute(attr) {
+                    // Furthermore, that entid must resolve to an attribute. If it doesn't, this
+                    // query is meaningless.
+                    self.mark_known_empty(EmptyBecause::InvalidAttributeEntid(attr));
+                    return true;
+                }
+
+                let cached_forward = known.is_attribute_cached_forward(attr);
+                let cached_reverse = known.is_attribute_cached_reverse(attr);
+
+                if (cached_forward || cached_reverse) &&
+                   pattern.tx == EvolvedNonValuePlace::Placeholder {
+
+                    let attribute = schema.attribute_for_entid(attr).unwrap();
+
+                    // There are two patterns we can handle:
+                    //     [?e :some/unique 123 _ _]     -- reverse lookup
+                    //     [123 :some/attr ?v _ _]       -- forward lookup
+                    match pattern.entity {
+                        // Reverse lookup.
+                        EvolvedNonValuePlace::Variable(ref var) => {
+                            match pattern.value {
+                                // TODO: EntidOrInteger etc.
+                                EvolvedValuePlace::IdentOrKeyword(ref kw) => {
+                                    match attribute.value_type {
+                                        ValueType::Ref => {
+                                            // It's an ident.
+                                            // TODO
+                                            return false;
+                                        },
+                                        ValueType::Keyword => {
+                                            let tv: TypedValue = TypedValue::Keyword(kw.clone());
+                                            return self.reverse_lookup(known, var, attr, &tv);
+                                        },
+                                        t => {
+                                            let tv: TypedValue = TypedValue::Keyword(kw.clone());
+                                            // Anything else can't match an IdentOrKeyword.
+                                            self.mark_known_empty(EmptyBecause::ValueTypeMismatch(t, tv));
+                                            return true;
+                                        },
+                                    }
+                                },
+                                EvolvedValuePlace::Value(ref val) => {
+                                    if cached_reverse {
+                                        return self.reverse_lookup(known, var, attr, val);
+                                    }
+                                }
+                                _ => {},      // TODO: check constant values against cache.
+                            }
+                        },
+
+                        // Forward lookup.
+                        EvolvedNonValuePlace::Entid(entity) => {
+                            match pattern.value {
+                                EvolvedValuePlace::Variable(ref var) => {
+                                    if cached_forward {
+                                        match known.get_value_for_entid(known.schema, attr, entity) {
+                                            None => {
+                                                self.mark_known_empty(EmptyBecause::CachedAttributeHasNoValues {
+                                                    entity: entity,
+                                                    attr: attr,
+                                                });
+                                                return true;
+                                            },
+                                            Some(item) => {
+                                                self.bind_value(var, item.clone());
+                                                return true;
+                                            }
+                                        }
+                                    }
+                                }
+                                _ => {},      // TODO: check constant values against cache.
+                            }
+                        },
+                        _ => {},
+                    }
+                }
+            },
+            _ => {},
+        }
+        false
+    }
+
+    /// Transform a pattern place into a narrower type.
+    /// If that's impossible, returns Empty.
+    fn make_evolved_non_value(&self, known: &Known, col: DatomsColumn, non_value: PatternNonValuePlace) -> PlaceOrEmpty<EvolvedNonValuePlace> {
+        use self::PlaceOrEmpty::*;
+        match non_value {
+            PatternNonValuePlace::Placeholder => Place(EvolvedNonValuePlace::Placeholder),
+            PatternNonValuePlace::Entid(e) => Place(EvolvedNonValuePlace::Entid(e)),
+            PatternNonValuePlace::Ident(kw) => {
+                // Resolve the ident.
+                if let Some(entid) = known.schema.get_entid(&kw) {
+                    Place(EvolvedNonValuePlace::Entid(entid.into()))
+                } else {
+                    Empty(EmptyBecause::UnresolvedIdent((&*kw).clone()))
+                }
+            },
+            PatternNonValuePlace::Variable(var) => {
+                // See if we have it!
+                match self.bound_value(&var) {
+                    None => Place(EvolvedNonValuePlace::Variable(var)),
+                    Some(TypedValue::Ref(entid)) => Place(EvolvedNonValuePlace::Entid(entid)),
+                    Some(TypedValue::Keyword(kw)) => {
+                        // We'll allow this only if it's an ident.
+                        if let Some(entid) = known.schema.get_entid(&kw) {
+                            Place(EvolvedNonValuePlace::Entid(entid.into()))
+                        } else {
+                            Empty(EmptyBecause::UnresolvedIdent((&*kw).clone()))
+                        }
+                    },
+                    Some(v) => {
+                        Empty(EmptyBecause::InvalidBinding(col.into(), v))
+                    },
+                }
+            },
+        }
+    }
+
+    fn make_evolved_entity(&self, known: &Known, entity: PatternNonValuePlace) -> PlaceOrEmpty<EvolvedNonValuePlace> {
+        self.make_evolved_non_value(known, DatomsColumn::Entity, entity)
+    }
+
+    fn make_evolved_tx(&self, known: &Known, tx: PatternNonValuePlace) -> PlaceOrEmpty<EvolvedNonValuePlace> {
+        // TODO: make sure that, if it's an entid, it names a tx.
+        self.make_evolved_non_value(known, DatomsColumn::Tx, tx)
+    }
+
+    pub(crate) fn make_evolved_attribute(&self, known: &Known, attribute: PatternNonValuePlace) -> PlaceOrEmpty<(EvolvedNonValuePlace, Option<ValueType>)> {
+        use self::PlaceOrEmpty::*;
+        self.make_evolved_non_value(known, DatomsColumn::Attribute, attribute)
+            .and_then(|a| {
+                // Make sure that, if it's an entid, it names an attribute.
+                if let EvolvedNonValuePlace::Entid(e) = a {
+                    if let Some(attr) = known.schema.attribute_for_entid(e) {
+                        Place((a, Some(attr.value_type)))
+                    } else {
+                        Empty(EmptyBecause::InvalidAttributeEntid(e))
+                    }
+                } else {
+                    Place((a, None))
+                }
+            })
+    }
+
+    pub(crate) fn make_evolved_value(&self,
+                                     known: &Known,
+                                     value_type: Option<ValueType>,
+                                     value: PatternValuePlace) -> PlaceOrEmpty<EvolvedValuePlace> {
+        use self::PlaceOrEmpty::*;
+        match value {
+            PatternValuePlace::Placeholder => Place(EvolvedValuePlace::Placeholder),
+            PatternValuePlace::EntidOrInteger(e) => {
+                match value_type {
+                    Some(ValueType::Ref) => Place(EvolvedValuePlace::Entid(e)),
+                    Some(ValueType::Long) => Place(EvolvedValuePlace::Value(TypedValue::Long(e))),
+                    Some(ValueType::Double) => Place(EvolvedValuePlace::Value((e as f64).into())),
+                    Some(t) => Empty(EmptyBecause::ValueTypeMismatch(t, TypedValue::Long(e))),
+                    None => Place(EvolvedValuePlace::EntidOrInteger(e)),
+                }
+            },
+            PatternValuePlace::IdentOrKeyword(kw) => {
+                match value_type {
+                    Some(ValueType::Ref) => {
+                        // Resolve the ident.
+                        if let Some(entid) = known.schema.get_entid(&kw) {
+                            Place(EvolvedValuePlace::Entid(entid.into()))
+                        } else {
+                            Empty(EmptyBecause::UnresolvedIdent((&*kw).clone()))
+                        }
+                    },
+                    Some(ValueType::Keyword) => {
+                        Place(EvolvedValuePlace::Value(TypedValue::Keyword(kw)))
+                    },
+                    Some(t) => {
+                        Empty(EmptyBecause::ValueTypeMismatch(t, TypedValue::Keyword(kw)))
+                    },
+                    None => {
+                        Place(EvolvedValuePlace::IdentOrKeyword(kw))
+                    },
+                }
+            },
+            PatternValuePlace::Variable(var) => {
+                // See if we have it!
+                match self.bound_value(&var) {
+                    None => Place(EvolvedValuePlace::Variable(var)),
+                    Some(TypedValue::Ref(entid)) => {
+                        if let Some(empty) = self.can_constrain_var_to_type(&var, ValueType::Ref) {
+                            Empty(empty)
+                        } else {
+                            Place(EvolvedValuePlace::Entid(entid))
+                        }
+                    },
+                    Some(val) => {
+                        if let Some(empty) = self.can_constrain_var_to_type(&var, val.value_type()) {
+                            Empty(empty)
+                        } else {
+                            Place(EvolvedValuePlace::Value(val))
+                        }
+                    },
+                }
+            },
+            PatternValuePlace::Constant(nic) => {
+                Place(EvolvedValuePlace::Value(into_typed_value(nic)))
+            },
+        }
+    }
+
+    pub(crate) fn make_evolved_pattern(&self, known: Known, pattern: Pattern) -> PlaceOrEmpty<EvolvedPattern> {
+        let (e, a, v, tx, source) = (pattern.entity, pattern.attribute, pattern.value, pattern.tx, pattern.source);
+        use self::PlaceOrEmpty::*;
+        match self.make_evolved_entity(&known, e) {
+            Empty(because) => Empty(because),
+            Place(e) => {
+                match self.make_evolved_attribute(&known, a) {
+                    Empty(because) => Empty(because),
+                    Place((a, value_type)) => {
+                        match self.make_evolved_value(&known, value_type, v) {
+                            Empty(because) => Empty(because),
+                            Place(v) => {
+                                match self.make_evolved_tx(&known, tx) {
+                                    Empty(because) => Empty(because),
+                                    Place(tx) => {
+                                        PlaceOrEmpty::Place(EvolvedPattern {
+                                            source: source.unwrap_or(SrcVar::DefaultSrc),
+                                            entity: e,
+                                            attribute: a,
+                                            value: v,
+                                            tx: tx,
+                                        })
+                                    },
+                                }
+                            },
+                        }
+                    },
+                }
+            },
+        }
+    }
+
+    /// Re-examine the pattern to see if it can be specialized or is now known to fail.
+    #[allow(unused_variables)]
+    pub(crate) fn evolve_pattern(&mut self, known: Known, mut pattern: EvolvedPattern) -> PlaceOrEmpty<EvolvedPattern> {
+        use self::PlaceOrEmpty::*;
+
+        let mut new_entity: Option<EvolvedNonValuePlace> = None;
+        let mut new_value: Option<EvolvedValuePlace> = None;
+
+        match &pattern.entity {
+            &EvolvedNonValuePlace::Variable(ref var) => {
+                // See if we have it yet!
+                match self.bound_value(&var) {
+                    None => (),
+                    Some(TypedValue::Ref(entid)) => {
+                        new_entity = Some(EvolvedNonValuePlace::Entid(entid));
+                    },
+                    Some(v) => {
+                        return Empty(EmptyBecause::TypeMismatch {
+                            var: var.clone(),
+                            existing: self.known_type_set(&var),
+                            desired: ValueTypeSet::of_one(ValueType::Ref),
+                        });
+                    },
+                };
+            },
+            _ => (),
+        }
+        match &pattern.value {
+            &EvolvedValuePlace::Variable(ref var) => {
+                // See if we have it yet!
+                match self.bound_value(&var) {
+                    None => (),
+                    Some(tv) => {
+                        new_value = Some(EvolvedValuePlace::Value(tv.clone()));
+                    },
+                };
+            },
+            _ => (),
+        }
+
+
+        if let Some(e) = new_entity {
+            pattern.entity = e;
+        }
+        if let Some(v) = new_value {
+            pattern.value = v;
+        }
+        Place(pattern)
+    }
+
+    #[cfg(test)]
+    pub(crate) fn apply_parsed_pattern(&mut self, known: Known, pattern: Pattern) {
+        use self::PlaceOrEmpty::*;
+        match self.make_evolved_pattern(known, pattern) {
+            Empty(e) => self.mark_known_empty(e),
+            Place(p) => self.apply_pattern(known, p),
+        };
+    }
+
+    pub(crate) fn apply_pattern(&mut self, known: Known, pattern: EvolvedPattern) {
+        // For now we only support the default source.
+        if pattern.source != SrcVar::DefaultSrc {
+            unimplemented!();
+        }
+
+        if self.attempt_cache_lookup(known, &pattern) {
+            return;
+        }
+
+        if let Some(alias) = self.alias_table(known.schema, &pattern) {
+            self.apply_pattern_clause_for_alias(known, &pattern, &alias);
+            self.from.push(alias);
+        } else {
+            // We didn't determine a table, likely because there was a mismatch
+            // between an attribute and a value.
+            // We know we cannot return a result, so we short-circuit here.
+            self.mark_known_empty(EmptyBecause::AttributeLookupFailed);
+            return;
+        }
+    }
+}
+
+#[cfg(test)]
+mod testing {
+    use super::*;
+
+    use std::collections::BTreeMap;
+    use std::collections::BTreeSet;
+
+    use mentat_core::attribute::Unique;
+    use mentat_core::{
+        Attribute,
+        Schema,
+        ValueTypeSet,
+    };
+
+    use mentat_query::{
+        Keyword,
+        Variable,
+    };
+
+    use clauses::{
+        QueryInputs,
+        add_attribute,
+        associate_ident,
+        ident,
+    };
+
+    use types::{
+        Column,
+        ColumnConstraint,
+        DatomsTable,
+        QualifiedAlias,
+        QueryValue,
+        SourceAlias,
+    };
+
+    use {
+        algebrize,
+        parse_find_string,
+    };
+
+    fn alg(schema: &Schema, input: &str) -> ConjoiningClauses {
+        let parsed = parse_find_string(input).expect("parse failed");
+        let known = Known::for_schema(schema);
+        algebrize(known, parsed).expect("algebrize failed").cc
+    }
+
+    #[test]
+    fn test_unknown_ident() {
+        let mut cc = ConjoiningClauses::default();
+        let schema = Schema::default();
+        let known = Known::for_schema(&schema);
+
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(Variable::from_valid_name("?x")),
+            attribute: ident("foo", "bar"),
+            value: PatternValuePlace::Constant(NonIntegerConstant::Boolean(true)),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+
+        assert!(cc.is_known_empty());
+    }
+
+    #[test]
+    fn test_unknown_attribute() {
+        let mut cc = ConjoiningClauses::default();
+        let mut schema = Schema::default();
+
+        associate_ident(&mut schema, Keyword::namespaced("foo", "bar"), 99);
+
+        let known = Known::for_schema(&schema);
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(Variable::from_valid_name("?x")),
+            attribute: ident("foo", "bar"),
+            value: PatternValuePlace::Constant(NonIntegerConstant::Boolean(true)),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+
+        assert!(cc.is_known_empty());
+    }
+
+    #[test]
+    fn test_apply_simple_pattern() {
+        let mut cc = ConjoiningClauses::default();
+        let mut schema = Schema::default();
+
+        associate_ident(&mut schema, Keyword::namespaced("foo", "bar"), 99);
+        add_attribute(&mut schema, 99, Attribute {
+            value_type: ValueType::Boolean,
+            ..Default::default()
+        });
+
+        let x = Variable::from_valid_name("?x");
+        let known = Known::for_schema(&schema);
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: ident("foo", "bar"),
+            value: PatternValuePlace::Constant(NonIntegerConstant::Boolean(true)),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+
+        // println!("{:#?}", cc);
+
+        let d0_e = QualifiedAlias::new("datoms00".to_string(), DatomsColumn::Entity);
+        let d0_a = QualifiedAlias::new("datoms00".to_string(), DatomsColumn::Attribute);
+        let d0_v = QualifiedAlias::new("datoms00".to_string(), DatomsColumn::Value);
+
+        // After this, we know a lot of things:
+        assert!(!cc.is_known_empty());
+        assert_eq!(cc.from, vec![SourceAlias(DatomsTable::Datoms, "datoms00".to_string())]);
+
+        // ?x must be a ref.
+        assert_eq!(cc.known_type(&x).unwrap(), ValueType::Ref);
+
+        // ?x is bound to datoms0.e.
+        assert_eq!(cc.column_bindings.get(&x).unwrap(), &vec![d0_e.clone()]);
+
+        // Our 'where' clauses are two:
+        // - datoms0.a = 99
+        // - datoms0.v = true
+        // No need for a type tag constraint, because the attribute is known.
+        assert_eq!(cc.wheres, vec![
+                   ColumnConstraint::Equals(d0_a, QueryValue::Entid(99)),
+                   ColumnConstraint::Equals(d0_v, QueryValue::TypedValue(TypedValue::Boolean(true))),
+        ].into());
+    }
+
+    #[test]
+    fn test_apply_unattributed_pattern() {
+        let mut cc = ConjoiningClauses::default();
+        let schema = Schema::default();
+
+        let x = Variable::from_valid_name("?x");
+        let known = Known::for_schema(&schema);
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: PatternNonValuePlace::Placeholder,
+            value: PatternValuePlace::Constant(NonIntegerConstant::Boolean(true)),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+
+        // println!("{:#?}", cc);
+
+        let d0_e = QualifiedAlias::new("datoms00".to_string(), DatomsColumn::Entity);
+        let d0_v = QualifiedAlias::new("datoms00".to_string(), DatomsColumn::Value);
+
+        assert!(!cc.is_known_empty());
+        assert_eq!(cc.from, vec![SourceAlias(DatomsTable::Datoms, "datoms00".to_string())]);
+
+        // ?x must be a ref.
+        assert_eq!(cc.known_type(&x).unwrap(), ValueType::Ref);
+
+        // ?x is bound to datoms0.e.
+        assert_eq!(cc.column_bindings.get(&x).unwrap(), &vec![d0_e.clone()]);
+
+        // Our 'where' clauses are two:
+        // - datoms0.v = true
+        // - datoms0.value_type_tag = boolean
+        // TODO: implement expand_type_tags.
+        assert_eq!(cc.wheres, vec![
+                   ColumnConstraint::Equals(d0_v, QueryValue::TypedValue(TypedValue::Boolean(true))),
+                   ColumnConstraint::has_unit_type("datoms00".to_string(), ValueType::Boolean),
+        ].into());
+    }
+
+    /// This test ensures that we do less work if we know the attribute thanks to a var lookup.
+    #[test]
+    fn test_apply_unattributed_but_bound_pattern_with_returned() {
+        let mut cc = ConjoiningClauses::default();
+        let mut schema = Schema::default();
+        associate_ident(&mut schema, Keyword::namespaced("foo", "bar"), 99);
+        add_attribute(&mut schema, 99, Attribute {
+            value_type: ValueType::Boolean,
+            ..Default::default()
+        });
+
+        let x = Variable::from_valid_name("?x");
+        let a = Variable::from_valid_name("?a");
+        let v = Variable::from_valid_name("?v");
+
+        cc.input_variables.insert(a.clone());
+        cc.value_bindings.insert(a.clone(), TypedValue::typed_ns_keyword("foo", "bar"));
+        let known = Known::for_schema(&schema);
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: PatternNonValuePlace::Variable(a.clone()),
+            value: PatternValuePlace::Variable(v.clone()),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+
+        // println!("{:#?}", cc);
+
+        let d0_e = QualifiedAlias::new("datoms00".to_string(), DatomsColumn::Entity);
+        let d0_a = QualifiedAlias::new("datoms00".to_string(), DatomsColumn::Attribute);
+
+        assert!(!cc.is_known_empty());
+        assert_eq!(cc.from, vec![SourceAlias(DatomsTable::Datoms, "datoms00".to_string())]);
+
+        // ?x must be a ref, and ?v a boolean.
+        assert_eq!(cc.known_type(&x), Some(ValueType::Ref));
+
+        // We don't need to extract a type for ?v, because the attribute is known.
+        assert!(!cc.extracted_types.contains_key(&v));
+        assert_eq!(cc.known_type(&v), Some(ValueType::Boolean));
+
+        // ?x is bound to datoms0.e.
+        assert_eq!(cc.column_bindings.get(&x).unwrap(), &vec![d0_e.clone()]);
+        assert_eq!(cc.wheres, vec![
+                   ColumnConstraint::Equals(d0_a, QueryValue::Entid(99)),
+        ].into());
+    }
+
+    /// Queries that bind non-entity values to entity places can't return results.
+    #[test]
+    fn test_bind_the_wrong_thing() {
+        let mut cc = ConjoiningClauses::default();
+        let schema = Schema::default();
+
+        let x = Variable::from_valid_name("?x");
+        let a = Variable::from_valid_name("?a");
+        let v = Variable::from_valid_name("?v");
+        let hello = TypedValue::typed_string("hello");
+
+        cc.input_variables.insert(a.clone());
+        cc.value_bindings.insert(a.clone(), hello.clone());
+        let known = Known::for_schema(&schema);
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: PatternNonValuePlace::Variable(a.clone()),
+            value: PatternValuePlace::Variable(v.clone()),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+
+        assert!(cc.is_known_empty());
+        assert_eq!(cc.empty_because.unwrap(), EmptyBecause::InvalidBinding(Column::Fixed(DatomsColumn::Attribute), hello));
+    }
+
+
+    /// This test ensures that we query all_datoms if we're possibly retrieving a string.
+    #[test]
+    fn test_apply_unattributed_pattern_with_returned() {
+        let mut cc = ConjoiningClauses::default();
+        let schema = Schema::default();
+
+        let x = Variable::from_valid_name("?x");
+        let a = Variable::from_valid_name("?a");
+        let v = Variable::from_valid_name("?v");
+        let known = Known::for_schema(&schema);
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: PatternNonValuePlace::Variable(a.clone()),
+            value: PatternValuePlace::Variable(v.clone()),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+
+        // println!("{:#?}", cc);
+
+        let d0_e = QualifiedAlias::new("all_datoms00".to_string(), DatomsColumn::Entity);
+
+        assert!(!cc.is_known_empty());
+        assert_eq!(cc.from, vec![SourceAlias(DatomsTable::AllDatoms, "all_datoms00".to_string())]);
+
+        // ?x must be a ref.
+        assert_eq!(cc.known_type(&x).unwrap(), ValueType::Ref);
+
+        // ?x is bound to datoms0.e.
+        assert_eq!(cc.column_bindings.get(&x).unwrap(), &vec![d0_e.clone()]);
+        assert_eq!(cc.wheres, vec![].into());
+    }
+
+    /// This test ensures that we query all_datoms if we're looking for a string.
+    #[test]
+    fn test_apply_unattributed_pattern_with_string_value() {
+        let mut cc = ConjoiningClauses::default();
+        let schema = Schema::default();
+
+        let x = Variable::from_valid_name("?x");
+        let known = Known::for_schema(&schema);
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: PatternNonValuePlace::Placeholder,
+            value: PatternValuePlace::Constant("hello".into()),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+
+        // println!("{:#?}", cc);
+
+        let d0_e = QualifiedAlias::new("all_datoms00".to_string(), DatomsColumn::Entity);
+        let d0_v = QualifiedAlias::new("all_datoms00".to_string(), DatomsColumn::Value);
+
+        assert!(!cc.is_known_empty());
+        assert_eq!(cc.from, vec![SourceAlias(DatomsTable::AllDatoms, "all_datoms00".to_string())]);
+
+        // ?x must be a ref.
+        assert_eq!(cc.known_type(&x).unwrap(), ValueType::Ref);
+
+        // ?x is bound to datoms0.e.
+        assert_eq!(cc.column_bindings.get(&x).unwrap(), &vec![d0_e.clone()]);
+
+        // Our 'where' clauses are two:
+        // - datoms0.v = 'hello'
+        // - datoms0.value_type_tag = string
+        // TODO: implement expand_type_tags.
+        assert_eq!(cc.wheres, vec![
+                   ColumnConstraint::Equals(d0_v, QueryValue::TypedValue(TypedValue::typed_string("hello"))),
+                   ColumnConstraint::has_unit_type("all_datoms00".to_string(), ValueType::String),
+        ].into());
+    }
+
+    #[test]
+    fn test_apply_two_patterns() {
+        let mut cc = ConjoiningClauses::default();
+        let mut schema = Schema::default();
+
+        associate_ident(&mut schema, Keyword::namespaced("foo", "bar"), 99);
+        associate_ident(&mut schema, Keyword::namespaced("foo", "roz"), 98);
+        add_attribute(&mut schema, 99, Attribute {
+            value_type: ValueType::Boolean,
+            ..Default::default()
+        });
+        add_attribute(&mut schema, 98, Attribute {
+            value_type: ValueType::String,
+            ..Default::default()
+        });
+
+        let x = Variable::from_valid_name("?x");
+        let y = Variable::from_valid_name("?y");
+        let known = Known::for_schema(&schema);
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: ident("foo", "roz"),
+            value: PatternValuePlace::Constant("idgoeshere".into()),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: ident("foo", "bar"),
+            value: PatternValuePlace::Variable(y.clone()),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+
+        // Finally, expand column bindings to get the overlaps for ?x.
+        cc.expand_column_bindings();
+
+        println!("{:#?}", cc);
+
+        let d0_e = QualifiedAlias::new("datoms00".to_string(), DatomsColumn::Entity);
+        let d0_a = QualifiedAlias::new("datoms00".to_string(), DatomsColumn::Attribute);
+        let d0_v = QualifiedAlias::new("datoms00".to_string(), DatomsColumn::Value);
+        let d1_e = QualifiedAlias::new("datoms01".to_string(), DatomsColumn::Entity);
+        let d1_a = QualifiedAlias::new("datoms01".to_string(), DatomsColumn::Attribute);
+
+        assert!(!cc.is_known_empty());
+        assert_eq!(cc.from, vec![
+                   SourceAlias(DatomsTable::Datoms, "datoms00".to_string()),
+                   SourceAlias(DatomsTable::Datoms, "datoms01".to_string()),
+        ]);
+
+        // ?x must be a ref.
+        assert_eq!(cc.known_type(&x).unwrap(), ValueType::Ref);
+
+        // ?x is bound to datoms0.e and datoms1.e.
+        assert_eq!(cc.column_bindings.get(&x).unwrap(),
+                   &vec![
+                       d0_e.clone(),
+                       d1_e.clone(),
+                   ]);
+
+        // Our 'where' clauses are four:
+        // - datoms0.a = 98 (:foo/roz)
+        // - datoms0.v = "idgoeshere"
+        // - datoms1.a = 99 (:foo/bar)
+        // - datoms1.e = datoms0.e
+        assert_eq!(cc.wheres, vec![
+                   ColumnConstraint::Equals(d0_a, QueryValue::Entid(98)),
+                   ColumnConstraint::Equals(d0_v, QueryValue::TypedValue(TypedValue::typed_string("idgoeshere"))),
+                   ColumnConstraint::Equals(d1_a, QueryValue::Entid(99)),
+                   ColumnConstraint::Equals(d0_e, QueryValue::Column(d1_e)),
+        ].into());
+    }
+
+    #[test]
+    fn test_value_bindings() {
+        let mut schema = Schema::default();
+
+        associate_ident(&mut schema, Keyword::namespaced("foo", "bar"), 99);
+        add_attribute(&mut schema, 99, Attribute {
+            value_type: ValueType::Boolean,
+            ..Default::default()
+        });
+
+        let x = Variable::from_valid_name("?x");
+        let y = Variable::from_valid_name("?y");
+
+        let b: BTreeMap<Variable, TypedValue> =
+            vec![(y.clone(), TypedValue::Boolean(true))].into_iter().collect();
+        let inputs = QueryInputs::with_values(b);
+        let variables: BTreeSet<Variable> = vec![Variable::from_valid_name("?y")].into_iter().collect();
+        let mut cc = ConjoiningClauses::with_inputs(variables, inputs);
+
+        let known = Known::for_schema(&schema);
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: ident("foo", "bar"),
+            value: PatternValuePlace::Variable(y.clone()),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+
+        let d0_e = QualifiedAlias::new("datoms00".to_string(), DatomsColumn::Entity);
+        let d0_a = QualifiedAlias::new("datoms00".to_string(), DatomsColumn::Attribute);
+        let d0_v = QualifiedAlias::new("datoms00".to_string(), DatomsColumn::Value);
+
+        // ?y has been expanded into `true`.
+        assert_eq!(cc.wheres, vec![
+                   ColumnConstraint::Equals(d0_a, QueryValue::Entid(99)),
+                   ColumnConstraint::Equals(d0_v, QueryValue::TypedValue(TypedValue::Boolean(true))),
+        ].into());
+
+        // There is no binding for ?y.
+        assert!(!cc.column_bindings.contains_key(&y));
+
+        // ?x is bound to the entity.
+        assert_eq!(cc.column_bindings.get(&x).unwrap(),
+                   &vec![d0_e.clone()]);
+    }
+
+    #[test]
+    /// Bind a value to a variable in a query where the type of the value disagrees with the type of
+    /// the variable inferred from known attributes.
+    fn test_value_bindings_type_disagreement() {
+        let mut schema = Schema::default();
+
+        associate_ident(&mut schema, Keyword::namespaced("foo", "bar"), 99);
+        add_attribute(&mut schema, 99, Attribute {
+            value_type: ValueType::Boolean,
+            ..Default::default()
+        });
+
+        let x = Variable::from_valid_name("?x");
+        let y = Variable::from_valid_name("?y");
+
+        let b: BTreeMap<Variable, TypedValue> =
+            vec![(y.clone(), TypedValue::Long(42))].into_iter().collect();
+        let inputs = QueryInputs::with_values(b);
+        let variables: BTreeSet<Variable> = vec![Variable::from_valid_name("?y")].into_iter().collect();
+        let mut cc = ConjoiningClauses::with_inputs(variables, inputs);
+
+        let known = Known::for_schema(&schema);
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: ident("foo", "bar"),
+            value: PatternValuePlace::Variable(y.clone()),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+
+        // The type of the provided binding doesn't match the type of the attribute.
+        assert!(cc.is_known_empty());
+    }
+
+    #[test]
+    /// Bind a non-textual value to a variable in a query where the variable is used as the value
+    /// of a fulltext-valued attribute.
+    fn test_fulltext_type_disagreement() {
+        let mut schema = Schema::default();
+
+        associate_ident(&mut schema, Keyword::namespaced("foo", "bar"), 99);
+        add_attribute(&mut schema, 99, Attribute {
+            value_type: ValueType::String,
+            index: true,
+            fulltext: true,
+            ..Default::default()
+        });
+
+        let x = Variable::from_valid_name("?x");
+        let y = Variable::from_valid_name("?y");
+
+        let b: BTreeMap<Variable, TypedValue> =
+            vec![(y.clone(), TypedValue::Long(42))].into_iter().collect();
+        let inputs = QueryInputs::with_values(b);
+        let variables: BTreeSet<Variable> = vec![Variable::from_valid_name("?y")].into_iter().collect();
+        let mut cc = ConjoiningClauses::with_inputs(variables, inputs);
+
+        let known = Known::for_schema(&schema);
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: ident("foo", "bar"),
+            value: PatternValuePlace::Variable(y.clone()),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+
+        // The type of the provided binding doesn't match the type of the attribute.
+        assert!(cc.is_known_empty());
+    }
+
+    #[test]
+    /// Apply two patterns with differently typed attributes, but sharing a variable in the value
+    /// place. No value can bind to a variable and match both types, so the CC is known to return
+    /// no results.
+    fn test_apply_two_conflicting_known_patterns() {
+        let mut cc = ConjoiningClauses::default();
+        let mut schema = Schema::default();
+
+        associate_ident(&mut schema, Keyword::namespaced("foo", "bar"), 99);
+        associate_ident(&mut schema, Keyword::namespaced("foo", "roz"), 98);
+        add_attribute(&mut schema, 99, Attribute {
+            value_type: ValueType::Boolean,
+            ..Default::default()
+        });
+        add_attribute(&mut schema, 98, Attribute {
+            value_type: ValueType::String,
+            unique: Some(Unique::Identity),
+            ..Default::default()
+        });
+
+        let x = Variable::from_valid_name("?x");
+        let y = Variable::from_valid_name("?y");
+        let known = Known::for_schema(&schema);
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: ident("foo", "roz"),
+            value: PatternValuePlace::Variable(y.clone()),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: ident("foo", "bar"),
+            value: PatternValuePlace::Variable(y.clone()),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+
+        // Finally, expand column bindings to get the overlaps for ?x.
+        cc.expand_column_bindings();
+
+        assert!(cc.is_known_empty());
+        assert_eq!(cc.empty_because.unwrap(),
+                   EmptyBecause::TypeMismatch {
+                       var: y.clone(),
+                       existing: ValueTypeSet::of_one(ValueType::String),
+                       desired: ValueTypeSet::of_one(ValueType::Boolean),
+                   });
+    }
+
+    #[test]
+    #[should_panic(expected = "assertion failed: cc.is_known_empty()")]
+    /// This test needs range inference in order to succeed: we must deduce that ?y must
+    /// simultaneously be a boolean-valued attribute and a ref-valued attribute, and thus
+    /// the CC can never return results.
+    fn test_apply_two_implicitly_conflicting_patterns() {
+        let mut cc = ConjoiningClauses::default();
+        let schema = Schema::default();
+
+        // [:find ?x :where
+        //  [?x ?y true]
+        //  [?z ?y ?x]]
+        let x = Variable::from_valid_name("?x");
+        let y = Variable::from_valid_name("?y");
+        let z = Variable::from_valid_name("?z");
+        let known = Known::for_schema(&schema);
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: PatternNonValuePlace::Variable(y.clone()),
+            value: PatternValuePlace::Constant(NonIntegerConstant::Boolean(true)),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(z.clone()),
+            attribute: PatternNonValuePlace::Variable(y.clone()),
+            value: PatternValuePlace::Variable(x.clone()),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+
+        // Finally, expand column bindings to get the overlaps for ?x.
+        cc.expand_column_bindings();
+
+        assert!(cc.is_known_empty());
+        assert_eq!(cc.empty_because.unwrap(),
+                   EmptyBecause::TypeMismatch {
+                       var: x.clone(),
+                       existing: ValueTypeSet::of_one(ValueType::Ref),
+                       desired: ValueTypeSet::of_one(ValueType::Boolean),
+                   });
+    }
+
+    #[test]
+    fn ensure_extracted_types_is_cleared() {
+        let query = r#"[:find ?e ?v :where [_ _ ?v] [?e :foo/bar ?v]]"#;
+        let mut schema = Schema::default();
+        associate_ident(&mut schema, Keyword::namespaced("foo", "bar"), 99);
+        add_attribute(&mut schema, 99, Attribute {
+            value_type: ValueType::Boolean,
+            ..Default::default()
+        });
+        let e = Variable::from_valid_name("?e");
+        let v = Variable::from_valid_name("?v");
+        let cc = alg(&schema, query);
+        assert_eq!(cc.known_types.get(&e), Some(&ValueTypeSet::of_one(ValueType::Ref)));
+        assert_eq!(cc.known_types.get(&v), Some(&ValueTypeSet::of_one(ValueType::Boolean)));
+        assert!(!cc.extracted_types.contains_key(&e));
+        assert!(!cc.extracted_types.contains_key(&v));
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/predicate.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/predicate.rs.html new file mode 100644 index 00000000..5314b3cd --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/predicate.rs.html @@ -0,0 +1,792 @@ + + + + + + + + + + predicate.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use mentat_core::{
+    Schema,
+    ValueType,
+    ValueTypeSet,
+};
+
+use mentat_query::{
+    FnArg,
+    PlainSymbol,
+    Predicate,
+    TypeAnnotation,
+};
+
+use clauses::ConjoiningClauses;
+
+use clauses::convert::ValueTypes;
+
+use errors::{
+    AlgebrizerError,
+    Result,
+};
+
+use types::{
+    ColumnConstraint,
+    EmptyBecause,
+    Inequality,
+    QueryValue,
+};
+
+use Known;
+
+/// Application of predicates.
+impl ConjoiningClauses {
+    /// There are several kinds of predicates in our Datalog:
+    /// - A limited set of binary comparison operators: < > <= >= !=.
+    ///   These are converted into SQLite binary comparisons and some type constraints.
+    /// - In the future, some predicates that are implemented via function calls in SQLite.
+    ///
+    /// At present we have implemented only the five built-in comparison binary operators.
+    pub(crate) fn apply_predicate(&mut self, known: Known, predicate: Predicate) -> Result<()> {
+        // Because we'll be growing the set of built-in predicates, handling each differently,
+        // and ultimately allowing user-specified predicates, we match on the predicate name first.
+        if let Some(op) = Inequality::from_datalog_operator(predicate.operator.0.as_str()) {
+            self.apply_inequality(known, op, predicate)
+        } else {
+            bail!(AlgebrizerError::UnknownFunction(predicate.operator.clone()))
+        }
+    }
+
+    fn potential_types(&self, schema: &Schema, fn_arg: &FnArg) -> Result<ValueTypeSet> {
+        match fn_arg {
+            &FnArg::Variable(ref v) => Ok(self.known_type_set(v)),
+            _ => fn_arg.potential_types(schema),
+        }
+    }
+
+    /// Apply a type annotation, which is a construct like a predicate that constrains the argument
+    /// to be a specific ValueType.
+    pub(crate) fn apply_type_anno(&mut self, anno: &TypeAnnotation) -> Result<()> {
+        match ValueType::from_keyword(&anno.value_type) {
+            Some(value_type) => self.add_type_requirement(anno.variable.clone(), ValueTypeSet::of_one(value_type)),
+            None => bail!(AlgebrizerError::InvalidArgumentType(PlainSymbol::plain("type"), ValueTypeSet::any(), 2)),
+        }
+        Ok(())
+    }
+
+    /// This function:
+    /// - Resolves variables and converts types to those more amenable to SQL.
+    /// - Ensures that the predicate functions name a known operator.
+    /// - Accumulates an `Inequality` constraint into the `wheres` list.
+    pub(crate) fn apply_inequality(&mut self, known: Known, comparison: Inequality, predicate: Predicate) -> Result<()> {
+        if predicate.args.len() != 2 {
+            bail!(AlgebrizerError::InvalidNumberOfArguments(predicate.operator.clone(), predicate.args.len(), 2));
+        }
+
+        // Go from arguments -- parser output -- to columns or values.
+        // Any variables that aren't bound by this point in the linear processing of clauses will
+        // cause the application of the predicate to fail.
+        let mut args = predicate.args.into_iter();
+        let left = args.next().expect("two args");
+        let right = args.next().expect("two args");
+
+
+        // The types we're handling here must be the intersection of the possible types of the arguments,
+        // the known types of any variables, and the types supported by our inequality operators.
+        let supported_types = comparison.supported_types();
+        let mut left_types = self.potential_types(known.schema, &left)?
+                                 .intersection(&supported_types);
+        if left_types.is_empty() {
+            bail!(AlgebrizerError::InvalidArgumentType(predicate.operator.clone(), supported_types, 0));
+        }
+
+        let mut right_types = self.potential_types(known.schema, &right)?
+                                  .intersection(&supported_types);
+        if right_types.is_empty() {
+            bail!(AlgebrizerError::InvalidArgumentType(predicate.operator.clone(), supported_types, 1));
+        }
+
+        // We would like to allow longs to compare to doubles.
+        // Do this by expanding the type sets. `resolve_numeric_argument` will
+        // use `Long` by preference.
+        if right_types.contains(ValueType::Long) {
+            right_types.insert(ValueType::Double);
+        }
+        if left_types.contains(ValueType::Long) {
+            left_types.insert(ValueType::Double);
+        }
+
+        let shared_types = left_types.intersection(&right_types);
+        if shared_types.is_empty() {
+            // In isolation these are both valid inputs to the operator, but the query cannot
+            // succeed because the types don't match.
+            self.mark_known_empty(
+                if let Some(var) = left.as_variable().or_else(|| right.as_variable()) {
+                    EmptyBecause::TypeMismatch {
+                        var: var.clone(),
+                        existing: left_types,
+                        desired: right_types,
+                    }
+                } else {
+                    EmptyBecause::KnownTypeMismatch {
+                        left: left_types,
+                        right: right_types,
+                    }
+                });
+            return Ok(());
+        }
+
+        // We expect the intersection to be Long, Long+Double, Double, or Instant.
+        let left_v;
+        let right_v;
+
+        if shared_types == ValueTypeSet::of_one(ValueType::Instant) {
+            left_v = self.resolve_instant_argument(&predicate.operator, 0, left)?;
+            right_v = self.resolve_instant_argument(&predicate.operator, 1, right)?;
+        } else if shared_types.is_only_numeric() {
+            left_v = self.resolve_numeric_argument(&predicate.operator, 0, left)?;
+            right_v = self.resolve_numeric_argument(&predicate.operator, 1, right)?;
+        } else if shared_types == ValueTypeSet::of_one(ValueType::Ref) {
+            left_v = self.resolve_ref_argument(known.schema, &predicate.operator, 0, left)?;
+            right_v = self.resolve_ref_argument(known.schema, &predicate.operator, 1, right)?;
+        } else {
+            bail!(AlgebrizerError::InvalidArgumentType(predicate.operator.clone(), supported_types, 0));
+        }
+
+        // These arguments must be variables or instant/numeric constants.
+        // TODO: static evaluation. #383.
+        let constraint = comparison.to_constraint(left_v, right_v);
+        self.wheres.add_intersection(constraint);
+        Ok(())
+    }
+}
+
+impl Inequality {
+    fn to_constraint(&self, left: QueryValue, right: QueryValue) -> ColumnConstraint {
+        match *self {
+            Inequality::TxAfter |
+            Inequality::TxBefore => {
+                // TODO: both ends of the range must be inside the tx partition!
+                // If we know the partition map -- and at this point we do, it's just
+                // not passed to this function -- then we can generate two constraints,
+                // or clamp a fixed value.
+            },
+            _ => {
+            },
+        }
+
+        ColumnConstraint::Inequality {
+            operator: *self,
+            left: left,
+            right: right,
+        }
+    }
+}
+
+#[cfg(test)]
+mod testing {
+    use super::*;
+
+    use mentat_core::attribute::Unique;
+    use mentat_core::{
+        Attribute,
+        TypedValue,
+        ValueType,
+    };
+
+    use mentat_query::{
+        FnArg,
+        Keyword,
+        Pattern,
+        PatternNonValuePlace,
+        PatternValuePlace,
+        PlainSymbol,
+        Variable,
+    };
+
+    use clauses::{
+        add_attribute,
+        associate_ident,
+        ident,
+    };
+
+    use types::{
+        ColumnConstraint,
+        EmptyBecause,
+        QueryValue,
+    };
+
+    #[test]
+    /// Apply two patterns: a pattern and a numeric predicate.
+    /// Verify that after application of the predicate we know that the value
+    /// must be numeric.
+    fn test_apply_inequality() {
+        let mut cc = ConjoiningClauses::default();
+        let mut schema = Schema::default();
+
+        associate_ident(&mut schema, Keyword::namespaced("foo", "bar"), 99);
+        add_attribute(&mut schema, 99, Attribute {
+            value_type: ValueType::Long,
+            ..Default::default()
+        });
+
+        let x = Variable::from_valid_name("?x");
+        let y = Variable::from_valid_name("?y");
+        let known = Known::for_schema(&schema);
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: PatternNonValuePlace::Placeholder,
+            value: PatternValuePlace::Variable(y.clone()),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+        assert!(!cc.is_known_empty());
+
+        let op = PlainSymbol::plain("<");
+        let comp = Inequality::from_datalog_operator(op.name()).unwrap();
+        assert!(cc.apply_inequality(known, comp, Predicate {
+             operator: op,
+             args: vec![
+                FnArg::Variable(Variable::from_valid_name("?y")), FnArg::EntidOrInteger(10),
+            ]}).is_ok());
+
+        assert!(!cc.is_known_empty());
+
+        // Finally, expand column bindings to get the overlaps for ?x.
+        cc.expand_column_bindings();
+        assert!(!cc.is_known_empty());
+
+        // After processing those two clauses, we know that ?y must be numeric, but not exactly
+        // which type it must be.
+        assert_eq!(None, cc.known_type(&y));      // Not just one.
+        let expected = ValueTypeSet::of_numeric_types();
+        assert_eq!(Some(&expected), cc.known_types.get(&y));
+
+        let clauses = cc.wheres;
+        assert_eq!(clauses.len(), 1);
+        assert_eq!(clauses.0[0], ColumnConstraint::Inequality {
+            operator: Inequality::LessThan,
+            left: QueryValue::Column(cc.column_bindings.get(&y).unwrap()[0].clone()),
+            right: QueryValue::TypedValue(TypedValue::Long(10)),
+        }.into());
+    }
+
+    #[test]
+    /// Apply three patterns: an unbound pattern to establish a value var,
+    /// a predicate to constrain the val to numeric types, and a third pattern to conflict with the
+    /// numeric types and cause the pattern to fail.
+    fn test_apply_conflict_with_numeric_range() {
+        let mut cc = ConjoiningClauses::default();
+        let mut schema = Schema::default();
+
+        associate_ident(&mut schema, Keyword::namespaced("foo", "bar"), 99);
+        associate_ident(&mut schema, Keyword::namespaced("foo", "roz"), 98);
+        add_attribute(&mut schema, 99, Attribute {
+            value_type: ValueType::Long,
+            ..Default::default()
+        });
+        add_attribute(&mut schema, 98, Attribute {
+            value_type: ValueType::String,
+            unique: Some(Unique::Identity),
+            ..Default::default()
+        });
+
+        let x = Variable::from_valid_name("?x");
+        let y = Variable::from_valid_name("?y");
+        let known = Known::for_schema(&schema);
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: PatternNonValuePlace::Placeholder,
+            value: PatternValuePlace::Variable(y.clone()),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+        assert!(!cc.is_known_empty());
+
+        let op = PlainSymbol::plain(">=");
+        let comp = Inequality::from_datalog_operator(op.name()).unwrap();
+        assert!(cc.apply_inequality(known, comp, Predicate {
+             operator: op,
+             args: vec![
+                FnArg::Variable(Variable::from_valid_name("?y")), FnArg::EntidOrInteger(10),
+            ]}).is_ok());
+
+        assert!(!cc.is_known_empty());
+        cc.apply_parsed_pattern(known, Pattern {
+            source: None,
+            entity: PatternNonValuePlace::Variable(x.clone()),
+            attribute: ident("foo", "roz"),
+            value: PatternValuePlace::Variable(y.clone()),
+            tx: PatternNonValuePlace::Placeholder,
+        });
+
+        // Finally, expand column bindings to get the overlaps for ?x.
+        cc.expand_column_bindings();
+
+        assert!(cc.is_known_empty());
+        assert_eq!(cc.empty_because.unwrap(),
+                   EmptyBecause::TypeMismatch {
+                       var: y.clone(),
+                       existing: ValueTypeSet::of_numeric_types(),
+                       desired: ValueTypeSet::of_one(ValueType::String),
+                   });
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/resolve.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/resolve.rs.html new file mode 100644 index 00000000..0455876b --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/resolve.rs.html @@ -0,0 +1,506 @@ + + + + + + + + + + resolve.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use mentat_core::{
+    HasSchema,
+    Schema,
+    TypedValue,
+    ValueType,
+};
+
+use mentat_query::{
+    FnArg,
+    NonIntegerConstant,
+    PlainSymbol,
+};
+
+use clauses::ConjoiningClauses;
+
+use errors::{
+    AlgebrizerError,
+    Result,
+};
+
+use types::{
+    EmptyBecause,
+    QueryValue,
+};
+
+/// Argument resolution.
+impl ConjoiningClauses {
+    /// Take a function argument and turn it into a `QueryValue` suitable for use in a concrete
+    /// constraint.
+    /// Additionally, do two things:
+    /// - Mark the pattern as known-empty if any argument is known non-numeric.
+    /// - Mark any variables encountered as numeric.
+    pub(crate) fn resolve_numeric_argument(&mut self, function: &PlainSymbol, position: usize, arg: FnArg) -> Result<QueryValue> {
+        use self::FnArg::*;
+        match arg {
+            FnArg::Variable(var) => {
+                // Handle incorrect types
+                if let Some(v) = self.bound_value(&var) {
+                    if v.value_type().is_numeric() {
+                        Ok(QueryValue::TypedValue(v))
+                    } else {
+                        bail!(AlgebrizerError::InputTypeDisagreement(var.name().clone(), ValueType::Long, v.value_type()))
+                    }
+                } else {
+                    self.constrain_var_to_numeric(var.clone());
+                    self.column_bindings
+                        .get(&var)
+                        .and_then(|cols| cols.first().map(|col| QueryValue::Column(col.clone())))
+                        .ok_or_else(|| AlgebrizerError::UnboundVariable(var.name()).into())
+                }
+            },
+            // Can't be an entid.
+            EntidOrInteger(i) => Ok(QueryValue::TypedValue(TypedValue::Long(i))),
+            IdentOrKeyword(_) |
+            SrcVar(_) |
+            Constant(NonIntegerConstant::Boolean(_)) |
+            Constant(NonIntegerConstant::Text(_)) |
+            Constant(NonIntegerConstant::Uuid(_)) |
+            Constant(NonIntegerConstant::Instant(_)) |        // Instants are covered below.
+            Constant(NonIntegerConstant::BigInteger(_)) |
+            Vector(_) => {
+                self.mark_known_empty(EmptyBecause::NonNumericArgument);
+                bail!(AlgebrizerError::InvalidArgument(function.clone(), "numeric", position))
+            },
+            Constant(NonIntegerConstant::Float(f)) => Ok(QueryValue::TypedValue(TypedValue::Double(f))),
+        }
+    }
+
+    /// Just like `resolve_numeric_argument`, but for `ValueType::Instant`.
+    pub(crate) fn resolve_instant_argument(&mut self, function: &PlainSymbol, position: usize, arg: FnArg) -> Result<QueryValue> {
+        use self::FnArg::*;
+        match arg {
+            FnArg::Variable(var) => {
+                match self.bound_value(&var) {
+                    Some(TypedValue::Instant(v)) => Ok(QueryValue::TypedValue(TypedValue::Instant(v))),
+                    Some(v) => bail!(AlgebrizerError::InputTypeDisagreement(var.name().clone(), ValueType::Instant, v.value_type())),
+                    None => {
+                        self.constrain_var_to_type(var.clone(), ValueType::Instant);
+                        self.column_bindings
+                            .get(&var)
+                            .and_then(|cols| cols.first().map(|col| QueryValue::Column(col.clone())))
+                            .ok_or_else(|| AlgebrizerError::UnboundVariable(var.name()).into())
+                    },
+                }
+            },
+            Constant(NonIntegerConstant::Instant(v)) => {
+                Ok(QueryValue::TypedValue(TypedValue::Instant(v)))
+            },
+
+            // TODO: should we allow integers if they seem to be timestamps? It's ambiguous…
+            EntidOrInteger(_) |
+            IdentOrKeyword(_) |
+            SrcVar(_) |
+            Constant(NonIntegerConstant::Boolean(_)) |
+            Constant(NonIntegerConstant::Float(_)) |
+            Constant(NonIntegerConstant::Text(_)) |
+            Constant(NonIntegerConstant::Uuid(_)) |
+            Constant(NonIntegerConstant::BigInteger(_)) |
+            Vector(_) => {
+                self.mark_known_empty(EmptyBecause::NonInstantArgument);
+                bail!(AlgebrizerError::InvalidArgumentType(function.clone(), ValueType::Instant.into(), position))
+            },
+        }
+    }
+
+    /// Take a function argument and turn it into a `QueryValue` suitable for use in a concrete
+    /// constraint.
+    pub(crate) fn resolve_ref_argument(&mut self, schema: &Schema, function: &PlainSymbol, position: usize, arg: FnArg) -> Result<QueryValue> {
+        use self::FnArg::*;
+        match arg {
+            FnArg::Variable(var) => {
+                self.constrain_var_to_type(var.clone(), ValueType::Ref);
+                if let Some(TypedValue::Ref(e)) = self.bound_value(&var) {
+                    // Incorrect types will be handled by the constraint, above.
+                    Ok(QueryValue::Entid(e))
+                } else {
+                    self.column_bindings
+                        .get(&var)
+                        .and_then(|cols| cols.first().map(|col| QueryValue::Column(col.clone())))
+                        .ok_or_else(|| AlgebrizerError::UnboundVariable(var.name()).into())
+                }
+            },
+            EntidOrInteger(i) => Ok(QueryValue::TypedValue(TypedValue::Ref(i))),
+            IdentOrKeyword(i) => {
+                schema.get_entid(&i)
+                      .map(|known_entid| QueryValue::Entid(known_entid.into()))
+                      .ok_or_else(|| AlgebrizerError::UnrecognizedIdent(i.to_string()).into())
+            },
+            Constant(NonIntegerConstant::Boolean(_)) |
+            Constant(NonIntegerConstant::Float(_)) |
+            Constant(NonIntegerConstant::Text(_)) |
+            Constant(NonIntegerConstant::Uuid(_)) |
+            Constant(NonIntegerConstant::Instant(_)) |
+            Constant(NonIntegerConstant::BigInteger(_)) |
+            SrcVar(_) |
+            Vector(_) => {
+                self.mark_known_empty(EmptyBecause::NonEntityArgument);
+                bail!(AlgebrizerError::InvalidArgumentType(function.clone(), ValueType::Ref.into(), position))
+            },
+
+        }
+    }
+
+    /// Take a transaction ID function argument and turn it into a `QueryValue` suitable for use in
+    /// a concrete constraint.
+    pub(crate) fn resolve_tx_argument(&mut self, schema: &Schema, function: &PlainSymbol, position: usize, arg: FnArg) -> Result<QueryValue> {
+        // Under the hood there's nothing special about a transaction ID -- it's just another ref.
+        // In the future, we might handle instants specially.
+        self.resolve_ref_argument(schema, function, position, arg)
+    }
+
+    /// Take a function argument and turn it into a `QueryValue` suitable for use in a concrete
+    /// constraint.
+    #[allow(dead_code)]
+    fn resolve_argument(&self, arg: FnArg) -> Result<QueryValue> {
+        use self::FnArg::*;
+        match arg {
+            FnArg::Variable(var) => {
+                match self.bound_value(&var) {
+                    Some(v) => Ok(QueryValue::TypedValue(v)),
+                    None => {
+                        self.column_bindings
+                            .get(&var)
+                            .and_then(|cols| cols.first().map(|col| QueryValue::Column(col.clone())))
+                            .ok_or_else(|| AlgebrizerError::UnboundVariable(var.name()).into())
+                    },
+                }
+            },
+            EntidOrInteger(i) => Ok(QueryValue::PrimitiveLong(i)),
+            IdentOrKeyword(_) => unimplemented!(),     // TODO
+            Constant(NonIntegerConstant::Boolean(val)) => Ok(QueryValue::TypedValue(TypedValue::Boolean(val))),
+            Constant(NonIntegerConstant::Float(f)) => Ok(QueryValue::TypedValue(TypedValue::Double(f))),
+            Constant(NonIntegerConstant::Text(s)) => Ok(QueryValue::TypedValue(TypedValue::typed_string(s.as_str()))),
+            Constant(NonIntegerConstant::Uuid(u)) => Ok(QueryValue::TypedValue(TypedValue::Uuid(u))),
+            Constant(NonIntegerConstant::Instant(u)) => Ok(QueryValue::TypedValue(TypedValue::Instant(u))),
+            Constant(NonIntegerConstant::BigInteger(_)) => unimplemented!(),
+            SrcVar(_) => unimplemented!(),
+            Vector(_) => unimplemented!(),    // TODO
+        }
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/tx_log_api.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/tx_log_api.rs.html new file mode 100644 index 00000000..508a166c --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/tx_log_api.rs.html @@ -0,0 +1,914 @@ + + + + + + + + + + tx_log_api.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use mentat_core::{
+    ValueType,
+};
+
+use mentat_query::{
+    Binding,
+    FnArg,
+    SrcVar,
+    VariableOrPlaceholder,
+    WhereFn,
+};
+
+use clauses::{
+    ConjoiningClauses,
+};
+
+use errors::{
+    AlgebrizerError,
+    BindingError,
+    InvalidBinding,
+    Result,
+};
+
+use types::{
+    Column,
+    ColumnConstraint,
+    DatomsTable,
+    Inequality,
+    QualifiedAlias,
+    QueryValue,
+    SourceAlias,
+    TransactionsColumn,
+};
+
+use Known;
+
+impl ConjoiningClauses {
+    // Log in Query: tx-ids and tx-data
+    //
+    // The log API includes two convenience functions that are available within query. The tx-ids
+    // function takes arguments similar to txRange above, but returns a collection of transaction
+    // entity ids. You will typically use the collection binding form [?tx …] to capture the
+    // results.
+    //
+    // [(tx-ids ?log ?tx1 ?tx2) [?tx ...]]
+    //
+    // TODO: handle tx1 == 0 (more generally, tx1 < bootstrap::TX0) specially (no after constraint).
+    // TODO: allow tx2 to be missing (no before constraint).
+    // TODO: allow txK arguments to be instants.
+    // TODO: allow arbitrary additional attribute arguments that restrict the tx-ids to those
+    // transactions that impact one of the given attributes.
+    pub(crate) fn apply_tx_ids(&mut self, known: Known, where_fn: WhereFn) -> Result<()> {
+        if where_fn.args.len() != 3 {
+            bail!(AlgebrizerError::InvalidNumberOfArguments(where_fn.operator.clone(), where_fn.args.len(), 3));
+        }
+
+        if where_fn.binding.is_empty() {
+            // The binding must introduce at least one bound variable.
+            bail!(InvalidBinding::new(where_fn.operator.clone(), BindingError::NoBoundVariable));
+        }
+
+        if !where_fn.binding.is_valid() {
+            // The binding must not duplicate bound variables.
+            bail!(InvalidBinding::new(where_fn.operator.clone(), BindingError::RepeatedBoundVariable));
+        }
+
+        // We should have exactly one binding. Destructure it now.
+        let tx_var = match where_fn.binding {
+            Binding::BindRel(bindings) => {
+                let bindings_count = bindings.len();
+                if bindings_count != 1 {
+                    bail!(InvalidBinding::new(where_fn.operator.clone(),
+                                                    BindingError::InvalidNumberOfBindings {
+                                                        number: bindings_count,
+                                                        expected: 1,
+                                                    }));
+                }
+                match bindings.into_iter().next().unwrap() {
+                    VariableOrPlaceholder::Placeholder => unreachable!("binding.is_empty()!"),
+                    VariableOrPlaceholder::Variable(v) => v,
+                }
+            },
+            Binding::BindColl(v) => v,
+            Binding::BindScalar(_) |
+            Binding::BindTuple(_) => {
+                bail!(InvalidBinding::new(where_fn.operator.clone(), BindingError::ExpectedBindRelOrBindColl))
+            },
+        };
+
+        let mut args = where_fn.args.into_iter();
+
+        // TODO: process source variables.
+        match args.next().unwrap() {
+            FnArg::SrcVar(SrcVar::DefaultSrc) => {},
+            _ => bail!(AlgebrizerError::InvalidArgument(where_fn.operator.clone(), "source variable", 0)),
+        }
+
+        let tx1 = self.resolve_tx_argument(&known.schema, &where_fn.operator, 1, args.next().unwrap())?;
+        let tx2 = self.resolve_tx_argument(&known.schema, &where_fn.operator, 2, args.next().unwrap())?;
+
+        let transactions = self.next_alias_for_table(DatomsTable::Transactions);
+
+        self.from.push(SourceAlias(DatomsTable::Transactions, transactions.clone()));
+
+        // Bound variable must be a ref.
+        self.constrain_var_to_type(tx_var.clone(), ValueType::Ref);
+        if self.is_known_empty() {
+            return Ok(());
+        }
+
+        self.bind_column_to_var(known.schema, transactions.clone(), TransactionsColumn::Tx, tx_var.clone());
+
+        let after_constraint = ColumnConstraint::Inequality {
+            operator: Inequality::LessThanOrEquals,
+            left: tx1,
+            right: QueryValue::Column(QualifiedAlias(transactions.clone(), Column::Transactions(TransactionsColumn::Tx))),
+        };
+        self.wheres.add_intersection(after_constraint);
+
+        let before_constraint = ColumnConstraint::Inequality {
+            operator: Inequality::LessThan,
+            left: QueryValue::Column(QualifiedAlias(transactions.clone(), Column::Transactions(TransactionsColumn::Tx))),
+            right: tx2,
+        };
+        self.wheres.add_intersection(before_constraint);
+
+        Ok(())
+    }
+
+    pub(crate) fn apply_tx_data(&mut self, known: Known, where_fn: WhereFn) -> Result<()> {
+        if where_fn.args.len() != 2 {
+            bail!(AlgebrizerError::InvalidNumberOfArguments(where_fn.operator.clone(), where_fn.args.len(), 2));
+        }
+
+        if where_fn.binding.is_empty() {
+            // The binding must introduce at least one bound variable.
+            bail!(InvalidBinding::new(where_fn.operator.clone(), BindingError::NoBoundVariable));
+        }
+
+        if !where_fn.binding.is_valid() {
+            // The binding must not duplicate bound variables.
+            bail!(InvalidBinding::new(where_fn.operator.clone(), BindingError::RepeatedBoundVariable));
+        }
+
+        // We should have at most five bindings. Destructure them now.
+        let bindings = match where_fn.binding {
+            Binding::BindRel(bindings) => {
+                let bindings_count = bindings.len();
+                if bindings_count < 1 || bindings_count > 5 {
+                    bail!(InvalidBinding::new(where_fn.operator.clone(),
+                                                    BindingError::InvalidNumberOfBindings {
+                                                        number: bindings.len(),
+                                                        expected: 5,
+                                                    }));
+                }
+                bindings
+            },
+            Binding::BindScalar(_) |
+            Binding::BindTuple(_) |
+            Binding::BindColl(_) => bail!(InvalidBinding::new(where_fn.operator.clone(), BindingError::ExpectedBindRel)),
+        };
+        let mut bindings = bindings.into_iter();
+        let b_e = bindings.next().unwrap_or(VariableOrPlaceholder::Placeholder);
+        let b_a = bindings.next().unwrap_or(VariableOrPlaceholder::Placeholder);
+        let b_v = bindings.next().unwrap_or(VariableOrPlaceholder::Placeholder);
+        let b_tx = bindings.next().unwrap_or(VariableOrPlaceholder::Placeholder);
+        let b_op = bindings.next().unwrap_or(VariableOrPlaceholder::Placeholder);
+
+        let mut args = where_fn.args.into_iter();
+
+        // TODO: process source variables.
+        match args.next().unwrap() {
+            FnArg::SrcVar(SrcVar::DefaultSrc) => {},
+            _ => bail!(AlgebrizerError::InvalidArgument(where_fn.operator.clone(), "source variable", 0)),
+        }
+
+        let tx = self.resolve_tx_argument(&known.schema, &where_fn.operator, 1, args.next().unwrap())?;
+
+        let transactions = self.next_alias_for_table(DatomsTable::Transactions);
+
+        self.from.push(SourceAlias(DatomsTable::Transactions, transactions.clone()));
+
+        let tx_constraint = ColumnConstraint::Equals(
+            QualifiedAlias(transactions.clone(), Column::Transactions(TransactionsColumn::Tx)),
+            tx);
+        self.wheres.add_intersection(tx_constraint);
+
+        if let VariableOrPlaceholder::Variable(ref var) = b_e {
+            // It must be a ref.
+            self.constrain_var_to_type(var.clone(), ValueType::Ref);
+            if self.is_known_empty() {
+                return Ok(());
+            }
+
+            self.bind_column_to_var(known.schema, transactions.clone(), TransactionsColumn::Entity, var.clone());
+        }
+
+        if let VariableOrPlaceholder::Variable(ref var) = b_a {
+            // It must be a ref.
+            self.constrain_var_to_type(var.clone(), ValueType::Ref);
+            if self.is_known_empty() {
+                return Ok(());
+            }
+
+            self.bind_column_to_var(known.schema, transactions.clone(), TransactionsColumn::Attribute, var.clone());
+        }
+
+        if let VariableOrPlaceholder::Variable(ref var) = b_v {
+            self.bind_column_to_var(known.schema, transactions.clone(), TransactionsColumn::Value, var.clone());
+        }
+
+        if let VariableOrPlaceholder::Variable(ref var) = b_tx {
+            // It must be a ref.
+            self.constrain_var_to_type(var.clone(), ValueType::Ref);
+            if self.is_known_empty() {
+                return Ok(());
+            }
+
+            // TODO: this might be a programming error if var is our tx argument.  Perhaps we can be
+            // helpful in that case.
+            self.bind_column_to_var(known.schema, transactions.clone(), TransactionsColumn::Tx, var.clone());
+        }
+
+        if let VariableOrPlaceholder::Variable(ref var) = b_op {
+            // It must be a boolean.
+            self.constrain_var_to_type(var.clone(), ValueType::Boolean);
+            if self.is_known_empty() {
+                return Ok(());
+            }
+
+            self.bind_column_to_var(known.schema, transactions.clone(), TransactionsColumn::Added, var.clone());
+        }
+
+        Ok(())
+    }
+}
+
+#[cfg(test)]
+mod testing {
+    use super::*;
+
+    use mentat_core::{
+        Schema,
+        TypedValue,
+        ValueType,
+    };
+
+    use mentat_query::{
+        Binding,
+        FnArg,
+        PlainSymbol,
+        Variable,
+    };
+
+    #[test]
+    fn test_apply_tx_ids() {
+        let mut cc = ConjoiningClauses::default();
+        let schema = Schema::default();
+
+        let known = Known::for_schema(&schema);
+
+        let op = PlainSymbol::plain("tx-ids");
+        cc.apply_tx_ids(known, WhereFn {
+            operator: op,
+            args: vec![
+                FnArg::SrcVar(SrcVar::DefaultSrc),
+                FnArg::EntidOrInteger(1000),
+                FnArg::EntidOrInteger(2000),
+            ],
+            binding: Binding::BindRel(vec![VariableOrPlaceholder::Variable(Variable::from_valid_name("?tx")),
+            ]),
+        }).expect("to be able to apply_tx_ids");
+
+        assert!(!cc.is_known_empty());
+
+        // Finally, expand column bindings.
+        cc.expand_column_bindings();
+        assert!(!cc.is_known_empty());
+
+        let clauses = cc.wheres;
+        assert_eq!(clauses.len(), 2);
+
+        assert_eq!(clauses.0[0],
+                   ColumnConstraint::Inequality {
+                       operator: Inequality::LessThanOrEquals,
+                       left: QueryValue::TypedValue(TypedValue::Ref(1000)),
+                       right: QueryValue::Column(QualifiedAlias("transactions00".to_string(), Column::Transactions(TransactionsColumn::Tx))),
+                   }.into());
+
+        assert_eq!(clauses.0[1],
+                   ColumnConstraint::Inequality {
+                       operator: Inequality::LessThan,
+                       left: QueryValue::Column(QualifiedAlias("transactions00".to_string(), Column::Transactions(TransactionsColumn::Tx))),
+                       right: QueryValue::TypedValue(TypedValue::Ref(2000)),
+                   }.into());
+
+        let bindings = cc.column_bindings;
+        assert_eq!(bindings.len(), 1);
+
+        assert_eq!(bindings.get(&Variable::from_valid_name("?tx")).expect("column binding for ?tx").clone(),
+                   vec![QualifiedAlias("transactions00".to_string(), Column::Transactions(TransactionsColumn::Tx))]);
+
+        let known_types = cc.known_types;
+        assert_eq!(known_types.len(), 1);
+
+        assert_eq!(known_types.get(&Variable::from_valid_name("?tx")).expect("known types for ?tx").clone(),
+                   vec![ValueType::Ref].into_iter().collect());
+    }
+
+    #[test]
+    fn test_apply_tx_data() {
+        let mut cc = ConjoiningClauses::default();
+        let schema = Schema::default();
+
+        let known = Known::for_schema(&schema);
+
+        let op = PlainSymbol::plain("tx-data");
+        cc.apply_tx_data(known, WhereFn {
+            operator: op,
+            args: vec![
+                FnArg::SrcVar(SrcVar::DefaultSrc),
+                FnArg::EntidOrInteger(1000),
+            ],
+            binding: Binding::BindRel(vec![
+                VariableOrPlaceholder::Variable(Variable::from_valid_name("?e")),
+                VariableOrPlaceholder::Variable(Variable::from_valid_name("?a")),
+                VariableOrPlaceholder::Variable(Variable::from_valid_name("?v")),
+                VariableOrPlaceholder::Variable(Variable::from_valid_name("?tx")),
+                VariableOrPlaceholder::Variable(Variable::from_valid_name("?added")),
+            ]),
+        }).expect("to be able to apply_tx_data");
+
+        assert!(!cc.is_known_empty());
+
+        // Finally, expand column bindings.
+        cc.expand_column_bindings();
+        assert!(!cc.is_known_empty());
+
+        let clauses = cc.wheres;
+        assert_eq!(clauses.len(), 1);
+
+        assert_eq!(clauses.0[0],
+                   ColumnConstraint::Equals(QualifiedAlias("transactions00".to_string(), Column::Transactions(TransactionsColumn::Tx)),
+                                            QueryValue::TypedValue(TypedValue::Ref(1000))).into());
+
+        let bindings = cc.column_bindings;
+        assert_eq!(bindings.len(), 5);
+
+        assert_eq!(bindings.get(&Variable::from_valid_name("?e")).expect("column binding for ?e").clone(),
+                   vec![QualifiedAlias("transactions00".to_string(), Column::Transactions(TransactionsColumn::Entity))]);
+
+        assert_eq!(bindings.get(&Variable::from_valid_name("?a")).expect("column binding for ?a").clone(),
+                   vec![QualifiedAlias("transactions00".to_string(), Column::Transactions(TransactionsColumn::Attribute))]);
+
+        assert_eq!(bindings.get(&Variable::from_valid_name("?v")).expect("column binding for ?v").clone(),
+                   vec![QualifiedAlias("transactions00".to_string(), Column::Transactions(TransactionsColumn::Value))]);
+
+        assert_eq!(bindings.get(&Variable::from_valid_name("?tx")).expect("column binding for ?tx").clone(),
+                   vec![QualifiedAlias("transactions00".to_string(), Column::Transactions(TransactionsColumn::Tx))]);
+
+        assert_eq!(bindings.get(&Variable::from_valid_name("?added")).expect("column binding for ?added").clone(),
+                   vec![QualifiedAlias("transactions00".to_string(), Column::Transactions(TransactionsColumn::Added))]);
+
+        let known_types = cc.known_types;
+        assert_eq!(known_types.len(), 4);
+
+        assert_eq!(known_types.get(&Variable::from_valid_name("?e")).expect("known types for ?e").clone(),
+                   vec![ValueType::Ref].into_iter().collect());
+
+        assert_eq!(known_types.get(&Variable::from_valid_name("?a")).expect("known types for ?a").clone(),
+                   vec![ValueType::Ref].into_iter().collect());
+
+        assert_eq!(known_types.get(&Variable::from_valid_name("?tx")).expect("known types for ?tx").clone(),
+                   vec![ValueType::Ref].into_iter().collect());
+
+        assert_eq!(known_types.get(&Variable::from_valid_name("?added")).expect("known types for ?added").clone(),
+                   vec![ValueType::Boolean].into_iter().collect());
+
+        let extracted_types = cc.extracted_types;
+        assert_eq!(extracted_types.len(), 1);
+
+        assert_eq!(extracted_types.get(&Variable::from_valid_name("?v")).expect("extracted types for ?v").clone(),
+                   QualifiedAlias("transactions00".to_string(), Column::Transactions(TransactionsColumn::ValueTypeTag)));
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/where_fn.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/where_fn.rs.html new file mode 100644 index 00000000..3d39bc3f --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/clauses/where_fn.rs.html @@ -0,0 +1,214 @@ + + + + + + + + + + where_fn.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use mentat_query::{
+    WhereFn,
+};
+
+use clauses::{
+    ConjoiningClauses,
+};
+
+use errors::{
+    AlgebrizerError,
+    Result,
+};
+
+use Known;
+
+/// Application of `where` functions.
+impl ConjoiningClauses {
+    /// There are several kinds of functions binding variables in our Datalog:
+    /// - A set of functions like `ground`, fulltext` and `get-else` that are translated into SQL
+    ///   `VALUES`, `MATCH`, or `JOIN`, yielding bindings.
+    /// - In the future, some functions that are implemented via function calls in SQLite.
+    ///
+    /// At present we have implemented only a limited selection of functions.
+    pub(crate) fn apply_where_fn(&mut self, known: Known, where_fn: WhereFn) -> Result<()> {
+        // Because we'll be growing the set of built-in functions, handling each differently, and
+        // ultimately allowing user-specified functions, we match on the function name first.
+        match where_fn.operator.0.as_str() {
+            "fulltext" => self.apply_fulltext(known, where_fn),
+            "ground" => self.apply_ground(known, where_fn),
+            "tx-data" => self.apply_tx_data(known, where_fn),
+            "tx-ids" => self.apply_tx_ids(known, where_fn),
+            _ => bail!(AlgebrizerError::UnknownFunction(where_fn.operator.clone())),
+        }
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/errors.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/errors.rs.html new file mode 100644 index 00000000..76190b56 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/errors.rs.html @@ -0,0 +1,418 @@ + + + + + + + + + + errors.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+extern crate mentat_query;
+
+use std; // To refer to std::result::Result.
+use std::fmt;
+use std::fmt::Display;
+
+use failure::{
+    Backtrace,
+    Context,
+    Error,
+    Fail,
+};
+
+use mentat_core::{
+    ValueType,
+    ValueTypeSet,
+};
+
+use self::mentat_query::{
+    PlainSymbol,
+};
+
+pub type Result<T> = std::result::Result<T, Error>;
+
+#[macro_export]
+macro_rules! bail {
+    ($e:expr) => (
+        return Err($e.into());
+    )
+}
+
+#[derive(Debug)]
+pub struct InvalidBinding {
+    pub function: PlainSymbol,
+    pub inner: Context<BindingError>
+}
+
+impl InvalidBinding {
+    pub fn new(function: PlainSymbol, inner: BindingError) -> InvalidBinding {
+        InvalidBinding {
+            function: function,
+            inner: Context::new(inner)
+        }
+    }
+}
+
+impl Fail for InvalidBinding {
+    fn cause(&self) -> Option<&Fail> {
+        self.inner.cause()
+    }
+
+    fn backtrace(&self) -> Option<&Backtrace> {
+        self.inner.backtrace()
+    }
+}
+
+impl Display for InvalidBinding {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "invalid binding for {}: {:?}", self.function, self.inner)
+    }
+}
+
+impl Display for BindingError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "BindingError: {:?}", self)
+    }
+}
+
+#[derive(Clone, Debug, Eq, PartialEq, Fail)]
+pub enum BindingError {
+    NoBoundVariable,
+    UnexpectedBinding,
+    RepeatedBoundVariable, // TODO: include repeated variable(s).
+
+    /// Expected `[[?x ?y]]` but got some other type of binding.  Mentat is deliberately more strict
+    /// than Datomic: we won't try to make sense of non-obvious (and potentially erroneous) bindings.
+    ExpectedBindRel,
+
+    /// Expected `[[?x ?y]]` or `[?x ...]` but got some other type of binding.  Mentat is
+    /// deliberately more strict than Datomic: we won't try to make sense of non-obvious (and
+    /// potentially erroneous) bindings.
+    ExpectedBindRelOrBindColl,
+
+    /// Expected `[?x1 … ?xN]` or `[[?x1 … ?xN]]` but got some other number of bindings.  Mentat is
+    /// deliberately more strict than Datomic: we prefer placeholders to omission.
+    InvalidNumberOfBindings { number: usize, expected: usize },
+}
+
+#[derive(Debug, Fail)]
+pub enum AlgebrizerError {
+    #[fail(display = "{} var {} is duplicated", _0, _1)]
+    DuplicateVariableError(PlainSymbol, &'static str),
+
+    #[fail(display = "unexpected FnArg")]
+    UnsupportedArgument,
+
+    #[fail(display = "value of type {} provided for var {}, expected {}", _0, _1, _2)]
+    InputTypeDisagreement(PlainSymbol, ValueType, ValueType),
+
+    #[fail(display = "invalid number of arguments to {}: expected {}, got {}.", _0, _1, _2)]
+    InvalidNumberOfArguments(PlainSymbol, usize, usize),
+
+    #[fail(display = "invalid argument to {}: expected {} in position {}.", _0, _1, _2)]
+    InvalidArgument(PlainSymbol, &'static str, usize),
+
+    #[fail(display = "invalid argument to {}: expected one of {:?} in position {}.", _0, _1, _2)]
+    InvalidArgumentType(PlainSymbol, ValueTypeSet, usize),
+
+    // TODO: flesh this out.
+    #[fail(display = "invalid expression in ground constant")]
+    InvalidGroundConstant,
+
+    #[fail(display = "invalid limit {} of type {}: expected natural number.", _0, _1)]
+    InvalidLimit(String, ValueType),
+
+    #[fail(display = "mismatched bindings in ground")]
+    GroundBindingsMismatch,
+
+    #[fail(display = "no entid found for ident: {}", _0)]
+    UnrecognizedIdent(String),
+
+    #[fail(display = "no function named {}", _0)]
+    UnknownFunction(PlainSymbol),
+
+    #[fail(display = ":limit var {} not present in :in", _0)]
+    UnknownLimitVar(PlainSymbol),
+
+    #[fail(display = "unbound variable {} in order clause or function call", _0)]
+    UnboundVariable(PlainSymbol),
+
+    // TODO: flesh out.
+    #[fail(display = "non-matching variables in 'or' clause")]
+    NonMatchingVariablesInOrClause,
+
+    #[fail(display = "non-matching variables in 'not' clause")]
+    NonMatchingVariablesInNotClause,
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/lib.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/lib.rs.html new file mode 100644 index 00000000..e86458df --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/lib.rs.html @@ -0,0 +1,930 @@ + + + + + + + + + + lib.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+extern crate failure;
+
+#[macro_use] extern crate failure_derive;
+
+extern crate mentat_core;
+extern crate mentat_query;
+
+use std::collections::BTreeSet;
+use std::ops::Sub;
+use std::rc::Rc;
+
+#[macro_use]
+mod errors;
+mod types;
+mod validate;
+mod clauses;
+
+use mentat_core::{
+    CachedAttributes,
+    Entid,
+    Schema,
+    TypedValue,
+    ValueType,
+    parse_query,
+};
+
+use mentat_core::counter::RcCounter;
+
+use mentat_query::{
+    Element,
+    FindSpec,
+    Limit,
+    Order,
+    ParsedQuery,
+    SrcVar,
+    Variable,
+    WhereClause,
+};
+
+pub use errors::{
+    AlgebrizerError,
+    BindingError,
+    Result,
+    InvalidBinding,
+};
+
+pub use clauses::{
+    QueryInputs,
+    VariableBindings,
+};
+
+pub use types::{
+    EmptyBecause,
+    FindQuery,
+};
+
+/// A convenience wrapper around things known in memory: the schema and caches.
+/// We use a trait object here to avoid making dozens of functions generic over the type
+/// of the cache. If performance becomes a concern, we should hard-code specific kinds of
+/// cache right here, and/or eliminate the Option.
+#[derive(Clone, Copy)]
+pub struct Known<'s, 'c> {
+    pub schema: &'s Schema,
+    pub cache: Option<&'c CachedAttributes>,
+}
+
+impl<'s, 'c> Known<'s, 'c> {
+    pub fn for_schema(s: &'s Schema) -> Known<'s, 'static> {
+        Known {
+            schema: s,
+            cache: None,
+        }
+    }
+
+    pub fn new(s: &'s Schema, c: Option<&'c CachedAttributes>) -> Known<'s, 'c> {
+        Known {
+            schema: s,
+            cache: c,
+        }
+    }
+}
+
+/// This is `CachedAttributes`, but with handy generic parameters.
+/// Why not make the trait generic? Because then we can't use it as a trait object in `Known`.
+impl<'s, 'c> Known<'s, 'c> {
+    pub fn is_attribute_cached_reverse<U>(&self, entid: U) -> bool where U: Into<Entid> {
+        self.cache
+            .map(|cache| cache.is_attribute_cached_reverse(entid.into()))
+            .unwrap_or(false)
+    }
+
+    pub fn is_attribute_cached_forward<U>(&self, entid: U) -> bool where U: Into<Entid> {
+        self.cache
+            .map(|cache| cache.is_attribute_cached_forward(entid.into()))
+            .unwrap_or(false)
+    }
+
+    pub fn get_values_for_entid<U, V>(&self, schema: &Schema, attribute: U, entid: V) -> Option<&Vec<TypedValue>>
+    where U: Into<Entid>, V: Into<Entid> {
+        self.cache.and_then(|cache| cache.get_values_for_entid(schema, attribute.into(), entid.into()))
+    }
+
+    pub fn get_value_for_entid<U, V>(&self, schema: &Schema, attribute: U, entid: V) -> Option<&TypedValue>
+    where U: Into<Entid>, V: Into<Entid> {
+        self.cache.and_then(|cache| cache.get_value_for_entid(schema, attribute.into(), entid.into()))
+    }
+
+    pub fn get_entid_for_value<U>(&self, attribute: U, value: &TypedValue) -> Option<Entid>
+    where U: Into<Entid> {
+        self.cache.and_then(|cache| cache.get_entid_for_value(attribute.into(), value))
+    }
+
+    pub fn get_entids_for_value<U>(&self, attribute: U, value: &TypedValue) -> Option<&BTreeSet<Entid>>
+    where U: Into<Entid> {
+        self.cache.and_then(|cache| cache.get_entids_for_value(attribute.into(), value))
+    }
+}
+
+#[derive(Debug)]
+pub struct AlgebraicQuery {
+    default_source: SrcVar,
+    pub find_spec: Rc<FindSpec>,
+    has_aggregates: bool,
+
+    /// The set of variables that the caller wishes to be used for grouping when aggregating.
+    /// These are specified in the query input, as `:with`, and are then chewed up during projection.
+    /// If no variables are supplied, then no additional grouping is necessary beyond the
+    /// non-aggregated projection list.
+    pub with: BTreeSet<Variable>,
+
+    /// Some query features, such as ordering, are implemented by implicit reference to SQL columns.
+    /// In order for these references to be 'live', those columns must be projected.
+    /// This is the set of variables that must be so projected.
+    /// This is not necessarily every variable that will be so required -- some variables
+    /// will already be in the projection list.
+    pub named_projection: BTreeSet<Variable>,
+    pub order: Option<Vec<OrderBy>>,
+    pub limit: Limit,
+    pub cc: clauses::ConjoiningClauses,
+}
+
+impl AlgebraicQuery {
+    #[inline]
+    pub fn is_known_empty(&self) -> bool {
+        self.cc.is_known_empty()
+    }
+
+    /// Return true if every variable in the find spec is fully bound to a single value.
+    pub fn is_fully_bound(&self) -> bool {
+        self.find_spec
+            .columns()
+            .all(|e| match e {
+                // Pull expressions are never fully bound.
+                // TODO: but the 'inside' of a pull expression certainly can be.
+                &Element::Pull(_) => false,
+
+                &Element::Variable(ref var) |
+                &Element::Corresponding(ref var) => self.cc.is_value_bound(var),
+
+                // For now, we pretend that aggregate functions are never fully bound:
+                // we don't statically compute them, even if we know the value of the var.
+                &Element::Aggregate(ref _fn) => false,
+            })
+    }
+
+    /// Return true if every variable in the find spec is fully bound to a single value,
+    /// and evaluating the query doesn't require running SQL.
+    pub fn is_fully_unit_bound(&self) -> bool {
+        self.cc.wheres.is_empty() &&
+        self.is_fully_bound()
+    }
+
+
+    /// Return a set of the input variables mentioned in the `:in` clause that have not yet been
+    /// bound. We do this by looking at the CC.
+    pub fn unbound_variables(&self) -> BTreeSet<Variable> {
+        self.cc.input_variables.sub(&self.cc.value_bound_variable_set())
+    }
+}
+
+pub fn algebrize_with_counter(known: Known, parsed: FindQuery, counter: usize) -> Result<AlgebraicQuery> {
+    algebrize_with_inputs(known, parsed, counter, QueryInputs::default())
+}
+
+pub fn algebrize(known: Known, parsed: FindQuery) -> Result<AlgebraicQuery> {
+    algebrize_with_inputs(known, parsed, 0, QueryInputs::default())
+}
+
+/// Take an ordering list. Any variables that aren't fixed by the query are used to produce
+/// a vector of `OrderBy` instances, including type comparisons if necessary. This function also
+/// returns a set of variables that should be added to the `with` clause to make the ordering
+/// clauses possible.
+fn validate_and_simplify_order(cc: &ConjoiningClauses, order: Option<Vec<Order>>)
+    -> Result<(Option<Vec<OrderBy>>, BTreeSet<Variable>)> {
+    match order {
+        None => Ok((None, BTreeSet::default())),
+        Some(order) => {
+            let mut order_bys: Vec<OrderBy> = Vec::with_capacity(order.len() * 2);   // Space for tags.
+            let mut vars: BTreeSet<Variable> = BTreeSet::default();
+
+            for Order(direction, var) in order.into_iter() {
+                // Eliminate any ordering clauses that are bound to fixed values.
+                if cc.bound_value(&var).is_some() {
+                    continue;
+                }
+
+                // Fail if the var isn't bound by the query.
+                if !cc.column_bindings.contains_key(&var) {
+                    bail!(AlgebrizerError::UnboundVariable(var.name()))
+                }
+
+                // Otherwise, determine if we also need to order by type…
+                if cc.known_type(&var).is_none() {
+                    order_bys.push(OrderBy(direction.clone(), VariableColumn::VariableTypeTag(var.clone())));
+                }
+                order_bys.push(OrderBy(direction, VariableColumn::Variable(var.clone())));
+                vars.insert(var.clone());
+            }
+
+            Ok((if order_bys.is_empty() { None } else { Some(order_bys) }, vars))
+        }
+    }
+}
+
+
+fn simplify_limit(mut query: AlgebraicQuery) -> Result<AlgebraicQuery> {
+    // Unpack any limit variables in place.
+    let refined_limit =
+        match query.limit {
+            Limit::Variable(ref v) => {
+                match query.cc.bound_value(v) {
+                    Some(TypedValue::Long(n)) => {
+                        if n <= 0 {
+                            // User-specified limits should always be natural numbers (> 0).
+                            bail!(AlgebrizerError::InvalidLimit(n.to_string(), ValueType::Long))
+                        } else {
+                            Some(Limit::Fixed(n as u64))
+                        }
+                    },
+                    Some(val) => {
+                        // Same.
+                        bail!(AlgebrizerError::InvalidLimit(format!("{:?}", val), val.value_type()))
+                    },
+                    None => {
+                        // We know that the limit variable is mentioned in `:in`.
+                        // That it's not bound here implies that we haven't got all the variables
+                        // we'll need to run the query yet.
+                        // (We should never hit this in `q_once`.)
+                        // Simply pass the `Limit` through to `SelectQuery` untouched.
+                        None
+                    },
+                }
+            },
+            Limit::None => None,
+            Limit::Fixed(_) => None,
+        };
+
+    if let Some(lim) = refined_limit {
+        query.limit = lim;
+    }
+    Ok(query)
+}
+
+pub fn algebrize_with_inputs(known: Known,
+                             parsed: FindQuery,
+                             counter: usize,
+                             inputs: QueryInputs) -> Result<AlgebraicQuery> {
+    let alias_counter = RcCounter::with_initial(counter);
+    let mut cc = ConjoiningClauses::with_inputs_and_alias_counter(parsed.in_vars, inputs, alias_counter);
+
+    // This is so the rest of the query knows that `?x` is a ref if `(pull ?x …)` appears in `:find`.
+    cc.derive_types_from_find_spec(&parsed.find_spec);
+
+    // Do we have a variable limit? If so, tell the CC that the var must be numeric.
+    if let &Limit::Variable(ref var) = &parsed.limit {
+        cc.constrain_var_to_long(var.clone());
+    }
+
+    // TODO: integrate default source into pattern processing.
+    // TODO: flesh out the rest of find-into-context.
+    cc.apply_clauses(known, parsed.where_clauses)?;
+
+    cc.expand_column_bindings();
+    cc.prune_extracted_types();
+    cc.process_required_types()?;
+
+    let (order, extra_vars) = validate_and_simplify_order(&cc, parsed.order)?;
+
+    // This might leave us with an unused `:in` variable.
+    let limit = if parsed.find_spec.is_unit_limited() { Limit::Fixed(1) } else { parsed.limit };
+    let q = AlgebraicQuery {
+        default_source: parsed.default_source,
+        find_spec: Rc::new(parsed.find_spec),
+        has_aggregates: false,           // TODO: we don't parse them yet.
+        with: parsed.with,
+        named_projection: extra_vars,
+        order: order,
+        limit: limit,
+        cc: cc,
+    };
+
+    // Substitute in any fixed values and fail if they're out of range.
+    simplify_limit(q)
+}
+
+pub use clauses::{
+    ConjoiningClauses,
+};
+
+pub use types::{
+    Column,
+    ColumnAlternation,
+    ColumnConstraint,
+    ColumnConstraintOrAlternation,
+    ColumnIntersection,
+    ColumnName,
+    ComputedTable,
+    DatomsColumn,
+    DatomsTable,
+    FulltextColumn,
+    OrderBy,
+    QualifiedAlias,
+    QueryValue,
+    SourceAlias,
+    TableAlias,
+    VariableColumn,
+};
+
+
+impl FindQuery {
+    pub fn simple(spec: FindSpec, where_clauses: Vec<WhereClause>) -> FindQuery {
+        FindQuery {
+            find_spec: spec,
+            default_source: SrcVar::DefaultSrc,
+            with: BTreeSet::default(),
+            in_vars: BTreeSet::default(),
+            in_sources: BTreeSet::default(),
+            limit: Limit::None,
+            where_clauses: where_clauses,
+            order: None,
+        }
+    }
+
+    pub fn from_parsed_query(parsed: ParsedQuery) -> Result<FindQuery> {
+        let in_vars = {
+            let mut set: BTreeSet<Variable> = BTreeSet::default();
+
+            for var in parsed.in_vars.into_iter() {
+                if !set.insert(var.clone()) {
+                    bail!(AlgebrizerError::DuplicateVariableError(var.name(), ":in"));
+                }
+            }
+
+            set
+        };
+
+        let with = {
+            let mut set: BTreeSet<Variable> = BTreeSet::default();
+
+            for var in parsed.with.into_iter() {
+                if !set.insert(var.clone()) {
+                    bail!(AlgebrizerError::DuplicateVariableError(var.name(), ":with"));
+                }
+            }
+
+            set
+        };
+
+        // Make sure that if we have `:limit ?x`, `?x` appears in `:in`.
+        if let Limit::Variable(ref v) = parsed.limit {
+            if !in_vars.contains(v) {
+                bail!(AlgebrizerError::UnknownLimitVar(v.name()));
+            }
+        }
+
+        Ok(FindQuery {
+            find_spec: parsed.find_spec,
+            default_source: parsed.default_source,
+            with,
+            in_vars,
+            in_sources: parsed.in_sources,
+            limit: parsed.limit,
+            where_clauses: parsed.where_clauses,
+            order: parsed.order,
+        })
+    }
+}
+
+pub fn parse_find_string(string: &str) -> Result<FindQuery> {
+    parse_query(string)
+        .map_err(|e| e.into())
+        .and_then(|parsed| FindQuery::from_parsed_query(parsed))
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/types.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/types.rs.html new file mode 100644 index 00000000..365b2b18 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/types.rs.html @@ -0,0 +1,1632 @@ + + + + + + + + + + types.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::collections::BTreeSet;
+use std::fmt::{
+    Debug,
+    Formatter,
+};
+
+use mentat_core::{
+    Entid,
+    TypedValue,
+    ValueRc,
+    ValueType,
+    ValueTypeSet,
+};
+
+use mentat_query::{
+    Direction,
+    FindSpec,
+    Keyword,
+    Limit,
+    Order,
+    SrcVar,
+    Variable,
+    WhereClause,
+};
+
+/// This enum models the fixed set of default tables we have -- two
+/// tables and two views -- and computed tables defined in the enclosing CC.
+#[derive(PartialEq, Eq, Clone, Copy, Debug)]
+pub enum DatomsTable {
+    Datoms,             // The non-fulltext datoms table.
+    FulltextValues,     // The virtual table mapping IDs to strings.
+    FulltextDatoms,     // The fulltext-datoms view.
+    AllDatoms,          // Fulltext and non-fulltext datoms.
+    Computed(usize),    // A computed table, tracked elsewhere in the query.
+    Transactions,       // The transactions table, which makes the tx-data log API efficient.
+}
+
+/// A source of rows that isn't a named table -- typically a subquery or union.
+#[derive(PartialEq, Eq, Debug)]
+pub enum ComputedTable {
+    Subquery(::clauses::ConjoiningClauses),
+    Union {
+        projection: BTreeSet<Variable>,
+        type_extraction: BTreeSet<Variable>,
+        arms: Vec<::clauses::ConjoiningClauses>,
+    },
+    NamedValues {
+        names: Vec<Variable>,
+        values: Vec<TypedValue>,
+    },
+}
+
+impl DatomsTable {
+    pub fn name(&self) -> &'static str {
+        match *self {
+            DatomsTable::Datoms => "datoms",
+            DatomsTable::FulltextValues => "fulltext_values",
+            DatomsTable::FulltextDatoms => "fulltext_datoms",
+            DatomsTable::AllDatoms => "all_datoms",
+            DatomsTable::Computed(_) => "c",
+            DatomsTable::Transactions => "transactions",
+        }
+    }
+}
+
+pub trait ColumnName {
+    fn column_name(&self) -> String;
+}
+
+/// One of the named columns of our tables.
+#[derive(PartialEq, Eq, Clone)]
+pub enum DatomsColumn {
+    Entity,
+    Attribute,
+    Value,
+    Tx,
+    ValueTypeTag,
+}
+
+/// One of the named columns of our fulltext values table.
+#[derive(PartialEq, Eq, Clone)]
+pub enum FulltextColumn {
+    Rowid,
+    Text,
+}
+
+/// One of the named columns of our transactions table.
+#[derive(PartialEq, Eq, Clone)]
+pub enum TransactionsColumn {
+    Entity,
+    Attribute,
+    Value,
+    Tx,
+    Added,
+    ValueTypeTag,
+}
+
+#[derive(PartialEq, Eq, Clone)]
+pub enum VariableColumn {
+    Variable(Variable),
+    VariableTypeTag(Variable),
+}
+
+#[derive(PartialEq, Eq, Clone)]
+pub enum Column {
+    Fixed(DatomsColumn),
+    Fulltext(FulltextColumn),
+    Variable(VariableColumn),
+    Transactions(TransactionsColumn),
+}
+
+impl From<DatomsColumn> for Column {
+    fn from(from: DatomsColumn) -> Column {
+        Column::Fixed(from)
+    }
+}
+
+impl From<VariableColumn> for Column {
+    fn from(from: VariableColumn) -> Column {
+        Column::Variable(from)
+    }
+}
+
+impl From<TransactionsColumn> for Column {
+    fn from(from: TransactionsColumn) -> Column {
+        Column::Transactions(from)
+    }
+}
+
+impl DatomsColumn {
+    pub fn as_str(&self) -> &'static str {
+        use self::DatomsColumn::*;
+        match *self {
+            Entity => "e",
+            Attribute => "a",
+            Value => "v",
+            Tx => "tx",
+            ValueTypeTag => "value_type_tag",
+        }
+    }
+
+    /// The type of the `v` column is determined by the `value_type_tag` column.  Return the
+    /// associated column determining the type of this column, if there is one.
+    pub fn associated_type_tag_column(&self) -> Option<DatomsColumn> {
+        use self::DatomsColumn::*;
+        match *self {
+            Value => Some(ValueTypeTag),
+            _ => None,
+        }
+    }
+}
+
+impl ColumnName for DatomsColumn {
+    fn column_name(&self) -> String {
+        self.as_str().to_string()
+    }
+}
+
+impl ColumnName for VariableColumn {
+    fn column_name(&self) -> String {
+        match self {
+            &VariableColumn::Variable(ref v) => v.to_string(),
+            &VariableColumn::VariableTypeTag(ref v) => format!("{}_value_type_tag", v.as_str()),
+        }
+    }
+}
+
+impl Debug for VariableColumn {
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        match self {
+            // These should agree with VariableColumn::column_name.
+            &VariableColumn::Variable(ref v) => write!(f, "{}", v.as_str()),
+            &VariableColumn::VariableTypeTag(ref v) => write!(f, "{}_value_type_tag", v.as_str()),
+        }
+    }
+}
+
+impl Debug for DatomsColumn {
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        write!(f, "{}", self.as_str())
+    }
+}
+
+impl Debug for Column {
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        match self {
+            &Column::Fixed(ref c) => c.fmt(f),
+            &Column::Fulltext(ref c) => c.fmt(f),
+            &Column::Variable(ref v) => v.fmt(f),
+            &Column::Transactions(ref t) => t.fmt(f),
+        }
+    }
+}
+
+impl FulltextColumn {
+    pub fn as_str(&self) -> &'static str {
+        use self::FulltextColumn::*;
+        match *self {
+            Rowid => "rowid",
+            Text => "text",
+        }
+    }
+}
+
+impl ColumnName for FulltextColumn {
+    fn column_name(&self) -> String {
+        self.as_str().to_string()
+    }
+}
+
+impl Debug for FulltextColumn {
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        write!(f, "{}", self.as_str())
+    }
+}
+
+impl TransactionsColumn {
+    pub fn as_str(&self) -> &'static str {
+        use self::TransactionsColumn::*;
+        match *self {
+            Entity => "e",
+            Attribute => "a",
+            Value => "v",
+            Tx => "tx",
+            Added => "added",
+            ValueTypeTag => "value_type_tag",
+        }
+    }
+
+    pub fn associated_type_tag_column(&self) -> Option<TransactionsColumn> {
+        use self::TransactionsColumn::*;
+        match *self {
+            Value => Some(ValueTypeTag),
+            _ => None,
+        }
+    }
+}
+
+impl ColumnName for TransactionsColumn {
+    fn column_name(&self) -> String {
+        self.as_str().to_string()
+    }
+}
+
+impl Debug for TransactionsColumn {
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        write!(f, "{}", self.as_str())
+    }
+}
+
+/// A specific instance of a table within a query. E.g., "datoms123".
+pub type TableAlias = String;
+
+/// The association between a table and its alias. E.g., AllDatoms, "all_datoms123".
+#[derive(PartialEq, Eq, Clone)]
+pub struct SourceAlias(pub DatomsTable, pub TableAlias);
+
+impl Debug for SourceAlias {
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        write!(f, "SourceAlias({:?}, {})", self.0, self.1)
+    }
+}
+
+/// A particular column of a particular aliased table. E.g., "datoms123", Attribute.
+#[derive(PartialEq, Eq, Clone)]
+pub struct QualifiedAlias(pub TableAlias, pub Column);
+
+impl Debug for QualifiedAlias {
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        write!(f, "{}.{:?}", self.0, self.1)
+    }
+}
+
+impl QualifiedAlias {
+    pub fn new<C: Into<Column>>(table: TableAlias, column: C) -> Self {
+        QualifiedAlias(table, column.into())
+    }
+
+    pub fn for_associated_type_tag(&self) -> Option<QualifiedAlias> {
+        match self.1 {
+            Column::Fixed(ref c) => c.associated_type_tag_column().map(Column::Fixed),
+            Column::Fulltext(_) => None,
+            Column::Variable(_) => None,
+            Column::Transactions(ref c) => c.associated_type_tag_column().map(Column::Transactions),
+        }.map(|d| QualifiedAlias(self.0.clone(), d))
+    }
+}
+
+#[derive(PartialEq, Eq, Clone)]
+pub enum QueryValue {
+    Column(QualifiedAlias),
+    Entid(Entid),
+    TypedValue(TypedValue),
+
+    // This is different: a numeric value can only apply to the 'v' column, and it implicitly
+    // constrains the `value_type_tag` column. For instance, a primitive long on `datoms00` of `5`
+    // cannot be a boolean, so `datoms00.value_type_tag` must be in the set `#{0, 4, 5}`.
+    // Note that `5 = 5.0` in SQLite, and we preserve that here.
+    PrimitiveLong(i64),
+}
+
+impl Debug for QueryValue {
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        use self::QueryValue::*;
+        match self {
+            &Column(ref qa) => {
+                write!(f, "{:?}", qa)
+            },
+            &Entid(ref entid) => {
+                write!(f, "entity({:?})", entid)
+            },
+            &TypedValue(ref typed_value) => {
+                write!(f, "value({:?})", typed_value)
+            },
+            &PrimitiveLong(value) => {
+                write!(f, "primitive({:?})", value)
+            },
+
+        }
+    }
+}
+
+/// Represents an entry in the ORDER BY list: a variable or a variable's type tag.
+/// (We require order vars to be projected, so we can simply use a variable here.)
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub struct OrderBy(pub Direction, pub VariableColumn);
+
+impl From<Order> for OrderBy {
+    fn from(item: Order) -> OrderBy {
+        let Order(direction, variable) = item;
+        OrderBy(direction, VariableColumn::Variable(variable))
+    }
+}
+
+#[derive(Copy, Clone, PartialEq, Eq)]
+/// Define the different inequality operators that we support.
+/// Note that we deliberately don't just use "<=" and friends as strings:
+/// Datalog and SQL don't use the same operators (e.g., `<>` and `!=`).
+/// These are applicable to numbers and instants.
+pub enum Inequality {
+    LessThan,
+    LessThanOrEquals,
+    GreaterThan,
+    GreaterThanOrEquals,
+    NotEquals,
+
+    // Ref operators.
+    Unpermute,
+    Differ,
+
+    // Tx operators.
+    TxAfter,
+    TxBefore,
+}
+
+impl Inequality {
+    pub fn to_sql_operator(self) -> &'static str {
+        use self::Inequality::*;
+        match self {
+            LessThan            => "<",
+            LessThanOrEquals    => "<=",
+            GreaterThan         => ">",
+            GreaterThanOrEquals => ">=",
+            NotEquals           => "<>",
+
+            Unpermute           => "<",
+            Differ              => "<>",
+
+            TxAfter             => ">",
+            TxBefore            => "<",
+        }
+    }
+
+    pub fn from_datalog_operator(s: &str) -> Option<Inequality> {
+        match s {
+            "<"  => Some(Inequality::LessThan),
+            "<=" => Some(Inequality::LessThanOrEquals),
+            ">"  => Some(Inequality::GreaterThan),
+            ">=" => Some(Inequality::GreaterThanOrEquals),
+            "!=" => Some(Inequality::NotEquals),
+
+            "unpermute" => Some(Inequality::Unpermute),
+            "differ" => Some(Inequality::Differ),
+
+            "tx-after" => Some(Inequality::TxAfter),
+            "tx-before" => Some(Inequality::TxBefore),
+            _ => None,
+        }
+    }
+
+    // The built-in inequality operators apply to Long, Double, and Instant.
+    pub fn supported_types(&self) -> ValueTypeSet {
+        use self::Inequality::*;
+        match self {
+            &LessThan |
+            &LessThanOrEquals |
+            &GreaterThan |
+            &GreaterThanOrEquals |
+            &NotEquals => {
+                let mut ts = ValueTypeSet::of_numeric_types();
+                ts.insert(ValueType::Instant);
+                ts
+            },
+            &Unpermute |
+            &Differ |
+            &TxAfter |
+            &TxBefore => {
+                ValueTypeSet::of_one(ValueType::Ref)
+            },
+        }
+    }
+}
+
+impl Debug for Inequality {
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        use self::Inequality::*;
+        f.write_str(match self {
+            &LessThan => "<",
+            &LessThanOrEquals => "<=",
+            &GreaterThan => ">",
+            &GreaterThanOrEquals => ">=",
+            &NotEquals => "!=",                // Datalog uses !=. SQL uses <>.
+
+            &Unpermute => "<",
+            &Differ => "<>",
+
+            &TxAfter => ">",
+            &TxBefore => "<",
+        })
+    }
+}
+
+#[derive(PartialEq, Eq)]
+pub enum ColumnConstraint {
+    Equals(QualifiedAlias, QueryValue),
+    Inequality {
+        operator: Inequality,
+        left: QueryValue,
+        right: QueryValue,
+    },
+    HasTypes {
+        value: TableAlias,
+        value_types: ValueTypeSet,
+        check_value: bool,
+    },
+    NotExists(ComputedTable),
+    Matches(QualifiedAlias, QueryValue),
+}
+
+impl ColumnConstraint {
+    pub fn has_unit_type(value: TableAlias, value_type: ValueType) -> ColumnConstraint {
+        ColumnConstraint::HasTypes {
+            value,
+            value_types: ValueTypeSet::of_one(value_type),
+            check_value: false,
+        }
+    }
+}
+
+#[derive(PartialEq, Eq, Debug)]
+pub enum ColumnConstraintOrAlternation {
+    Constraint(ColumnConstraint),
+    Alternation(ColumnAlternation),
+}
+
+impl From<ColumnConstraint> for ColumnConstraintOrAlternation {
+    fn from(thing: ColumnConstraint) -> Self {
+        ColumnConstraintOrAlternation::Constraint(thing)
+    }
+}
+
+/// A `ColumnIntersection` constraint is satisfied if all of its inner constraints are satisfied.
+/// An empty intersection is always satisfied.
+#[derive(PartialEq, Eq)]
+pub struct ColumnIntersection(pub Vec<ColumnConstraintOrAlternation>);
+
+impl From<Vec<ColumnConstraint>> for ColumnIntersection {
+    fn from(thing: Vec<ColumnConstraint>) -> Self {
+        ColumnIntersection(thing.into_iter().map(|x| x.into()).collect())
+    }
+}
+
+impl Default for ColumnIntersection {
+    fn default() -> Self {
+        ColumnIntersection(vec![])
+    }
+}
+
+impl IntoIterator for ColumnIntersection {
+    type Item = ColumnConstraintOrAlternation;
+    type IntoIter = ::std::vec::IntoIter<ColumnConstraintOrAlternation>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.0.into_iter()
+    }
+}
+
+impl ColumnIntersection {
+    #[inline]
+    pub fn len(&self) -> usize {
+        self.0.len()
+    }
+
+    #[inline]
+    pub fn is_empty(&self) -> bool {
+        self.0.is_empty()
+    }
+
+    #[inline]
+    pub fn add(&mut self, constraint: ColumnConstraintOrAlternation) {
+        self.0.push(constraint);
+    }
+
+    #[inline]
+    pub fn add_intersection(&mut self, constraint: ColumnConstraint) {
+        self.add(ColumnConstraintOrAlternation::Constraint(constraint));
+    }
+
+    pub fn append(&mut self, other: &mut Self) {
+        self.0.append(&mut other.0)
+    }
+}
+
+/// A `ColumnAlternation` constraint is satisfied if at least one of its inner constraints is
+/// satisfied. An empty `ColumnAlternation` is never satisfied.
+#[derive(PartialEq, Eq, Debug)]
+pub struct ColumnAlternation(pub Vec<ColumnIntersection>);
+
+impl Default for ColumnAlternation {
+    fn default() -> Self {
+        ColumnAlternation(vec![])
+    }
+}
+
+impl IntoIterator for ColumnAlternation {
+    type Item = ColumnIntersection;
+    type IntoIter = ::std::vec::IntoIter<ColumnIntersection>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.0.into_iter()
+    }
+}
+
+impl ColumnAlternation {
+    pub fn add_alternate(&mut self, intersection: ColumnIntersection) {
+        self.0.push(intersection);
+    }
+}
+
+impl Debug for ColumnIntersection {
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        write!(f, "{:?}", self.0)
+    }
+}
+
+impl Debug for ColumnConstraint {
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        use self::ColumnConstraint::*;
+        match self {
+            &Equals(ref qa1, ref thing) => {
+                write!(f, "{:?} = {:?}", qa1, thing)
+            },
+
+            &Inequality { operator, ref left, ref right } => {
+                write!(f, "{:?} {:?} {:?}", left, operator, right)
+            },
+
+            &Matches(ref qa, ref thing) => {
+                write!(f, "{:?} MATCHES {:?}", qa, thing)
+            },
+
+            &HasTypes { ref value, ref value_types, check_value } => {
+                // This is cludgey, but it's debug code.
+                write!(f, "(")?;
+                for value_type in value_types.iter() {
+                    write!(f, "({:?}.value_type_tag = {:?}", value, value_type)?;
+                    if check_value && value_type == ValueType::Double || value_type == ValueType::Long {
+                        write!(f, " AND typeof({:?}) = '{:?}')", value,
+                               if value_type == ValueType::Double { "real" } else { "integer" })?;
+                    } else {
+                        write!(f, ")")?;
+                    }
+                    write!(f, " OR ")?;
+                }
+                write!(f, "1)")
+            },
+            &NotExists(ref ct) => {
+                write!(f, "NOT EXISTS {:?}", ct)
+            },
+        }
+    }
+}
+
+#[derive(PartialEq, Clone)]
+pub enum EmptyBecause {
+    CachedAttributeHasNoValues { entity: Entid, attr: Entid },
+    CachedAttributeHasNoEntity { value: TypedValue, attr: Entid },
+    ConflictingBindings { var: Variable, existing: TypedValue, desired: TypedValue },
+
+    // A variable is known to be of two conflicting sets of types.
+    TypeMismatch { var: Variable, existing: ValueTypeSet, desired: ValueTypeSet },
+
+    // The same, but for non-variables.
+    KnownTypeMismatch { left: ValueTypeSet, right: ValueTypeSet },
+    NoValidTypes(Variable),
+    NonAttributeArgument,
+    NonInstantArgument,
+    NonNumericArgument,
+    NonEntityArgument,
+    NonStringFulltextValue,
+    NonFulltextAttribute(Entid),
+    UnresolvedIdent(Keyword),
+    InvalidAttributeIdent(Keyword),
+    InvalidAttributeEntid(Entid),
+    InvalidBinding(Column, TypedValue),
+    ValueTypeMismatch(ValueType, TypedValue),
+    AttributeLookupFailed,         // Catch-all, because the table lookup code is lazy. TODO
+}
+
+impl Debug for EmptyBecause {
+    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
+        use self::EmptyBecause::*;
+        match self {
+            &CachedAttributeHasNoEntity { ref value, ref attr } => {
+                write!(f, "(?e, {}, {:?}, _) not present in store", attr, value)
+            },
+            &CachedAttributeHasNoValues { ref entity, ref attr } => {
+                write!(f, "({}, {}, ?v, _) not present in store", entity, attr)
+            },
+            &ConflictingBindings { ref var, ref existing, ref desired } => {
+                write!(f, "Var {:?} can't be {:?} because it's already bound to {:?}",
+                       var, desired, existing)
+            },
+            &TypeMismatch { ref var, ref existing, ref desired } => {
+                write!(f, "Type mismatch: {:?} can't be {:?}, because it's already {:?}",
+                       var, desired, existing)
+            },
+            &KnownTypeMismatch { ref left, ref right } => {
+                write!(f, "Type mismatch: {:?} can't be compared to {:?}",
+                       left, right)
+            },
+            &NoValidTypes(ref var) => {
+                write!(f, "Type mismatch: {:?} has no valid types", var)
+            },
+            &NonAttributeArgument => {
+                write!(f, "Non-attribute argument in attribute place")
+            },
+            &NonInstantArgument => {
+                write!(f, "Non-instant argument in instant place")
+            },
+            &NonEntityArgument => {
+                write!(f, "Non-entity argument in entity place")
+            },
+            &NonNumericArgument => {
+                write!(f, "Non-numeric argument in numeric place")
+            },
+            &NonStringFulltextValue => {
+                write!(f, "Non-string argument for fulltext attribute")
+            },
+            &UnresolvedIdent(ref kw) => {
+                write!(f, "Couldn't resolve keyword {}", kw)
+            },
+            &InvalidAttributeIdent(ref kw) => {
+                write!(f, "{} does not name an attribute", kw)
+            },
+            &InvalidAttributeEntid(entid) => {
+                write!(f, "{} is not an attribute", entid)
+            },
+            &NonFulltextAttribute(entid) => {
+                write!(f, "{} is not a fulltext attribute", entid)
+            },
+            &InvalidBinding(ref column, ref tv) => {
+                write!(f, "{:?} cannot name column {:?}", tv, column)
+            },
+            &ValueTypeMismatch(value_type, ref typed_value) => {
+                write!(f, "Type mismatch: {:?} doesn't match attribute type {:?}",
+                       typed_value, value_type)
+            },
+            &AttributeLookupFailed => {
+                write!(f, "Attribute lookup failed")
+            },
+        }
+    }
+}
+
+
+/// A `FindQuery` represents a valid query to the query algebrizer.
+///
+/// We split `FindQuery` from `ParsedQuery` because it's not easy to generalize over containers
+/// (here, `Vec` and `BTreeSet`) in Rust.
+#[allow(dead_code)]
+#[derive(Debug, Eq, PartialEq)]
+pub struct FindQuery {
+    pub find_spec: FindSpec,
+    pub default_source: SrcVar,
+    pub with: BTreeSet<Variable>,
+    pub in_vars: BTreeSet<Variable>,
+    pub in_sources: BTreeSet<SrcVar>,
+    pub limit: Limit,
+    pub where_clauses: Vec<WhereClause>,
+    pub order: Option<Vec<Order>>,
+}
+
+// Intermediate data structures for resolving patterns.
+
+#[derive(Debug, Eq, PartialEq)]
+pub enum EvolvedNonValuePlace {
+    Placeholder,
+    Variable(Variable),
+    Entid(Entid),                       // Will always be +ve. See #190.
+}
+
+// TODO: some of these aren't necessary?
+#[derive(Debug, Eq, PartialEq)]
+pub enum EvolvedValuePlace {
+    Placeholder,
+    Variable(Variable),
+    Entid(Entid),
+    Value(TypedValue),
+    EntidOrInteger(i64),
+    IdentOrKeyword(ValueRc<Keyword>),
+}
+
+pub enum PlaceOrEmpty<T> {
+    Place(T),
+    Empty(EmptyBecause),
+}
+
+impl<T> PlaceOrEmpty<T> {
+    pub fn and_then<U, F: FnOnce(T) -> PlaceOrEmpty<U>>(self, f: F) -> PlaceOrEmpty<U> {
+        match self {
+            PlaceOrEmpty::Place(x) => f(x),
+            PlaceOrEmpty::Empty(e) => PlaceOrEmpty::Empty(e),
+        }
+    }
+}
+
+pub struct EvolvedPattern {
+    pub source: SrcVar,
+    pub entity: EvolvedNonValuePlace,
+    pub attribute: EvolvedNonValuePlace,
+    pub value: EvolvedValuePlace,
+    pub tx: EvolvedNonValuePlace,
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/validate.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/validate.rs.html new file mode 100644 index 00000000..4e26c500 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_algebrizer/validate.rs.html @@ -0,0 +1,874 @@ + + + + + + + + + + validate.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::collections::BTreeSet;
+
+use mentat_query::{
+    ContainsVariables,
+    OrJoin,
+    NotJoin,
+    Variable,
+    UnifyVars,
+};
+
+use errors::{
+    AlgebrizerError,
+    Result,
+};
+
+/// In an `or` expression, every mentioned var is considered 'free'.
+/// In an `or-join` expression, every var in the var list is 'required'.
+///
+/// Every extracted variable must be used in the clauses.
+/// The extracted var list cannot be empty.
+///
+/// The original Datomic docs are poorly worded:
+///
+/// "All clauses used in an or clause must use the same set of variables, which will unify with the
+/// surrounding query. This includes both the arguments to nested expression clauses as well as any
+/// bindings made by nested function expressions. Datomic will attempt to push the or clause down
+/// until all necessary variables are bound, and will throw an exception if that is not possible."
+///
+/// What this really means is: each pattern in the `or-join` clause must use the var list and unify
+/// with the surrounding query. It does not mean that each leg must have the same set of vars.
+///
+/// An `or` pattern must, because the set of vars is defined as every var mentioned in any clause,
+/// so naturally they must all be the same.
+///
+/// "As with rules, src-vars are not currently supported within the clauses of or, but are supported
+/// on the or clause as a whole at top level."
+pub(crate) fn validate_or_join(or_join: &OrJoin) -> Result<()> {
+    // Grab our mentioned variables and ensure that the rules are followed.
+    match or_join.unify_vars {
+        UnifyVars::Implicit => {
+            // Each 'leg' must have the same variable set.
+            if or_join.clauses.len() < 2 {
+                Ok(())
+            } else {
+                let mut clauses = or_join.clauses.iter();
+                let template = clauses.next().unwrap().collect_mentioned_variables();
+                for clause in clauses {
+                    if template != clause.collect_mentioned_variables() {
+                        bail!(AlgebrizerError::NonMatchingVariablesInOrClause)
+                    }
+                }
+                Ok(())
+            }
+        },
+        UnifyVars::Explicit(ref vars) => {
+            // Each leg must use the joined vars.
+            let var_set: BTreeSet<Variable> = vars.iter().cloned().collect();
+            for clause in &or_join.clauses {
+                if !var_set.is_subset(&clause.collect_mentioned_variables()) {
+                    bail!(AlgebrizerError::NonMatchingVariablesInOrClause)
+                }
+            }
+            Ok(())
+        },
+    }
+}
+
+pub(crate) fn validate_not_join(not_join: &NotJoin) -> Result<()> {
+    // Grab our mentioned variables and ensure that the rules are followed.
+    match not_join.unify_vars {
+        UnifyVars::Implicit => {
+            Ok(())
+        },
+        UnifyVars::Explicit(ref vars) => {
+            // The joined vars must each appear somewhere in the clause's mentioned variables.
+            let var_set: BTreeSet<Variable> = vars.iter().cloned().collect();
+            if !var_set.is_subset(&not_join.collect_mentioned_variables()) {
+                bail!(AlgebrizerError::NonMatchingVariablesInNotClause)
+            }
+            Ok(())
+        },
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    extern crate mentat_core;
+    extern crate mentat_query;
+
+    use self::mentat_query::{
+        Keyword,
+        OrWhereClause,
+        Pattern,
+        PatternNonValuePlace,
+        PatternValuePlace,
+        UnifyVars,
+        Variable,
+        WhereClause,
+    };
+
+    use clauses::ident;
+
+    use super::*;
+    use parse_find_string;
+    use types::{
+        FindQuery,
+    };
+
+    fn value_ident(ns: &str, name: &str) -> PatternValuePlace {
+        Keyword::namespaced(ns, name).into()
+    }
+
+    /// Tests that the top-level form is a valid `or`, returning the clauses.
+    fn valid_or_join(parsed: FindQuery, expected_unify: UnifyVars) -> Vec<OrWhereClause> {
+        let mut wheres = parsed.where_clauses.into_iter();
+
+        // There's only one.
+        let clause = wheres.next().unwrap();
+        assert_eq!(None, wheres.next());
+
+        match clause {
+            WhereClause::OrJoin(or_join) => {
+                // It's valid: the variables are the same in each branch.
+                assert_eq!((), validate_or_join(&or_join).unwrap());
+                assert_eq!(expected_unify, or_join.unify_vars);
+                or_join.clauses
+            },
+            _ => panic!(),
+        }
+    }
+
+    /// Test that an `or` is valid if all of its arms refer to the same variables.
+    #[test]
+    fn test_success_or() {
+        let query = r#"[:find [?artist ...]
+                        :where (or [?artist :artist/type :artist.type/group]
+                                   (and [?artist :artist/type :artist.type/person]
+                                        [?artist :artist/gender :artist.gender/female]))]"#;
+        let parsed = parse_find_string(query).expect("expected successful parse");
+        let clauses = valid_or_join(parsed, UnifyVars::Implicit);
+
+        // Let's do some detailed parse checks.
+        let mut arms = clauses.into_iter();
+        match (arms.next(), arms.next(), arms.next()) {
+            (Some(left), Some(right), None) => {
+                assert_eq!(
+                    left,
+                    OrWhereClause::Clause(WhereClause::Pattern(Pattern {
+                        source: None,
+                        entity: PatternNonValuePlace::Variable(Variable::from_valid_name("?artist")),
+                        attribute: ident("artist", "type"),
+                        value: value_ident("artist.type", "group"),
+                        tx: PatternNonValuePlace::Placeholder,
+                    })));
+                assert_eq!(
+                    right,
+                    OrWhereClause::And(
+                        vec![
+                            WhereClause::Pattern(Pattern {
+                                source: None,
+                                entity: PatternNonValuePlace::Variable(Variable::from_valid_name("?artist")),
+                                attribute: ident("artist", "type"),
+                                value: value_ident("artist.type", "person"),
+                                tx: PatternNonValuePlace::Placeholder,
+                            }),
+                            WhereClause::Pattern(Pattern {
+                                source: None,
+                                entity: PatternNonValuePlace::Variable(Variable::from_valid_name("?artist")),
+                                attribute: ident("artist", "gender"),
+                                value: value_ident("artist.gender", "female"),
+                                tx: PatternNonValuePlace::Placeholder,
+                            }),
+                        ]));
+            },
+            _ => panic!(),
+        };
+    }
+
+    /// Test that an `or` with differing variable sets in each arm will fail to validate.
+    #[test]
+    fn test_invalid_implicit_or() {
+        let query = r#"[:find [?artist ...]
+                        :where (or [?artist :artist/type :artist.type/group]
+                                   [?artist :artist/type ?type])]"#;
+        let parsed = parse_find_string(query).expect("expected successful parse");
+        match parsed.where_clauses.into_iter().next().expect("expected at least one clause") {
+            WhereClause::OrJoin(or_join) => assert!(validate_or_join(&or_join).is_err()),
+            _ => panic!(),
+        }
+    }
+
+    /// Test that two arms of an `or-join` can contain different variables if they both
+    /// contain the required `or-join` list.
+    #[test]
+    fn test_success_differing_or_join() {
+        let query = r#"[:find [?artist ...]
+                        :where (or-join [?artist]
+                                   [?artist :artist/type :artist.type/group]
+                                   (and [?artist :artist/type ?type]
+                                        [?type :artist/role :artist.role/parody]))]"#;
+        let parsed = parse_find_string(query).expect("expected successful parse");
+        let clauses = valid_or_join(parsed, UnifyVars::Explicit(::std::iter::once(Variable::from_valid_name("?artist")).collect()));
+
+        // Let's do some detailed parse checks.
+        let mut arms = clauses.into_iter();
+        match (arms.next(), arms.next(), arms.next()) {
+            (Some(left), Some(right), None) => {
+                assert_eq!(
+                    left,
+                    OrWhereClause::Clause(WhereClause::Pattern(Pattern {
+                        source: None,
+                        entity: PatternNonValuePlace::Variable(Variable::from_valid_name("?artist")),
+                        attribute: ident("artist", "type"),
+                        value: value_ident("artist.type", "group"),
+                        tx: PatternNonValuePlace::Placeholder,
+                    })));
+                assert_eq!(
+                    right,
+                    OrWhereClause::And(
+                        vec![
+                            WhereClause::Pattern(Pattern {
+                                source: None,
+                                entity: PatternNonValuePlace::Variable(Variable::from_valid_name("?artist")),
+                                attribute: ident("artist", "type"),
+                                value: PatternValuePlace::Variable(Variable::from_valid_name("?type")),
+                                tx: PatternNonValuePlace::Placeholder,
+                            }),
+                            WhereClause::Pattern(Pattern {
+                                source: None,
+                                entity: PatternNonValuePlace::Variable(Variable::from_valid_name("?type")),
+                                attribute: ident("artist", "role"),
+                                value: value_ident("artist.role", "parody"),
+                                tx: PatternNonValuePlace::Placeholder,
+                            }),
+                        ]));
+            },
+            _ => panic!(),
+        };
+    }
+
+
+    /// Tests that the top-level form is a valid `not`, returning the clauses.
+    fn valid_not_join(parsed: FindQuery, expected_unify: UnifyVars) -> Vec<WhereClause> {
+        // Filter out all the clauses that are not `not`s.
+        let mut nots = parsed.where_clauses.into_iter().filter(|x| match x {
+            &WhereClause::NotJoin(_) => true,
+            _ => false,
+        });
+
+        // There should be only one not clause.
+        let clause = nots.next().unwrap();
+        assert_eq!(None, nots.next());
+
+        match clause {
+            WhereClause::NotJoin(not_join) => {
+                // It's valid: the variables are the same in each branch.
+                assert_eq!((), validate_not_join(&not_join).unwrap());
+                assert_eq!(expected_unify, not_join.unify_vars);
+                not_join.clauses
+            },
+            _ => panic!(),
+        }
+    }
+
+    /// Test that a `not` is valid if it is implicit.
+    #[test]
+    fn test_success_not() {
+        let query = r#"[:find ?name
+                        :where [?id :artist/name ?name]
+                            (not [?id :artist/country :country/CA]
+                                 [?id :artist/country :country/GB])]"#;
+        let parsed = parse_find_string(query).expect("expected successful parse");
+        let clauses = valid_not_join(parsed, UnifyVars::Implicit);
+
+        let id = PatternNonValuePlace::Variable(Variable::from_valid_name("?id"));
+        let artist_country = ident("artist", "country");
+        // Check each part of the body
+        let mut parts = clauses.into_iter();
+        match (parts.next(), parts.next(), parts.next()) {
+            (Some(clause1), Some(clause2), None) => {
+                assert_eq!(
+                    clause1,
+                    WhereClause::Pattern(Pattern {
+                        source: None,
+                        entity: id.clone(),
+                        attribute: artist_country.clone(),
+                        value: value_ident("country", "CA"),
+                        tx: PatternNonValuePlace::Placeholder,
+                    }));
+                assert_eq!(
+                    clause2,
+                    WhereClause::Pattern(Pattern {
+                        source: None,
+                        entity: id,
+                        attribute: artist_country,
+                        value: value_ident("country", "GB"),
+                        tx: PatternNonValuePlace::Placeholder,
+                    }));
+            },
+            _ => panic!(),
+        };
+    }
+
+    #[test]
+    fn test_success_not_join() {
+        let query = r#"[:find ?artist
+                        :where [?artist :artist/name]
+                               (not-join [?artist]
+                                   [?release :release/artists ?artist]
+                                   [?release :release/year 1970])]"#;
+        let parsed = parse_find_string(query).expect("expected successful parse");
+        let clauses = valid_not_join(parsed, UnifyVars::Explicit(::std::iter::once(Variable::from_valid_name("?artist")).collect()));
+
+        let release = PatternNonValuePlace::Variable(Variable::from_valid_name("?release"));
+        let artist = PatternValuePlace::Variable(Variable::from_valid_name("?artist"));
+        // Let's do some detailed parse checks.
+        let mut parts = clauses.into_iter();
+        match (parts.next(), parts.next(), parts.next()) {
+            (Some(clause1), Some(clause2), None) => {
+                assert_eq!(
+                    clause1,
+                    WhereClause::Pattern(Pattern {
+                        source: None,
+                        entity: release.clone(),
+                        attribute: ident("release", "artists"),
+                        value: artist,
+                        tx: PatternNonValuePlace::Placeholder,
+                    }));
+                assert_eq!(
+                    clause2,
+                    WhereClause::Pattern(Pattern {
+                        source: None,
+                        entity: release,
+                        attribute: ident("release", "year"),
+                        value: PatternValuePlace::EntidOrInteger(1970),
+                        tx: PatternNonValuePlace::Placeholder,
+                    }));
+            },
+            _ => panic!(),
+        };
+    }
+
+    /// Test that a `not-join` that does not use the joining var fails to validate.
+    #[test]
+    fn test_invalid_explicit_not_join_non_matching_join_vars() {
+        let query = r#"[:find ?artist
+                        :where [?artist :artist/name]
+                               (not-join [?artist]
+                                   [?release :release/artists "Pink Floyd"]
+                                   [?release :release/year 1970])]"#;
+        let parsed = parse_find_string(query).expect("expected successful parse");
+        let mut nots = parsed.where_clauses.iter().filter(|&x| match *x {
+            WhereClause::NotJoin(_) => true,
+            _ => false,
+        });
+
+        let clause = nots.next().unwrap().clone();
+        assert_eq!(None, nots.next());
+
+        match clause {
+            WhereClause::NotJoin(not_join) => assert!(validate_not_join(&not_join).is_err()),
+            _ => panic!(),
+        }
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_projector/aggregates.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_projector/aggregates.rs.html new file mode 100644 index 00000000..8fc948b3 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_projector/aggregates.rs.html @@ -0,0 +1,590 @@ + + + + + + + + + + aggregates.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use mentat_core::{
+    ValueType,
+    ValueTypeSet,
+};
+
+use mentat_query::{
+    Aggregate,
+    QueryFunction,
+    Variable,
+};
+
+use mentat_query_algebrizer::{
+    ColumnName,
+    ConjoiningClauses,
+    VariableColumn,
+};
+
+use mentat_query_sql::{
+    ColumnOrExpression,
+    Expression,
+    Name,
+    ProjectedColumn,
+};
+
+use errors::{
+    ProjectorError,
+    Result,
+};
+
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
+pub enum SimpleAggregationOp {
+    Avg,
+    Count,
+    Max,
+    Min,
+    Sum,
+}
+
+impl SimpleAggregationOp {
+    pub(crate) fn to_sql(&self) -> &'static str {
+        use self::SimpleAggregationOp::*;
+        match self {
+            &Avg => "avg",
+            &Count => "count",
+            &Max => "max",
+            &Min => "min",
+            &Sum => "sum",
+        }
+    }
+
+    fn for_function(function: &QueryFunction) -> Option<SimpleAggregationOp> {
+        match function.0.name() {
+            "avg" => Some(SimpleAggregationOp::Avg),
+            "count" => Some(SimpleAggregationOp::Count),
+            "max" => Some(SimpleAggregationOp::Max),
+            "min" => Some(SimpleAggregationOp::Min),
+            "sum" => Some(SimpleAggregationOp::Sum),
+            _ => None,
+        }
+    }
+
+    /// With knowledge of the types to which a variable might be bound,
+    /// return a `Result` to determine whether this aggregation is suitable.
+    /// For example, it's valid to take the `Avg` of `{Double, Long}`, invalid
+    /// to take `Sum` of `{Instant}`, valid to take (lexicographic) `Max` of `{String}`,
+    /// but invalid to take `Max` of `{Uuid, String}`.
+    ///
+    /// The returned type is the type of the result of the aggregation.
+    pub(crate) fn is_applicable_to_types(&self, possibilities: ValueTypeSet) -> Result<ValueType> {
+        use self::SimpleAggregationOp::*;
+        if possibilities.is_empty() {
+            bail!(ProjectorError::CannotProjectImpossibleBinding(*self))
+        }
+
+        match self {
+            // One can always count results.
+            &Count => Ok(ValueType::Long),
+
+            // Only numeric types can be averaged or summed.
+            &Avg => {
+                if possibilities.is_only_numeric() {
+                    // The mean of a set of numeric values will always, for our purposes, be a double.
+                    Ok(ValueType::Double)
+                } else {
+                    bail!(ProjectorError::CannotApplyAggregateOperationToTypes(*self, possibilities))
+                }
+            },
+            &Sum => {
+                if possibilities.is_only_numeric() {
+                    if possibilities.contains(ValueType::Double) {
+                        Ok(ValueType::Double)
+                    } else {
+                        // TODO: BigInt.
+                        Ok(ValueType::Long)
+                    }
+                } else {
+                    bail!(ProjectorError::CannotApplyAggregateOperationToTypes(*self, possibilities))
+                }
+            },
+
+            &Max | &Min => {
+                if possibilities.is_unit() {
+                    use ValueType::*;
+                    let the_type = possibilities.exemplar().expect("a type");
+                    match the_type {
+                        // These types are numerically ordered.
+                        Double | Long | Instant => Ok(the_type),
+
+                        // Boolean: false < true.
+                        Boolean => Ok(the_type),
+
+                        // String: lexicographic order.
+                        String => Ok(the_type),
+
+                        // These types are unordered.
+                        Keyword | Ref | Uuid => {
+                            bail!(ProjectorError::CannotApplyAggregateOperationToTypes(*self, possibilities))
+                        },
+                    }
+                } else {
+                    // It cannot be empty -- we checked.
+                    // The only types that are valid to compare cross-type are numbers.
+                    if possibilities.is_only_numeric() {
+                        // Note that if the max/min is a Long, it will be returned as a Double!
+                        if possibilities.contains(ValueType::Double) {
+                            Ok(ValueType::Double)
+                        } else {
+                            // TODO: BigInt.
+                            Ok(ValueType::Long)
+                        }
+                    } else {
+                        bail!(ProjectorError::CannotApplyAggregateOperationToTypes(*self, possibilities))
+                    }
+                }
+            },
+        }
+    }
+}
+
+pub(crate) struct SimpleAggregate {
+    pub op: SimpleAggregationOp,
+    pub var: Variable,
+}
+
+impl SimpleAggregate {
+    pub(crate) fn column_name(&self) -> Name {
+        format!("({} {})", self.op.to_sql(), self.var.name())
+    }
+
+    pub(crate) fn use_static_value(&self) -> bool {
+        use self::SimpleAggregationOp::*;
+        match self.op {
+            Avg | Max | Min => true,
+            Count | Sum => false,
+        }
+    }
+
+    /// Return `true` if this aggregate can be `NULL` over 0 rows.
+    pub(crate) fn is_nullable(&self) -> bool {
+        use self::SimpleAggregationOp::*;
+        match self.op {
+            Avg | Max | Min => true,
+            Count | Sum => false,
+        }
+    }
+}
+
+pub(crate) trait SimpleAggregation {
+    fn to_simple(&self) -> Option<SimpleAggregate>;
+}
+
+impl SimpleAggregation for Aggregate {
+    fn to_simple(&self) -> Option<SimpleAggregate> {
+        if self.args.len() != 1 {
+            return None;
+        }
+        self.args[0]
+            .as_variable()
+            .and_then(|v| SimpleAggregationOp::for_function(&self.func)
+                              .map(|op| SimpleAggregate { op, var: v.clone(), }))
+    }
+}
+
+/// Returns two values:
+/// - The `ColumnOrExpression` to use in the query. This will always refer to other
+///   variables by name; never to a datoms column.
+/// - The known type of that value.
+pub(crate) fn projected_column_for_simple_aggregate(simple: &SimpleAggregate, cc: &ConjoiningClauses) -> Result<(ProjectedColumn, ValueType)> {
+    let known_types = cc.known_type_set(&simple.var);
+    let return_type = simple.op.is_applicable_to_types(known_types)?;
+    let projected_column_or_expression =
+        if let Some(value) = cc.bound_value(&simple.var) {
+            // Oh, we already know the value!
+            if simple.use_static_value() {
+                // We can statically compute the aggregate result for some operators -- not count or
+                // sum, but avg/max/min are OK.
+                ColumnOrExpression::Value(value)
+            } else {
+                let expression = Expression::Unary {
+                    sql_op: simple.op.to_sql(),
+                    arg: ColumnOrExpression::Value(value),
+                };
+                if simple.is_nullable() {
+                    ColumnOrExpression::NullableAggregate(Box::new(expression), return_type)
+                } else {
+                    ColumnOrExpression::Expression(Box::new(expression), return_type)
+                }
+            }
+        } else {
+            // The common case: the values are bound during execution.
+            let name = VariableColumn::Variable(simple.var.clone()).column_name();
+            let expression = Expression::Unary {
+                sql_op: simple.op.to_sql(),
+                arg: ColumnOrExpression::ExistingColumn(name),
+            };
+            if simple.is_nullable() {
+                ColumnOrExpression::NullableAggregate(Box::new(expression), return_type)
+            } else {
+                ColumnOrExpression::Expression(Box::new(expression), return_type)
+            }
+        };
+    Ok((ProjectedColumn(projected_column_or_expression, simple.column_name()), return_type))
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_projector/errors.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_projector/errors.rs.html new file mode 100644 index 00000000..f1fca674 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_projector/errors.rs.html @@ -0,0 +1,254 @@ + + + + + + + + + + errors.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std; // To refer to std::result::Result.
+
+use failure::{
+    Error,
+};
+
+use mentat_core::{
+    ValueTypeSet,
+};
+
+use mentat_query::{
+    PlainSymbol,
+};
+
+use aggregates::{
+    SimpleAggregationOp,
+};
+
+#[macro_export]
+macro_rules! bail {
+    ($e:expr) => (
+        return Err($e.into());
+    )
+}
+
+pub type Result<T> = std::result::Result<T, Error>;
+
+#[derive(Debug, Fail)]
+pub enum ProjectorError {
+    /// We're just not done yet.  Message that the feature is recognized but not yet
+    /// implemented.
+    #[fail(display = "not yet implemented: {}", _0)]
+    NotYetImplemented(String),
+
+    #[fail(display = "no possible types for value provided to {:?}", _0)]
+    CannotProjectImpossibleBinding(SimpleAggregationOp),
+
+    #[fail(display = "cannot apply projection operation {:?} to types {:?}", _0, _1)]
+    CannotApplyAggregateOperationToTypes(SimpleAggregationOp, ValueTypeSet),
+
+    #[fail(display = "invalid projection: {}", _0)]
+    InvalidProjection(String),
+
+    #[fail(display = "cannot project unbound variable {:?}", _0)]
+    UnboundVariable(PlainSymbol),
+
+    #[fail(display = "cannot find type for variable {:?}", _0)]
+    NoTypeAvailableForVariable(PlainSymbol),
+
+    #[fail(display = "expected {}, got {}", _0, _1)]
+    UnexpectedResultsType(&'static str, &'static str),
+
+    #[fail(display = "min/max expressions: {} (max 1), corresponding: {}", _0, _1)]
+    AmbiguousAggregates(usize, usize),
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_projector/lib.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_projector/lib.rs.html new file mode 100644 index 00000000..735d255b --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_projector/lib.rs.html @@ -0,0 +1,1158 @@ + + + + + + + + + + lib.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+extern crate failure;
+
+#[macro_use]
+extern crate failure_derive;
+extern crate indexmap;
+extern crate rusqlite;
+
+extern crate mentat_core;
+extern crate mentat_db;                 // For value conversion.
+extern crate mentat_query;
+extern crate mentat_query_algebrizer;
+extern crate mentat_query_pull;
+extern crate mentat_query_sql;
+extern crate mentat_sql;
+
+use std::collections::{
+    BTreeSet,
+};
+
+use std::iter;
+
+use std::rc::Rc;
+
+use rusqlite::{
+    Row,
+    Rows,
+};
+
+use mentat_core::{
+    Binding,
+    Schema,
+    TypedValue,
+    ValueType,
+    ValueTypeTag,
+};
+
+use mentat_core::util::{
+    Either,
+};
+
+use mentat_db::{
+    TypedSQLValue,
+};
+
+use mentat_query::{
+    Element,
+    FindSpec,
+    Limit,
+    Variable,
+};
+
+use mentat_query_algebrizer::{
+    AlgebraicQuery,
+    VariableBindings,
+};
+
+use mentat_query_sql::{
+    GroupBy,
+    Projection,
+};
+
+#[macro_use]
+pub mod errors;
+
+mod aggregates;
+mod project;
+mod projectors;
+mod pull;
+mod relresult;
+
+pub use aggregates::{
+    SimpleAggregationOp,
+};
+
+use project::{
+    ProjectedElements,
+    project_elements,
+};
+
+pub use project::{
+    projected_column_for_var,
+};
+
+pub use projectors::{
+    ConstantProjector,
+    Projector,
+};
+
+use projectors::{
+    CollProjector,
+    CollTwoStagePullProjector,
+    RelProjector,
+    RelTwoStagePullProjector,
+    ScalarProjector,
+    ScalarTwoStagePullProjector,
+    TupleProjector,
+    TupleTwoStagePullProjector,
+};
+
+pub use relresult::{
+    RelResult,
+    StructuredRelResult,
+};
+
+use errors::{
+    ProjectorError,
+    Result,
+};
+
+#[derive(Debug, PartialEq, Eq)]
+pub struct QueryOutput {
+    pub spec: Rc<FindSpec>,
+    pub results: QueryResults,
+}
+
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub enum QueryResults {
+    Scalar(Option<Binding>),
+    Tuple(Option<Vec<Binding>>),
+    Coll(Vec<Binding>),
+    Rel(RelResult<Binding>),
+}
+
+impl From<QueryOutput> for QueryResults {
+    fn from(o: QueryOutput) -> QueryResults {
+        o.results
+    }
+}
+
+impl QueryOutput {
+    pub fn empty_factory(spec: &FindSpec) -> Box<Fn() -> QueryResults> {
+        use self::FindSpec::*;
+        match spec {
+            &FindScalar(_)   => Box::new(|| QueryResults::Scalar(None)),
+            &FindTuple(_)    => Box::new(|| QueryResults::Tuple(None)),
+            &FindColl(_)     => Box::new(|| QueryResults::Coll(vec![])),
+            &FindRel(ref es) => {
+                let width = es.len();
+                Box::new(move || QueryResults::Rel(RelResult::empty(width)))
+            },
+        }
+    }
+
+    pub fn len(&self) -> usize {
+        self.results.len()
+    }
+
+    pub fn is_empty(&self) -> bool {
+        self.results.is_empty()
+    }
+
+    pub fn empty(spec: &Rc<FindSpec>) -> QueryOutput {
+        use self::FindSpec::*;
+        let results =
+            match &**spec {
+                &FindScalar(_)   => QueryResults::Scalar(None),
+                &FindTuple(_)    => QueryResults::Tuple(None),
+                &FindColl(_)     => QueryResults::Coll(vec![]),
+                &FindRel(ref es) => QueryResults::Rel(RelResult::empty(es.len())),
+            };
+        QueryOutput {
+            spec: spec.clone(),
+            results: results,
+        }
+    }
+
+    pub fn from_constants(spec: &Rc<FindSpec>, bindings: VariableBindings) -> QueryResults {
+        use self::FindSpec::*;
+        match &**spec {
+            &FindScalar(Element::Variable(ref var)) |
+            &FindScalar(Element::Corresponding(ref var)) => {
+                let val = bindings.get(var)
+                                  .cloned()
+                                  .map(|v| v.into());
+                QueryResults::Scalar(val)
+            },
+            &FindScalar(Element::Aggregate(ref _agg)) => {
+                // TODO: static aggregates.
+                unimplemented!();
+            },
+            &FindScalar(Element::Pull(ref _pull)) => {
+                // TODO: static pull.
+                unimplemented!();
+            },
+            &FindTuple(ref elements) => {
+                let values = elements.iter()
+                                     .map(|e| match e {
+                                         &Element::Variable(ref var) |
+                                         &Element::Corresponding(ref var) => {
+                                             bindings.get(var)
+                                                     .cloned()
+                                                     .expect("every var to have a binding")
+                                                     .into()
+                                         },
+                                         &Element::Pull(ref _pull) => {
+                                            // TODO: static pull.
+                                            unreachable!();
+                                         },
+                                         &Element::Aggregate(ref _agg) => {
+                                            // TODO: static computation of aggregates, then
+                                            // implement the condition in `is_fully_bound`.
+                                            unreachable!();
+                                         },
+                                     })
+                                     .collect();
+                QueryResults::Tuple(Some(values))
+            },
+            &FindColl(Element::Variable(ref var)) |
+            &FindColl(Element::Corresponding(ref var)) => {
+                let val = bindings.get(var)
+                                  .cloned()
+                                  .expect("every var to have a binding")
+                                  .into();
+                QueryResults::Coll(vec![val])
+            },
+            &FindColl(Element::Pull(ref _pull)) => {
+                // TODO: static pull.
+                unimplemented!();
+            },
+            &FindColl(Element::Aggregate(ref _agg)) => {
+                // Does it even make sense to write
+                // [:find [(max ?x) ...] :where [_ :foo/bar ?x]]
+                // ?
+                // TODO
+                unimplemented!();
+            },
+            &FindRel(ref elements) => {
+                let width = elements.len();
+                let values = elements.iter().map(|e| match e {
+                    &Element::Variable(ref var) |
+                    &Element::Corresponding(ref var) => {
+                        bindings.get(var)
+                                .cloned()
+                                .expect("every var to have a binding")
+                                .into()
+                    },
+                    &Element::Pull(ref _pull) => {
+                        // TODO: static pull.
+                        unreachable!();
+                    },
+                    &Element::Aggregate(ref _agg) => {
+                        // TODO: static computation of aggregates, then
+                        // implement the condition in `is_fully_bound`.
+                        unreachable!();
+                    },
+                }).collect();
+                QueryResults::Rel(RelResult { width, values })
+            },
+        }
+    }
+
+    pub fn into_scalar(self) -> Result<Option<Binding>> {
+        self.results.into_scalar()
+    }
+
+    pub fn into_coll(self) -> Result<Vec<Binding>> {
+        self.results.into_coll()
+    }
+
+    pub fn into_tuple(self) -> Result<Option<Vec<Binding>>> {
+        self.results.into_tuple()
+    }
+
+    pub fn into_rel(self) -> Result<RelResult<Binding>> {
+        self.results.into_rel()
+    }
+}
+
+impl QueryResults {
+    pub fn len(&self) -> usize {
+        use QueryResults::*;
+        match self {
+            &Scalar(ref o) => if o.is_some() { 1 } else { 0 },
+            &Tuple(ref o)  => if o.is_some() { 1 } else { 0 },
+            &Coll(ref v)   => v.len(),
+            &Rel(ref r)    => r.row_count(),
+        }
+    }
+
+    pub fn is_empty(&self) -> bool {
+        use QueryResults::*;
+        match self {
+            &Scalar(ref o) => o.is_none(),
+            &Tuple(ref o)  => o.is_none(),
+            &Coll(ref v)   => v.is_empty(),
+            &Rel(ref r)    => r.is_empty(),
+        }
+    }
+
+    pub fn into_scalar(self) -> Result<Option<Binding>> {
+        match self {
+            QueryResults::Scalar(o) => Ok(o),
+            QueryResults::Coll(_) => bail!(ProjectorError::UnexpectedResultsType("coll", "scalar")),
+            QueryResults::Tuple(_) => bail!(ProjectorError::UnexpectedResultsType("tuple", "scalar")),
+            QueryResults::Rel(_) => bail!(ProjectorError::UnexpectedResultsType("rel", "scalar")),
+        }
+    }
+
+    pub fn into_coll(self) -> Result<Vec<Binding>> {
+        match self {
+            QueryResults::Scalar(_) => bail!(ProjectorError::UnexpectedResultsType("scalar", "coll")),
+            QueryResults::Coll(c) => Ok(c),
+            QueryResults::Tuple(_) => bail!(ProjectorError::UnexpectedResultsType("tuple", "coll")),
+            QueryResults::Rel(_) => bail!(ProjectorError::UnexpectedResultsType("rel", "coll")),
+        }
+    }
+
+    pub fn into_tuple(self) -> Result<Option<Vec<Binding>>> {
+        match self {
+            QueryResults::Scalar(_) => bail!(ProjectorError::UnexpectedResultsType("scalar", "tuple")),
+            QueryResults::Coll(_) => bail!(ProjectorError::UnexpectedResultsType("coll", "tuple")),
+            QueryResults::Tuple(t) => Ok(t),
+            QueryResults::Rel(_) => bail!(ProjectorError::UnexpectedResultsType("rel", "tuple")),
+        }
+    }
+
+    pub fn into_rel(self) -> Result<RelResult<Binding>> {
+        match self {
+            QueryResults::Scalar(_) => bail!(ProjectorError::UnexpectedResultsType("scalar", "rel")),
+            QueryResults::Coll(_) => bail!(ProjectorError::UnexpectedResultsType("coll", "rel")),
+            QueryResults::Tuple(_) => bail!(ProjectorError::UnexpectedResultsType("tuple", "rel")),
+            QueryResults::Rel(r) => Ok(r),
+        }
+    }
+}
+
+type Index = i32;            // See rusqlite::RowIndex.
+enum TypedIndex {
+    Known(Index, ValueTypeTag),
+    Unknown(Index, Index),
+}
+
+impl TypedIndex {
+    /// Look up this index and type(index) pair in the provided row.
+    /// This function will panic if:
+    ///
+    /// - This is an `Unknown` and the retrieved type tag isn't an i32.
+    /// - If the retrieved value can't be coerced to a rusqlite `Value`.
+    /// - Either index is out of bounds.
+    ///
+    /// Because we construct our SQL projection list, the tag that stored the data, and this
+    /// consumer, a panic here implies that we have a bad bug — we put data of a very wrong type in
+    /// a row, and thus can't coerce to Value, we're retrieving from the wrong place, or our
+    /// generated SQL is junk.
+    ///
+    /// This function will return a runtime error if the type tag is unknown, or the value is
+    /// otherwise not convertible by the DB layer.
+    fn lookup<'a, 'stmt>(&self, row: &Row<'a, 'stmt>) -> Result<Binding> {
+        use TypedIndex::*;
+
+        match self {
+            &Known(value_index, value_type) => {
+                let v: rusqlite::types::Value = row.get(value_index);
+                TypedValue::from_sql_value_pair(v, value_type)
+                    .map(|v| v.into())
+                    .map_err(|e| e.into())
+            },
+            &Unknown(value_index, type_index) => {
+                let v: rusqlite::types::Value = row.get(value_index);
+                let value_type_tag: i32 = row.get(type_index);
+                TypedValue::from_sql_value_pair(v, value_type_tag)
+                    .map(|v| v.into())
+                    .map_err(|e| e.into())
+            },
+        }
+    }
+}
+
+
+/// Combines the things you need to turn a query into SQL and turn its results into
+/// `QueryResults`: SQL-related projection information (`DISTINCT`, columns, etc.) and
+/// a Datalog projector that turns SQL into structures.
+pub struct CombinedProjection {
+    /// A SQL projection, mapping columns mentioned in the body of the query to columns in the
+    /// output.
+    pub sql_projection: Projection,
+
+    /// If a query contains aggregates, we need to generate a nested subquery: an inner query
+    /// that returns our distinct variable bindings (and any `:with` vars), and an outer query
+    /// that applies aggregation. That's so we can put `DISTINCT` in the inner query and apply
+    /// aggregation afterwards -- `SELECT DISTINCT count(foo)` counts _then_ uniques, and we need
+    /// the opposite to implement Datalog distinct semantics.
+    /// If this is the case, `sql_projection` will be the outer query's projection list, and
+    /// `pre_aggregate_projection` will be the inner.
+    /// If the query doesn't use aggregation, this field will be `None`.
+    pub pre_aggregate_projection: Option<Projection>,
+
+    /// A Datalog projection. This consumes rows of the appropriate shape (as defined by
+    /// the SQL projection) to yield one of the four kinds of Datalog query result.
+    pub datalog_projector: Box<Projector>,
+
+    /// True if this query requires the SQL query to include DISTINCT.
+    pub distinct: bool,
+
+    // A list of column names to use as a GROUP BY clause.
+    pub group_by_cols: Vec<GroupBy>,
+}
+
+impl CombinedProjection {
+    fn flip_distinct_for_limit(mut self, limit: &Limit) -> Self {
+        if *limit == Limit::Fixed(1) {
+            self.distinct = false;
+        }
+        self
+    }
+}
+
+trait IsPull {
+    fn is_pull(&self) -> bool;
+}
+
+impl IsPull for Element {
+    fn is_pull(&self) -> bool {
+        match self {
+            &Element::Pull(_) => true,
+            _ => false,
+        }
+    }
+}
+
+/// Compute a suitable SQL projection for an algebrized query.
+/// This takes into account a number of things:
+/// - The variable list in the find spec.
+/// - The presence of any aggregate operations in the find spec. TODO: for now we only handle
+///   simple variables
+/// - The bindings established by the topmost CC.
+/// - The types known at algebrizing time.
+/// - The types extracted from the store for unknown attributes.
+pub fn query_projection(schema: &Schema, query: &AlgebraicQuery) -> Result<Either<ConstantProjector, CombinedProjection>> {
+    use self::FindSpec::*;
+
+    let spec = query.find_spec.clone();
+    if query.is_fully_unit_bound() {
+        // Do a few gyrations to produce empty results of the right kind for the query.
+
+        let variables: BTreeSet<Variable> = spec.columns()
+                                                .map(|e| match e {
+                                                    &Element::Variable(ref var) |
+                                                    &Element::Corresponding(ref var) => var.clone(),
+
+                                                    // Pull expressions can never be fully bound.
+                                                    // TODO: but the interior can be, in which case we
+                                                    // can handle this and simply project.
+                                                    &Element::Pull(_) => {
+                                                        unreachable!();
+                                                    },
+                                                    &Element::Aggregate(ref _agg) => {
+                                                        // TODO: static computation of aggregates, then
+                                                        // implement the condition in `is_fully_bound`.
+                                                        unreachable!();
+                                                    },
+                                                })
+                                                .collect();
+
+        // TODO: error handling
+        let results = QueryOutput::from_constants(&spec, query.cc.value_bindings(&variables));
+        let f = Box::new(move || { results.clone() });
+
+        Ok(Either::Left(ConstantProjector::new(spec, f)))
+    } else if query.is_known_empty() {
+        // Do a few gyrations to produce empty results of the right kind for the query.
+        let empty = QueryOutput::empty_factory(&spec);
+        Ok(Either::Left(ConstantProjector::new(spec, empty)))
+    } else {
+        match *query.find_spec {
+            FindColl(ref element) => {
+                let elements = project_elements(1, iter::once(element), query)?;
+                if element.is_pull() {
+                    CollTwoStagePullProjector::combine(spec, elements)
+                } else {
+                    CollProjector::combine(spec, elements)
+                }.map(|p| p.flip_distinct_for_limit(&query.limit))
+            },
+
+            FindScalar(ref element) => {
+                let elements = project_elements(1, iter::once(element), query)?;
+                if element.is_pull() {
+                    ScalarTwoStagePullProjector::combine(schema, spec, elements)
+                } else {
+                    ScalarProjector::combine(spec, elements)
+                }
+            },
+
+            FindRel(ref elements) => {
+                let is_pull = elements.iter().any(|e| e.is_pull());
+                let column_count = query.find_spec.expected_column_count();
+                let elements = project_elements(column_count, elements, query)?;
+                if is_pull {
+                    RelTwoStagePullProjector::combine(spec, column_count, elements)
+                } else {
+                    RelProjector::combine(spec, column_count, elements)
+                }.map(|p| p.flip_distinct_for_limit(&query.limit))
+            },
+
+            FindTuple(ref elements) => {
+                let is_pull = elements.iter().any(|e| e.is_pull());
+                let column_count = query.find_spec.expected_column_count();
+                let elements = project_elements(column_count, elements, query)?;
+                if is_pull {
+                    TupleTwoStagePullProjector::combine(spec, column_count, elements)
+                } else {
+                    TupleProjector::combine(spec, column_count, elements)
+                }
+            },
+        }.map(Either::Right)
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_projector/project.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_projector/project.rs.html new file mode 100644 index 00000000..bd59c067 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_projector/project.rs.html @@ -0,0 +1,1168 @@ + + + + + + + + + + project.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::collections::{
+    BTreeSet,
+};
+
+use indexmap::{
+    IndexSet,
+};
+
+use mentat_core::{
+    SQLValueType,
+    SQLValueTypeSet,
+    ValueTypeSet,
+};
+
+use mentat_core::util::{
+    Either,
+};
+
+use mentat_query::{
+    Element,
+    Pull,
+    Variable,
+};
+
+use mentat_query_algebrizer::{
+    AlgebraicQuery,
+    ColumnName,
+    ConjoiningClauses,
+    QualifiedAlias,
+    VariableColumn,
+};
+
+
+use mentat_query_sql::{
+    ColumnOrExpression,
+    GroupBy,
+    Name,
+    Projection,
+    ProjectedColumn,
+};
+
+use aggregates::{
+    SimpleAggregation,
+    projected_column_for_simple_aggregate,
+};
+
+use errors::{
+    ProjectorError,
+    Result,
+};
+
+use projectors::{
+    Projector,
+};
+
+use pull::{
+    PullIndices,
+    PullOperation,
+    PullTemplate,
+};
+
+use super::{
+    CombinedProjection,
+    TypedIndex,
+};
+
+/// An internal temporary struct to pass between the projection 'walk' and the
+/// resultant projector.
+/// Projection accumulates four things:
+/// - Two SQL projection lists. We need two because aggregate queries are nested
+///   in order to apply DISTINCT to values prior to aggregation.
+/// - A collection of templates for the projector to use to extract values.
+/// - A list of columns to use for grouping. Grouping is a property of the projection!
+pub(crate) struct ProjectedElements {
+    pub sql_projection: Projection,
+    pub pre_aggregate_projection: Option<Projection>,
+    pub templates: Vec<TypedIndex>,
+
+    // TODO: when we have an expression like
+    // [:find (pull ?x [:foo/name :foo/age]) (pull ?x [:foo/friend]) …]
+    // it would be more efficient to combine them.
+    pub pulls: Vec<PullTemplate>,
+    pub group_by: Vec<GroupBy>,
+}
+
+impl ProjectedElements {
+    pub(crate) fn combine(self, projector: Box<Projector>, distinct: bool) -> Result<CombinedProjection> {
+        Ok(CombinedProjection {
+            sql_projection: self.sql_projection,
+            pre_aggregate_projection: self.pre_aggregate_projection,
+            datalog_projector: projector,
+            distinct: distinct,
+            group_by_cols: self.group_by,
+        })
+    }
+
+    // We need the templates to make a projector that we can then hand to `combine`. This is the easy
+    // way to get it.
+    pub(crate) fn take_templates(&mut self) -> Vec<TypedIndex> {
+        let mut out = vec![];
+        ::std::mem::swap(&mut out, &mut self.templates);
+        out
+    }
+
+    pub(crate) fn take_pulls(&mut self) -> Vec<PullTemplate> {
+        let mut out = vec![];
+        ::std::mem::swap(&mut out, &mut self.pulls);
+        out
+    }
+}
+
+fn candidate_type_column(cc: &ConjoiningClauses, var: &Variable) -> Result<(ColumnOrExpression, Name)> {
+    cc.extracted_types
+      .get(var)
+      .cloned()
+      .map(|alias| {
+          let type_name = VariableColumn::VariableTypeTag(var.clone()).column_name();
+          (ColumnOrExpression::Column(alias), type_name)
+      })
+      .ok_or_else(|| ProjectorError::UnboundVariable(var.name()).into())
+}
+
+fn cc_column(cc: &ConjoiningClauses, var: &Variable) -> Result<QualifiedAlias> {
+    cc.column_bindings
+      .get(var)
+      .and_then(|cols| cols.get(0).cloned())
+      .ok_or_else(|| ProjectorError::UnboundVariable(var.name()).into())
+}
+
+fn candidate_column(cc: &ConjoiningClauses, var: &Variable) -> Result<(ColumnOrExpression, Name)> {
+    // Every variable should be bound by the top-level CC to at least
+    // one column in the query. If that constraint is violated it's a
+    // bug in our code, so it's appropriate to panic here.
+    cc_column(cc, var)
+        .map(|qa| {
+            let name = VariableColumn::Variable(var.clone()).column_name();
+            (ColumnOrExpression::Column(qa), name)
+        })
+}
+
+/// Return the projected column -- that is, a value or SQL column and an associated name -- for a
+/// given variable. Also return the type.
+/// Callers are expected to determine whether to project a type tag as an additional SQL column.
+pub fn projected_column_for_var(var: &Variable, cc: &ConjoiningClauses) -> Result<(ProjectedColumn, ValueTypeSet)> {
+    if let Some(value) = cc.bound_value(&var) {
+        // If we already know the value, then our lives are easy.
+        let tag = value.value_type();
+        let name = VariableColumn::Variable(var.clone()).column_name();
+        Ok((ProjectedColumn(ColumnOrExpression::Value(value.clone()), name), ValueTypeSet::of_one(tag)))
+    } else {
+        // If we don't, then the CC *must* have bound the variable.
+        let (column, name) = candidate_column(cc, var)?;
+        Ok((ProjectedColumn(column, name), cc.known_type_set(var)))
+    }
+}
+
+/// Walk an iterator of `Element`s, collecting projector templates and columns.
+///
+/// Returns a `ProjectedElements`, which combines SQL projections
+/// and a `Vec` of `TypedIndex` 'keys' to use when looking up values.
+///
+/// Callers must ensure that every `Element` is distinct -- a query like
+///
+/// ```edn
+/// [:find ?x ?x :where [?x _ _]]
+/// ```
+///
+/// should fail to parse. See #358.
+pub(crate) fn project_elements<'a, I: IntoIterator<Item = &'a Element>>(
+    count: usize,
+    elements: I,
+    query: &AlgebraicQuery) -> Result<ProjectedElements> {
+
+    // Give a little padding for type tags.
+    let mut inner_projection = Vec::with_capacity(count + 2);
+
+    // Everything in the outer query will _either_ be an aggregate operation
+    // _or_ a reference to a name projected from the inner.
+    // We'll expand them later.
+    let mut outer_projection: Vec<Either<Name, ProjectedColumn>> = Vec::with_capacity(count + 2);
+
+    let mut i: i32 = 0;
+    let mut min_max_count: usize = 0;
+    let mut templates = vec![];
+    let mut pulls: Vec<PullTemplate> = vec![];
+
+    let mut aggregates = false;
+
+    // Any variable that appears intact in the :find clause, not inside an aggregate expression.
+    // "Query variables not in aggregate expressions will group the results and appear intact
+    // in the result."
+    // We use an ordered set here so that we group in the correct order.
+    let mut outer_variables = IndexSet::new();
+    let mut corresponded_variables = IndexSet::new();
+
+    // Any variable that we are projecting from the inner query.
+    let mut inner_variables = BTreeSet::new();
+
+    for e in elements {
+        // Check for and reject duplicates.
+        match e {
+            &Element::Variable(ref var) => {
+                if outer_variables.contains(var) {
+                    bail!(ProjectorError::InvalidProjection(format!("Duplicate variable {} in query.", var)));
+                }
+                if corresponded_variables.contains(var) {
+                    bail!(ProjectorError::InvalidProjection(format!("Can't project both {} and `(the {})` from a query.", var, var)));
+                }
+            },
+            &Element::Corresponding(ref var) => {
+                if outer_variables.contains(var) {
+                    bail!(ProjectorError::InvalidProjection(format!("Can't project both {} and `(the {})` from a query.", var, var)));
+                }
+                if corresponded_variables.contains(var) {
+                    bail!(ProjectorError::InvalidProjection(format!("`(the {})` appears twice in query.", var)));
+                }
+            },
+            &Element::Aggregate(_) => {
+            },
+            &Element::Pull(_) => {
+            },
+        };
+
+        // Record variables -- `(the ?x)` and `?x` are different in this regard, because we don't want
+        // to group on variables that are corresponding-projected.
+        match e {
+            &Element::Variable(ref var) => {
+                outer_variables.insert(var.clone());
+            },
+            &Element::Corresponding(ref var) => {
+                // We will project these later; don't put them in `outer_variables`
+                // so we know not to group them.
+                corresponded_variables.insert(var.clone());
+            },
+            &Element::Pull(Pull { ref var, patterns: _ }) => {
+                // We treat `pull` as an ordinary variable extraction,
+                // and we expand it later.
+                outer_variables.insert(var.clone());
+            },
+            &Element::Aggregate(_) => {
+            },
+        };
+
+        // Now do the main processing of each element.
+        match e {
+            // Each time we come across a variable, we push a SQL column
+            // into the SQL projection, aliased to the name of the variable,
+            // and we push an annotated index into the projector.
+            &Element::Variable(ref var) |
+            &Element::Corresponding(ref var) => {
+                inner_variables.insert(var.clone());
+
+                let (projected_column, type_set) = projected_column_for_var(&var, &query.cc)?;
+                outer_projection.push(Either::Left(projected_column.1.clone()));
+                inner_projection.push(projected_column);
+
+                if let Some(tag) = type_set.unique_type_tag() {
+                    templates.push(TypedIndex::Known(i, tag));
+                    i += 1;     // We used one SQL column.
+                } else {
+                    templates.push(TypedIndex::Unknown(i, i + 1));
+                    i += 2;     // We used two SQL columns.
+
+                    // Also project the type from the SQL query.
+                    let (type_column, type_name) = candidate_type_column(&query.cc, &var)?;
+                    inner_projection.push(ProjectedColumn(type_column, type_name.clone()));
+                    outer_projection.push(Either::Left(type_name));
+                }
+            },
+            &Element::Pull(Pull { ref var, ref patterns }) => {
+                inner_variables.insert(var.clone());
+
+                let (projected_column, type_set) = projected_column_for_var(&var, &query.cc)?;
+                outer_projection.push(Either::Left(projected_column.1.clone()));
+                inner_projection.push(projected_column);
+
+                if let Some(tag) = type_set.unique_type_tag() {
+                    // We will have at least as many SQL columns as Datalog output columns.
+                    // `i` tracks the former. The length of `templates` is the current latter.
+                    // Projecting pull requires grabbing values, which we can do from the raw
+                    // rows, and then populating the output, so we keep both column indices.
+                    let output_index = templates.len();
+                    assert!(output_index <= i as usize);
+
+                    templates.push(TypedIndex::Known(i, tag));
+                    pulls.push(PullTemplate {
+                        indices: PullIndices {
+                            sql_index: i,
+                            output_index,
+                        },
+                        op: PullOperation((*patterns).clone()),
+                    });
+                    i += 1;     // We used one SQL column.
+                } else {
+                    // This should be impossible: (pull ?x) implies that ?x is a ref.
+                    unreachable!();
+                }
+            },
+            &Element::Aggregate(ref a) => {
+                if let Some(simple) = a.to_simple() {
+                    aggregates = true;
+
+                    use aggregates::SimpleAggregationOp::*;
+                    match simple.op {
+                        Max | Min => {
+                            min_max_count += 1;
+                        },
+                        Avg | Count | Sum => (),
+                    }
+
+                    // When we encounter a simple aggregate -- one in which the aggregation can be
+                    // implemented in SQL, on a single variable -- we just push the SQL aggregation op.
+                    // We must ensure the following:
+                    // - There's a column for the var.
+                    // - The type of the var is known to be restricted to a sensible input set
+                    //   (not necessarily a single type, but e.g., all vals must be Double or Long).
+                    // - The type set must be appropriate for the operation. E.g., `Sum` is not a
+                    //   meaningful operation on instants.
+
+                    let (projected_column, return_type) = projected_column_for_simple_aggregate(&simple, &query.cc)?;
+                    outer_projection.push(Either::Right(projected_column));
+
+                    if !inner_variables.contains(&simple.var) {
+                        inner_variables.insert(simple.var.clone());
+                        let (projected_column, _type_set) = projected_column_for_var(&simple.var, &query.cc)?;
+                        inner_projection.push(projected_column);
+                        if query.cc.known_type_set(&simple.var).unique_type_tag().is_none() {
+                            // Also project the type from the SQL query.
+                            let (type_column, type_name) = candidate_type_column(&query.cc, &simple.var)?;
+                            inner_projection.push(ProjectedColumn(type_column, type_name.clone()));
+                        }
+                    }
+
+                    // We might regret using the type tag here instead of the `ValueType`.
+                    templates.push(TypedIndex::Known(i, return_type.value_type_tag()));
+                    i += 1;
+                } else {
+                    // TODO: complex aggregates.
+                    bail!(ProjectorError::NotYetImplemented("complex aggregates".into()));
+                }
+            },
+        }
+    }
+
+    match (min_max_count, corresponded_variables.len()) {
+        (0, 0) | (_, 0) => {},
+        (0, _) => {
+            bail!(ProjectorError::InvalidProjection("Warning: used `the` without `min` or `max`.".to_string()));
+        },
+        (1, _) => {
+            // This is the success case!
+        },
+        (n, c) => {
+            bail!(ProjectorError::AmbiguousAggregates(n, c));
+        },
+    }
+
+    // Anything used in ORDER BY (which we're given in `named_projection`)
+    // needs to be in the SQL column list so we can refer to it by name.
+    //
+    // They don't affect projection.
+    //
+    // If a variable is of a non-fixed type, also project the type tag column, so we don't
+    // accidentally unify across types when considering uniqueness!
+    for var in query.named_projection.iter() {
+        if outer_variables.contains(var) {
+            continue;
+        }
+
+        // If it's a fixed value, we need do nothing further.
+        if query.cc.is_value_bound(&var) {
+            continue;
+        }
+
+        let already_inner = inner_variables.contains(&var);
+        let (column, name) = candidate_column(&query.cc, &var)?;
+        if !already_inner {
+            inner_projection.push(ProjectedColumn(column, name.clone()));
+            inner_variables.insert(var.clone());
+        }
+
+        outer_projection.push(Either::Left(name));
+        outer_variables.insert(var.clone());
+
+        // We don't care if a column has a single _type_, we care if it has a single type _tag_,
+        // because that's what we'll use if we're projecting. E.g., Long and Double.
+        // Single type implies single type tag, and is cheaper, so we check that first.
+        let types = query.cc.known_type_set(&var);
+        if !types.has_unique_type_tag() {
+            let (type_column, type_name) = candidate_type_column(&query.cc, &var)?;
+            if !already_inner {
+                inner_projection.push(ProjectedColumn(type_column, type_name.clone()));
+            }
+
+            outer_projection.push(Either::Left(type_name));
+        }
+    }
+
+    if !aggregates {
+        // We're done -- we never need to group unless we're aggregating.
+        return Ok(ProjectedElements {
+                      sql_projection: Projection::Columns(inner_projection),
+                      pre_aggregate_projection: None,
+                      templates,
+                      pulls,
+                      group_by: vec![],
+                  });
+    }
+
+    // OK, on to aggregates.
+    // We need to produce two SQL projection lists: one for an inner query and one for the outer.
+    //
+    // The inner serves these purposes:
+    // - Projecting variables to avoid duplicates being elided. (:with)
+    // - Making bindings available to the outermost query for projection, ordering, and grouping.
+    //
+    // The outer is consumed by the projector.
+    //
+    // We will also be producing:
+    // - A GROUP BY list to group the output of the inner query by non-aggregate variables
+    //   so that it can be correctly aggregated.
+
+    // Turn this collection of vars into a collection of columns from the query.
+    // We don't allow grouping on anything but a variable bound in the query.
+    // We group by tag if necessary.
+    let mut group_by = Vec::with_capacity(outer_variables.len() + 2);
+
+    let vars = outer_variables.into_iter().zip(::std::iter::repeat(true));
+    let corresponds = corresponded_variables.into_iter().zip(::std::iter::repeat(false));
+
+    for (var, group) in vars.chain(corresponds) {
+        if query.cc.is_value_bound(&var) {
+            continue;
+        }
+
+        if group {
+            // The GROUP BY goes outside, but it needs every variable and type tag to be
+            // projected from inside. Collect in both directions here.
+            let name = VariableColumn::Variable(var.clone()).column_name();
+            group_by.push(GroupBy::ProjectedColumn(name));
+        }
+
+        let needs_type_projection = !query.cc.known_type_set(&var).has_unique_type_tag();
+
+        let already_inner = inner_variables.contains(&var);
+        if !already_inner {
+            let (column, name) = candidate_column(&query.cc, &var)?;
+            inner_projection.push(ProjectedColumn(column, name.clone()));
+        }
+
+        if needs_type_projection {
+            let type_name = VariableColumn::VariableTypeTag(var.clone()).column_name();
+            if !already_inner {
+                let type_col = query.cc
+                                    .extracted_types
+                                    .get(&var)
+                                    .cloned()
+                                    .ok_or_else(|| ProjectorError::NoTypeAvailableForVariable(var.name().clone()))?;
+                inner_projection.push(ProjectedColumn(ColumnOrExpression::Column(type_col), type_name.clone()));
+            }
+            if group {
+                group_by.push(GroupBy::ProjectedColumn(type_name));
+            }
+        };
+    }
+
+    for var in query.with.iter() {
+        // We never need to project a constant.
+        if query.cc.is_value_bound(&var) {
+            continue;
+        }
+
+        // We don't need to add inner projections for :with if they are already there.
+        if !inner_variables.contains(&var) {
+            let (projected_column, type_set) = projected_column_for_var(&var, &query.cc)?;
+            inner_projection.push(projected_column);
+
+            if type_set.unique_type_tag().is_none() {
+                // Also project the type from the SQL query.
+                let (type_column, type_name) = candidate_type_column(&query.cc, &var)?;
+                inner_projection.push(ProjectedColumn(type_column, type_name.clone()));
+            }
+        }
+    }
+
+    // At this point we know we have a double-layer projection. Collect the outer.
+    //
+    // If we have an inner and outer layer, the inner layer will name its
+    // variables, and the outer will re-project them.
+    // If we only have one layer, then the outer will do the naming.
+    // (We could try to not use names in the inner query, but then what would we do for
+    // `ground` and known values?)
+    // Walk the projection, switching the outer columns to use the inner names.
+
+    let outer_projection = outer_projection.into_iter().map(|c| {
+        match c {
+            Either::Left(name) => {
+                ProjectedColumn(ColumnOrExpression::ExistingColumn(name.clone()),
+                                name)
+            },
+            Either::Right(pc) => pc,
+        }
+    }).collect();
+
+    Ok(ProjectedElements {
+        sql_projection: Projection::Columns(outer_projection),
+        pre_aggregate_projection: Some(Projection::Columns(inner_projection)),
+        templates,
+        pulls,
+        group_by,
+    })
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_projector/projectors/constant.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_projector/projectors/constant.rs.html new file mode 100644 index 00000000..106f0d25 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_projector/projectors/constant.rs.html @@ -0,0 +1,256 @@ + + + + + + + + + + constant.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::rc::Rc;
+
+use ::{
+    Element,
+    FindSpec,
+    QueryOutput,
+    QueryResults,
+    Rows,
+    Schema,
+    rusqlite,
+};
+
+use ::errors::{
+    Result,
+};
+
+use super::{
+    Projector,
+};
+
+/// A projector that produces a `QueryResult` containing fixed data.
+/// Takes a boxed function that should return an empty result set of the desired type.
+pub struct ConstantProjector {
+    spec: Rc<FindSpec>,
+    results_factory: Box<Fn() -> QueryResults>,
+}
+
+impl ConstantProjector {
+    pub fn new(spec: Rc<FindSpec>, results_factory: Box<Fn() -> QueryResults>) -> ConstantProjector {
+        ConstantProjector {
+            spec: spec,
+            results_factory: results_factory,
+        }
+    }
+
+    pub fn project_without_rows<'stmt>(&self) -> Result<QueryOutput> {
+        let results = (self.results_factory)();
+        let spec = self.spec.clone();
+        Ok(QueryOutput {
+            spec: spec,
+            results: results,
+        })
+    }
+}
+
+// TODO: a ConstantProjector with non-constant pull expressions.
+
+impl Projector for ConstantProjector {
+    fn project<'stmt, 's>(&self, _schema: &Schema, _sqlite: &'s rusqlite::Connection, _rows: Rows<'stmt>) -> Result<QueryOutput> {
+        self.project_without_rows()
+    }
+
+    fn columns<'s>(&'s self) -> Box<Iterator<Item=&Element> + 's> {
+        self.spec.columns()
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_projector/projectors/mod.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_projector/projectors/mod.rs.html new file mode 100644 index 00000000..0a785a3b --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_projector/projectors/mod.rs.html @@ -0,0 +1,216 @@ + + + + + + + + + + mod.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use super::{
+    Element,
+    Schema,
+    QueryOutput,
+    Rows,
+    rusqlite,
+};
+
+use super::errors::{
+    Result,
+};
+
+pub trait Projector {
+    fn project<'stmt, 's>(&self, schema: &Schema, sqlite: &'s rusqlite::Connection, rows: Rows<'stmt>) -> Result<QueryOutput>;
+    fn columns<'s>(&'s self) -> Box<Iterator<Item=&Element> + 's>;
+}
+
+mod constant;
+mod simple;
+mod pull_two_stage;
+
+pub use self::constant::ConstantProjector;
+
+pub(crate) use self::simple::{
+    CollProjector,
+    RelProjector,
+    ScalarProjector,
+    TupleProjector,
+};
+
+pub(crate) use self::pull_two_stage::{
+    CollTwoStagePullProjector,
+    RelTwoStagePullProjector,
+    ScalarTwoStagePullProjector,
+    TupleTwoStagePullProjector,
+};
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_projector/projectors/pull_two_stage.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_projector/projectors/pull_two_stage.rs.html new file mode 100644 index 00000000..ab103f36 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_projector/projectors/pull_two_stage.rs.html @@ -0,0 +1,794 @@ + + + + + + + + + + pull_two_stage.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::rc::Rc;
+
+use std::iter::{
+    once,
+};
+
+use mentat_query_pull::{
+    Puller,
+};
+
+use mentat_core::{
+    Entid,
+};
+
+use ::{
+    Binding,
+    CombinedProjection,
+    Element,
+    FindSpec,
+    ProjectedElements,
+    QueryOutput,
+    QueryResults,
+    RelResult,
+    Row,
+    Rows,
+    Schema,
+    TypedIndex,
+    rusqlite,
+};
+
+use ::pull::{
+    PullConsumer,
+    PullOperation,
+    PullTemplate,
+};
+
+use ::errors::{
+    Result,
+};
+
+use super::{
+    Projector,
+};
+
+pub(crate) struct ScalarTwoStagePullProjector {
+    spec: Rc<FindSpec>,
+    puller: Puller,
+}
+
+// TODO: almost by definition, a scalar result format doesn't need to be run in two stages.
+// The only output is the pull expression, and so we can directly supply the projected entity
+// to the pull SQL.
+impl ScalarTwoStagePullProjector {
+    fn with_template(schema: &Schema, spec: Rc<FindSpec>, pull: PullOperation) -> Result<ScalarTwoStagePullProjector> {
+        Ok(ScalarTwoStagePullProjector {
+            spec: spec,
+            puller: Puller::prepare(schema, pull.0.clone())?,
+        })
+    }
+
+    pub(crate) fn combine(schema: &Schema, spec: Rc<FindSpec>, mut elements: ProjectedElements) -> Result<CombinedProjection> {
+        let pull = elements.pulls.pop().expect("Expected a single pull");
+        let projector = Box::new(ScalarTwoStagePullProjector::with_template(schema, spec, pull.op)?);
+        let distinct = false;
+        elements.combine(projector, distinct)
+    }
+}
+
+impl Projector for ScalarTwoStagePullProjector {
+    fn project<'stmt, 's>(&self, schema: &Schema, sqlite: &'s rusqlite::Connection, mut rows: Rows<'stmt>) -> Result<QueryOutput> {
+        // Scalar is pretty straightforward -- zero or one entity, do the pull directly.
+        let results =
+            if let Some(r) = rows.next() {
+                let row = r?;
+                let entity: Entid = row.get(0);          // This will always be 0 and a ref.
+                let bindings = self.puller.pull(schema, sqlite, once(entity))?;
+                let m = Binding::Map(bindings.get(&entity).cloned().unwrap_or_else(Default::default));
+                QueryResults::Scalar(Some(m))
+            } else {
+                QueryResults::Scalar(None)
+            };
+
+        Ok(QueryOutput {
+            spec: self.spec.clone(),
+            results: results,
+        })
+    }
+
+    fn columns<'s>(&'s self) -> Box<Iterator<Item=&Element> + 's> {
+        self.spec.columns()
+    }
+}
+
+/// A tuple projector produces a single vector. It's the single-result version of rel.
+pub(crate) struct TupleTwoStagePullProjector {
+    spec: Rc<FindSpec>,
+    len: usize,
+    templates: Vec<TypedIndex>,
+    pulls: Vec<PullTemplate>,
+}
+
+impl TupleTwoStagePullProjector {
+    fn with_templates(spec: Rc<FindSpec>, len: usize, templates: Vec<TypedIndex>, pulls: Vec<PullTemplate>) -> TupleTwoStagePullProjector {
+        TupleTwoStagePullProjector {
+            spec: spec,
+            len: len,
+            templates: templates,
+            pulls: pulls,
+        }
+    }
+
+    // This is exactly the same as for rel.
+    fn collect_bindings<'a, 'stmt>(&self, row: Row<'a, 'stmt>) -> Result<Vec<Binding>> {
+        // There will be at least as many SQL columns as Datalog columns.
+        // gte 'cos we might be querying extra columns for ordering.
+        // The templates will take care of ignoring columns.
+        assert!(row.column_count() >= self.len as i32);
+        self.templates
+            .iter()
+            .map(|ti| ti.lookup(&row))
+            .collect::<Result<Vec<Binding>>>()
+    }
+
+    pub(crate) fn combine(spec: Rc<FindSpec>, column_count: usize, mut elements: ProjectedElements) -> Result<CombinedProjection> {
+        let projector = Box::new(TupleTwoStagePullProjector::with_templates(spec, column_count, elements.take_templates(), elements.take_pulls()));
+        let distinct = false;
+        elements.combine(projector, distinct)
+    }
+}
+
+impl Projector for TupleTwoStagePullProjector {
+    fn project<'stmt, 's>(&self, schema: &Schema, sqlite: &'s rusqlite::Connection, mut rows: Rows<'stmt>) -> Result<QueryOutput> {
+        let results =
+            if let Some(r) = rows.next() {
+                let row = r?;
+
+                // Keeping the compiler happy.
+                let pull_consumers: Result<Vec<PullConsumer>> = self.pulls
+                                                                    .iter()
+                                                                    .map(|op| PullConsumer::for_template(schema, op))
+                                                                    .collect();
+                let mut pull_consumers = pull_consumers?;
+
+                // Collect the usual bindings and accumulate entity IDs for pull.
+                for mut p in pull_consumers.iter_mut() {
+                    p.collect_entity(&row);
+                }
+
+                let mut bindings = self.collect_bindings(row)?;
+
+                // Run the pull expressions for the collected IDs.
+                for mut p in pull_consumers.iter_mut() {
+                    p.pull(sqlite)?;
+                }
+
+                // Expand the pull expressions back into the results vector.
+                for p in pull_consumers.into_iter() {
+                    p.expand(&mut bindings);
+                }
+
+                QueryResults::Tuple(Some(bindings))
+            } else {
+                QueryResults::Tuple(None)
+            };
+        Ok(QueryOutput {
+            spec: self.spec.clone(),
+            results: results,
+        })
+    }
+
+    fn columns<'s>(&'s self) -> Box<Iterator<Item=&Element> + 's> {
+        self.spec.columns()
+    }
+}
+
+/// A rel projector produces a RelResult, which is a striding abstraction over a vector.
+/// Each stride across the vector is the same size, and sourced from the same columns.
+/// Each column in each stride is the result of taking one or two columns from
+/// the `Row`: one for the value and optionally one for the type tag.
+pub(crate) struct RelTwoStagePullProjector {
+    spec: Rc<FindSpec>,
+    len: usize,
+    templates: Vec<TypedIndex>,
+    pulls: Vec<PullTemplate>,
+}
+
+impl RelTwoStagePullProjector {
+    fn with_templates(spec: Rc<FindSpec>, len: usize, templates: Vec<TypedIndex>, pulls: Vec<PullTemplate>) -> RelTwoStagePullProjector {
+        RelTwoStagePullProjector {
+            spec: spec,
+            len: len,
+            templates: templates,
+            pulls: pulls,
+        }
+    }
+
+    fn collect_bindings_into<'a, 'stmt, 'out>(&self, row: Row<'a, 'stmt>, out: &mut Vec<Binding>) -> Result<()> {
+        // There will be at least as many SQL columns as Datalog columns.
+        // gte 'cos we might be querying extra columns for ordering.
+        // The templates will take care of ignoring columns.
+        assert!(row.column_count() >= self.len as i32);
+        let mut count = 0;
+        for binding in self.templates
+                           .iter()
+                           .map(|ti| ti.lookup(&row)) {
+            out.push(binding?);
+            count += 1;
+        }
+        assert_eq!(self.len, count);
+        Ok(())
+    }
+
+    pub(crate) fn combine(spec: Rc<FindSpec>, column_count: usize, mut elements: ProjectedElements) -> Result<CombinedProjection> {
+        let projector = Box::new(RelTwoStagePullProjector::with_templates(spec, column_count, elements.take_templates(), elements.take_pulls()));
+
+        // If every column yields only one value, or if this is an aggregate query
+        // (because by definition every column in an aggregate query is either
+        // aggregated or is a variable _upon which we group_), then don't bother
+        // with DISTINCT.
+        let already_distinct = elements.pre_aggregate_projection.is_some() ||
+                               projector.columns().all(|e| e.is_unit());
+
+        elements.combine(projector, !already_distinct)
+    }
+}
+
+impl Projector for RelTwoStagePullProjector {
+    fn project<'stmt, 's>(&self, schema: &Schema, sqlite: &'s rusqlite::Connection, mut rows: Rows<'stmt>) -> Result<QueryOutput> {
+        // Allocate space for five rows to start.
+        // This is better than starting off by doubling the buffer a couple of times, and will
+        // rapidly grow to support larger query results.
+        let width = self.len;
+        let mut values: Vec<_> = Vec::with_capacity(5 * width);
+
+        let pull_consumers: Result<Vec<PullConsumer>> = self.pulls
+                                                            .iter()
+                                                            .map(|op| PullConsumer::for_template(schema, op))
+                                                            .collect();
+        let mut pull_consumers = pull_consumers?;
+
+        // Collect the usual bindings and accumulate entity IDs for pull.
+        while let Some(r) = rows.next() {
+            let row = r?;
+            for mut p in pull_consumers.iter_mut() {
+                p.collect_entity(&row);
+            }
+            self.collect_bindings_into(row, &mut values)?;
+        }
+
+        // Run the pull expressions for the collected IDs.
+        for mut p in pull_consumers.iter_mut() {
+            p.pull(sqlite)?;
+        }
+
+        // Expand the pull expressions back into the results vector.
+        for bindings in values.chunks_mut(width) {
+            for p in pull_consumers.iter() {
+                p.expand(bindings);
+            }
+        };
+
+        Ok(QueryOutput {
+            spec: self.spec.clone(),
+            results: QueryResults::Rel(RelResult { width, values }),
+        })
+    }
+
+    fn columns<'s>(&'s self) -> Box<Iterator<Item=&Element> + 's> {
+        self.spec.columns()
+    }
+}
+
+/// A coll projector produces a vector of values.
+/// Each value is sourced from the same column.
+pub(crate) struct CollTwoStagePullProjector {
+    spec: Rc<FindSpec>,
+    pull: PullOperation,
+}
+
+impl CollTwoStagePullProjector {
+    fn with_pull(spec: Rc<FindSpec>, pull: PullOperation) -> CollTwoStagePullProjector {
+        CollTwoStagePullProjector {
+            spec: spec,
+            pull: pull,
+        }
+    }
+
+    pub(crate) fn combine(spec: Rc<FindSpec>, mut elements: ProjectedElements) -> Result<CombinedProjection> {
+        let pull = elements.pulls.pop().expect("Expected a single pull");
+        let projector = Box::new(CollTwoStagePullProjector::with_pull(spec, pull.op));
+
+        // If every column yields only one value, or we're grouping by the value,
+        // don't bother with DISTINCT. This shouldn't really apply to coll-pull.
+        let already_distinct = elements.pre_aggregate_projection.is_some() ||
+                               projector.columns().all(|e| e.is_unit());
+        elements.combine(projector, !already_distinct)
+    }
+}
+
+impl Projector for CollTwoStagePullProjector {
+    fn project<'stmt, 's>(&self, schema: &Schema, sqlite: &'s rusqlite::Connection, mut rows: Rows<'stmt>) -> Result<QueryOutput> {
+        let mut pull_consumer = PullConsumer::for_operation(schema, &self.pull)?;
+
+        while let Some(r) = rows.next() {
+            let row = r?;
+            pull_consumer.collect_entity(&row);
+        }
+
+        // Run the pull expressions for the collected IDs.
+        pull_consumer.pull(sqlite)?;
+
+        // Expand the pull expressions into a results vector.
+        let out = pull_consumer.into_coll_results();
+
+        Ok(QueryOutput {
+            spec: self.spec.clone(),
+            results: QueryResults::Coll(out),
+        })
+    }
+
+    fn columns<'s>(&'s self) -> Box<Iterator<Item=&Element> + 's> {
+        self.spec.columns()
+    }
+}
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_projector/projectors/simple.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_projector/projectors/simple.rs.html new file mode 100644 index 00000000..c21254b0 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_projector/projectors/simple.rs.html @@ -0,0 +1,630 @@ + + + + + + + + + + simple.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::rc::Rc;
+
+use ::{
+    Binding,
+    CombinedProjection,
+    Element,
+    FindSpec,
+    ProjectedElements,
+    QueryOutput,
+    QueryResults,
+    RelResult,
+    Row,
+    Rows,
+    Schema,
+    TypedIndex,
+    rusqlite,
+};
+
+use ::errors::{
+    Result,
+};
+
+use super::{
+    Projector,
+};
+
+pub(crate) struct ScalarProjector {
+    spec: Rc<FindSpec>,
+    template: TypedIndex,
+}
+
+impl ScalarProjector {
+    fn with_template(spec: Rc<FindSpec>, template: TypedIndex) -> ScalarProjector {
+        ScalarProjector {
+            spec: spec,
+            template: template,
+        }
+    }
+
+    pub(crate) fn combine(spec: Rc<FindSpec>, mut elements: ProjectedElements) -> Result<CombinedProjection> {
+        let template = elements.templates.pop().expect("Expected a single template");
+        let projector = Box::new(ScalarProjector::with_template(spec, template));
+        let distinct = false;
+        elements.combine(projector, distinct)
+    }
+}
+
+impl Projector for ScalarProjector {
+    fn project<'stmt, 's>(&self, _schema: &Schema, _sqlite: &'s rusqlite::Connection, mut rows: Rows<'stmt>) -> Result<QueryOutput> {
+        let results =
+            if let Some(r) = rows.next() {
+                let row = r?;
+                let binding = self.template.lookup(&row)?;
+                QueryResults::Scalar(Some(binding))
+            } else {
+                QueryResults::Scalar(None)
+            };
+        Ok(QueryOutput {
+            spec: self.spec.clone(),
+            results: results,
+        })
+    }
+
+    fn columns<'s>(&'s self) -> Box<Iterator<Item=&Element> + 's> {
+        self.spec.columns()
+    }
+}
+
+/// A tuple projector produces a single vector. It's the single-result version of rel.
+pub(crate) struct TupleProjector {
+    spec: Rc<FindSpec>,
+    len: usize,
+    templates: Vec<TypedIndex>,
+}
+
+impl TupleProjector {
+    fn with_templates(spec: Rc<FindSpec>, len: usize, templates: Vec<TypedIndex>) -> TupleProjector {
+        TupleProjector {
+            spec: spec,
+            len: len,
+            templates: templates,
+        }
+    }
+
+    // This is just like we do for `rel`, but into a vec of its own.
+    fn collect_bindings<'a, 'stmt>(&self, row: Row<'a, 'stmt>) -> Result<Vec<Binding>> {
+        // There will be at least as many SQL columns as Datalog columns.
+        // gte 'cos we might be querying extra columns for ordering.
+        // The templates will take care of ignoring columns.
+        assert!(row.column_count() >= self.len as i32);
+        self.templates
+            .iter()
+            .map(|ti| ti.lookup(&row))
+            .collect::<Result<Vec<Binding>>>()
+    }
+
+    pub(crate) fn combine(spec: Rc<FindSpec>, column_count: usize, mut elements: ProjectedElements) -> Result<CombinedProjection> {
+        let projector = Box::new(TupleProjector::with_templates(spec, column_count, elements.take_templates()));
+        let distinct = false;
+        elements.combine(projector, distinct)
+    }
+}
+
+impl Projector for TupleProjector {
+    fn project<'stmt, 's>(&self, _schema: &Schema, _sqlite: &'s rusqlite::Connection, mut rows: Rows<'stmt>) -> Result<QueryOutput> {
+        let results =
+            if let Some(r) = rows.next() {
+                let row = r?;
+                let bindings = self.collect_bindings(row)?;
+                QueryResults::Tuple(Some(bindings))
+            } else {
+                QueryResults::Tuple(None)
+            };
+        Ok(QueryOutput {
+            spec: self.spec.clone(),
+            results: results,
+        })
+    }
+
+    fn columns<'s>(&'s self) -> Box<Iterator<Item=&Element> + 's> {
+        self.spec.columns()
+    }
+}
+
+/// A rel projector produces a RelResult, which is a striding abstraction over a vector.
+/// Each stride across the vector is the same size, and sourced from the same columns.
+/// Each column in each stride is the result of taking one or two columns from
+/// the `Row`: one for the value and optionally one for the type tag.
+pub(crate) struct RelProjector {
+    spec: Rc<FindSpec>,
+    len: usize,
+    templates: Vec<TypedIndex>,
+}
+
+impl RelProjector {
+    fn with_templates(spec: Rc<FindSpec>, len: usize, templates: Vec<TypedIndex>) -> RelProjector {
+        RelProjector {
+            spec: spec,
+            len: len,
+            templates: templates,
+        }
+    }
+
+    fn collect_bindings_into<'a, 'stmt, 'out>(&self, row: Row<'a, 'stmt>, out: &mut Vec<Binding>) -> Result<()> {
+        // There will be at least as many SQL columns as Datalog columns.
+        // gte 'cos we might be querying extra columns for ordering.
+        // The templates will take care of ignoring columns.
+        assert!(row.column_count() >= self.len as i32);
+        let mut count = 0;
+        for binding in self.templates
+                           .iter()
+                           .map(|ti| ti.lookup(&row)) {
+            out.push(binding?);
+            count += 1;
+        }
+        assert_eq!(self.len, count);
+        Ok(())
+    }
+
+    pub(crate) fn combine(spec: Rc<FindSpec>, column_count: usize, mut elements: ProjectedElements) -> Result<CombinedProjection> {
+        let projector = Box::new(RelProjector::with_templates(spec, column_count, elements.take_templates()));
+
+        // If every column yields only one value, or if this is an aggregate query
+        // (because by definition every column in an aggregate query is either
+        // aggregated or is a variable _upon which we group_), then don't bother
+        // with DISTINCT.
+        let already_distinct = elements.pre_aggregate_projection.is_some() ||
+                               projector.columns().all(|e| e.is_unit());
+        elements.combine(projector, !already_distinct)
+    }
+}
+
+impl Projector for RelProjector {
+    fn project<'stmt, 's>(&self, _schema: &Schema, _sqlite: &'s rusqlite::Connection, mut rows: Rows<'stmt>) -> Result<QueryOutput> {
+        // Allocate space for five rows to start.
+        // This is better than starting off by doubling the buffer a couple of times, and will
+        // rapidly grow to support larger query results.
+        let width = self.len;
+        let mut values: Vec<_> = Vec::with_capacity(5 * width);
+
+        while let Some(r) = rows.next() {
+            let row = r?;
+            self.collect_bindings_into(row, &mut values)?;
+        }
+
+        Ok(QueryOutput {
+            spec: self.spec.clone(),
+            results: QueryResults::Rel(RelResult { width, values }),
+        })
+    }
+
+    fn columns<'s>(&'s self) -> Box<Iterator<Item=&Element> + 's> {
+        self.spec.columns()
+    }
+}
+
+/// A coll projector produces a vector of values.
+/// Each value is sourced from the same column.
+pub(crate) struct CollProjector {
+    spec: Rc<FindSpec>,
+    template: TypedIndex,
+}
+
+impl CollProjector {
+    fn with_template(spec: Rc<FindSpec>, template: TypedIndex) -> CollProjector {
+        CollProjector {
+            spec: spec,
+            template: template,
+        }
+    }
+
+    pub(crate) fn combine(spec: Rc<FindSpec>, mut elements: ProjectedElements) -> Result<CombinedProjection> {
+        let template = elements.templates.pop().expect("Expected a single template");
+        let projector = Box::new(CollProjector::with_template(spec, template));
+
+        // If every column yields only one value, or if this is an aggregate query
+        // (because by definition every column in an aggregate query is either
+        // aggregated or is a variable _upon which we group_), then don't bother
+        // with DISTINCT.
+        let already_distinct = elements.pre_aggregate_projection.is_some() ||
+                               projector.columns().all(|e| e.is_unit());
+        elements.combine(projector, !already_distinct)
+    }
+}
+
+impl Projector for CollProjector {
+    fn project<'stmt, 's>(&self, _schema: &Schema, _sqlite: &'s rusqlite::Connection, mut rows: Rows<'stmt>) -> Result<QueryOutput> {
+        let mut out: Vec<_> = vec![];
+        while let Some(r) = rows.next() {
+            let row = r?;
+            let binding = self.template.lookup(&row)?;
+            out.push(binding);
+        }
+        Ok(QueryOutput {
+            spec: self.spec.clone(),
+            results: QueryResults::Coll(out),
+        })
+    }
+
+    fn columns<'s>(&'s self) -> Box<Iterator<Item=&Element> + 's> {
+        self.spec.columns()
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_projector/pull.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_projector/pull.rs.html new file mode 100644 index 00000000..a9b50240 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_projector/pull.rs.html @@ -0,0 +1,362 @@ + + + + + + + + + + pull.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::collections::{
+    BTreeMap,
+    BTreeSet,
+};
+
+use mentat_core::{
+    Binding,
+    Entid,
+    Schema,
+    StructuredMap,
+    TypedValue,
+    ValueRc,
+};
+
+use mentat_query::{
+    PullAttributeSpec,
+};
+
+use mentat_query_pull::{
+    Puller,
+};
+
+use errors::Result;
+
+use super::{
+    Index,
+    rusqlite,
+};
+
+#[derive(Clone, Debug)]
+pub(crate) struct PullOperation(pub(crate) Vec<PullAttributeSpec>);
+
+#[derive(Clone, Copy, Debug)]
+pub(crate) struct PullIndices {
+    pub(crate) sql_index: Index,                   // SQLite column index.
+    pub(crate) output_index: usize,
+}
+
+impl PullIndices {
+    fn zero() -> PullIndices {
+        PullIndices {
+            sql_index: 0,
+            output_index: 0,
+        }
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct PullTemplate {
+    pub(crate) indices: PullIndices,
+    pub(crate) op: PullOperation,
+}
+
+pub(crate) struct PullConsumer<'schema> {
+    indices: PullIndices,
+    schema: &'schema Schema,
+    puller: Puller,
+    entities: BTreeSet<Entid>,
+    results: BTreeMap<Entid, ValueRc<StructuredMap>>,
+}
+
+impl<'schema> PullConsumer<'schema> {
+    pub(crate) fn for_puller(puller: Puller, schema: &'schema Schema, indices: PullIndices) -> PullConsumer<'schema> {
+        PullConsumer {
+            indices: indices,
+            schema: schema,
+            puller: puller,
+            entities: Default::default(),
+            results: Default::default(),
+        }
+    }
+
+    pub(crate) fn for_template(schema: &'schema Schema, template: &PullTemplate) -> Result<PullConsumer<'schema>> {
+        let puller = Puller::prepare(schema, template.op.0.clone())?;
+        Ok(PullConsumer::for_puller(puller, schema, template.indices))
+    }
+
+    pub(crate) fn for_operation(schema: &'schema Schema, operation: &PullOperation) -> Result<PullConsumer<'schema>> {
+        let puller = Puller::prepare(schema, operation.0.clone())?;
+        Ok(PullConsumer::for_puller(puller, schema, PullIndices::zero()))
+    }
+
+    pub(crate) fn collect_entity<'a, 'stmt>(&mut self, row: &rusqlite::Row<'a, 'stmt>) -> Entid {
+        let entity = row.get(self.indices.sql_index);
+        self.entities.insert(entity);
+        entity
+    }
+
+    pub(crate) fn pull(&mut self, sqlite: &rusqlite::Connection) -> Result<()> {
+        let entities: Vec<Entid> = self.entities.iter().cloned().collect();
+        self.results = self.puller.pull(self.schema, sqlite, entities)?;
+        Ok(())
+    }
+
+    pub(crate) fn expand(&self, bindings: &mut [Binding]) {
+        if let Binding::Scalar(TypedValue::Ref(id)) = bindings[self.indices.output_index] {
+            if let Some(pulled) = self.results.get(&id).cloned() {
+                bindings[self.indices.output_index] = Binding::Map(pulled);
+            } else {
+                bindings[self.indices.output_index] = Binding::Map(ValueRc::new(Default::default()));
+            }
+        }
+    }
+
+    // TODO: do we need to include empty maps for entities that didn't match any pull?
+    pub(crate) fn into_coll_results(self) -> Vec<Binding> {
+        self.results.values().cloned().map(|vrc| Binding::Map(vrc)).collect()
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_projector/relresult.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_projector/relresult.rs.html new file mode 100644 index 00000000..701f8612 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_projector/relresult.rs.html @@ -0,0 +1,430 @@ + + + + + + + + + + relresult.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use mentat_core::{
+    Binding,
+    TypedValue,
+};
+
+/// The result you get from a 'rel' query, like:
+///
+/// ```edn
+/// [:find ?person ?name
+///  :where [?person :person/name ?name]]
+/// ```
+///
+/// There are three ways to get data out of a `RelResult`:
+/// - By iterating over rows as slices. Use `result.rows()`. This is efficient and is
+///   recommended in two cases:
+///   1. If you don't need to take ownership of the resulting values (e.g., you're comparing
+///      or making a modified clone).
+///   2. When the data you're retrieving is cheap to clone. All scalar values are relatively
+///      cheap: they're either small values or `Rc`.
+/// - By direct reference to a row by index, using `result.row(i)`. This also returns
+///   a reference.
+/// - By consuming the results using `into_iter`. This allocates short-lived vectors,
+///   but gives you ownership of the enclosed `TypedValue`s.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct RelResult<T> {
+    pub width: usize,
+    pub values: Vec<T>,
+}
+
+pub type StructuredRelResult = RelResult<Binding>;
+
+impl<T> RelResult<T> {
+    pub fn empty(width: usize) -> RelResult<T> {
+        RelResult {
+            width: width,
+            values: Vec::new(),
+        }
+    }
+
+    pub fn is_empty(&self) -> bool {
+        self.values.is_empty()
+    }
+
+    pub fn row_count(&self) -> usize {
+        self.values.len() / self.width
+    }
+
+    pub fn rows(&self) -> ::std::slice::Chunks<T> {
+        // TODO: Nightly-only API `exact_chunks`. #47115.
+        self.values.chunks(self.width)
+    }
+
+    pub fn row(&self, index: usize) -> Option<&[T]> {
+        let end = self.width * (index + 1);
+        if end > self.values.len() {
+            None
+        } else {
+            let start = self.width * index;
+            Some(&self.values[start..end])
+        }
+    }
+}
+
+#[test]
+fn test_rel_result() {
+    let empty = StructuredRelResult::empty(3);
+    let unit = StructuredRelResult {
+        width: 1,
+        values: vec![TypedValue::Long(5).into()],
+    };
+    let two_by_two = StructuredRelResult {
+        width: 2,
+        values: vec![TypedValue::Long(5).into(), TypedValue::Boolean(true).into(),
+                     TypedValue::Long(-2).into(), TypedValue::Boolean(false).into()],
+    };
+
+    assert!(empty.is_empty());
+    assert!(!unit.is_empty());
+    assert!(!two_by_two.is_empty());
+
+    assert_eq!(empty.row_count(), 0);
+    assert_eq!(unit.row_count(), 1);
+    assert_eq!(two_by_two.row_count(), 2);
+
+    assert_eq!(empty.row(0), None);
+    assert_eq!(unit.row(1), None);
+    assert_eq!(two_by_two.row(2), None);
+
+    assert_eq!(unit.row(0), Some(vec![TypedValue::Long(5).into()].as_slice()));
+    assert_eq!(two_by_two.row(0), Some(vec![TypedValue::Long(5).into(), TypedValue::Boolean(true).into()].as_slice()));
+    assert_eq!(two_by_two.row(1), Some(vec![TypedValue::Long(-2).into(), TypedValue::Boolean(false).into()].as_slice()));
+
+    let mut rr = two_by_two.rows();
+    assert_eq!(rr.next(), Some(vec![TypedValue::Long(5).into(), TypedValue::Boolean(true).into()].as_slice()));
+    assert_eq!(rr.next(), Some(vec![TypedValue::Long(-2).into(), TypedValue::Boolean(false).into()].as_slice()));
+    assert_eq!(rr.next(), None);
+}
+
+// Primarily for testing.
+impl From<Vec<Vec<TypedValue>>> for RelResult<Binding> {
+    fn from(src: Vec<Vec<TypedValue>>) -> Self {
+        if src.is_empty() {
+            RelResult::empty(0)
+        } else {
+            let width = src.get(0).map(|r| r.len()).unwrap_or(0);
+            RelResult {
+                width: width,
+                values: src.into_iter().flat_map(|r| r.into_iter().map(|v| v.into())).collect(),
+            }
+        }
+    }
+}
+
+pub struct SubvecIntoIterator<T> {
+    width: usize,
+    values: ::std::vec::IntoIter<T>,
+}
+
+impl<T> Iterator for SubvecIntoIterator<T> {
+    // TODO: this is a good opportunity to use `SmallVec` instead: most queries
+    // return a handful of columns.
+    type Item = Vec<T>;
+    fn next(&mut self) -> Option<Self::Item> {
+        let result: Vec<_> = (&mut self.values).take(self.width).collect();
+        if result.is_empty() {
+            None
+        } else {
+            Some(result)
+        }
+    }
+}
+
+impl<T> IntoIterator for RelResult<T> {
+    type Item = Vec<T>;
+    type IntoIter = SubvecIntoIterator<T>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        SubvecIntoIterator {
+            width: self.width,
+            values: self.values.into_iter(),
+        }
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_pull/errors.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_pull/errors.rs.html new file mode 100644 index 00000000..084efb23 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_pull/errors.rs.html @@ -0,0 +1,184 @@ + + + + + + + + + + errors.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std; // To refer to std::result::Result.
+
+use mentat_core::{
+    Entid,
+};
+
+use failure::{
+    Error,
+};
+
+pub type Result<T> = std::result::Result<T, Error>;
+
+#[derive(Debug, Fail)]
+pub enum PullError {
+    #[fail(display = "attribute {:?} has no name", _0)]
+    UnnamedAttribute(Entid),
+
+    #[fail(display = ":db/id repeated")]
+    RepeatedDbId,
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_pull/lib.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_pull/lib.rs.html new file mode 100644 index 00000000..2e215597 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_pull/lib.rs.html @@ -0,0 +1,690 @@ + + + + + + + + + + lib.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+///! A pull expression is a function.
+///!
+///! Its inputs are a store, a schema, and a set of bindings.
+///!
+///! Its output is a map whose keys are the input bindings and whose values are
+///! appropriate structured values to represent the pull expression.
+///!
+///! For example, the pull expression:
+///!
+///! ```edn
+///! (pull ?person [:person/name
+///!                :person/tattoo
+///!                {:person/friend [*]}])`
+///! ```
+///!
+///! will return values shaped like:
+///!
+///! ```edn
+///! {:person/name "Alice"                            ; Single-valued attribute
+///!                                                  ; Absence: Alice has no tattoos.
+///!  :person/friend [                                ; Multi-valued attribute.
+///!    {:person/name "Bob"                           ; Nesting and wildcard.
+///!     :person/pet ["Harrison", "Hoppy"]}]}
+///! ```
+///!
+///! There will be one such value for each input binding.
+///!
+///! We fetch layers of a pull expression iteratively: all attributes at the same
+///! 'level' can be fetched at the same time and accumulated into maps.
+///!
+///! Those maps are wrapped in `Rc` for two reasons:
+///! - They might occur multiple times when projected from a `:find` query.
+///! - They might refer to each other (consider recursion).
+///!
+///! A nested or recursive pull expression consumes values produced by earlier stages
+///! (the recursion with a smaller recursion limit and a growing 'seen' list),
+///! generating another layer of mappings.
+///!
+///! For example, you can imagine the nesting in the earlier pull expression being
+///! decomposed into two chained expressions:
+///!
+///! ```edn
+///! (pull
+///!     (pull ?person [:person/friend])
+///      [*]))
+///! ```
+
+extern crate failure;
+
+#[macro_use]
+extern crate failure_derive;
+
+extern crate rusqlite;
+
+extern crate mentat_core;
+extern crate mentat_db;
+extern crate mentat_query;
+extern crate mentat_query_algebrizer;
+extern crate mentat_query_sql;
+extern crate mentat_sql;
+
+use std::collections::{
+    BTreeMap,
+    BTreeSet,
+};
+
+use std::iter::{
+    once,
+};
+
+use mentat_core::{
+    Binding,
+    Cloned,
+    Entid,
+    HasSchema,
+    Keyword,
+    Schema,
+    StructuredMap,
+    TypedValue,
+    ValueRc,
+};
+
+use mentat_db::cache;
+
+use mentat_query::{
+    NamedPullAttribute,
+    PullAttributeSpec,
+    PullConcreteAttribute,
+};
+
+pub mod errors;
+
+use errors::{
+    PullError,
+    Result,
+};
+
+type PullResults = BTreeMap<Entid, ValueRc<StructuredMap>>;
+
+pub fn pull_attributes_for_entity<A>(schema: &Schema,
+                                     db: &rusqlite::Connection,
+                                     entity: Entid,
+                                     attributes: A) -> Result<StructuredMap>
+    where A: IntoIterator<Item=Entid> {
+    let attrs = attributes.into_iter()
+                          .map(|e| PullAttributeSpec::Attribute(PullConcreteAttribute::Entid(e).into()))
+                          .collect();
+    Puller::prepare(schema, attrs)?
+        .pull(schema, db, once(entity))
+        .map(|m| m.into_iter()
+                  .next()
+                  .map(|(k, vs)| {
+                      assert_eq!(k, entity);
+                      vs.cloned()
+                  })
+                  .unwrap_or_else(StructuredMap::default))
+}
+
+pub fn pull_attributes_for_entities<E, A>(schema: &Schema,
+                                          db: &rusqlite::Connection,
+                                          entities: E,
+                                          attributes: A) -> Result<PullResults>
+    where E: IntoIterator<Item=Entid>,
+          A: IntoIterator<Item=Entid> {
+    let attrs = attributes.into_iter()
+                          .map(|e| PullAttributeSpec::Attribute(PullConcreteAttribute::Entid(e).into()))
+                          .collect();
+    Puller::prepare(schema, attrs)?
+        .pull(schema, db, entities)
+}
+
+/// A `Puller` constructs on demand a map from a provided set of entity IDs to a set of structured maps.
+pub struct Puller {
+    // The domain of this map is the set of attributes to fetch.
+    // The range is the set of aliases to use in the output.
+    attributes: BTreeMap<Entid, ValueRc<Keyword>>,
+    attribute_spec: cache::AttributeSpec,
+
+    // If this is set, each pulled entity is contributed to its own output map, labeled with this
+    // keyword. This is a divergence from Datomic, which has no types by which to differentiate a
+    // long from an entity ID, and thus represents all entities in pull as, _e.g._, `{:db/id 1234}`.
+    //  Mentat can use `TypedValue::Ref(1234)`, but it's sometimes convenient to fetch the entity ID
+    // itself as part of a pull expression: `{:person 1234, :person/name "Peter"}`.
+    db_id_alias: Option<ValueRc<Keyword>>,
+}
+
+impl Puller {
+    pub fn prepare(schema: &Schema, attributes: Vec<PullAttributeSpec>) -> Result<Puller> {
+        // TODO: eventually this entry point will handle aliasing and that kind of
+        // thing. For now it's just a convenience.
+
+        let lookup_name = |i: &Entid| {
+            // In the unlikely event that we have an attribute with no name, we bail.
+            schema.get_ident(*i)
+                    .map(|ident| ValueRc::new(ident.clone()))
+                    .ok_or_else(|| PullError::UnnamedAttribute(*i))
+        };
+
+        let mut names: BTreeMap<Entid, ValueRc<Keyword>> = Default::default();
+        let mut attrs: BTreeSet<Entid> = Default::default();
+        let db_id = ::std::rc::Rc::new(Keyword::namespaced("db", "id"));
+        let mut db_id_alias = None;
+
+        for attr in attributes.iter() {
+            match attr {
+                &PullAttributeSpec::Wildcard => {
+                    let attribute_ids = schema.attribute_map.keys();
+                    for id in attribute_ids {
+                        names.insert(*id, lookup_name(id)?);
+                        attrs.insert(*id);
+                    }
+                    break;
+                },
+                &PullAttributeSpec::Attribute(NamedPullAttribute {
+                    ref attribute,
+                    ref alias,
+                }) => {
+                    let alias = alias.as_ref()
+                                     .map(|ref r| r.to_value_rc());
+                    match attribute {
+                        // Handle :db/id.
+                        &PullConcreteAttribute::Ident(ref i) if i.as_ref() == db_id.as_ref() => {
+                            // We only allow :db/id once.
+                            if db_id_alias.is_some() {
+                                Err(PullError::RepeatedDbId)?
+                            }
+                            db_id_alias = Some(alias.unwrap_or_else(|| db_id.to_value_rc()));
+                        },
+                        &PullConcreteAttribute::Ident(ref i) => {
+                            if let Some(entid) = schema.get_entid(i) {
+                                let name = alias.unwrap_or_else(|| i.to_value_rc());
+                                names.insert(entid.into(), name);
+                                attrs.insert(entid.into());
+                            }
+                        },
+                        &PullConcreteAttribute::Entid(ref entid) => {
+                            let name = alias.map(Ok).unwrap_or_else(|| lookup_name(entid))?;
+                            names.insert(*entid, name);
+                            attrs.insert(*entid);
+                        },
+                    }
+                },
+            }
+        }
+
+        Ok(Puller {
+            attributes: names,
+            attribute_spec: cache::AttributeSpec::specified(&attrs, schema),
+            db_id_alias,
+        })
+    }
+
+    pub fn pull<E>(&self,
+                   schema: &Schema,
+                   db: &rusqlite::Connection,
+                   entities: E) -> Result<PullResults>
+        where E: IntoIterator<Item=Entid> {
+        // We implement pull by:
+        // - Generating `AttributeCaches` for the provided attributes and entities.
+        //   TODO: it would be nice to invert the cache as we build it, rather than have to invert it here.
+        // - Recursing. (TODO: we'll need AttributeCaches to not overwrite in case of recursion! And
+        //   ideally not do excess work when some entity/attribute pairs are known.)
+        // - Building a structure by walking the pull expression with the caches.
+        // TODO: limits.
+
+        // Build a cache for these attributes and entities.
+        // TODO: use the store's existing cache!
+        let entities: Vec<Entid> = entities.into_iter().collect();
+        let caches = cache::AttributeCaches::make_cache_for_entities_and_attributes(
+            schema,
+            db,
+            self.attribute_spec.clone(),
+            &entities)?;
+
+        // Now construct the appropriate result format.
+        // TODO: should we walk `e` then `a`, or `a` then `e`? Possibly the right answer
+        // is just to collect differently!
+        let mut maps = BTreeMap::new();
+
+        // Collect :db/id if requested.
+        if let Some(ref alias) = self.db_id_alias {
+            for e in entities.iter() {
+                let mut r = maps.entry(*e)
+                                .or_insert(ValueRc::new(StructuredMap::default()));
+                let mut m = ValueRc::get_mut(r).unwrap();
+                m.insert(alias.clone(), Binding::Scalar(TypedValue::Ref(*e)));
+            }
+        }
+
+        for (name, cache) in self.attributes.iter().filter_map(|(a, name)|
+            caches.forward_attribute_cache_for_attribute(schema, *a)
+                  .map(|cache| (name.clone(), cache))) {
+
+            for e in entities.iter() {
+                if let Some(binding) = cache.binding_for_e(*e) {
+                    let mut r = maps.entry(*e)
+                                    .or_insert(ValueRc::new(StructuredMap::default()));
+
+                    // Get into the inner map so we can accumulate a value.
+                    // We can unwrap here because we created all of these maps…
+                    let mut m = ValueRc::get_mut(r).unwrap();
+
+                    m.insert(name.clone(), binding);
+                }
+            }
+        }
+
+        Ok(maps)
+    }
+
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_sql/lib.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_sql/lib.rs.html new file mode 100644 index 00000000..d3a1601b --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_sql/lib.rs.html @@ -0,0 +1,1764 @@ + + + + + + + + + + lib.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+extern crate regex;
+#[macro_use] extern crate mentat_core;
+extern crate mentat_query;
+extern crate mentat_query_algebrizer;
+extern crate mentat_sql;
+
+use std::boxed::Box;
+use mentat_core::{
+    Entid,
+    SQLTypeAffinity,
+    TypedValue,
+    ValueType,
+};
+
+use mentat_query::{
+    Direction,
+    Limit,
+    Variable,
+};
+
+use mentat_query_algebrizer::{
+    Column,
+    OrderBy,
+    QualifiedAlias,
+    QueryValue,
+    SourceAlias,
+    TableAlias,
+    VariableColumn,
+};
+
+use mentat_sql::{
+    BuildQueryResult,
+    QueryBuilder,
+    QueryFragment,
+    SQLError,
+    SQLiteQueryBuilder,
+    SQLQuery,
+};
+
+//---------------------------------------------------------
+// A Mentat-focused representation of a SQL query.
+
+/// One of the things that can appear in a projection or a constraint. Note that we use
+/// `TypedValue` here; it's not pure SQL, but it avoids us having to concern ourselves at this
+/// point with the translation between a `TypedValue` and the storage-layer representation.
+///
+/// Eventually we might allow different translations by providing a different `QueryBuilder`
+/// implementation for each storage backend. Passing `TypedValue`s here allows for that.
+pub enum ColumnOrExpression {
+    Column(QualifiedAlias),
+    ExistingColumn(Name),
+    Entid(Entid),       // Because it's so common.
+    Integer(i32),       // We use these for type codes etc.
+    Long(i64),
+    Value(TypedValue),
+    // Some aggregates (`min`, `max`, `avg`) can be over 0 rows, and therefore can be `NULL`; that
+    // needs special treatment.
+    NullableAggregate(Box<Expression>, ValueType),      // Track the return type.
+    Expression(Box<Expression>, ValueType),             // Track the return type.
+}
+
+pub enum Expression {
+    Unary { sql_op: &'static str, arg: ColumnOrExpression },
+}
+
+/// `QueryValue` and `ColumnOrExpression` are almost identical… merge somehow?
+impl From<QueryValue> for ColumnOrExpression {
+    fn from(v: QueryValue) -> Self {
+        match v {
+            QueryValue::Column(c) => ColumnOrExpression::Column(c),
+            QueryValue::Entid(e) => ColumnOrExpression::Entid(e),
+            QueryValue::PrimitiveLong(v) => ColumnOrExpression::Long(v),
+            QueryValue::TypedValue(v) => ColumnOrExpression::Value(v),
+        }
+    }
+}
+
+pub type Name = String;
+
+pub struct ProjectedColumn(pub ColumnOrExpression, pub Name);
+
+pub enum Projection {
+    Columns(Vec<ProjectedColumn>),
+    Star,
+    One,
+}
+
+#[derive(Debug, PartialEq, Eq)]
+pub enum GroupBy {
+    ProjectedColumn(Name),
+    QueryColumn(QualifiedAlias),
+    // TODO: non-projected expressions, etc.
+}
+
+impl QueryFragment for GroupBy {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult {
+        match self {
+            &GroupBy::ProjectedColumn(ref name) => {
+                out.push_identifier(name.as_str())
+            },
+            &GroupBy::QueryColumn(ref qa) => {
+                qualified_alias_push_sql(out, qa)
+            },
+        }
+    }
+}
+
+#[derive(Copy, Clone)]
+pub struct Op(pub &'static str);      // TODO: we can do better than this!
+
+pub enum Constraint {
+    Infix {
+        op: Op,
+        left: ColumnOrExpression,
+        right: ColumnOrExpression,
+    },
+    Or {
+        constraints: Vec<Constraint>,
+    },
+    And {
+        constraints: Vec<Constraint>,
+    },
+    In {
+        left: ColumnOrExpression,
+        list: Vec<ColumnOrExpression>,
+    },
+    IsNull {
+        value: ColumnOrExpression,
+    },
+    IsNotNull {
+        value: ColumnOrExpression,
+    },
+    NotExists {
+        subquery: TableOrSubquery,
+    },
+    TypeCheck {
+        value: ColumnOrExpression,
+        affinity: SQLTypeAffinity
+    }
+}
+
+impl Constraint {
+    pub fn not_equal(left: ColumnOrExpression, right: ColumnOrExpression) -> Constraint {
+        Constraint::Infix {
+            op: Op("<>"),     // ANSI SQL for future-proofing!
+            left: left,
+            right: right,
+        }
+    }
+
+    pub fn equal(left: ColumnOrExpression, right: ColumnOrExpression) -> Constraint {
+        Constraint::Infix {
+            op: Op("="),
+            left: left,
+            right: right,
+        }
+    }
+
+    pub fn fulltext_match(left: ColumnOrExpression, right: ColumnOrExpression) -> Constraint {
+        Constraint::Infix {
+            op: Op("MATCH"), // SQLite specific!
+            left: left,
+            right: right,
+        }
+    }
+}
+
+#[allow(dead_code)]
+enum JoinOp {
+    Inner,
+}
+
+// Short-hand for a list of tables all inner-joined.
+pub struct TableList(pub Vec<TableOrSubquery>);
+
+impl TableList {
+    fn is_empty(&self) -> bool {
+        self.0.is_empty()
+    }
+}
+
+pub struct Join {
+    left: TableOrSubquery,
+    op: JoinOp,
+    right: TableOrSubquery,
+    // TODO: constraints (ON, USING).
+}
+
+#[allow(dead_code)]
+pub enum TableOrSubquery {
+    Table(SourceAlias),
+    Union(Vec<SelectQuery>, TableAlias),
+    Subquery(Box<SelectQuery>),
+    Values(Values, TableAlias),
+}
+
+pub enum Values {
+    /// Like "VALUES (0, 1), (2, 3), ...".
+    /// The vector must be of a length that is a multiple of the given size.
+    Unnamed(usize, Vec<TypedValue>),
+
+    /// Like "SELECT 0 AS x, SELECT 0 AS y WHERE 0 UNION ALL VALUES (0, 1), (2, 3), ...".
+    /// The vector of values must be of a length that is a multiple of the length
+    /// of the vector of names.
+    Named(Vec<Variable>, Vec<TypedValue>),
+}
+
+pub enum FromClause {
+    TableList(TableList),      // Short-hand for a pile of inner joins.
+    Join(Join),
+    Nothing,
+}
+
+pub struct SelectQuery {
+    pub distinct: bool,
+    pub projection: Projection,
+    pub from: FromClause,
+    pub constraints: Vec<Constraint>,
+    pub group_by: Vec<GroupBy>,
+    pub order: Vec<OrderBy>,
+    pub limit: Limit,
+}
+
+fn push_variable_column(qb: &mut QueryBuilder, vc: &VariableColumn) -> BuildQueryResult {
+    match vc {
+        &VariableColumn::Variable(ref v) => {
+            qb.push_identifier(v.as_str())
+        },
+        &VariableColumn::VariableTypeTag(ref v) => {
+            qb.push_identifier(format!("{}_value_type_tag", v.name()).as_str())
+        },
+    }
+}
+
+fn push_column(qb: &mut QueryBuilder, col: &Column) -> BuildQueryResult {
+    match col {
+        &Column::Fixed(ref d) => {
+            qb.push_sql(d.as_str());
+            Ok(())
+        },
+        &Column::Fulltext(ref d) => {
+            qb.push_sql(d.as_str());
+            Ok(())
+        },
+        &Column::Variable(ref vc) => push_variable_column(qb, vc),
+        &Column::Transactions(ref d) => {
+            qb.push_sql(d.as_str());
+            Ok(())
+        },
+    }
+}
+
+//---------------------------------------------------------
+// Turn that representation into SQL.
+
+impl QueryFragment for ColumnOrExpression {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult {
+        use self::ColumnOrExpression::*;
+        match self {
+            &Column(ref qa) => {
+                qualified_alias_push_sql(out, qa)
+            },
+            &ExistingColumn(ref alias) => {
+                out.push_identifier(alias.as_str())
+            },
+            &Entid(entid) => {
+                out.push_sql(entid.to_string().as_str());
+                Ok(())
+            },
+            &Integer(integer) => {
+                out.push_sql(integer.to_string().as_str());
+                Ok(())
+            },
+            &Long(long) => {
+                out.push_sql(long.to_string().as_str());
+                Ok(())
+            },
+            &Value(ref v) => {
+                out.push_typed_value(v)
+            },
+            &NullableAggregate(ref e, _) |
+            &Expression(ref e, _) => {
+                e.push_sql(out)
+            },
+        }
+    }
+}
+
+impl QueryFragment for Expression {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult {
+        match self {
+            &Expression::Unary { ref sql_op, ref arg } => {
+                out.push_sql(sql_op);              // No need to escape built-ins.
+                out.push_sql("(");
+                arg.push_sql(out)?;
+                out.push_sql(")");
+                Ok(())
+            },
+        }
+    }
+}
+
+impl QueryFragment for Projection {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult {
+        use self::Projection::*;
+        match self {
+            &One => out.push_sql("1"),
+            &Star => out.push_sql("*"),
+            &Columns(ref cols) => {
+                let &ProjectedColumn(ref col, ref alias) = &cols[0];
+                col.push_sql(out)?;
+                out.push_sql(" AS ");
+                out.push_identifier(alias.as_str())?;
+
+                for &ProjectedColumn(ref col, ref alias) in &cols[1..] {
+                    out.push_sql(", ");
+                    col.push_sql(out)?;
+                    out.push_sql(" AS ");
+                    out.push_identifier(alias.as_str())?;
+                }
+            },
+        };
+        Ok(())
+    }
+}
+
+impl QueryFragment for Op {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult {
+        // No escaping needed.
+        out.push_sql(self.0);
+        Ok(())
+    }
+}
+
+impl QueryFragment for Constraint {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult {
+        use self::Constraint::*;
+        match self {
+            &Infix { ref op, ref left, ref right } => {
+                left.push_sql(out)?;
+                out.push_sql(" ");
+                op.push_sql(out)?;
+                out.push_sql(" ");
+                right.push_sql(out)
+            },
+
+            &IsNull { ref value } => {
+                value.push_sql(out)?;
+                out.push_sql(" IS NULL");
+                Ok(())
+            },
+
+            &IsNotNull { ref value } => {
+                value.push_sql(out)?;
+                out.push_sql(" IS NOT NULL");
+                Ok(())
+            },
+
+            &And { ref constraints } => {
+                // An empty intersection is true.
+                if constraints.is_empty() {
+                    out.push_sql("1");
+                    return Ok(())
+                }
+                out.push_sql("(");
+                interpose!(constraint, constraints,
+                           { constraint.push_sql(out)? },
+                           { out.push_sql(" AND ") });
+                out.push_sql(")");
+                Ok(())
+            },
+
+            &Or { ref constraints } => {
+                // An empty alternation is false.
+                if constraints.is_empty() {
+                    out.push_sql("0");
+                    return Ok(())
+                }
+                out.push_sql("(");
+                interpose!(constraint, constraints,
+                           { constraint.push_sql(out)? },
+                           { out.push_sql(" OR ") });
+                out.push_sql(")");
+                Ok(())
+            }
+
+            &In { ref left, ref list } => {
+                left.push_sql(out)?;
+                out.push_sql(" IN (");
+                interpose!(item, list,
+                           { item.push_sql(out)? },
+                           { out.push_sql(", ") });
+                out.push_sql(")");
+                Ok(())
+            },
+            &NotExists { ref subquery } => {
+                out.push_sql("NOT EXISTS ");
+                subquery.push_sql(out)
+            },
+            &TypeCheck { ref value, ref affinity } => {
+                out.push_sql("typeof(");
+                value.push_sql(out)?;
+                out.push_sql(") = ");
+                out.push_sql(match *affinity {
+                    SQLTypeAffinity::Null => "'null'",
+                    SQLTypeAffinity::Integer => "'integer'",
+                    SQLTypeAffinity::Real => "'real'",
+                    SQLTypeAffinity::Text => "'text'",
+                    SQLTypeAffinity::Blob => "'blob'",
+                });
+                Ok(())
+            },
+        }
+    }
+}
+
+impl QueryFragment for JoinOp {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult {
+        out.push_sql(" JOIN ");
+        Ok(())
+    }
+}
+
+// We don't own QualifiedAlias or QueryFragment, so we can't implement the trait.
+fn qualified_alias_push_sql(out: &mut QueryBuilder, qa: &QualifiedAlias) -> BuildQueryResult {
+    out.push_identifier(qa.0.as_str())?;
+    out.push_sql(".");
+    push_column(out, &qa.1)
+}
+
+// We don't own SourceAlias or QueryFragment, so we can't implement the trait.
+fn source_alias_push_sql(out: &mut QueryBuilder, sa: &SourceAlias) -> BuildQueryResult {
+    let &SourceAlias(ref table, ref alias) = sa;
+    out.push_identifier(table.name())?;
+    out.push_sql(" AS ");
+    out.push_identifier(alias.as_str())
+}
+
+impl QueryFragment for TableList {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult {
+        if self.0.is_empty() {
+            return Ok(());
+        }
+
+        interpose!(t, self.0,
+                   { t.push_sql(out)? },
+                   { out.push_sql(", ") });
+        Ok(())
+    }
+}
+
+impl QueryFragment for Join {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult {
+        self.left.push_sql(out)?;
+        self.op.push_sql(out)?;
+        self.right.push_sql(out)
+    }
+}
+
+impl QueryFragment for TableOrSubquery {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult {
+        use self::TableOrSubquery::*;
+        match self {
+            &Table(ref sa) => source_alias_push_sql(out, sa),
+            &Union(ref subqueries, ref table_alias) => {
+                out.push_sql("(");
+                interpose!(subquery, subqueries,
+                           { subquery.push_sql(out)? },
+                           { out.push_sql(" UNION ") });
+                out.push_sql(") AS ");
+                out.push_identifier(table_alias.as_str())
+            },
+            &Subquery(ref subquery) => {
+                out.push_sql("(");
+                subquery.push_sql(out)?;
+                out.push_sql(")");
+                Ok(())
+            },
+            &Values(ref values, ref table_alias) => {
+                // XXX: does this work for Values::Unnamed?
+                out.push_sql("(");
+                values.push_sql(out)?;
+                out.push_sql(") AS ");
+                out.push_identifier(table_alias.as_str())
+            },
+        }
+    }
+}
+
+impl QueryFragment for Values {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult {
+        // There are at least 3 ways to name the columns of a VALUES table:
+        // 1) the columns are named "", ":1", ":2", ... -- but this is undocumented.  See
+        //    http://stackoverflow.com/a/40921724.
+        // 2) A CTE ("WITH" statement) can declare the shape of the table, like "WITH
+        //    table_name(column_name, ...) AS (VALUES ...)".
+        // 3) We can "UNION ALL" a dummy "SELECT" statement in place.
+        //
+        // We don't want to use an undocumented SQLite quirk, and we're a little concerned that some
+        // SQL systems will not optimize WITH statements well.  It's also convenient to have an in
+        // place table to query, so for now we implement option 3.
+        if let &Values::Named(ref names, _) = self {
+            out.push_sql("SELECT ");
+            interpose!(alias, names,
+                       { out.push_sql("0 AS ");
+                         out.push_identifier(alias.as_str())? },
+                       { out.push_sql(", ") });
+
+            out.push_sql(" WHERE 0 UNION ALL ");
+        }
+
+        let values = match self {
+            &Values::Named(ref names, ref values) => values.chunks(names.len()),
+            &Values::Unnamed(ref size, ref values) => values.chunks(*size),
+        };
+
+        out.push_sql("VALUES ");
+
+        interpose_iter!(outer, values,
+                        { out.push_sql("(");
+                          interpose!(inner, outer,
+                                     { out.push_typed_value(inner)? },
+                                     { out.push_sql(", ") });
+                          out.push_sql(")");
+                        },
+                        { out.push_sql(", ") });
+        Ok(())
+    }
+}
+
+impl QueryFragment for FromClause {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult {
+        use self::FromClause::*;
+        match self {
+            &TableList(ref table_list) => {
+                if table_list.is_empty() {
+                    Ok(())
+                } else {
+                    out.push_sql(" FROM ");
+                    table_list.push_sql(out)
+                }
+            },
+            &Join(ref join) => {
+                out.push_sql(" FROM ");
+                join.push_sql(out)
+            },
+            &Nothing => Ok(()),
+        }
+    }
+}
+
+impl SelectQuery {
+    fn push_variable_param(&self, var: &Variable, out: &mut QueryBuilder) -> BuildQueryResult {
+        // `var` is something like `?foo99-people`.
+        // Trim the `?` and escape the rest. Prepend `i` to distinguish from
+        // the inline value space `v`.
+        let re = regex::Regex::new("[^a-zA-Z_0-9]").unwrap();
+        let without_question = var.as_str().split_at(1).1;
+        let replaced = re.replace_all(without_question, "_");
+        let bind_param = format!("i{}", replaced);                 // We _could_ avoid this copying.
+        out.push_bind_param(bind_param.as_str())
+    }
+}
+
+impl QueryFragment for SelectQuery {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult {
+        if self.distinct {
+            out.push_sql("SELECT DISTINCT ");
+        } else {
+            out.push_sql("SELECT ");
+        }
+        self.projection.push_sql(out)?;
+        self.from.push_sql(out)?;
+
+        if !self.constraints.is_empty() {
+            out.push_sql(" WHERE ");
+            interpose!(constraint, self.constraints,
+                       { constraint.push_sql(out)? },
+                       { out.push_sql(" AND ") });
+        }
+
+        match &self.group_by {
+            group_by if !group_by.is_empty() => {
+                out.push_sql(" GROUP BY ");
+                interpose!(group, group_by,
+                           { group.push_sql(out)? },
+                           { out.push_sql(", ") });
+            },
+            _ => {},
+        }
+
+        if !self.order.is_empty() {
+            out.push_sql(" ORDER BY ");
+            interpose!(&OrderBy(ref dir, ref var), self.order,
+                       { push_variable_column(out, var)?;
+                         match dir {
+                             &Direction::Ascending => { out.push_sql(" ASC"); },
+                             &Direction::Descending => { out.push_sql(" DESC"); },
+                         };
+                       },
+                       { out.push_sql(", ") });
+        }
+
+        match &self.limit {
+            &Limit::None => (),
+            &Limit::Fixed(limit) => {
+                // Guaranteed to be non-negative: u64.
+                out.push_sql(" LIMIT ");
+                out.push_sql(limit.to_string().as_str());
+            },
+            &Limit::Variable(ref var) => {
+                // Guess this wasn't bound yet. Produce an argument.
+                out.push_sql(" LIMIT ");
+                self.push_variable_param(var, out)?;
+            },
+        }
+
+        Ok(())
+    }
+}
+
+impl SelectQuery {
+    pub fn to_sql_query(&self) -> Result<SQLQuery, SQLError> {
+        let mut builder = SQLiteQueryBuilder::new();
+        self.push_sql(&mut builder).map(|_| builder.finish())
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use std::rc::Rc;
+
+    use mentat_query_algebrizer::{
+        Column,
+        DatomsColumn,
+        DatomsTable,
+        FulltextColumn,
+    };
+
+    fn build_query(c: &QueryFragment) -> SQLQuery {
+        let mut builder = SQLiteQueryBuilder::new();
+        c.push_sql(&mut builder)
+         .map(|_| builder.finish())
+         .expect("to produce a query for the given constraint")
+    }
+
+    fn build(c: &QueryFragment) -> String {
+        build_query(c).sql
+    }
+
+    #[test]
+    fn test_in_constraint() {
+        let none = Constraint::In {
+            left: ColumnOrExpression::Column(QualifiedAlias::new("datoms01".to_string(), Column::Fixed(DatomsColumn::Value))),
+            list: vec![],
+        };
+
+        let one = Constraint::In {
+            left: ColumnOrExpression::Column(QualifiedAlias::new("datoms01".to_string(), DatomsColumn::Value)),
+            list: vec![
+                ColumnOrExpression::Entid(123),
+            ],
+        };
+
+        let three = Constraint::In {
+            left: ColumnOrExpression::Column(QualifiedAlias::new("datoms01".to_string(), DatomsColumn::Value)),
+            list: vec![
+                ColumnOrExpression::Entid(123),
+                ColumnOrExpression::Entid(456),
+                ColumnOrExpression::Entid(789),
+            ],
+        };
+
+        assert_eq!("`datoms01`.v IN ()", build(&none));
+        assert_eq!("`datoms01`.v IN (123)", build(&one));
+        assert_eq!("`datoms01`.v IN (123, 456, 789)", build(&three));
+    }
+
+    #[test]
+    fn test_and_constraint() {
+        let c = Constraint::And {
+            constraints: vec![
+                Constraint::And {
+                    constraints: vec![
+                        Constraint::Infix {
+                            op: Op("="),
+                            left: ColumnOrExpression::Entid(123),
+                            right: ColumnOrExpression::Entid(456),
+                        },
+                        Constraint::Infix {
+                            op: Op("="),
+                            left: ColumnOrExpression::Entid(789),
+                            right: ColumnOrExpression::Entid(246),
+                        },
+                    ],
+                },
+            ],
+        };
+
+        // Two sets of parens: the outermost AND only has one child,
+        // but still contributes parens.
+        assert_eq!("((123 = 456 AND 789 = 246))", build(&c));
+    }
+
+    #[test]
+    fn test_unnamed_values() {
+        let build = |len, values| build(&Values::Unnamed(len, values));
+
+        assert_eq!(build(1, vec![TypedValue::Long(1)]),
+                   "VALUES (1)");
+
+        assert_eq!(build(2, vec![TypedValue::Boolean(false), TypedValue::Long(1)]),
+                   "VALUES (0, 1)");
+
+        assert_eq!(build(2, vec![TypedValue::Boolean(false), TypedValue::Long(1),
+                                 TypedValue::Boolean(true), TypedValue::Long(2)]),
+                   "VALUES (0, 1), (1, 2)");
+    }
+
+    #[test]
+    fn test_named_values() {
+        let build = |names: Vec<_>, values| build(&Values::Named(names.into_iter().map(Variable::from_valid_name).collect(), values));
+        assert_eq!(build(vec!["?a"], vec![TypedValue::Long(1)]),
+                   "SELECT 0 AS `?a` WHERE 0 UNION ALL VALUES (1)");
+
+        assert_eq!(build(vec!["?a", "?b"], vec![TypedValue::Boolean(false), TypedValue::Long(1)]),
+                   "SELECT 0 AS `?a`, 0 AS `?b` WHERE 0 UNION ALL VALUES (0, 1)");
+
+        assert_eq!(build(vec!["?a", "?b"],
+                         vec![TypedValue::Boolean(false), TypedValue::Long(1),
+                              TypedValue::Boolean(true), TypedValue::Long(2)]),
+                   "SELECT 0 AS `?a`, 0 AS `?b` WHERE 0 UNION ALL VALUES (0, 1), (1, 2)");
+    }
+
+    #[test]
+    fn test_matches_constraint() {
+        let c = Constraint::Infix {
+            op: Op("MATCHES"),
+            left: ColumnOrExpression::Column(QualifiedAlias("fulltext01".to_string(), Column::Fulltext(FulltextColumn::Text))),
+            right: ColumnOrExpression::Value("needle".into()),
+        };
+        let q = build_query(&c);
+        assert_eq!("`fulltext01`.text MATCHES $v0", q.sql);
+        assert_eq!(vec![("$v0".to_string(), Rc::new(mentat_sql::Value::Text("needle".to_string())))], q.args);
+
+        let c = Constraint::Infix {
+            op: Op("="),
+            left: ColumnOrExpression::Column(QualifiedAlias("fulltext01".to_string(), Column::Fulltext(FulltextColumn::Rowid))),
+            right: ColumnOrExpression::Column(QualifiedAlias("datoms02".to_string(), Column::Fixed(DatomsColumn::Value))),
+        };
+        assert_eq!("`fulltext01`.rowid = `datoms02`.v", build(&c));
+    }
+
+    #[test]
+    fn test_end_to_end() {
+        // [:find ?x :where [?x 65537 ?v] [?x 65536 ?v]]
+        let datoms00 = "datoms00".to_string();
+        let datoms01 = "datoms01".to_string();
+        let eq = Op("=");
+        let source_aliases = vec![
+            TableOrSubquery::Table(SourceAlias(DatomsTable::Datoms, datoms00.clone())),
+            TableOrSubquery::Table(SourceAlias(DatomsTable::Datoms, datoms01.clone())),
+        ];
+
+        let mut query = SelectQuery {
+            distinct: true,
+            projection: Projection::Columns(
+                            vec![
+                                ProjectedColumn(
+                                    ColumnOrExpression::Column(QualifiedAlias::new(datoms00.clone(), DatomsColumn::Entity)),
+                                    "x".to_string()),
+                            ]),
+            from: FromClause::TableList(TableList(source_aliases)),
+            constraints: vec![
+                Constraint::Infix {
+                    op: eq.clone(),
+                    left: ColumnOrExpression::Column(QualifiedAlias::new(datoms01.clone(), DatomsColumn::Value)),
+                    right: ColumnOrExpression::Column(QualifiedAlias::new(datoms00.clone(), DatomsColumn::Value)),
+                },
+                Constraint::Infix {
+                    op: eq.clone(),
+                    left: ColumnOrExpression::Column(QualifiedAlias::new(datoms00.clone(), DatomsColumn::Attribute)),
+                    right: ColumnOrExpression::Entid(65537),
+                },
+                Constraint::Infix {
+                    op: eq.clone(),
+                    left: ColumnOrExpression::Column(QualifiedAlias::new(datoms01.clone(), DatomsColumn::Attribute)),
+                    right: ColumnOrExpression::Entid(65536),
+                },
+            ],
+            group_by: vec![],
+            order: vec![],
+            limit: Limit::None,
+        };
+
+        let SQLQuery { sql, args } = query.to_sql_query().unwrap();
+        println!("{}", sql);
+        assert_eq!("SELECT DISTINCT `datoms00`.e AS `x` FROM `datoms` AS `datoms00`, `datoms` AS `datoms01` WHERE `datoms01`.v = `datoms00`.v AND `datoms00`.a = 65537 AND `datoms01`.a = 65536", sql);
+        assert!(args.is_empty());
+
+        // And without distinct…
+        query.distinct = false;
+        let SQLQuery { sql, args } = query.to_sql_query().unwrap();
+        println!("{}", sql);
+        assert_eq!("SELECT `datoms00`.e AS `x` FROM `datoms` AS `datoms00`, `datoms` AS `datoms01` WHERE `datoms01`.v = `datoms00`.v AND `datoms00`.a = 65537 AND `datoms01`.a = 65536", sql);
+        assert!(args.is_empty());
+
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_translator/lib.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_translator/lib.rs.html new file mode 100644 index 00000000..8c0d0080 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_translator/lib.rs.html @@ -0,0 +1,190 @@ + + + + + + + + + + lib.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+extern crate failure;
+extern crate mentat_core;
+extern crate mentat_query;
+extern crate mentat_query_algebrizer;
+extern crate mentat_query_projector;
+extern crate mentat_query_sql;
+extern crate mentat_sql;
+
+use failure::Error;
+
+mod translate;
+
+pub use mentat_query_sql::{
+    Projection,
+};
+
+pub use translate::{
+    ProjectedSelect,
+    cc_to_exists,
+    query_to_select,
+};
+
+type Result<T> = std::result::Result<T, Error>;
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_query_translator/translate.rs.html b/docs/apis/rust/0.7.0/src/mentat_query_translator/translate.rs.html new file mode 100644 index 00000000..7355658c --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_query_translator/translate.rs.html @@ -0,0 +1,1174 @@ + + + + + + + + + + translate.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use mentat_core::{
+    Schema,
+    SQLTypeAffinity,
+    SQLValueType,
+    SQLValueTypeSet,
+    TypedValue,
+    ValueType,
+    ValueTypeTag,
+    ValueTypeSet,
+};
+
+use mentat_core::util::{
+    Either,
+};
+
+use mentat_query::{
+    Limit,
+};
+
+use mentat_query_algebrizer::{
+    AlgebraicQuery,
+    ColumnAlternation,
+    ColumnConstraint,
+    ColumnConstraintOrAlternation,
+    ColumnIntersection,
+    ColumnName,
+    ComputedTable,
+    ConjoiningClauses,
+    DatomsColumn,
+    DatomsTable,
+    OrderBy,
+    QualifiedAlias,
+    QueryValue,
+    SourceAlias,
+    TableAlias,
+    VariableColumn,
+};
+
+use mentat_query_projector::{
+    CombinedProjection,
+    ConstantProjector,
+    Projector,
+    projected_column_for_var,
+    query_projection,
+};
+
+use mentat_query_sql::{
+    ColumnOrExpression,
+    Constraint,
+    FromClause,
+    GroupBy,
+    Op,
+    ProjectedColumn,
+    Projection,
+    SelectQuery,
+    TableList,
+    TableOrSubquery,
+    Values,
+};
+
+use std::collections::HashMap;
+
+use super::Result;
+
+trait ToConstraint {
+    fn to_constraint(self) -> Constraint;
+}
+
+trait ToColumn {
+    fn to_column(self) -> ColumnOrExpression;
+}
+
+impl ToColumn for QualifiedAlias {
+    fn to_column(self) -> ColumnOrExpression {
+        ColumnOrExpression::Column(self)
+    }
+}
+
+impl ToConstraint for ColumnIntersection {
+    fn to_constraint(self) -> Constraint {
+        Constraint::And {
+            constraints: self.into_iter().map(|x| x.to_constraint()).collect()
+        }
+    }
+}
+
+impl ToConstraint for ColumnAlternation {
+    fn to_constraint(self) -> Constraint {
+        Constraint::Or {
+            constraints: self.into_iter().map(|x| x.to_constraint()).collect()
+        }
+    }
+}
+
+impl ToConstraint for ColumnConstraintOrAlternation {
+    fn to_constraint(self) -> Constraint {
+        use self::ColumnConstraintOrAlternation::*;
+        match self {
+            Alternation(alt) => alt.to_constraint(),
+            Constraint(c) => c.to_constraint(),
+        }
+    }
+}
+
+fn affinity_count(tag: i32) -> usize {
+    ValueTypeSet::any().into_iter()
+                       .filter(|t| t.value_type_tag() == tag)
+                       .count()
+}
+
+fn type_constraint(table: &TableAlias, tag: i32, to_check: Option<Vec<SQLTypeAffinity>>) -> Constraint {
+    let type_column = QualifiedAlias::new(table.clone(),
+                                          DatomsColumn::ValueTypeTag).to_column();
+    let check_type_tag = Constraint::equal(type_column, ColumnOrExpression::Integer(tag));
+    if let Some(affinities) = to_check {
+        let check_affinities = Constraint::Or {
+            constraints: affinities.into_iter().map(|affinity| {
+                Constraint::TypeCheck {
+                    value: QualifiedAlias::new(table.clone(),
+                                               DatomsColumn::Value).to_column(),
+                    affinity,
+                }
+            }).collect()
+        };
+        Constraint::And {
+            constraints: vec![
+                check_type_tag,
+                check_affinities
+            ]
+        }
+    } else {
+        check_type_tag
+    }
+}
+
+// Returns a map of tags to a vector of all the possible affinities that those tags can represent
+// given the types in `value_types`.
+fn possible_affinities(value_types: ValueTypeSet) -> HashMap<ValueTypeTag, Vec<SQLTypeAffinity>> {
+    let mut result = HashMap::with_capacity(value_types.len());
+    for ty in value_types {
+        let (tag, affinity_to_check) = ty.sql_representation();
+        let affinities = result.entry(tag).or_insert_with(Vec::new);
+        if let Some(affinity) = affinity_to_check {
+            affinities.push(affinity);
+        }
+    }
+    result
+}
+
+impl ToConstraint for ColumnConstraint {
+    fn to_constraint(self) -> Constraint {
+        use self::ColumnConstraint::*;
+        match self {
+            Equals(qa, QueryValue::Entid(entid)) =>
+                Constraint::equal(qa.to_column(), ColumnOrExpression::Entid(entid)),
+
+            Equals(qa, QueryValue::TypedValue(tv)) =>
+                Constraint::equal(qa.to_column(), ColumnOrExpression::Value(tv)),
+
+            Equals(left, QueryValue::Column(right)) =>
+                Constraint::equal(left.to_column(), right.to_column()),
+
+            Equals(qa, QueryValue::PrimitiveLong(value)) => {
+                let tag_column = qa.for_associated_type_tag().expect("an associated type tag alias").to_column();
+                let value_column = qa.to_column();
+
+                // A bare long in a query might match a ref, an instant, a long (obviously), or a
+                // double. If it's negative, it can't match a ref, but that's OK -- it won't!
+                //
+                // However, '1' and '0' are used to represent booleans, and some integers are also
+                // used to represent FTS values. We don't want to accidentally match those.
+                //
+                // We ask `SQLValueType` whether this value is in range for how booleans are
+                // represented in the database.
+                //
+                // We only hit this code path when the attribute is unknown, so we're querying
+                // `all_datoms`. That means we don't see FTS IDs at all -- they're transparently
+                // replaced by their strings. If that changes, then you should also exclude the
+                // string type code (10) here.
+                let must_exclude_boolean = ValueType::Boolean.accommodates_integer(value);
+                if must_exclude_boolean {
+                    Constraint::And {
+                        constraints: vec![
+                            Constraint::equal(value_column,
+                                              ColumnOrExpression::Value(TypedValue::Long(value))),
+                            Constraint::not_equal(tag_column,
+                                                  ColumnOrExpression::Integer(ValueType::Boolean.value_type_tag())),
+                        ],
+                    }
+                } else {
+                    Constraint::equal(value_column, ColumnOrExpression::Value(TypedValue::Long(value)))
+                }
+            },
+
+            Inequality { operator, left, right } => {
+                Constraint::Infix {
+                    op: Op(operator.to_sql_operator()),
+                    left: left.into(),
+                    right: right.into(),
+                }
+            },
+
+            Matches(left, right) => {
+                Constraint::Infix {
+                    op: Op("MATCH"),
+                    left: ColumnOrExpression::Column(left),
+                    right: right.into(),
+                }
+            },
+            HasTypes { value: table, value_types, check_value } => {
+                let constraints = if check_value {
+                    possible_affinities(value_types)
+                        .into_iter()
+                        .map(|(tag, affinities)| {
+                            let to_check = if affinities.is_empty() || affinities.len() == affinity_count(tag) {
+                                None
+                            } else {
+                                Some(affinities)
+                            };
+                            type_constraint(&table, tag, to_check)
+                        }).collect()
+                } else {
+                    value_types.into_iter()
+                               .map(|vt| type_constraint(&table, vt.value_type_tag(), None))
+                               .collect()
+                };
+                Constraint::Or { constraints }
+            },
+
+            NotExists(computed_table) => {
+                let subquery = table_for_computed(computed_table, TableAlias::new());
+                Constraint::NotExists {
+                    subquery: subquery,
+                }
+            },
+        }
+    }
+}
+
+pub enum ProjectedSelect {
+    Constant(ConstantProjector),
+    Query {
+        query: SelectQuery,
+        projector: Box<Projector>,
+    },
+}
+
+// Nasty little hack to let us move out of indexed context.
+struct ConsumableVec<T> {
+    inner: Vec<Option<T>>,
+}
+
+impl<T> From<Vec<T>> for ConsumableVec<T> {
+    fn from(vec: Vec<T>) -> ConsumableVec<T> {
+        ConsumableVec { inner: vec.into_iter().map(|x| Some(x)).collect() }
+    }
+}
+
+impl<T> ConsumableVec<T> {
+    fn take_dangerously(&mut self, i: usize) -> T {
+        ::std::mem::replace(&mut self.inner[i], None).expect("each value to only be fetched once")
+    }
+}
+
+fn table_for_computed(computed: ComputedTable, alias: TableAlias) -> TableOrSubquery {
+    match computed {
+        ComputedTable::Union {
+            projection, type_extraction, arms,
+        } => {
+            // The projection list for each CC must have the same shape and the same names.
+            // The values we project might be fixed or they might be columns.
+            TableOrSubquery::Union(
+                arms.into_iter()
+                    .map(|cc| {
+                        // We're going to end up with the variables being projected and also some
+                        // type tag columns.
+                        let mut columns: Vec<ProjectedColumn> = Vec::with_capacity(projection.len() + type_extraction.len());
+
+                        // For each variable, find out which column it maps to within this arm, and
+                        // project it as the variable name.
+                        // E.g., SELECT datoms03.v AS `?x`.
+                        for var in projection.iter() {
+                            // TODO: chain results out.
+                            let (projected_column, type_set) = projected_column_for_var(var, &cc).expect("every var to be bound");
+                            columns.push(projected_column);
+
+                            // Similarly, project type tags if they're not known conclusively in the
+                            // outer query.
+                            // Assumption: we'll never need to project a tag without projecting the value of a variable.
+                            if type_extraction.contains(var) {
+                                let expression =
+                                    if let Some(tag) = type_set.unique_type_tag() {
+                                        // If we know the type for sure, just project the constant.
+                                        // SELECT datoms03.v AS `?x`, 10 AS `?x_value_type_tag`
+                                        ColumnOrExpression::Integer(tag)
+                                    } else {
+                                        // Otherwise, we'll have an established type binding! This'll be
+                                        // either a datoms table or, recursively, a subquery. Project
+                                        // this:
+                                        // SELECT datoms03.v AS `?x`,
+                                        //        datoms03.value_type_tag AS `?x_value_type_tag`
+                                        let extract = cc.extracted_types
+                                                        .get(var)
+                                                        .expect("Expected variable to have a known type or an extracted type");
+                                        ColumnOrExpression::Column(extract.clone())
+                                    };
+                                let type_column = VariableColumn::VariableTypeTag(var.clone());
+                                let proj = ProjectedColumn(expression, type_column.column_name());
+                                columns.push(proj);
+                            }
+                        }
+
+                        // Each arm simply turns into a subquery.
+                        // The SQL translation will stuff "UNION" between each arm.
+                        let projection = Projection::Columns(columns);
+                        cc_to_select_query(projection, cc, false, vec![], None, Limit::None)
+                  }).collect(),
+                alias)
+        },
+        ComputedTable::Subquery(subquery) => {
+            TableOrSubquery::Subquery(Box::new(cc_to_exists(subquery)))
+        },
+        ComputedTable::NamedValues {
+            names, values,
+        } => {
+            // We assume column homogeneity, so we won't have any type tag columns.
+            TableOrSubquery::Values(Values::Named(names, values), alias)
+        },
+    }
+}
+
+fn empty_query() -> SelectQuery {
+    SelectQuery {
+        distinct: false,
+        projection: Projection::One,
+        from: FromClause::Nothing,
+        group_by: vec![],
+        constraints: vec![],
+        order: vec![],
+        limit: Limit::None,
+    }
+}
+
+/// Returns a `SelectQuery` that queries for the provided `cc`. Note that this _always_ returns a
+/// query that runs SQL. The next level up the call stack can check for known-empty queries if
+/// needed.
+fn cc_to_select_query(projection: Projection,
+                      cc: ConjoiningClauses,
+                      distinct: bool,
+                      group_by: Vec<GroupBy>,
+                      order: Option<Vec<OrderBy>>,
+                      limit: Limit) -> SelectQuery {
+    let from = if cc.from.is_empty() {
+        FromClause::Nothing
+    } else {
+        // Move these out of the CC.
+        let from = cc.from;
+        let mut computed: ConsumableVec<_> = cc.computed_tables.into();
+
+        // Why do we put computed tables directly into the `FROM` clause? The alternative is to use
+        // a CTE (`WITH`). They're typically equivalent, but some SQL systems (notably Postgres)
+        // treat CTEs as optimization barriers, so a `WITH` can be significantly slower. Given that
+        // this is easy enough to change later, we'll opt for using direct inclusion in `FROM`.
+        let tables =
+            from.into_iter().map(|source_alias| {
+                match source_alias {
+                    SourceAlias(DatomsTable::Computed(i), alias) => {
+                        let comp = computed.take_dangerously(i);
+                        table_for_computed(comp, alias)
+                    },
+                    _ => {
+                        TableOrSubquery::Table(source_alias)
+                    }
+                }
+            });
+
+        FromClause::TableList(TableList(tables.collect()))
+    };
+
+    let order = order.map_or(vec![], |vec| { vec.into_iter().map(|o| o.into()).collect() });
+    let limit = if cc.empty_because.is_some() { Limit::Fixed(0) } else { limit };
+    SelectQuery {
+        distinct: distinct,
+        projection: projection,
+        from: from,
+        group_by: group_by,
+        constraints: cc.wheres
+                       .into_iter()
+                       .map(|c| c.to_constraint())
+                       .collect(),
+        order: order,
+        limit: limit,
+    }
+}
+
+/// Return a query that projects `1` if the `cc` matches the store, and returns no results
+/// if it doesn't.
+pub fn cc_to_exists(cc: ConjoiningClauses) -> SelectQuery {
+    if cc.is_known_empty() {
+        // In this case we can produce a very simple query that returns no results.
+        empty_query()
+    } else {
+        cc_to_select_query(Projection::One, cc, false, vec![], None, Limit::None)
+    }
+}
+
+/// Take a query and wrap it as a subquery of a new query with the provided projection list.
+/// All limits, ordering, and grouping move to the outer query. The inner query is marked as
+/// distinct.
+fn re_project(mut inner: SelectQuery, projection: Projection) -> SelectQuery {
+    let outer_distinct = inner.distinct;
+    inner.distinct = true;
+    let group_by = inner.group_by;
+    inner.group_by = vec![];
+    let order_by = inner.order;
+    inner.order = vec![];
+    let limit = inner.limit;
+    inner.limit = Limit::None;
+
+    use self::Projection::*;
+
+    let nullable = match &projection {
+        &Columns(ref columns) => {
+            columns.iter().filter_map(|pc| {
+                match pc {
+                    &ProjectedColumn(ColumnOrExpression::NullableAggregate(_, _), ref name) => {
+                        Some(Constraint::IsNotNull {
+                            value: ColumnOrExpression::ExistingColumn(name.clone()),
+                        })
+                    },
+                    _ => None,
+                }
+            }).collect()
+        },
+        &Star => vec![],
+        &One => vec![],
+    };
+
+    if nullable.is_empty() {
+        return SelectQuery {
+            distinct: outer_distinct,
+            projection: projection,
+            from: FromClause::TableList(TableList(vec![TableOrSubquery::Subquery(Box::new(inner))])),
+            constraints: vec![],
+            group_by: group_by,
+            order: order_by,
+            limit: limit,
+        };
+    }
+
+    // Our pattern is `SELECT * FROM (SELECT ...) WHERE (nullable aggregate) IS NOT NULL`.  If
+    // there's an `ORDER BY` in the subselect, SQL does not guarantee that the outer select will
+    // respect that order.  But `ORDER BY` is relevant to the subselect when we have a `LIMIT`.
+    // Thus we lift the `ORDER BY` if there’s no `LIMIT` in the subselect, and repeat the `ORDER BY`
+    // if there is.
+    let subselect = SelectQuery {
+        distinct: outer_distinct,
+        projection: projection,
+        from: FromClause::TableList(TableList(vec![TableOrSubquery::Subquery(Box::new(inner))])),
+        constraints: vec![],
+        group_by: group_by,
+        order: match &limit {
+            &Limit::None => vec![],
+            &Limit::Fixed(_) | &Limit::Variable(_) => order_by.clone(),
+        },
+        limit,
+    };
+
+    SelectQuery {
+        distinct: false,
+        projection: Projection::Star,
+        from: FromClause::TableList(TableList(vec![TableOrSubquery::Subquery(Box::new(subselect))])),
+        constraints: nullable,
+        group_by: vec![],
+        order: order_by,
+        limit: Limit::None, // Any limiting comes from the internal query.
+    }
+}
+
+/// Consume a provided `AlgebraicQuery` to yield a new
+/// `ProjectedSelect`.
+pub fn query_to_select(schema: &Schema, query: AlgebraicQuery) -> Result<ProjectedSelect> {
+    // TODO: we can't pass `query.limit` here if we aggregate during projection.
+    // SQL-based aggregation -- `SELECT SUM(datoms00.e)` -- is fine.
+    query_projection(schema, &query).map(|e| match e {
+        Either::Left(constant) => ProjectedSelect::Constant(constant),
+        Either::Right(CombinedProjection {
+            sql_projection,
+            pre_aggregate_projection,
+            datalog_projector,
+            distinct,
+            group_by_cols,
+        }) => {
+            ProjectedSelect::Query {
+                query: match pre_aggregate_projection {
+                    // If we know we need a nested query for aggregation, build that first.
+                    Some(pre_aggregate) => {
+                        let inner = cc_to_select_query(pre_aggregate,
+                                                       query.cc,
+                                                       distinct,
+                                                       group_by_cols,
+                                                       query.order,
+                                                       query.limit);
+                        let outer = re_project(inner, sql_projection);
+                        outer
+                    },
+                    None => {
+                        cc_to_select_query(sql_projection, query.cc, distinct, group_by_cols, query.order, query.limit)
+                    },
+                },
+                projector: datalog_projector,
+            }
+        },
+    }).map_err(|e| e.into())
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_sql/lib.rs.html b/docs/apis/rust/0.7.0/src/mentat_sql/lib.rs.html new file mode 100644 index 00000000..30ff3a59 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_sql/lib.rs.html @@ -0,0 +1,670 @@ + + + + + + + + + + lib.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+
+// Copyright 2016 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+extern crate failure;
+
+#[macro_use] extern crate failure_derive;
+extern crate ordered_float;
+extern crate rusqlite;
+
+extern crate mentat_core;
+
+use std::rc::Rc;
+
+use std::collections::HashMap;
+
+use ordered_float::OrderedFloat;
+
+use mentat_core::{
+    ToMicros,
+    TypedValue,
+    ValueRc,
+};
+
+pub use rusqlite::types::Value;
+
+#[derive(Debug, Fail)]
+pub enum SQLError {
+    #[fail(display = "invalid parameter name: {}", _0)]
+    InvalidParameterName(String),
+
+    #[fail(display = "parameter name could be generated: '{}'", _0)]
+    BindParamCouldBeGenerated(String)
+}
+
+pub type BuildQueryResult = Result<(), SQLError>;
+
+/// We want to accumulate values that will later be substituted into a SQL statement execution.
+/// This struct encapsulates the generated string and the _initial_ argument list.
+/// Additional user-supplied argument bindings, with their placeholders accumulated via
+/// `push_bind_param`, will be appended to this argument list.
+pub struct SQLQuery {
+    pub sql: String,
+
+    /// These will eventually perhaps be rusqlite `ToSql` instances.
+    pub args: Vec<(String, Rc<rusqlite::types::Value>)>,
+}
+
+/// Gratefully based on Diesel's QueryBuilder trait:
+/// https://github.com/diesel-rs/diesel/blob/4885f61b8205f7f3c2cfa03837ed6714831abe6b/diesel/src/query_builder/mod.rs#L56
+pub trait QueryBuilder {
+    fn push_sql(&mut self, sql: &str);
+    fn push_identifier(&mut self, identifier: &str) -> BuildQueryResult;
+    fn push_typed_value(&mut self, value: &TypedValue) -> BuildQueryResult;
+    fn push_bind_param(&mut self, name: &str) -> BuildQueryResult;
+    fn finish(self) -> SQLQuery;
+}
+
+pub trait QueryFragment {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult;
+}
+
+impl QueryFragment for Box<QueryFragment> {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult {
+        QueryFragment::push_sql(&**self, out)
+    }
+}
+
+impl<'a> QueryFragment for &'a QueryFragment {
+    fn push_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult {
+        QueryFragment::push_sql(&**self, out)
+    }
+}
+
+impl QueryFragment for () {
+    fn push_sql(&self, _out: &mut QueryBuilder) -> BuildQueryResult {
+        Ok(())
+    }
+}
+
+/// A QueryBuilder that implements SQLite's specific escaping rules.
+pub struct SQLiteQueryBuilder {
+    pub sql: String,
+
+    arg_prefix: String,
+    arg_counter: i64,
+
+    // We can't just use an InternSet on the rusqlite::types::Value instances, because that
+    // includes f64, so it's not Hash or Eq.
+    // Instead we track byte and String arguments separately, mapping them to their argument name,
+    // in order to dedupe. We'll add these to the regular argument vector later.
+    byte_args: HashMap<Vec<u8>, String>,             // From value to argument name.
+    string_args: HashMap<ValueRc<String>, String>,   // From value to argument name.
+    args: Vec<(String, Rc<rusqlite::types::Value>)>, // (arg, value).
+}
+
+impl SQLiteQueryBuilder {
+    pub fn new() -> Self {
+        SQLiteQueryBuilder::with_prefix("$v".to_string())
+    }
+
+    pub fn with_prefix(prefix: String) -> Self {
+        SQLiteQueryBuilder {
+            sql: String::new(),
+            arg_prefix: prefix,
+            arg_counter: 0,
+
+            byte_args: HashMap::default(),
+            string_args: HashMap::default(),
+            args: vec![],
+        }
+    }
+
+    fn next_argument_name(&mut self) -> String {
+        let arg = format!("{}{}", self.arg_prefix, self.arg_counter);
+        self.arg_counter = self.arg_counter + 1;
+        arg
+    }
+
+    fn push_static_arg(&mut self, val: Rc<rusqlite::types::Value>) {
+        // TODO: intern these, too.
+        let arg = self.next_argument_name();
+        self.push_named_arg(arg.as_str());
+        self.args.push((arg, val));
+    }
+
+    fn push_named_arg(&mut self, arg: &str) {
+        self.push_sql(arg);
+    }
+}
+
+impl QueryBuilder for SQLiteQueryBuilder {
+    fn push_sql(&mut self, sql: &str) {
+        self.sql.push_str(sql);
+    }
+
+    fn push_identifier(&mut self, identifier: &str) -> BuildQueryResult {
+        self.push_sql("`");
+        self.push_sql(&identifier.replace("`", "``"));
+        self.push_sql("`");
+        Ok(())
+    }
+
+    fn push_typed_value(&mut self, value: &TypedValue) -> BuildQueryResult {
+        use TypedValue::*;
+        match value {
+            &Ref(entid) => self.push_sql(entid.to_string().as_str()),
+            &Boolean(v) => self.push_sql(if v { "1" } else { "0" }),
+            &Long(v) => self.push_sql(v.to_string().as_str()),
+            &Double(OrderedFloat(v)) => {
+                // Rust's floats print without a trailing '.' in some cases.
+                // https://github.com/rust-lang/rust/issues/30967
+                // We format with 'e' -- scientific notation -- so that SQLite treats them as
+                // floats and not integers. This is most noticeable for fulltext scores, which
+                // will currently (2017-06) always be 0, and need to round-trip as doubles.
+                self.push_sql(format!("{:e}", v).as_str());
+            },
+            &Instant(dt) => {
+                self.push_sql(format!("{}", dt.to_micros()).as_str());      // TODO: argument instead?
+            },
+            &Uuid(ref u) => {
+                let bytes = u.as_bytes();
+                if let Some(arg) = self.byte_args.get(bytes.as_ref()).cloned() {        // Why, borrow checker, why?!
+                    self.push_named_arg(arg.as_str());
+                } else {
+                    let arg = self.next_argument_name();
+                    self.push_named_arg(arg.as_str());
+                    self.byte_args.insert(bytes.clone().to_vec(), arg);
+                }
+            },
+            // These are both `Rc`. Unfortunately, we can't use that fact when
+            // turning these into rusqlite Values.
+            // However, we can check to see whether there's an existing var that matches…
+            &String(ref s) => {
+                if let Some(arg) = self.string_args.get(s).cloned() {
+                    self.push_named_arg(arg.as_str());
+                } else {
+                    let arg = self.next_argument_name();
+                    self.push_named_arg(arg.as_str());
+                    self.string_args.insert(s.clone(), arg);
+                }
+            },
+            &Keyword(ref s) => {
+                // TODO: intern.
+                let v = Rc::new(rusqlite::types::Value::Text(s.as_ref().to_string()));
+                self.push_static_arg(v);
+            },
+        }
+        Ok(())
+    }
+
+    /// Our bind parameters will be interleaved with pushed `TypedValue` instances. That means we
+    /// need to use named parameters, not positional parameters.
+    /// The `name` argument to this method is expected to be alphanumeric. If not, this method
+    /// returns an `InvalidParameterName` error result.
+    /// Callers should make sure that the name doesn't overlap with generated parameter names. If
+    /// it does, `BindParamCouldBeGenerated` is the error.
+    fn push_bind_param(&mut self, name: &str) -> BuildQueryResult {
+        // Do some validation first.
+        // This is not free, but it's probably worth it for now.
+        if !name.chars().all(|c| char::is_alphanumeric(c) || c == '_') {
+            return Err(SQLError::InvalidParameterName(name.to_string()))
+        }
+
+        if name.starts_with(self.arg_prefix.as_str()) &&
+           name.chars().skip(self.arg_prefix.len()).all(char::is_numeric) {
+               return Err(SQLError::BindParamCouldBeGenerated(name.to_string()))
+        }
+
+        self.push_sql("$");
+        self.push_sql(name);
+        Ok(())
+    }
+
+    fn finish(self) -> SQLQuery {
+        // We collected string and byte arguments into separate maps so that we could
+        // dedupe them. Now we need to turn them into rusqlite Values.
+        let mut args = self.args;
+        let string_args = self.string_args.into_iter().map(|(val, arg)| {
+             (arg, Rc::new(rusqlite::types::Value::Text(val.as_ref().clone())))
+        });
+        let byte_args = self.byte_args.into_iter().map(|(val, arg)| {
+            (arg, Rc::new(rusqlite::types::Value::Blob(val)))
+        });
+
+        args.extend(string_args);
+        args.extend(byte_args);
+
+        // Get the args in the right order -- $v0, $v1…
+        args.sort_by(|&(ref k1, _), &(ref k2, _)| k1.cmp(k2));
+        SQLQuery {
+            sql: self.sql,
+            args: args,
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    fn string_arg(s: &str) -> Rc<rusqlite::types::Value> {
+        Rc::new(rusqlite::types::Value::Text(s.to_string()))
+    }
+
+    #[test]
+    fn test_sql() {
+        let mut s = SQLiteQueryBuilder::new();
+        s.push_sql("SELECT ");
+        s.push_identifier("foo").unwrap();
+        s.push_sql(" WHERE ");
+        s.push_identifier("bar").unwrap();
+        s.push_sql(" = ");
+        s.push_static_arg(string_arg("frobnicate"));
+        s.push_sql(" OR ");
+        s.push_static_arg(string_arg("swoogle"));
+        s.push_sql(" OR ");
+        s.push_identifier("bar").unwrap();
+        s.push_sql(" = ");
+        s.push_typed_value(&TypedValue::Double(1.0.into())).unwrap();
+        let q = s.finish();
+
+        assert_eq!(q.sql.as_str(), "SELECT `foo` WHERE `bar` = $v0 OR $v1 OR `bar` = 1e0");
+        assert_eq!(q.args,
+                   vec![("$v0".to_string(), string_arg("frobnicate")),
+                        ("$v1".to_string(), string_arg("swoogle"))]);
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_tolstoy/errors.rs.html b/docs/apis/rust/0.7.0/src/mentat_tolstoy/errors.rs.html new file mode 100644 index 00000000..a5ed464d --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_tolstoy/errors.rs.html @@ -0,0 +1,210 @@ + + + + + + + + + + errors.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+use failure::Error;
+
+#[macro_export]
+macro_rules! bail {
+    ($e:expr) => (
+        return Err($e.into());
+    )
+}
+
+pub type Result<T> = ::std::result::Result<T, Error>;
+
+#[derive(Debug, Fail)]
+pub enum TolstoyError {
+    #[fail(display = "Received bad response from the server: {}", _0)]
+    BadServerResponse(String),
+
+    #[fail(display = "encountered more than one metadata value for key: {}", _0)]
+    DuplicateMetadata(String),
+
+    #[fail(display = "transaction processor didn't say it was done")]
+    TxProcessorUnfinished,
+
+    #[fail(display = "expected one, found {} uuid mappings for tx", _0)]
+    TxIncorrectlyMapped(usize),
+
+    #[fail(display = "encountered unexpected state: {}", _0)]
+    UnexpectedState(String),
+
+    #[fail(display = "not yet implemented: {}", _0)]
+    NotYetImplemented(String),
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_tolstoy/lib.rs.html b/docs/apis/rust/0.7.0/src/mentat_tolstoy/lib.rs.html new file mode 100644 index 00000000..4e2d60e5 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_tolstoy/lib.rs.html @@ -0,0 +1,214 @@ + + + + + + + + + + lib.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+extern crate failure;
+#[macro_use]
+extern crate failure_derive;
+
+#[macro_use]
+extern crate lazy_static;
+
+#[macro_use]
+extern crate serde_derive;
+
+extern crate hyper;
+// TODO https://github.com/mozilla/mentat/issues/569
+// extern crate hyper_tls;
+extern crate tokio_core;
+extern crate futures;
+extern crate serde;
+extern crate serde_cbor;
+extern crate serde_json;
+extern crate mentat_db;
+extern crate mentat_core;
+extern crate rusqlite;
+extern crate uuid;
+
+#[macro_use]
+pub mod errors;
+pub mod schema;
+pub mod metadata;
+pub mod tx_processor;
+pub mod syncer;
+pub mod tx_mapper;
+pub use syncer::Syncer;
+pub use errors::{
+    TolstoyError,
+    Result,
+};
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_tolstoy/metadata.rs.html b/docs/apis/rust/0.7.0/src/mentat_tolstoy/metadata.rs.html new file mode 100644 index 00000000..21875cbc --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_tolstoy/metadata.rs.html @@ -0,0 +1,264 @@ + + + + + + + + + + metadata.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#![allow(dead_code)]
+
+use rusqlite;
+use uuid::Uuid;
+
+use schema;
+use errors::{
+    TolstoyError,
+    Result,
+};
+
+pub trait HeadTrackable {
+    fn remote_head(tx: &rusqlite::Transaction) -> Result<Uuid>;
+    fn set_remote_head(tx: &rusqlite::Transaction, uuid: &Uuid) -> Result<()>;
+}
+
+pub struct SyncMetadataClient {}
+
+impl HeadTrackable for SyncMetadataClient {
+    fn remote_head(tx: &rusqlite::Transaction) -> Result<Uuid> {
+        tx.query_row(
+            "SELECT value FROM tolstoy_metadata WHERE key = ?",
+            &[&schema::REMOTE_HEAD_KEY], |r| {
+                let bytes: Vec<u8> = r.get(0);
+                Uuid::from_bytes(bytes.as_slice())
+            }
+        )?.map_err(|e| e.into())
+    }
+
+    fn set_remote_head(tx: &rusqlite::Transaction, uuid: &Uuid) -> Result<()> {
+        let uuid_bytes = uuid.as_bytes().to_vec();
+        let updated = tx.execute("UPDATE tolstoy_metadata SET value = ? WHERE key = ?",
+            &[&uuid_bytes, &schema::REMOTE_HEAD_KEY])?;
+        if updated != 1 {
+            bail!(TolstoyError::DuplicateMetadata(schema::REMOTE_HEAD_KEY.into()));
+        }
+        Ok(())
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_get_remote_head_default() {
+        let mut conn = schema::tests::setup_conn();
+        let tx = conn.transaction().expect("db tx");
+        assert_eq!(Uuid::nil(), SyncMetadataClient::remote_head(&tx).expect("fetch succeeded"));
+    }
+
+    #[test]
+    fn test_set_and_get_remote_head() {
+        let mut conn = schema::tests::setup_conn();
+        let uuid = Uuid::new_v4();
+        let tx = conn.transaction().expect("db tx");
+        SyncMetadataClient::set_remote_head(&tx, &uuid).expect("update succeeded");
+        assert_eq!(uuid, SyncMetadataClient::remote_head(&tx).expect("fetch succeeded"));
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_tolstoy/schema.rs.html b/docs/apis/rust/0.7.0/src/mentat_tolstoy/schema.rs.html new file mode 100644 index 00000000..2c4c258f --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_tolstoy/schema.rs.html @@ -0,0 +1,364 @@ + + + + + + + + + + schema.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use rusqlite;
+use errors::Result;
+
+pub static REMOTE_HEAD_KEY: &str = r#"remote_head"#;
+
+lazy_static! {
+    /// SQL statements to be executed, in order, to create the Tolstoy SQL schema (version 1).
+    #[cfg_attr(rustfmt, rustfmt_skip)]
+    static ref SCHEMA_STATEMENTS: Vec<&'static str> = { vec![
+        r#"CREATE TABLE IF NOT EXISTS tolstoy_tu (tx INTEGER PRIMARY KEY, uuid BLOB NOT NULL UNIQUE) WITHOUT ROWID"#,
+        r#"CREATE TABLE IF NOT EXISTS tolstoy_metadata (key BLOB NOT NULL UNIQUE, value BLOB NOT NULL)"#,
+        r#"CREATE INDEX IF NOT EXISTS idx_tolstoy_tu_ut ON tolstoy_tu (uuid, tx)"#,
+        ]
+    };
+}
+
+pub fn ensure_current_version(conn: &mut rusqlite::Connection) -> Result<()> {
+    let tx = conn.transaction()?;
+
+    for statement in (&SCHEMA_STATEMENTS).iter() {
+        tx.execute(statement, &[])?;
+    }
+
+    tx.execute("INSERT OR IGNORE INTO tolstoy_metadata (key, value) VALUES (?, zeroblob(16))", &[&REMOTE_HEAD_KEY])?;
+    tx.commit().map_err(|e| e.into())
+}
+
+#[cfg(test)]
+pub mod tests {
+    use super::*;
+    use uuid::Uuid;
+
+    fn setup_conn_bare() -> rusqlite::Connection {
+        let conn = rusqlite::Connection::open_in_memory().unwrap();
+
+        conn.execute_batch("
+            PRAGMA page_size=32768;
+            PRAGMA journal_mode=wal;
+            PRAGMA wal_autocheckpoint=32;
+            PRAGMA journal_size_limit=3145728;
+            PRAGMA foreign_keys=ON;
+        ").expect("success");
+
+        conn
+    }
+
+    pub fn setup_conn() -> rusqlite::Connection {
+        let mut conn = setup_conn_bare();
+        ensure_current_version(&mut conn).expect("connection setup");
+        conn
+    }
+
+    #[test]
+    fn test_empty() {
+        let mut conn = setup_conn_bare();
+
+        assert!(ensure_current_version(&mut conn).is_ok());
+
+        let mut stmt = conn.prepare("SELECT key FROM tolstoy_metadata WHERE value = zeroblob(16)").unwrap();
+        let mut keys_iter = stmt.query_map(&[], |r| r.get(0)).expect("query works");
+
+        let first: Result<String> = keys_iter.next().unwrap().map_err(|e| e.into());
+        let second: Option<_> = keys_iter.next();
+        match (first, second) {
+            (Ok(key), None) => {
+                assert_eq!(key, REMOTE_HEAD_KEY);
+            },
+            (_, _) => { panic!("Wrong number of results."); },
+        }
+    }
+
+    #[test]
+    fn test_non_empty() {
+        let mut conn = setup_conn_bare();
+
+        assert!(ensure_current_version(&mut conn).is_ok());
+
+        let test_uuid = Uuid::new_v4();
+        {
+            let tx = conn.transaction().unwrap();
+            let uuid_bytes = test_uuid.as_bytes().to_vec();
+            match tx.execute("UPDATE tolstoy_metadata SET value = ? WHERE key = ?", &[&uuid_bytes, &REMOTE_HEAD_KEY]) {
+                Err(e) => panic!("Error running an update: {}", e),
+                _ => ()
+            }
+            match tx.commit() {
+                Err(e) => panic!("Error committing an update: {}", e),
+                _ => ()
+            }
+        }
+
+        assert!(ensure_current_version(&mut conn).is_ok());
+
+        // Check that running ensure_current_version on an initialized conn doesn't change anything.
+        let mut stmt = conn.prepare("SELECT value FROM tolstoy_metadata").unwrap();
+        let mut values_iter = stmt.query_map(&[], |r| {
+            let raw_uuid: Vec<u8> = r.get(0);
+            Uuid::from_bytes(raw_uuid.as_slice()).unwrap()
+        }).expect("query works");
+
+        let first: Result<Uuid> = values_iter.next().unwrap().map_err(|e| e.into());
+        let second: Option<_> = values_iter.next();
+        match (first, second) {
+            (Ok(uuid), None) => {
+                assert_eq!(test_uuid, uuid);
+            },
+            (_, _) => { panic!("Wrong number of results."); },
+        }
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_tolstoy/syncer.rs.html b/docs/apis/rust/0.7.0/src/mentat_tolstoy/syncer.rs.html new file mode 100644 index 00000000..029b2a39 --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_tolstoy/syncer.rs.html @@ -0,0 +1,974 @@ + + + + + + + + + + syncer.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std;
+use std::collections::HashMap;
+
+use futures::{future, Future, Stream};
+use hyper;
+// TODO: enable TLS support; hurdle is cross-compiling openssl for Android.
+// See https://github.com/mozilla/mentat/issues/569
+// use hyper_tls;
+use hyper::{Method, Request, StatusCode, Error as HyperError};
+use hyper::header::{ContentType};
+use rusqlite;
+// TODO: https://github.com/mozilla/mentat/issues/570
+// use serde_cbor;
+use serde_json;
+use tokio_core::reactor::Core;
+use uuid::Uuid;
+
+use mentat_core::Entid;
+use metadata::SyncMetadataClient;
+use metadata::HeadTrackable;
+use schema::ensure_current_version;
+
+use errors::{
+    TolstoyError,
+    Result,
+};
+
+use tx_processor::{
+    Processor,
+    TxReceiver,
+    TxPart,
+};
+
+use tx_mapper::TxMapper;
+
+// TODO it would be nice to be able to pass
+// in a logger into Syncer::flow; would allow for a "debug mode"
+// and getting useful logs out of clients.
+// See https://github.com/mozilla/mentat/issues/571
+// Below is some debug Android-friendly logging:
+
+// use std::os::raw::c_char;
+// use std::os::raw::c_int;
+// use std::ffi::CString;
+// pub const ANDROID_LOG_DEBUG: i32 = 3;
+// extern { pub fn __android_log_write(prio: c_int, tag: *const c_char, text: *const c_char) -> c_int; }
+
+pub fn d(message: &str) {
+    println!("d: {}", message);
+    // let message = CString::new(message).unwrap();
+    // let message = message.as_ptr();
+    // let tag = CString::new("RustyToodle").unwrap();
+    // let tag = tag.as_ptr();
+    // unsafe { __android_log_write(ANDROID_LOG_DEBUG, tag, message) };
+}
+
+pub struct Syncer {}
+
+// TODO this is sub-optimal, we don't need to walk the table
+// to query the last thing in it w/ an index on tx!!
+// but it's the hammer at hand!
+// See https://github.com/mozilla/mentat/issues/572
+struct InquiringTxReceiver {
+    pub last_tx: Option<Entid>,
+    pub is_done: bool,
+}
+
+impl InquiringTxReceiver {
+    fn new() -> InquiringTxReceiver {
+        InquiringTxReceiver {
+            last_tx: None,
+            is_done: false,
+        }
+    }
+}
+
+impl TxReceiver for InquiringTxReceiver {
+    fn tx<T>(&mut self, tx_id: Entid, _datoms: &mut T) -> Result<()>
+    where T: Iterator<Item=TxPart> {
+        self.last_tx = Some(tx_id);
+        Ok(())
+    }
+
+    fn done(&mut self) -> Result<()> {
+        self.is_done = true;
+        Ok(())
+    }
+}
+
+struct UploadingTxReceiver<'c> {
+    pub tx_temp_uuids: HashMap<Entid, Uuid>,
+    pub is_done: bool,
+    remote_client: &'c RemoteClient,
+    remote_head: &'c Uuid,
+    rolling_temp_head: Option<Uuid>,
+}
+
+impl<'c> UploadingTxReceiver<'c> {
+    fn new(client: &'c RemoteClient, remote_head: &'c Uuid) -> UploadingTxReceiver<'c> {
+        UploadingTxReceiver {
+            tx_temp_uuids: HashMap::new(),
+            remote_client: client,
+            remote_head: remote_head,
+            rolling_temp_head: None,
+            is_done: false
+        }
+    }
+}
+
+impl<'c> TxReceiver for UploadingTxReceiver<'c> {
+    fn tx<T>(&mut self, tx_id: Entid, datoms: &mut T) -> Result<()>
+    where T: Iterator<Item=TxPart> {
+        // Yes, we generate a new UUID for a given Tx, even if we might
+        // already have one mapped locally. Pre-existing local mapping will
+        // be replaced if this sync succeeds entirely.
+        // If we're seeing this tx again, it implies that previous attempt
+        // to sync didn't update our local head. Something went wrong last time,
+        // and it's unwise to try to re-use these remote tx mappings.
+        // We just leave garbage txs to be GC'd on the server.
+        let tx_uuid = Uuid::new_v4();
+        self.tx_temp_uuids.insert(tx_id, tx_uuid);
+        let mut tx_chunks = vec![];
+
+        // TODO separate bits of network work should be combined into single 'future'
+
+        // Upload all chunks.
+        for datom in datoms {
+            let datom_uuid = Uuid::new_v4();
+            tx_chunks.push(datom_uuid);
+            d(&format!("putting chunk: {:?}, {:?}", &datom_uuid, &datom));
+            // TODO switch over to CBOR once we're past debugging stuff.
+            // See https://github.com/mozilla/mentat/issues/570
+            // let cbor_val = serde_cbor::to_value(&datom)?;
+            // self.remote_client.put_chunk(&datom_uuid, &serde_cbor::ser::to_vec_sd(&cbor_val)?)?;
+            self.remote_client.put_chunk(&datom_uuid, &serde_json::to_string(&datom)?)?;
+        }
+
+        // Upload tx.
+        // NB: At this point, we may choose to update remote & local heads.
+        // Depending on how much we're uploading, and how unreliable our connection
+        // is, this might be a good thing to do to ensure we make at least some progress.
+        // Comes at a cost of possibly increasing racing against other clients.
+        match self.rolling_temp_head {
+            Some(parent) => {
+                d(&format!("putting transaction: {:?}, {:?}, {:?}", &tx_uuid, &parent, &tx_chunks));
+                self.remote_client.put_transaction(&tx_uuid, &parent, &tx_chunks)?;
+                
+            },
+            None => {
+                d(&format!("putting transaction: {:?}, {:?}, {:?}", &tx_uuid, &self.remote_head, &tx_chunks));
+                self.remote_client.put_transaction(&tx_uuid, self.remote_head, &tx_chunks)?;
+            }
+        }
+
+        d(&format!("updating rolling head: {:?}", tx_uuid));
+        self.rolling_temp_head = Some(tx_uuid.clone());
+
+        Ok(())
+    }
+
+    fn done(&mut self) -> Result<()> {
+        self.is_done = true;
+        Ok(())
+    }
+}
+
+impl Syncer {
+    fn upload_ours(db_tx: &mut rusqlite::Transaction, from_tx: Option<Entid>, remote_client: &RemoteClient, remote_head: &Uuid) -> Result<()> {
+        let mut uploader = UploadingTxReceiver::new(remote_client, remote_head);
+        Processor::process(db_tx, from_tx, &mut uploader)?;
+        if !uploader.is_done {
+            bail!(TolstoyError::TxProcessorUnfinished);
+        }
+        // Last tx uuid uploaded by the tx receiver.
+        // It's going to be our new head.
+        if let Some(last_tx_uploaded) = uploader.rolling_temp_head {
+            // Upload remote head.
+            remote_client.put_head(&last_tx_uploaded)?;
+
+            // On succes:
+            // - persist local mappings from the receiver
+            // - update our local "remote head".
+            TxMapper::set_bulk(db_tx, &uploader.tx_temp_uuids)?;
+            SyncMetadataClient::set_remote_head(db_tx, &last_tx_uploaded)?;
+        }
+
+        Ok(())
+    }
+
+    pub fn flow(sqlite: &mut rusqlite::Connection, server_uri: &String, user_uuid: &Uuid) -> Result<()> {
+        d(&format!("sync flowing"));
+
+        ensure_current_version(sqlite)?;
+        
+        // TODO configure this sync with some auth data
+        let remote_client = RemoteClient::new(server_uri.clone(), user_uuid.clone());
+        let mut db_tx = sqlite.transaction()?;
+
+        let remote_head = remote_client.get_head()?;
+        d(&format!("remote head {:?}", remote_head));
+
+        let locally_known_remote_head = SyncMetadataClient::remote_head(&db_tx)?;
+        d(&format!("local head {:?}", locally_known_remote_head));
+
+        // Local head: latest transaction that we have in the store,
+        // but with one caveat: its tx might will not be mapped if it's
+        // never been synced successfully.
+        // In other words: if latest tx isn't mapped, then HEAD moved
+        // since last sync and server needs to be updated.
+        let mut inquiring_tx_receiver = InquiringTxReceiver::new();
+        // TODO don't just start from the beginning... but then again, we should do this
+        // without walking the table at all, and use the tx index.
+        Processor::process(&db_tx, None, &mut inquiring_tx_receiver)?;
+        if !inquiring_tx_receiver.is_done {
+            bail!(TolstoyError::TxProcessorUnfinished);
+        }
+        let have_local_changes = match inquiring_tx_receiver.last_tx {
+            Some(tx) => {
+                match TxMapper::get(&db_tx, tx)? {
+                    Some(_) => false,
+                    None => true
+                }
+            },
+            None => false
+        };
+
+        // Check if the server is empty - populate it.
+        if remote_head == Uuid::nil() {
+            d(&format!("empty server!"));
+            Syncer::upload_ours(&mut db_tx, None, &remote_client, &remote_head)?;
+        
+        // Check if the server is the same as us, and if our HEAD moved.
+        } else if locally_known_remote_head == remote_head {
+            d(&format!("server unchanged since last sync."));
+            
+            if !have_local_changes {
+                d(&format!("local HEAD did not move. Nothing to do!"));
+                return Ok(());
+            }
+
+            d(&format!("local HEAD moved."));
+            // TODO it's possible that we've successfully advanced remote head previously,
+            // but failed to advance our own local head. If that's the case, and we can recognize it,
+            // our sync becomes just bumping our local head. AFAICT below would currently fail.
+            if let Some(upload_from_tx) = TxMapper::get_tx_for_uuid(&db_tx, &locally_known_remote_head)? {
+                d(&format!("Fast-forwarding the server."));
+                Syncer::upload_ours(&mut db_tx, Some(upload_from_tx), &remote_client, &remote_head)?;
+            } else {
+                d(&format!("Unable to fast-forward the server; missing local tx mapping"));
+                bail!(TolstoyError::TxIncorrectlyMapped(0));
+            }
+            
+        // We diverged from the server.
+        // We'll need to rebase/merge ourselves on top of it.
+        } else {
+            d(&format!("server changed since last sync."));
+
+            bail!(TolstoyError::NotYetImplemented(
+                format!("Can't yet sync against changed server. Local head {:?}, remote head {:?}", locally_known_remote_head, remote_head)
+            ));
+        }
+
+        // Commit everything, if there's anything to commit!
+        // Any new tx->uuid mappings and the new HEAD. We're synced!
+        db_tx.commit()?;
+
+        Ok(())
+    }
+}
+
+#[derive(Serialize,Deserialize)]
+struct SerializedHead {
+    head: Uuid
+}
+
+#[derive(Serialize)]
+struct SerializedTransaction<'a> {
+    parent: &'a Uuid,
+    chunks: &'a Vec<Uuid>
+}
+
+struct RemoteClient {
+    base_uri: String,
+    user_uuid: Uuid
+}
+
+
+impl RemoteClient {
+    fn new(base_uri: String, user_uuid: Uuid) -> Self {
+        RemoteClient {
+            base_uri: base_uri,
+            user_uuid: user_uuid
+        }
+    }
+
+    fn bound_base_uri(&self) -> String {
+        // TODO escaping
+        format!("{}/{}", self.base_uri, self.user_uuid)
+    }
+
+    fn get_uuid(&self, uri: String) -> Result<Uuid> {
+        let mut core = Core::new()?;
+        // TODO enable TLS, see https://github.com/mozilla/mentat/issues/569
+        // let client = hyper::Client::configure()
+        //     .connector(hyper_tls::HttpsConnector::new(4, &core.handle()).unwrap())
+        //     .build(&core.handle());
+        let client = hyper::Client::new(&core.handle());
+
+        d(&format!("client"));
+
+        let uri = uri.parse()?;
+
+        d(&format!("parsed uri {:?}", uri));
+        
+        let work = client.get(uri).and_then(|res| {
+            println!("Response: {}", res.status());
+
+            res.body().concat2().and_then(move |body| {
+                let head_json: SerializedHead = serde_json::from_slice(&body).map_err(|e| {
+                    std::io::Error::new(std::io::ErrorKind::Other, e)
+                })?;
+                Ok(head_json)
+            })
+        });
+
+        d(&format!("running..."));
+
+        let head_json = core.run(work)?;
+        d(&format!("got head: {:?}", &head_json.head));
+        Ok(head_json.head)
+    }
+
+    fn put<T>(&self, uri: String, payload: T, expected: StatusCode) -> Result<()>
+    where hyper::Body: std::convert::From<T>, {
+        let mut core = Core::new()?;
+        // TODO enable TLS, see https://github.com/mozilla/mentat/issues/569
+        // let client = hyper::Client::configure()
+        //     .connector(hyper_tls::HttpsConnector::new(4, &core.handle()).unwrap())
+        //     .build(&core.handle());
+        let client = hyper::Client::new(&core.handle());
+
+        let uri = uri.parse()?;
+
+        d(&format!("PUT {:?}", uri));
+
+        let mut req = Request::new(Method::Put, uri);
+        req.headers_mut().set(ContentType::json());
+        req.set_body(payload);
+
+        let put = client.request(req).and_then(|res| {
+            let status_code = res.status();
+
+            if status_code != expected {
+                d(&format!("bad put response: {:?}", status_code));
+                future::err(HyperError::Status)
+            } else {
+                future::ok(())
+            }
+        });
+
+        core.run(put)?;
+        Ok(())
+    }
+
+    fn put_transaction(&self, transaction_uuid: &Uuid, parent_uuid: &Uuid, chunks: &Vec<Uuid>) -> Result<()> {
+        // {"parent": uuid, "chunks": [chunk1, chunk2...]}
+        let transaction = SerializedTransaction {
+            parent: parent_uuid,
+            chunks: chunks
+        };
+
+        let uri = format!("{}/transactions/{}", self.bound_base_uri(), transaction_uuid);
+        let json = serde_json::to_string(&transaction)?;
+        d(&format!("serialized transaction: {:?}", json));
+        self.put(uri, json, StatusCode::Created)
+    }
+
+    fn get_head(&self) -> Result<Uuid> {
+        let uri = format!("{}/head", self.bound_base_uri());
+        self.get_uuid(uri)
+    }
+
+    fn put_head(&self, uuid: &Uuid) -> Result<()> {
+        // {"head": uuid}
+        let head = SerializedHead {
+            head: uuid.clone()
+        };
+
+        let uri = format!("{}/head", self.bound_base_uri());
+        let json = serde_json::to_string(&head)?;
+        d(&format!("serialized head: {:?}", json));
+        self.put(uri, json, StatusCode::NoContent)
+    }
+
+    fn put_chunk(&self, chunk_uuid: &Uuid, payload: &String) -> Result<()> {
+        let uri = format!("{}/chunks/{}", self.bound_base_uri(), chunk_uuid);
+        d(&format!("serialized chunk: {:?}", payload));
+        // TODO don't want to clone every datom!
+        self.put(uri, payload.clone(), StatusCode::Created)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use std::str::FromStr;
+
+    #[test]
+    fn test_remote_client_bound_uri() {
+        let user_uuid = Uuid::from_str(&"316ea470-ce35-4adf-9c61-e0de6e289c59").expect("uuid");
+        let server_uri = String::from("https://example.com/api/0.1");
+        let remote_client = RemoteClient::new(server_uri, user_uuid);
+        assert_eq!("https://example.com/api/0.1/316ea470-ce35-4adf-9c61-e0de6e289c59", remote_client.bound_base_uri());
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_tolstoy/tx_mapper.rs.html b/docs/apis/rust/0.7.0/src/mentat_tolstoy/tx_mapper.rs.html new file mode 100644 index 00000000..0ffd84ad --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_tolstoy/tx_mapper.rs.html @@ -0,0 +1,380 @@ + + + + + + + + + + tx_mapper.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+use std::collections::HashMap;
+use rusqlite;
+use uuid::Uuid;
+use mentat_core::Entid;
+
+use errors::{
+    TolstoyError,
+    Result,
+};
+
+// Exposes a tx<->uuid mapping interface.
+pub struct TxMapper {}
+
+impl TxMapper {
+    pub fn set_bulk(db_tx: &mut rusqlite::Transaction, tx_uuid_map: &HashMap<Entid, Uuid>) -> Result<()> {
+        let mut stmt = db_tx.prepare_cached(
+            "INSERT OR REPLACE INTO tolstoy_tu (tx, uuid) VALUES (?, ?)"
+        )?;
+        for (tx, uuid) in tx_uuid_map.iter() {
+            let uuid_bytes = uuid.as_bytes().to_vec();
+            stmt.execute(&[tx, &uuid_bytes])?;
+        }
+        Ok(())
+    }
+
+    // TODO for when we're downloading, right?
+    pub fn get_or_set_uuid_for_tx(db_tx: &mut rusqlite::Transaction, tx: Entid) -> Result<Uuid> {
+        match TxMapper::get(db_tx, tx)? {
+            Some(uuid) => Ok(uuid),
+            None => {
+                let uuid = Uuid::new_v4();
+                let uuid_bytes = uuid.as_bytes().to_vec();
+                db_tx.execute("INSERT INTO tolstoy_tu (tx, uuid) VALUES (?, ?)", &[&tx, &uuid_bytes])?;
+                return Ok(uuid);
+            }
+        }
+    }
+
+    pub fn get_tx_for_uuid(db_tx: &rusqlite::Transaction, uuid: &Uuid) -> Result<Option<Entid>> {
+        let mut stmt = db_tx.prepare_cached(
+            "SELECT tx FROM tolstoy_tu WHERE uuid = ?"
+        )?;
+
+        let uuid_bytes = uuid.as_bytes().to_vec();
+        let results = stmt.query_map(&[&uuid_bytes], |r| r.get(0))?;
+
+        let mut txs = vec![];
+        txs.extend(results);
+        if txs.len() == 0 {
+            return Ok(None);
+        } else if txs.len() > 1 {
+            bail!(TolstoyError::TxIncorrectlyMapped(txs.len()));
+        }
+        Ok(Some(txs.remove(0)?))
+    }
+
+    pub fn get(db_tx: &rusqlite::Transaction, tx: Entid) -> Result<Option<Uuid>> {
+        let mut stmt = db_tx.prepare_cached(
+            "SELECT uuid FROM tolstoy_tu WHERE tx = ?"
+        )?;
+
+        let results = stmt.query_and_then(&[&tx], |r| -> Result<Uuid>{
+            let bytes: Vec<u8> = r.get(0);
+            Uuid::from_bytes(bytes.as_slice()).map_err(|e| e.into())
+        })?;
+
+        let mut uuids = vec![];
+        uuids.extend(results);
+        if uuids.len() == 0 {
+            return Ok(None);
+        } else if uuids.len() > 1 {
+            bail!(TolstoyError::TxIncorrectlyMapped(uuids.len()));
+        }
+        Ok(Some(uuids.remove(0)?))
+    }
+}
+
+#[cfg(test)]
+pub mod tests {
+    use super::*;
+    use schema;
+
+    #[test]
+    fn test_getters() {
+        let mut conn = schema::tests::setup_conn();
+        let mut tx = conn.transaction().expect("db tx");
+        assert_eq!(None, TxMapper::get(&mut tx, 1).expect("success"));
+        let set_uuid = TxMapper::get_or_set_uuid_for_tx(&mut tx, 1).expect("success");
+        assert_eq!(Some(set_uuid), TxMapper::get(&mut tx, 1).expect("success"));
+    }
+
+    #[test]
+    fn test_bulk_setter() {
+        let mut conn = schema::tests::setup_conn();
+        let mut tx = conn.transaction().expect("db tx");
+        let mut map = HashMap::new();
+
+        TxMapper::set_bulk(&mut tx, &map).expect("empty map success");
+
+        let uuid1 = Uuid::new_v4();
+        let uuid2 = Uuid::new_v4();
+        map.insert(1, uuid1);
+        map.insert(2, uuid2);
+
+        TxMapper::set_bulk(&mut tx, &map).expect("map success");
+        assert_eq!(Some(uuid1), TxMapper::get(&mut tx, 1).expect("success"));
+        assert_eq!(Some(uuid2), TxMapper::get(&mut tx, 2).expect("success"));
+
+        // Now let's replace one of mappings.
+        map.remove(&1);
+        let new_uuid2 = Uuid::new_v4();
+        map.insert(2, new_uuid2);
+
+        TxMapper::set_bulk(&mut tx, &map).expect("map success");
+        assert_eq!(Some(uuid1), TxMapper::get(&mut tx, 1).expect("success"));
+        assert_eq!(Some(new_uuid2), TxMapper::get(&mut tx, 2).expect("success"));
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/src/mentat_tolstoy/tx_processor.rs.html b/docs/apis/rust/0.7.0/src/mentat_tolstoy/tx_processor.rs.html new file mode 100644 index 00000000..7919b5bd --- /dev/null +++ b/docs/apis/rust/0.7.0/src/mentat_tolstoy/tx_processor.rs.html @@ -0,0 +1,456 @@ + + + + + + + + + + tx_processor.rs.html -- source + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+
+// Copyright 2018 Mozilla
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+// this file except in compliance with the License. You may obtain a copy of the
+// License at http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+use std::iter::Peekable;
+
+use rusqlite;
+
+use errors::{
+    Result,
+};
+
+use mentat_db::{
+    TypedSQLValue,
+};
+
+use mentat_core::{
+    Entid,
+    TypedValue,
+};
+
+#[derive(Debug,Clone,Serialize,Deserialize)]
+pub struct TxPart {
+    pub e: Entid,
+    pub a: Entid,
+    pub v: TypedValue,
+    pub tx: Entid,
+    pub added: bool,
+}
+
+pub trait TxReceiver {
+    fn tx<T>(&mut self, tx_id: Entid, d: &mut T) -> Result<()>
+        where T: Iterator<Item=TxPart>;
+    fn done(&mut self) -> Result<()>;
+}
+
+pub struct Processor {}
+
+pub struct DatomsIterator<'dbtx, 't, T>
+where T: Sized + Iterator<Item=Result<TxPart>> + 't {
+    at_first: bool,
+    at_last: bool,
+    first: &'dbtx TxPart,
+    rows: &'t mut Peekable<T>,
+}
+
+impl<'dbtx, 't, T> DatomsIterator<'dbtx, 't, T>
+where T: Sized + Iterator<Item=Result<TxPart>> + 't {
+    fn new(first: &'dbtx TxPart, rows: &'t mut Peekable<T>) -> DatomsIterator<'dbtx, 't, T>
+    {
+        DatomsIterator {
+            at_first: true,
+            at_last: false,
+            first: first,
+            rows: rows,
+        }
+    }
+}
+
+impl<'dbtx, 't, T> Iterator for DatomsIterator<'dbtx, 't, T>
+where T: Sized + Iterator<Item=Result<TxPart>> + 't {
+    type Item = TxPart;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        if self.at_last {
+            return None;
+        }
+
+        if self.at_first {
+            self.at_first = false;
+            return Some(self.first.clone());
+        }
+
+        // Look ahead to see if we're about to cross into
+        // the next partition.
+        {
+            let next_option = self.rows.peek();
+            match next_option {
+                Some(&Ok(ref next)) => {
+                    if next.tx != self.first.tx {
+                        self.at_last = true;
+                        return None;
+                    }
+                },
+                // Empty, or error. Either way, this iterator's done.
+                _ => {
+                    self.at_last = true;
+                    return None;
+                }
+            }
+        }
+
+        // We're in the correct partition, return a TxPart.
+        if let Some(result) = self.rows.next() {
+            match result {
+                Err(_) => None,
+                Ok(datom) => {
+                    Some(TxPart {
+                        e: datom.e,
+                        a: datom.a,
+                        v: datom.v.clone(),
+                        tx: datom.tx,
+                        added: datom.added,
+                    })
+                },
+            }
+        } else {
+            self.at_last = true;
+            None
+        }
+    }
+}
+
+fn to_tx_part(row: &rusqlite::Row) -> Result<TxPart> {
+    Ok(TxPart {
+        e: row.get(0),
+        a: row.get(1),
+        v: TypedValue::from_sql_value_pair(row.get(2), row.get(3))?,
+        tx: row.get(4),
+        added: row.get(5),
+    })
+}
+
+impl Processor {
+    pub fn process<R>(sqlite: &rusqlite::Transaction, from_tx: Option<Entid>, receiver: &mut R) -> Result<()>
+    where R: TxReceiver {
+        let tx_filter = match from_tx {
+            Some(tx) => format!(" WHERE tx > {} ", tx),
+            None => format!("")
+        };
+        let select_query = format!("SELECT e, a, v, value_type_tag, tx, added FROM transactions {} ORDER BY tx", tx_filter);
+        let mut stmt = sqlite.prepare(&select_query)?;
+
+        let mut rows = stmt.query_and_then(&[], to_tx_part)?.peekable();
+        let mut current_tx = None;
+        while let Some(row) = rows.next() {
+            let datom = row?;
+
+            match current_tx {
+                Some(tx) => {
+                    if tx != datom.tx {
+                        current_tx = Some(datom.tx);
+                        receiver.tx(
+                            datom.tx,
+                            &mut DatomsIterator::new(&datom, &mut rows)
+                        )?;
+                    }
+                },
+                None => {
+                    current_tx = Some(datom.tx);
+                    receiver.tx(
+                        datom.tx,
+                        &mut DatomsIterator::new(&datom, &mut rows)
+                    )?;
+                }
+            }
+        }
+        receiver.done()?;
+        Ok(())
+    }
+}
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/apis/rust/0.7.0/storage.js b/docs/apis/rust/0.7.0/storage.js new file mode 100644 index 00000000..09511fa3 --- /dev/null +++ b/docs/apis/rust/0.7.0/storage.js @@ -0,0 +1,71 @@ +var resourcesSuffix = ""; +/*! + * Copyright 2018 The Rust Project Developers. See the COPYRIGHT + * file at the top-level directory of this distribution and at + * http://rust-lang.org/COPYRIGHT. + * + * Licensed under the Apache License, Version 2.0 or the MIT license + * , at your + * option. This file may not be copied, modified, or distributed + * except according to those terms. + */ + +var currentTheme = document.getElementById("themeStyle"); +var mainTheme = document.getElementById("mainThemeStyle"); + +var savedHref = []; + +function onEach(arr, func) { + if (arr && arr.length > 0 && func) { + for (var i = 0; i < arr.length; i++) { + if (func(arr[i]) === true) { + break; + } + } + } +} + +function updateLocalStorage(name, value) { + if (typeof(Storage) !== "undefined") { + localStorage[name] = value; + } else { + // No Web Storage support so we do nothing + } +} + +function getCurrentValue(name) { + if (typeof(Storage) !== "undefined" && localStorage[name] !== undefined) { + return localStorage[name]; + } + return null; +} + +function switchTheme(styleElem, mainStyleElem, newTheme) { + var fullBasicCss = "rustdoc" + resourcesSuffix + ".css"; + var fullNewTheme = newTheme + resourcesSuffix + ".css"; + var newHref = mainStyleElem.href.replace(fullBasicCss, fullNewTheme); + + if (styleElem.href === newHref) { + return; + } + + var found = false; + if (savedHref.length === 0) { + onEach(document.getElementsByTagName("link"), function(el) { + savedHref.push(el.href); + }); + } + onEach(savedHref, function(el) { + if (el === newHref) { + found = true; + return true; + } + }); + if (found === true) { + styleElem.href = newHref; + updateLocalStorage('rustdoc-theme', newTheme); + } +} + +switchTheme(currentTheme, mainTheme, getCurrentValue('rustdoc-theme') || 'light'); diff --git a/docs/apis/rust/0.7.0/theme.js b/docs/apis/rust/0.7.0/theme.js new file mode 100644 index 00000000..3e7a5beb --- /dev/null +++ b/docs/apis/rust/0.7.0/theme.js @@ -0,0 +1,21 @@ +var themes = document.getElementById("theme-choices"); +var themePicker = document.getElementById("theme-picker"); +themePicker.onclick = function() { + if (themes.style.display === "block") { + themes.style.display = "none"; + themePicker.style.borderBottomRightRadius = "3px"; + themePicker.style.borderBottomLeftRadius = "3px"; + } else { + themes.style.display = "block"; + themePicker.style.borderBottomRightRadius = "0"; + themePicker.style.borderBottomLeftRadius = "0"; + } +}; +["dark","light"].forEach(function(item) { + var but = document.createElement('button'); + but.innerHTML = item; + but.onclick = function(el) { + switchTheme(currentTheme, mainTheme, item); + }; + themes.appendChild(but); +}); diff --git a/docs/apis/swift/0.1/Classes.html b/docs/apis/swift/0.1/Classes.html new file mode 100644 index 00000000..0a7dee14 --- /dev/null +++ b/docs/apis/swift/0.1/Classes.html @@ -0,0 +1,912 @@ + + + + Classes Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Classes

+

The following classes are available globally.

+ +
+
+
+
    +
  • +
    + + + + TypedValue + +
    +
    +
    +
    +
    +
    +

    A wrapper around Mentat’s TypedValue Rust object. This class wraps a raw pointer to a Rust TypedValue +struct and provides accessors to the values according to expected result type.

    + +

    As the FFI functions for fetching values are consuming, this class keeps a copy of the result internally after +fetching so that the value can be referenced several times.

    + +

    Also, due to the consuming nature of the FFI layer, this class also manages it’s raw pointer, nilling it after calling the +FFI conversion function so that the underlying base class can manage cleanup.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class TypedValue : OptionalRustObject
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + Mentat + +
    +
    +
    +
    +
    +
    +

    The primary class for accessing Mentat’s API. +This class provides all of the basic API that can be found in Mentat’s Store struct. +The raw pointer it holds is a pointer to a Store.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class Mentat : RustObject
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + Query + +
    +
    +
    +
    +
    +
    +

    This class allows you to construct a query, bind values to variables and run those queries against a mentat DB.

    + +

    This class cannot be created directly, but must be created through Mentat.query(String:).

    + +

    The types of values you can bind are

    + +
      +
    • Int64
    • +
    • Entid
    • +
    • Keyword
    • +
    • Bool
    • +
    • Double
    • +
    • Date
    • +
    • String
    • +
    • UUID.
    • +
    + +

    Each bound variable must have a corresponding value in the query string used to create this query.

    +
    let query = """
    +           [:find ?name ?cat
    +            :in ?type
    +            :where
    +            [?c :community/name ?name]
    +            [?c :community/type ?type]
    +            [?c :community/category ?cat]]
    +           """
    +mentat.query(query: query)
    +       .bind(varName: "?type", toKeyword: ":community.type/website")
    +       .run { result in
    +            ...
    +        }
    +
    + +

    Queries can be run and the results returned in a number of different formats. Individual result values are returned as TypedValues and +the format differences relate to the number and structure of those values. The result format is related to the format provided in the query string.

    + +
      +
    • Rel - This is the default run function and returns a list of rows of values. Queries that wish to have Rel results should format their query strings: + +let query = """ + [: find ?a ?b ?c + : where ... ] + """ +mentat.query(query: query) +.run { result in + ... +} +
    • +
    • Scalar - This returns a single value as a result. This can be optional, as the value may not be present. Queries that wish to have Scalar results should format their query strings: + +let query = """ + [: find ?a . + : where ... ] + """ +mentat.query(query: query) +.runScalar { result in + ... +} +
    • +
    • Coll - This returns a list of single values as a result. Queries that wish to have Coll results should format their query strings: + +let query = """ + [: find [?a ...] + : where ... ] + """ +mentat.query(query: query) + .runColl { result in + ... + } +
    • +
    • Tuple - This returns a single row of values. Queries that wish to have Tuple results should format their query strings: + +let query = """ + [: find [?a ?b ?c] + : where ... ] + """ +mentat.query(query: query) +.runTuple { result in + ... +} +
    • +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class Query : OptionalRustObject
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + RelResult + +
    +
    +
    +
    +
    +
    +

    Wraps a Rel result from a Mentat query. +A Rel result is a list of rows of TypedValues. +Individual rows can be fetched or the set can be iterated.

    + +

    To fetch individual rows from a RelResult use row(Int32).

    +
    query.run { rows in
    +   let row1 = rows.row(0)
    +   let row2 = rows.row(1)
    +}
    +
    + +

    To iterate over the result set use standard iteration flows.

    +
    query.run { rows in
    +    rows.forEach { row in
    +        ...
    +    }
    +}
    +
    + +

    Note that iteration is consuming and can only be done once.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class RelResult : OptionalRustObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + RelResultIterator + +
    +
    +
    +
    +
    +
    +

    Iterator for RelResult.

    + +

    To iterate over the result set use standard iteration flows.

    +
    query.run { result in
    +    rows.forEach { row in
    +       ...
    +    }
    +}
    +
    + +

    Note that iteration is consuming and can only be done once.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class RelResultIterator : OptionalRustObject, IteratorProtocol
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + TupleResult + +
    +
    +
    +
    +
    +
    +

    Wraps a Tuple result from a Mentat query. +A Tuple result is a list of TypedValues. +Individual values can be fetched as TypedValues or converted into a requested type.

    + +

    Values can be fetched as one of the following types:

    + + + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class TupleResult : OptionalRustObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ColResult + +
    +
    +
    +
    +
    +
    +

    Wraps a Coll result from a Mentat query. +A Coll result is a list of rows of single values of type TypedValue. +Values for individual rows can be fetched as TypedValue or converted into a requested type.

    + +

    Row values can be fetched as one of the following types:

    + + + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class ColResult : TupleResult
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ColResultIterator + +
    +
    +
    +
    +
    +
    +

    Iterator for ColResult.

    + +

    To iterate over the result set use standard iteration flows.

    +
    query.runColl { rows in
    +    rows.forEach { value in
    +       ...
    +    }
    +}
    +
    + +

    Note that iteration is consuming and can only be done once.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class ColResultIterator : OptionalRustObject, IteratorProtocol
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + OptionalRustObject + +
    +
    +
    +
    +
    +
    +

    Base class that wraps an optional OpaquePointer representing a pointer to a Rust object. +This class should be used to wrap Rust pointer that point to consuming structs, that is, calling a function +for that Rust pointer, will cause Rust to destroy the pointer, leaving the Swift pointer dangling. +These classes are responsible for ensuring that their raw OpaquePointer are nilled after calling a consuming +FFI function. +This class provides cleanup functions on deinit, ensuring that all classes +that inherit from it will have their OpaquePointer destroyed when the Swift wrapper is destroyed. +If a class does not override cleanup then a fatalError is thrown. +The optional pointer is managed here such that is the pointer is nil, then the cleanup function is not called +ensuring that we do not double free the pointer on exit.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class OptionalRustObject : Destroyable
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + RustObject + +
    +
    +
    +
    +
    +
    +

    Base class that wraps an non-optional OpaquePointer representing a pointer to a Rust object. +This class provides cleanup functions on deinit, ensuring that all classes +that inherit from it will have their OpaquePointer destroyed when the Swift wrapper is destroyed. +If a class does not override cleanup then a fatalError is thrown.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class RustObject : Destroyable
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + EntityBuilder + +
    +
    +
    +
    +
    +
    +

    This class wraps a raw pointer that points to a Rust EntityBuilder<InProgressBuilder> object.

    + +

    EntityBuilder provides a programmatic interface to performing assertions on a specific entity. +It provides functions for adding and retracting values for attributes for an entity within +an in progress transaction.

    + +

    The transact function will transact the assertions that have been added to the EntityBuilder +and pass back the TxReport that was generated by this transact and the InProgress that was +used to perform the transact. This enables you to perform further transacts on the same InProgress +before committing.

    +
    let aEntid = txReport.entid(forTempId: "a")
    +let bEntid = txReport.entid(forTempId: "b")
    +do {
    +   let builder = try mentat.entityBuilder(forEntid: bEntid)
    +   try builder.add(keyword: ":foo/boolean", boolean: true)
    +   try builder.add(keyword: ":foo/instant", date: newDate)
    +   let (inProgress, report) = try builder.transact()
    +   try inProgress.transact(transaction: "[[:db/add \(aEntid) :foo/long 22]]")
    +   try inProgress.commit()
    +} catch {
    +   ...
    +}
    +
    + +

    The commit function will transact and commit the assertions that have been added to the EntityBuilder. +It will consume the InProgress used to perform the transact. It returns the TxReport generated by +the transact. After calling commit, a new transaction must be started by calling Mentat.beginTransaction() +in order to perform further actions.

    +
    let aEntid = txReport.entid(forTempId: "a")
    +do {
    +    let builder = try mentat.entityBuilder(forEntid: aEntid)
    +    try builder.add(keyword: ":foo/boolean", boolean: true)
    +    try builder.add(keyword: ":foo/instant", date: newDate)
    +    let report = try builder.commit()
    +    ...
    +} catch {
    +   ...
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class EntityBuilder : OptionalRustObject
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + InProgress + +
    +
    +
    +
    +
    +
    +

    This class wraps a raw pointer that points to a Rust InProgress object.

    + +

    InProgress allows for multiple transacts to be performed in a single transaction. + Each transact performed results in a TxReport that can be used to gather information + to be used in subsequent transacts.

    + +

    Committing an InProgress commits all the transacts that have been performed using + that InProgress.

    + +

    Rolling back and InProgress rolls back all the transacts that have been performed + using that InProgress.

    +
     do {
    +     let inProgress = try mentat.beginTransaction()
    +     let txReport = try inProgress.transact(transaction: "[[:db/add "a" :foo/long 22]]")
    +     let aEntid = txReport.entid(forTempId: "a")
    +     let report = try inProgress.transact(transaction: "[[:db/add "b" :foo/ref \(aEntid)] [:db/add "b" :foo/boolean true]]")
    +     try inProgress.commit()
    + } catch {
    +    ...
    + }
    +
    + +

    InProgress also provides a number of functions to generating an builder to assert datoms programatically. + The two types of builder are InProgressBuilder and EntityBuilder.

    + +

    InProgressBuilder takes the current InProgress and provides a programmatic interface to add + and retract values from entities for which there exists an Entid. The provided InProgress + is used to perform the transacts.

    +
     let aEntid = txReport.entid(forTempId: "a")
    + let bEntid = txReport.entid(forTempId: "b")
    + do {
    +     let inProgress = try mentat.beginTransaction()
    +     let builder = try inProgress.builder()
    +     try builder.add(entid: bEntid, keyword: ":foo/boolean", boolean: true)
    +     try builder.add(entid: aEntid, keyword: ":foo/instant", date: newDate)
    +     let (inProgress, report) = try builder.transact()
    +     try inProgress.transact(transaction: "[[:db/add \(aEntid) :foo/long 22]]")
    +     try inProgress.commit()
    + } catch {
    +    ...
    + }
    +
    + +

    EntityBuilder takes the current InProgress and either an Entid or a tempid to provide + a programmatic interface to add and retract values from a specific entity. The provided InProgress + is used to perform the transacts.

    +
     do {
    +     let transaction = try mentat.beginTransaction()
    +     let builder = try transaction.builder(forTempId: "b")
    +     try builder.add(keyword: ":foo/boolean", boolean: true)
    +     try builder.add(keyword: ":foo/instant", date: newDate)
    +     let (inProgress, report) = try builder.transact()
    +     let bEntid = report.entid(forTempId: "b")
    +     try inProgress.transact(transaction: "[[:db/add \(bEntid) :foo/long 22]]")
    +     try inProgress.commit()
    + } catch {
    +    ...
    + }
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class InProgress : OptionalRustObject
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + InProgressBuilder + +
    +
    +
    +
    +
    +
    +

    This class wraps a raw pointer that points to a Rust InProgressBuilder object.

    + +

    InProgressBuilder provides a programmatic interface to performing assertions for entities. +It provides functions for adding and retracting values for attributes for an entity within +an in progress transaction.

    + +

    The transact function will transact the assertions that have been added to the InProgressBuilder +and pass back the TxReport that was generated by this transact and the InProgress that was +used to perform the transact. This enables you to perform further transacts on the same InProgress +before committing.

    +
    let aEntid = txReport.entid(forTempId: "a")
    +let bEntid = txReport.entid(forTempId: "b")
    +do {
    +    let builder = try mentat.entityBuilder()
    +    try builder.add(entid: bEntid, keyword: ":foo/boolean", boolean: true)
    +    try builder.add(entid: aEntid, keyword: ":foo/instant", date: newDate)
    +    let (inProgress, report) = try builder.transact()
    +    try inProgress.transact(transaction: "[[:db/add \(aEntid) :foo/long 22]]")
    +    try inProgress.commit()
    +    ...
    +} catch {
    +   ...
    +}
    +
    + +

    The commit function will transact and commit the assertions that have been added to the EntityBuilder. +It will consume the InProgress used to perform the transact. It returns the TxReport generated by +the transact. After calling commit, a new transaction must be started by calling Mentat.beginTransaction() +in order to perform further actions.

    +
    let aEntid = txReport.entid(forTempId: "a")
    +let bEntid = txReport.entid(forTempId: "b")
    +do {
    +    let builder = try mentat.entityBuilder(forEntid: aEntid)
    +    try builder.add(entid: bEntid, keyword: ":foo/boolean", boolean: true)
    +    try builder.add(entid: aEntid, keyword: ":foo/instant", date: newDate)
    +    let report = try builder.commit()
    +   ...
    +} catch {
    +   ...
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class InProgressBuilder : OptionalRustObject
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + TxReport + +
    +
    +
    +
    +
    +
    +

    This class wraps a raw pointer that points to a Rust TxReport object.

    + +

    The TxReport contains information about a successful Mentat transaction.

    + +

    This information includes:

    + +
      +
    • txId - the identifier for the transaction.
    • +
    • txInstant - the time that the transaction occured.
    • +
    • a map of temporary identifiers provided in the transaction and the Entids that they were mapped to,
    • +
    + +

    Access an Entid for a temporary identifier that was provided in the transaction can be done through entid(String:).

    +
    let report = mentat.transact("[[:db/add "a" :foo/boolean true]]")
    +let aEntid = report.entid(forTempId: "a")
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class TxReport : RustObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Classes/ColResult.html b/docs/apis/swift/0.1/Classes/ColResult.html new file mode 100644 index 00000000..1b928041 --- /dev/null +++ b/docs/apis/swift/0.1/Classes/ColResult.html @@ -0,0 +1,204 @@ + + + + ColResult Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

ColResult

+
+
+
open class ColResult : TupleResult
+ +
+
+

Wraps a Coll result from a Mentat query. +A Coll result is a list of rows of single values of type TypedValue. +Values for individual rows can be fetched as TypedValue or converted into a requested type.

+ +

Row values can be fetched as one of the following types:

+ + + +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Classes/ColResultIterator.html b/docs/apis/swift/0.1/Classes/ColResultIterator.html new file mode 100644 index 00000000..cc470b67 --- /dev/null +++ b/docs/apis/swift/0.1/Classes/ColResultIterator.html @@ -0,0 +1,251 @@ + + + + ColResultIterator Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

ColResultIterator

+
+
+
open class ColResultIterator : OptionalRustObject, IteratorProtocol
+ +
+
+

Iterator for ColResult.

+ +

To iterate over the result set use standard iteration flows.

+
query.runColl { rows in
+    rows.forEach { value in
+       ...
+    }
+}
+
+ +

Note that iteration is consuming and can only be done once.

+ +
+
+
+
    +
  • +
    + + + + Element + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Element = TypedValue
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + next() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func next() -> Element?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Classes/EntityBuilder.html b/docs/apis/swift/0.1/Classes/EntityBuilder.html new file mode 100644 index 00000000..d1fbbdf3 --- /dev/null +++ b/docs/apis/swift/0.1/Classes/EntityBuilder.html @@ -0,0 +1,1438 @@ + + + + EntityBuilder Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

EntityBuilder

+
+
+
open class EntityBuilder : OptionalRustObject
+ +
+
+

This class wraps a raw pointer that points to a Rust EntityBuilder<InProgressBuilder> object.

+ +

EntityBuilder provides a programmatic interface to performing assertions on a specific entity. +It provides functions for adding and retracting values for attributes for an entity within +an in progress transaction.

+ +

The transact function will transact the assertions that have been added to the EntityBuilder +and pass back the TxReport that was generated by this transact and the InProgress that was +used to perform the transact. This enables you to perform further transacts on the same InProgress +before committing.

+
let aEntid = txReport.entid(forTempId: "a")
+let bEntid = txReport.entid(forTempId: "b")
+do {
+   let builder = try mentat.entityBuilder(forEntid: bEntid)
+   try builder.add(keyword: ":foo/boolean", boolean: true)
+   try builder.add(keyword: ":foo/instant", date: newDate)
+   let (inProgress, report) = try builder.transact()
+   try inProgress.transact(transaction: "[[:db/add \(aEntid) :foo/long 22]]")
+   try inProgress.commit()
+} catch {
+   ...
+}
+
+ +

The commit function will transact and commit the assertions that have been added to the EntityBuilder. +It will consume the InProgress used to perform the transact. It returns the TxReport generated by +the transact. After calling commit, a new transaction must be started by calling Mentat.beginTransaction() +in order to perform further actions.

+
let aEntid = txReport.entid(forTempId: "a")
+do {
+    let builder = try mentat.entityBuilder(forEntid: aEntid)
+    try builder.add(keyword: ":foo/boolean", boolean: true)
+    try builder.add(keyword: ":foo/instant", date: newDate)
+    let report = try builder.commit()
+    ...
+} catch {
+   ...
+}
+
+ +
+
+
+
    +
  • +
    + + + + add(keyword:long:) + +
    +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/long.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(keyword: String, long value: Int64) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/ref.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(keyword: String, reference value: Int64) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + add(keyword:keyword:) + +
    +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/keyword.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(keyword: String, keyword value: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + add(keyword:boolean:) + +
    +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/boolean.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(keyword: String, boolean value: Bool) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + add(keyword:double:) + +
    +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/double.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(keyword: String, double value: Double) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + add(keyword:date:) + +
    +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/instant.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(keyword: String, date value: Date) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + add(keyword:string:) + +
    +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/string.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(keyword: String, string value: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + add(keyword:uuid:) + +
    +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/uuid.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(keyword: String, uuid value: UUID) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/long.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(keyword: String, long value: Int64) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/ref.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(keyword: String, reference value: Int64) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/keyword.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(keyword: String, keyword value: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/boolean.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(keyword: String, boolean value: Bool) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/double.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(keyword: String, double value: Double) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/instant.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(keyword: String, date value: Date) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/string.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(keyword: String, string value: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/uuid.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(keyword: String, uuid value: UUID) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + transact() + +
    +
    +
    +
    +
    +
    +

    Transacts the added assertions. This consumes the pointer associated with this EntityBuilder +such that no further assertions can be added after the transact has completed. To perform +further assertions, use the InProgress returned from this function.

    + +

    This does not commit the transaction. In order to do so, commit can be called on the InProgress returned +from this function.

    +
    +

    Throws

    + PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed. + +
    +
    +

    Throws

    +

    ResultError.error if an error occured during the execution of the transact.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func transact() throws -> (InProgress, TxReport?)
    + +
    +
    +
    +

    Return Value

    +

    The current InProgress and the TxReport generated by the transact.

    +
    +
    +
    +
  • +
  • +
    + + + + commit() + +
    +
    +
    +
    +
    +
    +

    Transacts the added assertions and commits. This consumes the pointer associated with this EntityBuilder +and the associated InProgress such that no further assertions can be added after the commit has completed. +To perform further assertions, a new InProgress or EntityBuilder should be created.

    +
    +

    Throws

    + PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed. + +
    +
    +

    Throws

    +

    ResultError.error if an error occured during the execution of the transact.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func commit() throws -> TxReport
    + +
    +
    +
    +

    Return Value

    +

    The TxReport generated by the transact.

    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Classes/InProgress.html b/docs/apis/swift/0.1/Classes/InProgress.html new file mode 100644 index 00000000..2902b6f4 --- /dev/null +++ b/docs/apis/swift/0.1/Classes/InProgress.html @@ -0,0 +1,543 @@ + + + + InProgress Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

InProgress

+
+
+
open class InProgress : OptionalRustObject
+ +
+
+

This class wraps a raw pointer that points to a Rust InProgress object.

+ +

InProgress allows for multiple transacts to be performed in a single transaction. + Each transact performed results in a TxReport that can be used to gather information + to be used in subsequent transacts.

+ +

Committing an InProgress commits all the transacts that have been performed using + that InProgress.

+ +

Rolling back and InProgress rolls back all the transacts that have been performed + using that InProgress.

+
 do {
+     let inProgress = try mentat.beginTransaction()
+     let txReport = try inProgress.transact(transaction: "[[:db/add "a" :foo/long 22]]")
+     let aEntid = txReport.entid(forTempId: "a")
+     let report = try inProgress.transact(transaction: "[[:db/add "b" :foo/ref \(aEntid)] [:db/add "b" :foo/boolean true]]")
+     try inProgress.commit()
+ } catch {
+    ...
+ }
+
+ +

InProgress also provides a number of functions to generating an builder to assert datoms programatically. + The two types of builder are InProgressBuilder and EntityBuilder.

+ +

InProgressBuilder takes the current InProgress and provides a programmatic interface to add + and retract values from entities for which there exists an Entid. The provided InProgress + is used to perform the transacts.

+
 let aEntid = txReport.entid(forTempId: "a")
+ let bEntid = txReport.entid(forTempId: "b")
+ do {
+     let inProgress = try mentat.beginTransaction()
+     let builder = try inProgress.builder()
+     try builder.add(entid: bEntid, keyword: ":foo/boolean", boolean: true)
+     try builder.add(entid: aEntid, keyword: ":foo/instant", date: newDate)
+     let (inProgress, report) = try builder.transact()
+     try inProgress.transact(transaction: "[[:db/add \(aEntid) :foo/long 22]]")
+     try inProgress.commit()
+ } catch {
+    ...
+ }
+
+ +

EntityBuilder takes the current InProgress and either an Entid or a tempid to provide + a programmatic interface to add and retract values from a specific entity. The provided InProgress + is used to perform the transacts.

+
 do {
+     let transaction = try mentat.beginTransaction()
+     let builder = try transaction.builder(forTempId: "b")
+     try builder.add(keyword: ":foo/boolean", boolean: true)
+     try builder.add(keyword: ":foo/instant", date: newDate)
+     let (inProgress, report) = try builder.transact()
+     let bEntid = report.entid(forTempId: "b")
+     try inProgress.transact(transaction: "[[:db/add \(bEntid) :foo/long 22]]")
+     try inProgress.commit()
+ } catch {
+    ...
+ }
+
+ +
+
+
+
    +
  • +
    + + + + builder() + +
    +
    +
    +
    +
    +
    +

    Creates an InProgressBuilder using this InProgress.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the InProgress +has already been committed, or converted into a Builder.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func builder() throws -> InProgressBuilder
    + +
    +
    +
    +

    Return Value

    +

    an InProgressBuilder for this InProgress

    +
    +
    +
    +
  • +
  • +
    + + + + builder(forEntid:) + +
    +
    +
    +
    +
    +
    +

    Creates an EntityBuilder using this InProgress for the entity with entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the InProgress +has already been committed, or converted into a Builder.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func builder(forEntid entid: Int64) throws -> EntityBuilder
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entid + + +
    +

    The Entid for this entity.

    +
    +
    +
    +
    +

    Return Value

    +

    an EntityBuilder for this InProgress

    +
    +
    +
    +
  • +
  • +
    + + + + builder(forTempId:) + +
    +
    +
    +
    +
    +
    +

    Creates an EntityBuilder using this InProgress for a new entity with tempId.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the InProgress +has already been committed, or converted into a Builder.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func builder(forTempId tempId: String) throws -> EntityBuilder
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + tempId + + +
    +

    The temporary identifier for this entity.

    +
    +
    +
    +
    +

    Return Value

    +

    an EntityBuilder for this InProgress

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Transacts the transaction

    + +

    This does not commit the transaction. In order to do so, commit can be called.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the transaction failed.

    + +
    +
    +

    Throws

    +

    ResultError.empty if no TxReport is returned from the transact.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func transact(transaction: String) throws -> TxReport
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + transaction + + +
    +

    The EDN string to be transacted.

    +
    +
    +
    +
    +

    Return Value

    +

    The TxReport generated by the transact.

    +
    +
    +
    +
  • +
  • +
    + + + + commit() + +
    +
    +
    +
    +
    +
    +
    Commits all the transacts that have been performed on this `InProgress`, either directly
    +or through a Builder.
    +
    +
    +

    Throws

    + PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed. + +
    +
    +

    Throws

    + ResultError.error if the commit failed. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func commit() throws
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rollback() + +
    +
    +
    +
    +
    +
    +

    Rolls back all the transacts that have been performed on this InProgress, either directly +or through a Builder.

    +
    +

    Throws

    + PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed. + +
    +
    +

    Throws

    + ResultError.error if the rollback failed. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func rollback() throws
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Classes/InProgressBuilder.html b/docs/apis/swift/0.1/Classes/InProgressBuilder.html new file mode 100644 index 00000000..a0500349 --- /dev/null +++ b/docs/apis/swift/0.1/Classes/InProgressBuilder.html @@ -0,0 +1,1632 @@ + + + + InProgressBuilder Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

InProgressBuilder

+
+
+
open class InProgressBuilder : OptionalRustObject
+ +
+
+

This class wraps a raw pointer that points to a Rust InProgressBuilder object.

+ +

InProgressBuilder provides a programmatic interface to performing assertions for entities. +It provides functions for adding and retracting values for attributes for an entity within +an in progress transaction.

+ +

The transact function will transact the assertions that have been added to the InProgressBuilder +and pass back the TxReport that was generated by this transact and the InProgress that was +used to perform the transact. This enables you to perform further transacts on the same InProgress +before committing.

+
let aEntid = txReport.entid(forTempId: "a")
+let bEntid = txReport.entid(forTempId: "b")
+do {
+    let builder = try mentat.entityBuilder()
+    try builder.add(entid: bEntid, keyword: ":foo/boolean", boolean: true)
+    try builder.add(entid: aEntid, keyword: ":foo/instant", date: newDate)
+    let (inProgress, report) = try builder.transact()
+    try inProgress.transact(transaction: "[[:db/add \(aEntid) :foo/long 22]]")
+    try inProgress.commit()
+    ...
+} catch {
+   ...
+}
+
+ +

The commit function will transact and commit the assertions that have been added to the EntityBuilder. +It will consume the InProgress used to perform the transact. It returns the TxReport generated by +the transact. After calling commit, a new transaction must be started by calling Mentat.beginTransaction() +in order to perform further actions.

+
let aEntid = txReport.entid(forTempId: "a")
+let bEntid = txReport.entid(forTempId: "b")
+do {
+    let builder = try mentat.entityBuilder(forEntid: aEntid)
+    try builder.add(entid: bEntid, keyword: ":foo/boolean", boolean: true)
+    try builder.add(entid: aEntid, keyword: ":foo/instant", date: newDate)
+    let report = try builder.commit()
+   ...
+} catch {
+   ...
+}
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/long.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(entid: Entid, keyword: String, long value: Int64) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/ref.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(entid: Entid, keyword: String, reference value: Entid) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/keyword.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(entid: Entid, keyword: String, keyword value: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/boolean.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(entid: Entid, keyword: String, boolean value: Bool) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/double.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(entid: Entid, keyword: String, double value: Double) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/instant.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(entid: Entid, keyword: String, date value: Date) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/string.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(entid: Entid, keyword: String, string value: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/uuid.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(entid: Entid, keyword: String, uuid value: UUID) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/long.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(entid: Entid, keyword: String, long value: Int64) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/ref.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(entid: Entid, keyword: String, reference value: Entid) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/keyword.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(entid: Entid, keyword: String, keyword value: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/boolean.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(entid: Entid, keyword: String, boolean value: Bool) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/double.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(entid: Entid, keyword: String, double value: Double) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/instant.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(entid: Entid, keyword: String, date value: Date) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/string.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(entid: Entid, keyword: String, string value: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/uuid.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(entid: Entid, keyword: String, uuid value: UUID) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + transact() + +
    +
    +
    +
    +
    +
    +

    Transacts the added assertions. This consumes the pointer associated with this InProgressBuilder +such that no further assertions can be added after the transact has completed. To perform +further assertions, use the InProgress returned from this function.

    + +

    This does not commit the transaction. In order to do so, commit can be called on the InProgress returned +from this function.

    +
    +

    Throws

    + PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed. + +
    +
    +

    Throws

    +

    ResultError.error if an error occured during the execution of the transact.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func transact() throws -> (InProgress, TxReport?)
    + +
    +
    +
    +

    Return Value

    +

    The current InProgress and the TxReport generated by the transact.

    +
    +
    +
    +
  • +
  • +
    + + + + commit() + +
    +
    +
    +
    +
    +
    +

    Transacts the added assertions and commits. This consumes the pointer associated with this InProgressBuilder +and the associated InProgress such that no further assertions can be added after the commit has completed. +To perform further assertions, a new InProgress or InProgressBuilder should be created.

    +
    +

    Throws

    + PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed. + +
    +
    +

    Throws

    +

    ResultError.error if an error occured during the execution of the transact.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func commit() throws -> TxReport
    + +
    +
    +
    +

    Return Value

    +

    The TxReport generated by the transact.

    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Classes/Mentat.html b/docs/apis/swift/0.1/Classes/Mentat.html new file mode 100644 index 00000000..4f446394 --- /dev/null +++ b/docs/apis/swift/0.1/Classes/Mentat.html @@ -0,0 +1,904 @@ + + + + Mentat Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Mentat

+
+
+
open class Mentat : RustObject
+ +
+
+

The primary class for accessing Mentat’s API. +This class provides all of the basic API that can be found in Mentat’s Store struct. +The raw pointer it holds is a pointer to a Store.

+ +
+
+
+
    +
  • +
    + + + + init(raw:) + +
    +
    +
    +
    +
    +
    +

    Create a new Mentat with the provided pointer to a Mentat Store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required override init(raw: OpaquePointer)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + raw + + +
    +

    A pointer to a Mentat Store.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(storeURI:) + +
    +
    +
    +
    +
    +
    +

    Open a connection to a Store in a given location. +If the store does not already exist, one will be created.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(storeURI: String = "")
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storeURI + + +
    +

    The URI as a String of the store to open. +If no store URI is provided, an in-memory store will be opened.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Add an attribute to the cache. The {@link CacheDirection} determines how that attribute can be +looked up.

    +
    +

    Throws

    +

    ResultError.error if an error occured while trying to cache the attribute.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func cache(attribute: String, direction: CacheDirection) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + attribute + + +
    +

    The attribute to cache

    +
    +
    + + direction + + +
    +

    The direction the attribute should be keyed. +forward caches values for an attribute keyed by entity +(i.e. find values and entities that have this attribute, or find values of attribute for an entity) +reverse caches entities for an attribute keyed by value. +(i.e. find entities that have a particular value for an attribute). +both adds an attribute such that it is cached in both directions.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Simple transact of an EDN string.

    +
    +

    Throws

    +

    ResultError.error if the an error occured during the transaction, or the TxReport is nil.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func transact(transaction: String) throws -> TxReport
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + transaction + + +
    +

    The string, as EDN, to be transacted

    +
    +
    +
    +
    +

    Return Value

    +

    The TxReport of the completed transaction

    +
    +
    +
    +
  • +
  • +
    + + + + beginTransaction() + +
    +
    +
    +
    +
    +
    +

    Start a new transaction.

    +
    +

    Throws

    + ResultError.error if the creation of the transaction fails. + +
    +
    +

    Throws

    +

    ResultError.empty if no InProgress is created.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func beginTransaction() throws -> InProgress
    + +
    +
    +
    +

    Return Value

    +

    The InProgress used to manage the transaction

    +
    +
    +
    +
  • +
  • +
    + + + + entityBuilder() + +
    +
    +
    +
    +
    +
    +

    Creates a new transaction (InProgress) and returns an InProgressBuilder for that transaction.

    +
    +

    Throws

    + ResultError.error if the creation of the transaction fails. + +
    +
    +

    Throws

    +

    ResultError.empty if no InProgressBuilder is created.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func entityBuilder() throws -> InProgressBuilder
    + +
    +
    +
    +

    Return Value

    +

    an InProgressBuilder for this InProgress

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a new transaction (InProgress) and returns an EntityBuilder for the entity with entid +for that transaction.

    +
    +

    Throws

    +

    ResultError.error if the creation of the transaction fails.

    + +
    +
    +

    Throws

    +

    ResultError.empty if no EntityBuilder is created.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func entityBuilder(forEntid entid: Entid) throws -> EntityBuilder
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entid + + +
    +

    The Entid for this entity.

    +
    +
    +
    +
    +

    Return Value

    +

    an EntityBuilder for this InProgress

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a new transaction (InProgress) and returns an EntityBuilder for a new entity with tempId +for that transaction.

    +
    +

    Throws

    +

    ResultError.error if the creation of the transaction fails.

    + +
    +
    +

    Throws

    +

    ResultError.empty if no EntityBuilder is created.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func entityBuilder(forTempId tempId: String) throws -> EntityBuilder
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + tempId + + +
    +

    The temporary identifier for this entity.

    +
    +
    +
    +
    +

    Return Value

    +

    an EntityBuilder for this InProgress

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Get the the Entid of the attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func entidForAttribute(attribute: String) -> Entid
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + attribute + + +
    +

    The string represeting the attribute whose Entid we are after. +The string is represented as :namespace/name.

    +
    +
    +
    +
    +

    Return Value

    +

    The Entid associated with the attribute.

    +
    +
    +
    +
  • +
  • +
    + + + + query(query:) + +
    +
    +
    +
    +
    +
    +

    Start a query.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func query(query: String) -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + query + + +
    +

    The string represeting the the query to be executed.

    +
    +
    +
    +
    +

    Return Value

    +

    The Query representing the query that can be executed.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retrieve a single value of an attribute for an Entity

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func value(forAttribute attribute: String, ofEntity entid: Entid) throws -> TypedValue?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + attribute + + +
    +

    The string the attribute whose value is to be returned. +The string is represented as :namespace/name.

    +
    +
    + + entid + + +
    +

    The Entid of the entity we want the value from.

    +
    +
    +
    +
    +

    Return Value

    +

    The TypedValue containing the value of the attribute for the entity.

    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Register an Observing and a set of attributes to observer for transaction observation. +The transactionDidOccur(String: [TxChange]:) function is called when a transaction +occurs in the Store that this Mentat is connected to that affects the attributes that an +Observing has registered for.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func register(key: String, observer: Observing, attributes: [String])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + key + + +
    +

    String representing an identifier for the Observing.

    +
    +
    + + observer + + +
    +

    The Observing to be notified when a transaction occurs.

    +
    +
    + + attributes + + +
    +

    An Array of Strings representing the attributes that the Observing +wishes to be notified about if they are referenced in a transaction.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + unregister(key:) + +
    +
    +
    +
    +
    +
    +

    Unregister the Observing that was registered with the provided key such that it will no longer be called +if a transaction occurs that affects the attributes that Observing was registered to observe.

    + +

    The Observing will need to re-register if it wants to start observing again.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func unregister(key: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + key + + +
    +

    String representing an identifier for the Observing.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Classes/OptionalRustObject.html b/docs/apis/swift/0.1/Classes/OptionalRustObject.html new file mode 100644 index 00000000..102cd12c --- /dev/null +++ b/docs/apis/swift/0.1/Classes/OptionalRustObject.html @@ -0,0 +1,315 @@ + + + + OptionalRustObject Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

OptionalRustObject

+
+
+
open class OptionalRustObject : Destroyable
+ +
+
+

Base class that wraps an optional OpaquePointer representing a pointer to a Rust object. +This class should be used to wrap Rust pointer that point to consuming structs, that is, calling a function +for that Rust pointer, will cause Rust to destroy the pointer, leaving the Swift pointer dangling. +These classes are responsible for ensuring that their raw OpaquePointer are nilled after calling a consuming +FFI function. +This class provides cleanup functions on deinit, ensuring that all classes +that inherit from it will have their OpaquePointer destroyed when the Swift wrapper is destroyed. +If a class does not override cleanup then a fatalError is thrown. +The optional pointer is managed here such that is the pointer is nil, then the cleanup function is not called +ensuring that we do not double free the pointer on exit.

+ +
+
+
+
    +
  • +
    + + + + init(raw:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(raw: UnsafeMutableRawPointer)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(raw:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(raw: OpaquePointer?)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + getRaw() + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func getRaw() -> OpaquePointer?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + validPointer() + +
    +
    +
    +
    +
    +
    +

    Provides a non-optional OpaquePointer if one exists for this class.

    +
    +

    Throws

    +

    Pointer.pointerConsumed if the raw pointer wrapped by this class is nil

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func validPointer() throws -> OpaquePointer
    + +
    +
    +
    +

    Return Value

    +

    the raw OpaquePointer wrapped by this class.

    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Classes/Query.html b/docs/apis/swift/0.1/Classes/Query.html new file mode 100644 index 00000000..4838707f --- /dev/null +++ b/docs/apis/swift/0.1/Classes/Query.html @@ -0,0 +1,1103 @@ + + + + Query Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Query

+
+
+
open class Query : OptionalRustObject
+ +
+
+

This class allows you to construct a query, bind values to variables and run those queries against a mentat DB.

+ +

This class cannot be created directly, but must be created through Mentat.query(String:).

+ +

The types of values you can bind are

+ +
    +
  • Int64
  • +
  • Entid
  • +
  • Keyword
  • +
  • Bool
  • +
  • Double
  • +
  • Date
  • +
  • String
  • +
  • UUID.
  • +
+ +

Each bound variable must have a corresponding value in the query string used to create this query.

+
let query = """
+           [:find ?name ?cat
+            :in ?type
+            :where
+            [?c :community/name ?name]
+            [?c :community/type ?type]
+            [?c :community/category ?cat]]
+           """
+mentat.query(query: query)
+       .bind(varName: "?type", toKeyword: ":community.type/website")
+       .run { result in
+            ...
+        }
+
+ +

Queries can be run and the results returned in a number of different formats. Individual result values are returned as TypedValues and +the format differences relate to the number and structure of those values. The result format is related to the format provided in the query string.

+ +
    +
  • Rel - This is the default run function and returns a list of rows of values. Queries that wish to have Rel results should format their query strings: + +let query = """ + [: find ?a ?b ?c + : where ... ] + """ +mentat.query(query: query) +.run { result in + ... +} +
  • +
  • Scalar - This returns a single value as a result. This can be optional, as the value may not be present. Queries that wish to have Scalar results should format their query strings: + +let query = """ + [: find ?a . + : where ... ] + """ +mentat.query(query: query) +.runScalar { result in + ... +} +
  • +
  • Coll - This returns a list of single values as a result. Queries that wish to have Coll results should format their query strings: + +let query = """ + [: find [?a ...] + : where ... ] + """ +mentat.query(query: query) + .runColl { result in + ... + } +
  • +
  • Tuple - This returns a single row of values. Queries that wish to have Tuple results should format their query strings: + +let query = """ + [: find [?a ?b ?c] + : where ... ] + """ +mentat.query(query: query) +.runTuple { result in + ... +} +
  • +
+ +
+
+
+
    +
  • +
    + + + + bind(varName:toLong:) + +
    +
    +
    +
    +
    +
    +

    Binds a Int64 value to the provided variable name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toLong value: Int64) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Binds a Entid value to the provided variable name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toReference value: Entid) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Binds a String value representing a keyword for an attribute to the provided variable name. +Keywords take the format :namespace/name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toReference value: String) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Binds a keyword String value to the provided variable name. +Keywords take the format :namespace/name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toKeyword value: String) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Binds a Bool value to the provided variable name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toBoolean value: Bool) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Binds a Double value to the provided variable name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toDouble value: Double) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • +
    + + + + bind(varName:toDate:) + +
    +
    +
    +
    +
    +
    +

    Binds a Date value to the provided variable name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toDate value: Date) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Binds a String value to the provided variable name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toString value: String) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • +
    + + + + bind(varName:toUuid:) + +
    +
    +
    +
    +
    +
    +

    Binds a UUID value to the provided variable name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toUuid value: UUID) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • +
    + + + + run(callback:) + +
    +
    +
    +
    +
    +
    +

    Execute the query with the values bound associated with this Query and call the provided callback function with the results as a list of rows of TypedValues.

    +
    +

    Throws

    +

    QueryError.executionFailed if the query fails to execute. This could be because the provided query did not parse, or that +variable we incorrectly bound, or that the query provided was not Rel.

    + +
    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has previously been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func run(callback: @escaping (RelResult?) -> Void) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + callback + + +
    +

    the function to call with the results of this query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + runScalar(callback:) + +
    +
    +
    +
    +
    +
    +

    Execute the query with the values bound associated with this Query and call the provided callback function with the result as a single TypedValue.

    +
    +

    Throws

    +

    QueryError.executionFailed if the query fails to execute. This could be because the provided query did not parse, that +variable we incorrectly bound, or that the query provided was not Scalar.

    + +
    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has previously been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func runScalar(callback: @escaping (TypedValue?) -> Void) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + callback + + +
    +

    the function to call with the results of this query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + runColl(callback:) + +
    +
    +
    +
    +
    +
    +

    Execute the query with the values bound associated with this Query and call the provided callback function with the result as a list of single TypedValues.

    +
    +

    Throws

    +

    QueryError.executionFailed if the query fails to execute. This could be because the provided query did not parse, that +variable we incorrectly bound, or that the query provided was not Coll.

    + +
    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has previously been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func runColl(callback: @escaping (ColResult?) -> Void) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + callback + + +
    +

    the function to call with the results of this query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + runTuple(callback:) + +
    +
    +
    +
    +
    +
    +

    Execute the query with the values bound associated with this Query and call the provided callback function with the result as a list of single TypedValues.

    +
    +

    Throws

    +

    QueryError.executionFailed if the query fails to execute. This could be because the provided query did not parse, that +variable we incorrectly bound, or that the query provided was not Tuple.

    + +
    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has previously been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func runTuple(callback: @escaping (TupleResult?) -> Void) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + callback + + +
    +

    the function to call with the results of this query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Classes/RelResult.html b/docs/apis/swift/0.1/Classes/RelResult.html new file mode 100644 index 00000000..0c38ae71 --- /dev/null +++ b/docs/apis/swift/0.1/Classes/RelResult.html @@ -0,0 +1,293 @@ + + + + RelResult Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

RelResult

+
+
+
open class RelResult : OptionalRustObject
+ +
+
+

Wraps a Rel result from a Mentat query. +A Rel result is a list of rows of TypedValues. +Individual rows can be fetched or the set can be iterated.

+ +

To fetch individual rows from a RelResult use row(Int32).

+
query.run { rows in
+   let row1 = rows.row(0)
+   let row2 = rows.row(1)
+}
+
+ +

To iterate over the result set use standard iteration flows.

+
query.run { rows in
+    rows.forEach { row in
+        ...
+    }
+}
+
+ +

Note that iteration is consuming and can only be done once.

+ +
+
+
+
    +
  • +
    + + + + row(index:) + +
    +
    +
    +
    +
    +
    +

    Fetch the row at the requested index.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the result set has already been iterated.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func row(index: Int32) throws -> TupleResult?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    the index of the row to be fetched

    +
    +
    +
    +
    +

    Return Value

    +

    The row at the requested index as a TupleResult, if present, or nil if there is no row at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Classes/RelResultIterator.html b/docs/apis/swift/0.1/Classes/RelResultIterator.html new file mode 100644 index 00000000..5a92da4d --- /dev/null +++ b/docs/apis/swift/0.1/Classes/RelResultIterator.html @@ -0,0 +1,251 @@ + + + + RelResultIterator Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

RelResultIterator

+
+
+
open class RelResultIterator : OptionalRustObject, IteratorProtocol
+ +
+
+

Iterator for RelResult.

+ +

To iterate over the result set use standard iteration flows.

+
query.run { result in
+    rows.forEach { row in
+       ...
+    }
+}
+
+ +

Note that iteration is consuming and can only be done once.

+ +
+
+
+
    +
  • +
    + + + + Element + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Element = TupleResult
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + next() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func next() -> Element?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Classes/RustObject.html b/docs/apis/swift/0.1/Classes/RustObject.html new file mode 100644 index 00000000..d1be5c1f --- /dev/null +++ b/docs/apis/swift/0.1/Classes/RustObject.html @@ -0,0 +1,300 @@ + + + + RustObject Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

RustObject

+
+
+
open class RustObject : Destroyable
+ +
+
+

Base class that wraps an non-optional OpaquePointer representing a pointer to a Rust object. +This class provides cleanup functions on deinit, ensuring that all classes +that inherit from it will have their OpaquePointer destroyed when the Swift wrapper is destroyed. +If a class does not override cleanup then a fatalError is thrown.

+ +
+
+
+
    +
  • +
    + + + + init(raw:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(raw: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(raw:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(raw: UnsafeMutableRawPointer)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(raw:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(raw: OpaquePointer?)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + getRaw() + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func getRaw() -> OpaquePointer
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Classes/TupleResult.html b/docs/apis/swift/0.1/Classes/TupleResult.html new file mode 100644 index 00000000..4539938a --- /dev/null +++ b/docs/apis/swift/0.1/Classes/TupleResult.html @@ -0,0 +1,672 @@ + + + + TupleResult Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

TupleResult

+
+
+
open class TupleResult : OptionalRustObject
+ +
+
+

Wraps a Tuple result from a Mentat query. +A Tuple result is a list of TypedValues. +Individual values can be fetched as TypedValues or converted into a requested type.

+ +

Values can be fetched as one of the following types:

+ + + +
+
+
+
    +
  • +
    + + + + get(index:) + +
    +
    +
    +
    +
    +
    +

    Return the TypedValue at the specified index. +If the index is greater than the number of values then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func get(index: Int) -> TypedValue
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The TypedValue at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + asLong(index:) + +
    +
    +
    +
    +
    +
    +

    Return the Int64 at the specified index. +If the index is greater than the number of values then this function will crash. +If the value type if the TypedValue at this index is not Long then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asLong(index: Int) -> Int64
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The Int64 at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + asEntid(index:) + +
    +
    +
    +
    +
    +
    +

    Return the Entid at the specified index. +If the index is greater than the number of values then this function will crash. +If the value type if the TypedValue at this index is not Ref then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asEntid(index: Int) -> Entid
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The Entid at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + asKeyword(index:) + +
    +
    +
    +
    +
    +
    +

    Return the keyword String at the specified index. +If the index is greater than the number of values then this function will crash. +If the value type if the TypedValue at this index is not Keyword then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asKeyword(index: Int) -> String
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The keyword String at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + asBool(index:) + +
    +
    +
    +
    +
    +
    +

    Return the Bool at the specified index. +If the index is greater than the number of values then this function will crash. +If the value type if the TypedValue at this index is not Boolean then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asBool(index: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The Bool at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + asDouble(index:) + +
    +
    +
    +
    +
    +
    +

    Return the Double at the specified index. +If the index is greater than the number of values then this function will crash. +If the value type if the TypedValue at this index is not Double then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asDouble(index: Int) -> Double
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The Double at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + asDate(index:) + +
    +
    +
    +
    +
    +
    +

    Return the Date at the specified index. +If the index is greater than the number of values then this function will crash. +If the value type if the TypedValue at this index is not Instant then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asDate(index: Int) -> Date
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The Date at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + asString(index:) + +
    +
    +
    +
    +
    +
    +

    Return the String at the specified index. +If the index is greater than the number of values then this function will crash. +If the value type if the TypedValue at this index is not String then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asString(index: Int) -> String
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The String at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + asUUID(index:) + +
    +
    +
    +
    +
    +
    +

    Return the UUID at the specified index. +If the index is greater than the number of values then this function will crash. +If the value type if the TypedValue at this index is not Uuid then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asUUID(index: Int) -> UUID?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The UUID at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Classes/TxReport.html b/docs/apis/swift/0.1/Classes/TxReport.html new file mode 100644 index 00000000..b88b87ce --- /dev/null +++ b/docs/apis/swift/0.1/Classes/TxReport.html @@ -0,0 +1,308 @@ + + + + TxReport Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

TxReport

+
+
+
open class TxReport : RustObject
+ +
+
+

This class wraps a raw pointer that points to a Rust TxReport object.

+ +

The TxReport contains information about a successful Mentat transaction.

+ +

This information includes:

+ +
    +
  • txId - the identifier for the transaction.
  • +
  • txInstant - the time that the transaction occured.
  • +
  • a map of temporary identifiers provided in the transaction and the Entids that they were mapped to,
  • +
+ +

Access an Entid for a temporary identifier that was provided in the transaction can be done through entid(String:).

+
let report = mentat.transact("[[:db/add "a" :foo/boolean true]]")
+let aEntid = report.entid(forTempId: "a")
+
+ +
+
+
+
    +
  • +
    + + + + txId + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open var txId: Entid { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + txInstant + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open var txInstant: Date { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + entid(forTempId:) + +
    +
    +
    +
    +
    +
    +

    Access an Entid for a temporary identifier that was provided in the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func entid(forTempId tempId: String) -> Entid?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + tempId + + +
    +

    A String representing the temporary identifier to fetch the Entid for.

    +
    +
    +
    +
    +

    Return Value

    +

    The Entid for the temporary identifier, if present, otherwise nil.

    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Classes/TypedValue.html b/docs/apis/swift/0.1/Classes/TypedValue.html new file mode 100644 index 00000000..1240c1a8 --- /dev/null +++ b/docs/apis/swift/0.1/Classes/TypedValue.html @@ -0,0 +1,452 @@ + + + + TypedValue Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

TypedValue

+
+
+
open class TypedValue : OptionalRustObject
+ +
+
+

A wrapper around Mentat’s TypedValue Rust object. This class wraps a raw pointer to a Rust TypedValue +struct and provides accessors to the values according to expected result type.

+ +

As the FFI functions for fetching values are consuming, this class keeps a copy of the result internally after +fetching so that the value can be referenced several times.

+ +

Also, due to the consuming nature of the FFI layer, this class also manages it’s raw pointer, nilling it after calling the +FFI conversion function so that the underlying base class can manage cleanup.

+ +
+
+
+
    +
  • +
    + + + + asLong() + +
    +
    +
    +
    +
    +
    +

    This value as a Int64. This function will panic if the ValueType of this TypedValue +is not a Long

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asLong() -> Int64
    + +
    +
    +
    +

    Return Value

    +

    the value of this TypedValue as a Int64

    +
    +
    +
    +
  • +
  • +
    + + + + asEntid() + +
    +
    +
    +
    +
    +
    +

    This value as an Entid. This function will panic if the ValueType of this TypedValue +is not a Ref

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asEntid() -> Entid
    + +
    +
    +
    +

    Return Value

    +

    the value of this TypedValue as an Entid

    +
    +
    +
    +
  • +
  • +
    + + + + asKeyword() + +
    +
    +
    +
    +
    +
    +

    This value as a keyword String. This function will panic if the ValueType of this TypedValue +is not a Keyword

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asKeyword() -> String
    + +
    +
    +
    +

    Return Value

    +

    the value of this TypedValue as a keyword String

    +
    +
    +
    +
  • +
  • +
    + + + + asBool() + +
    +
    +
    +
    +
    +
    +

    This value as a Bool. This function will panic if the ValueType of this TypedValue +is not a Boolean

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asBool() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    the value of this TypedValue as a Bool

    +
    +
    +
    +
  • +
  • +
    + + + + asDouble() + +
    +
    +
    +
    +
    +
    +

    This value as a Double. This function will panic if the ValueType of this TypedValue +is not a Double

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asDouble() -> Double
    + +
    +
    +
    +

    Return Value

    +

    the value of this TypedValue as a Double

    +
    +
    +
    +
  • +
  • +
    + + + + asDate() + +
    +
    +
    +
    +
    +
    +

    This value as a Date. This function will panic if the ValueType of this TypedValue +is not a Instant

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asDate() -> Date
    + +
    +
    +
    +

    Return Value

    +

    the value of this TypedValue as a Date

    +
    +
    +
    +
  • +
  • +
    + + + + asString() + +
    +
    +
    +
    +
    +
    +

    This value as a String. This function will panic if the ValueType of this TypedValue +is not a String

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asString() -> String
    + +
    +
    +
    +

    Return Value

    +

    the value of this TypedValue as a String

    +
    +
    +
    +
  • +
  • +
    + + + + asUUID() + +
    +
    +
    +
    +
    +
    +

    This value as a UUID. This function will panic if the ValueType of this TypedValue +is not a Uuid

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asUUID() -> UUID?
    + +
    +
    +
    +

    Return Value

    +

    the value of this TypedValue as a UUID?. If the UUID is not valid then this function returns nil.

    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Enums.html b/docs/apis/swift/0.1/Enums.html new file mode 100644 index 00000000..75323db6 --- /dev/null +++ b/docs/apis/swift/0.1/Enums.html @@ -0,0 +1,272 @@ + + + + Enumerations Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Enumerations

+

The following enumerations are available globally.

+ +
+
+
+
    +
  • +
    + + + + QueryError + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum QueryError : Error
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + PointerError + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum PointerError : Error
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ResultError + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ResultError : Error
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + CacheDirection + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum CacheDirection
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Enums/CacheDirection.html b/docs/apis/swift/0.1/Enums/CacheDirection.html new file mode 100644 index 00000000..875124a4 --- /dev/null +++ b/docs/apis/swift/0.1/Enums/CacheDirection.html @@ -0,0 +1,243 @@ + + + + CacheDirection Enumeration Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

CacheDirection

+
+
+
public enum CacheDirection
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + forward + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case forward
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + reverse + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case reverse
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + both + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case both
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Enums/PointerError.html b/docs/apis/swift/0.1/Enums/PointerError.html new file mode 100644 index 00000000..08a63799 --- /dev/null +++ b/docs/apis/swift/0.1/Enums/PointerError.html @@ -0,0 +1,189 @@ + + + + PointerError Enumeration Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

PointerError

+
+
+
public enum PointerError : Error
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + pointerConsumed + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case pointerConsumed
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Enums/QueryError.html b/docs/apis/swift/0.1/Enums/QueryError.html new file mode 100644 index 00000000..5090fcec --- /dev/null +++ b/docs/apis/swift/0.1/Enums/QueryError.html @@ -0,0 +1,216 @@ + + + + QueryError Enumeration Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

QueryError

+
+
+
public enum QueryError : Error
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + invalidKeyword + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case invalidKeyword(message: String)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + executionFailed + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case executionFailed(message: String)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Enums/ResultError.html b/docs/apis/swift/0.1/Enums/ResultError.html new file mode 100644 index 00000000..d3219856 --- /dev/null +++ b/docs/apis/swift/0.1/Enums/ResultError.html @@ -0,0 +1,216 @@ + + + + ResultError Enumeration Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

ResultError

+
+
+
public enum ResultError : Error
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + error + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case error(message: String)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + empty + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case empty
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Extensions.html b/docs/apis/swift/0.1/Extensions.html new file mode 100644 index 00000000..09cd69f0 --- /dev/null +++ b/docs/apis/swift/0.1/Extensions.html @@ -0,0 +1,215 @@ + + + + Extensions Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Extensions

+

The following extensions are available globally.

+ +
+
+
+
    +
  • +
    + + + + Date + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Date : ReferenceConvertible, Comparable, Equatable
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + Result + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Result
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Extensions/Date.html b/docs/apis/swift/0.1/Extensions/Date.html new file mode 100644 index 00000000..e64d0df5 --- /dev/null +++ b/docs/apis/swift/0.1/Extensions/Date.html @@ -0,0 +1,192 @@ + + + + Date Extension Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Date

+
+
+
struct Date : ReferenceConvertible, Comparable, Equatable
+ +
+
+ +
+
+
+
    +
  • +
    + + + + toMicroseconds() + +
    +
    +
    +
    +
    +
    +

    This Date as microseconds.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func toMicroseconds() -> Int64
    + +
    +
    +
    +

    Return Value

    +

    The timeIntervalSince1970 in microseconds

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Extensions/Result.html b/docs/apis/swift/0.1/Extensions/Result.html new file mode 100644 index 00000000..f78bf684 --- /dev/null +++ b/docs/apis/swift/0.1/Extensions/Result.html @@ -0,0 +1,242 @@ + + + + Result Extension Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Result

+
+
+
struct Result
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + unwrap() + +
    +
    +
    +
    +
    +
    +

    Force unwraps a result. +Expects there to be a value attached and throws an error is there is not.

    +
    +

    Throws

    + ResultError.error if the result contains an error + +
    +
    +

    Throws

    +

    ResultError.empty if the result contains no error but also no result.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func unwrap() throws -> UnsafeMutableRawPointer
    + +
    +
    +
    +

    Return Value

    +

    The pointer to the successful result value.

    +
    +
    +
    +
  • +
  • +
    + + + + tryUnwrap() + +
    +
    +
    +
    +
    +
    +

    Unwraps an optional result, yielding either a successful value or a nil.

    +
    +

    Throws

    +

    ResultError.error if the result contains an error

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func tryUnwrap() throws -> UnsafeMutableRawPointer?
    + +
    +
    +
    +

    Return Value

    +

    The pointer to the successful result value, or nil if no value is present.

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Protocols.html b/docs/apis/swift/0.1/Protocols.html new file mode 100644 index 00000000..223c09e5 --- /dev/null +++ b/docs/apis/swift/0.1/Protocols.html @@ -0,0 +1,212 @@ + + + + Protocols Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Protocols

+

The following protocols are available globally.

+ +
+
+
+
    +
  • +
    + + + + Observing + +
    +
    +
    +
    +
    +
    +

    Protocol to be implemented by any object that wishes to register for transaction observation

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol Observing
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Observable + +
    +
    +
    +
    +
    +
    +

    Protocol to be implemented by any object that provides an interface to Mentat’s transaction observers.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol Observable
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Protocols/Observable.html b/docs/apis/swift/0.1/Protocols/Observable.html new file mode 100644 index 00000000..ed5f8bcc --- /dev/null +++ b/docs/apis/swift/0.1/Protocols/Observable.html @@ -0,0 +1,216 @@ + + + + Observable Protocol Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Observable

+
+
+
public protocol Observable
+ +
+
+

Protocol to be implemented by any object that provides an interface to Mentat’s transaction observers.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func register(key: String, observer: Observing, attributes: [String])
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + unregister(key:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func unregister(key: String)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Protocols/Observing.html b/docs/apis/swift/0.1/Protocols/Observing.html new file mode 100644 index 00000000..070d11e3 --- /dev/null +++ b/docs/apis/swift/0.1/Protocols/Observing.html @@ -0,0 +1,189 @@ + + + + Observing Protocol Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Observing

+
+
+
public protocol Observing
+ +
+
+

Protocol to be implemented by any object that wishes to register for transaction observation

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func transactionDidOccur(key: String, reports: [TxChange])
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Structs.html b/docs/apis/swift/0.1/Structs.html new file mode 100644 index 00000000..e0dac947 --- /dev/null +++ b/docs/apis/swift/0.1/Structs.html @@ -0,0 +1,183 @@ + + + + Structures Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Structures

+

The following structures are available globally.

+ +
+
+
+
    +
  • +
    + + + + MentatError + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct MentatError : Error
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/Typealiases.html b/docs/apis/swift/0.1/Typealiases.html new file mode 100644 index 00000000..500a8e4a --- /dev/null +++ b/docs/apis/swift/0.1/Typealiases.html @@ -0,0 +1,183 @@ + + + + Type Aliases Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Type Aliases

+

The following type aliases are available globally.

+ +
+
+
+
    +
  • +
    + + + + Entid + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Entid = Int64
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/badge.svg b/docs/apis/swift/0.1/badge.svg new file mode 100644 index 00000000..8f2e1c0c --- /dev/null +++ b/docs/apis/swift/0.1/badge.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + documentation + + + documentation + + + 74% + + + 74% + + + diff --git a/docs/apis/swift/0.1/css/highlight.css b/docs/apis/swift/0.1/css/highlight.css new file mode 100644 index 00000000..d0db0e13 --- /dev/null +++ b/docs/apis/swift/0.1/css/highlight.css @@ -0,0 +1,200 @@ +/* Credit to https://gist.github.com/wataru420/2048287 */ +.highlight { + /* Comment */ + /* Error */ + /* Keyword */ + /* Operator */ + /* Comment.Multiline */ + /* Comment.Preproc */ + /* Comment.Single */ + /* Comment.Special */ + /* Generic.Deleted */ + /* Generic.Deleted.Specific */ + /* Generic.Emph */ + /* Generic.Error */ + /* Generic.Heading */ + /* Generic.Inserted */ + /* Generic.Inserted.Specific */ + /* Generic.Output */ + /* Generic.Prompt */ + /* Generic.Strong */ + /* Generic.Subheading */ + /* Generic.Traceback */ + /* Keyword.Constant */ + /* Keyword.Declaration */ + /* Keyword.Pseudo */ + /* Keyword.Reserved */ + /* Keyword.Type */ + /* Literal.Number */ + /* Literal.String */ + /* Name.Attribute */ + /* Name.Builtin */ + /* Name.Class */ + /* Name.Constant */ + /* Name.Entity */ + /* Name.Exception */ + /* Name.Function */ + /* Name.Namespace */ + /* Name.Tag */ + /* Name.Variable */ + /* Operator.Word */ + /* Text.Whitespace */ + /* Literal.Number.Float */ + /* Literal.Number.Hex */ + /* Literal.Number.Integer */ + /* Literal.Number.Oct */ + /* Literal.String.Backtick */ + /* Literal.String.Char */ + /* Literal.String.Doc */ + /* Literal.String.Double */ + /* Literal.String.Escape */ + /* Literal.String.Heredoc */ + /* Literal.String.Interpol */ + /* Literal.String.Other */ + /* Literal.String.Regex */ + /* Literal.String.Single */ + /* Literal.String.Symbol */ + /* Name.Builtin.Pseudo */ + /* Name.Variable.Class */ + /* Name.Variable.Global */ + /* Name.Variable.Instance */ + /* Literal.Number.Integer.Long */ } + .highlight .c { + color: #999988; + font-style: italic; } + .highlight .err { + color: #a61717; + background-color: #e3d2d2; } + .highlight .k { + color: #000000; + font-weight: bold; } + .highlight .o { + color: #000000; + font-weight: bold; } + .highlight .cm { + color: #999988; + font-style: italic; } + .highlight .cp { + color: #999999; + font-weight: bold; } + .highlight .c1 { + color: #999988; + font-style: italic; } + .highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; } + .highlight .gd { + color: #000000; + background-color: #ffdddd; } + .highlight .gd .x { + color: #000000; + background-color: #ffaaaa; } + .highlight .ge { + color: #000000; + font-style: italic; } + .highlight .gr { + color: #aa0000; } + .highlight .gh { + color: #999999; } + .highlight .gi { + color: #000000; + background-color: #ddffdd; } + .highlight .gi .x { + color: #000000; + background-color: #aaffaa; } + .highlight .go { + color: #888888; } + .highlight .gp { + color: #555555; } + .highlight .gs { + font-weight: bold; } + .highlight .gu { + color: #aaaaaa; } + .highlight .gt { + color: #aa0000; } + .highlight .kc { + color: #000000; + font-weight: bold; } + .highlight .kd { + color: #000000; + font-weight: bold; } + .highlight .kp { + color: #000000; + font-weight: bold; } + .highlight .kr { + color: #000000; + font-weight: bold; } + .highlight .kt { + color: #445588; } + .highlight .m { + color: #009999; } + .highlight .s { + color: #d14; } + .highlight .na { + color: #008080; } + .highlight .nb { + color: #0086B3; } + .highlight .nc { + color: #445588; + font-weight: bold; } + .highlight .no { + color: #008080; } + .highlight .ni { + color: #800080; } + .highlight .ne { + color: #990000; + font-weight: bold; } + .highlight .nf { + color: #990000; } + .highlight .nn { + color: #555555; } + .highlight .nt { + color: #000080; } + .highlight .nv { + color: #008080; } + .highlight .ow { + color: #000000; + font-weight: bold; } + .highlight .w { + color: #bbbbbb; } + .highlight .mf { + color: #009999; } + .highlight .mh { + color: #009999; } + .highlight .mi { + color: #009999; } + .highlight .mo { + color: #009999; } + .highlight .sb { + color: #d14; } + .highlight .sc { + color: #d14; } + .highlight .sd { + color: #d14; } + .highlight .s2 { + color: #d14; } + .highlight .se { + color: #d14; } + .highlight .sh { + color: #d14; } + .highlight .si { + color: #d14; } + .highlight .sx { + color: #d14; } + .highlight .sr { + color: #009926; } + .highlight .s1 { + color: #d14; } + .highlight .ss { + color: #990073; } + .highlight .bp { + color: #999999; } + .highlight .vc { + color: #008080; } + .highlight .vg { + color: #008080; } + .highlight .vi { + color: #008080; } + .highlight .il { + color: #009999; } diff --git a/docs/apis/swift/0.1/css/jazzy.css b/docs/apis/swift/0.1/css/jazzy.css new file mode 100644 index 00000000..d6282826 --- /dev/null +++ b/docs/apis/swift/0.1/css/jazzy.css @@ -0,0 +1,337 @@ +html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { + background: transparent; + border: 0; + margin: 0; + outline: 0; + padding: 0; + vertical-align: baseline; } + +body { + background-color: #f2f2f2; + font-family: Helvetica, freesans, Arial, sans-serif; + font-size: 14px; + -webkit-font-smoothing: subpixel-antialiased; + word-wrap: break-word; } + +h1, h2, h3 { + margin-top: 0.8em; + margin-bottom: 0.3em; + font-weight: 100; + color: black; } + +h1 { + font-size: 2.5em; } + +h2 { + font-size: 2em; + border-bottom: 1px solid #e2e2e2; } + +h4 { + font-size: 13px; + line-height: 1.5; + margin-top: 21px; } + +h5 { + font-size: 1.1em; } + +h6 { + font-size: 1.1em; + color: #777; } + +.section-name { + color: gray; + display: block; + font-family: Helvetica; + font-size: 22px; + font-weight: 100; + margin-bottom: 15px; } + +pre, code { + font: 0.95em Menlo, monospace; + color: #777; + word-wrap: normal; } + +p code, li code { + background-color: #eee; + padding: 2px 4px; + border-radius: 4px; } + +a { + color: #0088cc; + text-decoration: none; } + +ul { + padding-left: 15px; } + +li { + line-height: 1.8em; } + +img { + max-width: 100%; } + +blockquote { + margin-left: 0; + padding: 0 10px; + border-left: 4px solid #ccc; } + +.content-wrapper { + margin: 0 auto; + width: 980px; } + +header { + font-size: 0.85em; + line-height: 26px; + background-color: #414141; + position: fixed; + width: 100%; + z-index: 1; } + header img { + padding-right: 6px; + vertical-align: -4px; + height: 16px; } + header a { + color: #fff; } + header p { + float: left; + color: #999; } + header .header-right { + float: right; + margin-left: 16px; } + +#breadcrumbs { + background-color: #f2f2f2; + height: 27px; + padding-top: 17px; + position: fixed; + width: 100%; + z-index: 1; + margin-top: 26px; } + #breadcrumbs #carat { + height: 10px; + margin: 0 5px; } + +.sidebar { + background-color: #f9f9f9; + border: 1px solid #e2e2e2; + overflow-y: auto; + overflow-x: hidden; + position: fixed; + top: 70px; + bottom: 0; + width: 230px; + word-wrap: normal; } + +.nav-groups { + list-style-type: none; + background: #fff; + padding-left: 0; } + +.nav-group-name { + border-bottom: 1px solid #e2e2e2; + font-size: 1.1em; + font-weight: 100; + padding: 15px 0 15px 20px; } + .nav-group-name > a { + color: #333; } + +.nav-group-tasks { + margin-top: 5px; } + +.nav-group-task { + font-size: 0.9em; + list-style-type: none; + white-space: nowrap; } + .nav-group-task a { + color: #888; } + +.main-content { + background-color: #fff; + border: 1px solid #e2e2e2; + margin-left: 246px; + position: absolute; + overflow: hidden; + padding-bottom: 60px; + top: 70px; + width: 734px; } + .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { + margin-bottom: 1em; } + .main-content p { + line-height: 1.8em; } + .main-content section .section:first-child { + margin-top: 0; + padding-top: 0; } + .main-content section .task-group-section .task-group:first-of-type { + padding-top: 10px; } + .main-content section .task-group-section .task-group:first-of-type .section-name { + padding-top: 15px; } + .main-content section .heading:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + +.section { + padding: 0 25px; } + +.highlight { + background-color: #eee; + padding: 10px 12px; + border: 1px solid #e2e2e2; + border-radius: 4px; + overflow-x: auto; } + +.declaration .highlight { + overflow-x: initial; + padding: 0 40px 40px 0; + margin-bottom: -25px; + background-color: transparent; + border: none; } + +.section-name { + margin: 0; + margin-left: 18px; } + +.task-group-section { + padding-left: 6px; + border-top: 1px solid #e2e2e2; } + +.task-group { + padding-top: 0px; } + +.task-name-container a[name]:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + +.item { + padding-top: 8px; + width: 100%; + list-style-type: none; } + .item a[name]:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + .item code { + background-color: transparent; + padding: 0; } + .item .token { + padding-left: 3px; + margin-left: 15px; + font-size: 11.9px; } + .item .declaration-note { + font-size: .85em; + color: gray; + font-style: italic; } + +.pointer-container { + border-bottom: 1px solid #e2e2e2; + left: -23px; + padding-bottom: 13px; + position: relative; + width: 110%; } + +.pointer { + background: #f9f9f9; + border-left: 1px solid #e2e2e2; + border-top: 1px solid #e2e2e2; + height: 12px; + left: 21px; + top: -7px; + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); + position: absolute; + width: 12px; } + +.height-container { + display: none; + left: -25px; + padding: 0 25px; + position: relative; + width: 100%; + overflow: hidden; } + .height-container .section { + background: #f9f9f9; + border-bottom: 1px solid #e2e2e2; + left: -25px; + position: relative; + width: 100%; + padding-top: 10px; + padding-bottom: 5px; } + +.aside, .language { + padding: 6px 12px; + margin: 12px 0; + border-left: 5px solid #dddddd; + overflow-y: hidden; } + .aside .aside-title, .language .aside-title { + font-size: 9px; + letter-spacing: 2px; + text-transform: uppercase; + padding-bottom: 0; + margin: 0; + color: #aaa; + -webkit-user-select: none; } + .aside p:last-child, .language p:last-child { + margin-bottom: 0; } + +.language { + border-left: 5px solid #cde9f4; } + .language .aside-title { + color: #4b8afb; } + +.aside-warning { + border-left: 5px solid #ff6666; } + .aside-warning .aside-title { + color: #ff0000; } + +.graybox { + border-collapse: collapse; + width: 100%; } + .graybox p { + margin: 0; + word-break: break-word; + min-width: 50px; } + .graybox td { + border: 1px solid #e2e2e2; + padding: 5px 25px 5px 10px; + vertical-align: middle; } + .graybox tr td:first-of-type { + text-align: right; + padding: 7px; + vertical-align: top; + word-break: normal; + width: 40px; } + +.slightly-smaller { + font-size: 0.9em; } + +#footer { + position: absolute; + bottom: 10px; + margin-left: 25px; } + #footer p { + margin: 0; + color: #aaa; + font-size: 0.8em; } + +html.dash header, html.dash #breadcrumbs, html.dash .sidebar { + display: none; } +html.dash .main-content { + width: 980px; + margin-left: 0; + border: none; + width: 100%; + top: 0; + padding-bottom: 0; } +html.dash .height-container { + display: block; } +html.dash .item .token { + margin-left: 0; } +html.dash .content-wrapper { + width: auto; } +html.dash #footer { + position: static; } diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Info.plist b/docs/apis/swift/0.1/docsets/.docset/Contents/Info.plist new file mode 100644 index 00000000..61863ec4 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleIdentifier + com.jazzy. + CFBundleName + + DocSetPlatformFamily + + isDashDocset + + dashIndexFilePath + index.html + isJavaScriptEnabled + + DashDocSetFamily + dashtoc + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes.html new file mode 100644 index 00000000..0a7dee14 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes.html @@ -0,0 +1,912 @@ + + + + Classes Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Classes

+

The following classes are available globally.

+ +
+
+
+
    +
  • +
    + + + + TypedValue + +
    +
    +
    +
    +
    +
    +

    A wrapper around Mentat’s TypedValue Rust object. This class wraps a raw pointer to a Rust TypedValue +struct and provides accessors to the values according to expected result type.

    + +

    As the FFI functions for fetching values are consuming, this class keeps a copy of the result internally after +fetching so that the value can be referenced several times.

    + +

    Also, due to the consuming nature of the FFI layer, this class also manages it’s raw pointer, nilling it after calling the +FFI conversion function so that the underlying base class can manage cleanup.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class TypedValue : OptionalRustObject
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + Mentat + +
    +
    +
    +
    +
    +
    +

    The primary class for accessing Mentat’s API. +This class provides all of the basic API that can be found in Mentat’s Store struct. +The raw pointer it holds is a pointer to a Store.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class Mentat : RustObject
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + Query + +
    +
    +
    +
    +
    +
    +

    This class allows you to construct a query, bind values to variables and run those queries against a mentat DB.

    + +

    This class cannot be created directly, but must be created through Mentat.query(String:).

    + +

    The types of values you can bind are

    + +
      +
    • Int64
    • +
    • Entid
    • +
    • Keyword
    • +
    • Bool
    • +
    • Double
    • +
    • Date
    • +
    • String
    • +
    • UUID.
    • +
    + +

    Each bound variable must have a corresponding value in the query string used to create this query.

    +
    let query = """
    +           [:find ?name ?cat
    +            :in ?type
    +            :where
    +            [?c :community/name ?name]
    +            [?c :community/type ?type]
    +            [?c :community/category ?cat]]
    +           """
    +mentat.query(query: query)
    +       .bind(varName: "?type", toKeyword: ":community.type/website")
    +       .run { result in
    +            ...
    +        }
    +
    + +

    Queries can be run and the results returned in a number of different formats. Individual result values are returned as TypedValues and +the format differences relate to the number and structure of those values. The result format is related to the format provided in the query string.

    + +
      +
    • Rel - This is the default run function and returns a list of rows of values. Queries that wish to have Rel results should format their query strings: + +let query = """ + [: find ?a ?b ?c + : where ... ] + """ +mentat.query(query: query) +.run { result in + ... +} +
    • +
    • Scalar - This returns a single value as a result. This can be optional, as the value may not be present. Queries that wish to have Scalar results should format their query strings: + +let query = """ + [: find ?a . + : where ... ] + """ +mentat.query(query: query) +.runScalar { result in + ... +} +
    • +
    • Coll - This returns a list of single values as a result. Queries that wish to have Coll results should format their query strings: + +let query = """ + [: find [?a ...] + : where ... ] + """ +mentat.query(query: query) + .runColl { result in + ... + } +
    • +
    • Tuple - This returns a single row of values. Queries that wish to have Tuple results should format their query strings: + +let query = """ + [: find [?a ?b ?c] + : where ... ] + """ +mentat.query(query: query) +.runTuple { result in + ... +} +
    • +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class Query : OptionalRustObject
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + RelResult + +
    +
    +
    +
    +
    +
    +

    Wraps a Rel result from a Mentat query. +A Rel result is a list of rows of TypedValues. +Individual rows can be fetched or the set can be iterated.

    + +

    To fetch individual rows from a RelResult use row(Int32).

    +
    query.run { rows in
    +   let row1 = rows.row(0)
    +   let row2 = rows.row(1)
    +}
    +
    + +

    To iterate over the result set use standard iteration flows.

    +
    query.run { rows in
    +    rows.forEach { row in
    +        ...
    +    }
    +}
    +
    + +

    Note that iteration is consuming and can only be done once.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class RelResult : OptionalRustObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + RelResultIterator + +
    +
    +
    +
    +
    +
    +

    Iterator for RelResult.

    + +

    To iterate over the result set use standard iteration flows.

    +
    query.run { result in
    +    rows.forEach { row in
    +       ...
    +    }
    +}
    +
    + +

    Note that iteration is consuming and can only be done once.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class RelResultIterator : OptionalRustObject, IteratorProtocol
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + TupleResult + +
    +
    +
    +
    +
    +
    +

    Wraps a Tuple result from a Mentat query. +A Tuple result is a list of TypedValues. +Individual values can be fetched as TypedValues or converted into a requested type.

    + +

    Values can be fetched as one of the following types:

    + + + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class TupleResult : OptionalRustObject
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ColResult + +
    +
    +
    +
    +
    +
    +

    Wraps a Coll result from a Mentat query. +A Coll result is a list of rows of single values of type TypedValue. +Values for individual rows can be fetched as TypedValue or converted into a requested type.

    + +

    Row values can be fetched as one of the following types:

    + + + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class ColResult : TupleResult
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ColResultIterator + +
    +
    +
    +
    +
    +
    +

    Iterator for ColResult.

    + +

    To iterate over the result set use standard iteration flows.

    +
    query.runColl { rows in
    +    rows.forEach { value in
    +       ...
    +    }
    +}
    +
    + +

    Note that iteration is consuming and can only be done once.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class ColResultIterator : OptionalRustObject, IteratorProtocol
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + OptionalRustObject + +
    +
    +
    +
    +
    +
    +

    Base class that wraps an optional OpaquePointer representing a pointer to a Rust object. +This class should be used to wrap Rust pointer that point to consuming structs, that is, calling a function +for that Rust pointer, will cause Rust to destroy the pointer, leaving the Swift pointer dangling. +These classes are responsible for ensuring that their raw OpaquePointer are nilled after calling a consuming +FFI function. +This class provides cleanup functions on deinit, ensuring that all classes +that inherit from it will have their OpaquePointer destroyed when the Swift wrapper is destroyed. +If a class does not override cleanup then a fatalError is thrown. +The optional pointer is managed here such that is the pointer is nil, then the cleanup function is not called +ensuring that we do not double free the pointer on exit.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class OptionalRustObject : Destroyable
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + RustObject + +
    +
    +
    +
    +
    +
    +

    Base class that wraps an non-optional OpaquePointer representing a pointer to a Rust object. +This class provides cleanup functions on deinit, ensuring that all classes +that inherit from it will have their OpaquePointer destroyed when the Swift wrapper is destroyed. +If a class does not override cleanup then a fatalError is thrown.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class RustObject : Destroyable
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + EntityBuilder + +
    +
    +
    +
    +
    +
    +

    This class wraps a raw pointer that points to a Rust EntityBuilder<InProgressBuilder> object.

    + +

    EntityBuilder provides a programmatic interface to performing assertions on a specific entity. +It provides functions for adding and retracting values for attributes for an entity within +an in progress transaction.

    + +

    The transact function will transact the assertions that have been added to the EntityBuilder +and pass back the TxReport that was generated by this transact and the InProgress that was +used to perform the transact. This enables you to perform further transacts on the same InProgress +before committing.

    +
    let aEntid = txReport.entid(forTempId: "a")
    +let bEntid = txReport.entid(forTempId: "b")
    +do {
    +   let builder = try mentat.entityBuilder(forEntid: bEntid)
    +   try builder.add(keyword: ":foo/boolean", boolean: true)
    +   try builder.add(keyword: ":foo/instant", date: newDate)
    +   let (inProgress, report) = try builder.transact()
    +   try inProgress.transact(transaction: "[[:db/add \(aEntid) :foo/long 22]]")
    +   try inProgress.commit()
    +} catch {
    +   ...
    +}
    +
    + +

    The commit function will transact and commit the assertions that have been added to the EntityBuilder. +It will consume the InProgress used to perform the transact. It returns the TxReport generated by +the transact. After calling commit, a new transaction must be started by calling Mentat.beginTransaction() +in order to perform further actions.

    +
    let aEntid = txReport.entid(forTempId: "a")
    +do {
    +    let builder = try mentat.entityBuilder(forEntid: aEntid)
    +    try builder.add(keyword: ":foo/boolean", boolean: true)
    +    try builder.add(keyword: ":foo/instant", date: newDate)
    +    let report = try builder.commit()
    +    ...
    +} catch {
    +   ...
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class EntityBuilder : OptionalRustObject
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + InProgress + +
    +
    +
    +
    +
    +
    +

    This class wraps a raw pointer that points to a Rust InProgress object.

    + +

    InProgress allows for multiple transacts to be performed in a single transaction. + Each transact performed results in a TxReport that can be used to gather information + to be used in subsequent transacts.

    + +

    Committing an InProgress commits all the transacts that have been performed using + that InProgress.

    + +

    Rolling back and InProgress rolls back all the transacts that have been performed + using that InProgress.

    +
     do {
    +     let inProgress = try mentat.beginTransaction()
    +     let txReport = try inProgress.transact(transaction: "[[:db/add "a" :foo/long 22]]")
    +     let aEntid = txReport.entid(forTempId: "a")
    +     let report = try inProgress.transact(transaction: "[[:db/add "b" :foo/ref \(aEntid)] [:db/add "b" :foo/boolean true]]")
    +     try inProgress.commit()
    + } catch {
    +    ...
    + }
    +
    + +

    InProgress also provides a number of functions to generating an builder to assert datoms programatically. + The two types of builder are InProgressBuilder and EntityBuilder.

    + +

    InProgressBuilder takes the current InProgress and provides a programmatic interface to add + and retract values from entities for which there exists an Entid. The provided InProgress + is used to perform the transacts.

    +
     let aEntid = txReport.entid(forTempId: "a")
    + let bEntid = txReport.entid(forTempId: "b")
    + do {
    +     let inProgress = try mentat.beginTransaction()
    +     let builder = try inProgress.builder()
    +     try builder.add(entid: bEntid, keyword: ":foo/boolean", boolean: true)
    +     try builder.add(entid: aEntid, keyword: ":foo/instant", date: newDate)
    +     let (inProgress, report) = try builder.transact()
    +     try inProgress.transact(transaction: "[[:db/add \(aEntid) :foo/long 22]]")
    +     try inProgress.commit()
    + } catch {
    +    ...
    + }
    +
    + +

    EntityBuilder takes the current InProgress and either an Entid or a tempid to provide + a programmatic interface to add and retract values from a specific entity. The provided InProgress + is used to perform the transacts.

    +
     do {
    +     let transaction = try mentat.beginTransaction()
    +     let builder = try transaction.builder(forTempId: "b")
    +     try builder.add(keyword: ":foo/boolean", boolean: true)
    +     try builder.add(keyword: ":foo/instant", date: newDate)
    +     let (inProgress, report) = try builder.transact()
    +     let bEntid = report.entid(forTempId: "b")
    +     try inProgress.transact(transaction: "[[:db/add \(bEntid) :foo/long 22]]")
    +     try inProgress.commit()
    + } catch {
    +    ...
    + }
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class InProgress : OptionalRustObject
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + InProgressBuilder + +
    +
    +
    +
    +
    +
    +

    This class wraps a raw pointer that points to a Rust InProgressBuilder object.

    + +

    InProgressBuilder provides a programmatic interface to performing assertions for entities. +It provides functions for adding and retracting values for attributes for an entity within +an in progress transaction.

    + +

    The transact function will transact the assertions that have been added to the InProgressBuilder +and pass back the TxReport that was generated by this transact and the InProgress that was +used to perform the transact. This enables you to perform further transacts on the same InProgress +before committing.

    +
    let aEntid = txReport.entid(forTempId: "a")
    +let bEntid = txReport.entid(forTempId: "b")
    +do {
    +    let builder = try mentat.entityBuilder()
    +    try builder.add(entid: bEntid, keyword: ":foo/boolean", boolean: true)
    +    try builder.add(entid: aEntid, keyword: ":foo/instant", date: newDate)
    +    let (inProgress, report) = try builder.transact()
    +    try inProgress.transact(transaction: "[[:db/add \(aEntid) :foo/long 22]]")
    +    try inProgress.commit()
    +    ...
    +} catch {
    +   ...
    +}
    +
    + +

    The commit function will transact and commit the assertions that have been added to the EntityBuilder. +It will consume the InProgress used to perform the transact. It returns the TxReport generated by +the transact. After calling commit, a new transaction must be started by calling Mentat.beginTransaction() +in order to perform further actions.

    +
    let aEntid = txReport.entid(forTempId: "a")
    +let bEntid = txReport.entid(forTempId: "b")
    +do {
    +    let builder = try mentat.entityBuilder(forEntid: aEntid)
    +    try builder.add(entid: bEntid, keyword: ":foo/boolean", boolean: true)
    +    try builder.add(entid: aEntid, keyword: ":foo/instant", date: newDate)
    +    let report = try builder.commit()
    +   ...
    +} catch {
    +   ...
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class InProgressBuilder : OptionalRustObject
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + TxReport + +
    +
    +
    +
    +
    +
    +

    This class wraps a raw pointer that points to a Rust TxReport object.

    + +

    The TxReport contains information about a successful Mentat transaction.

    + +

    This information includes:

    + +
      +
    • txId - the identifier for the transaction.
    • +
    • txInstant - the time that the transaction occured.
    • +
    • a map of temporary identifiers provided in the transaction and the Entids that they were mapped to,
    • +
    + +

    Access an Entid for a temporary identifier that was provided in the transaction can be done through entid(String:).

    +
    let report = mentat.transact("[[:db/add "a" :foo/boolean true]]")
    +let aEntid = report.entid(forTempId: "a")
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class TxReport : RustObject
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/ColResult.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/ColResult.html new file mode 100644 index 00000000..1b928041 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/ColResult.html @@ -0,0 +1,204 @@ + + + + ColResult Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

ColResult

+
+
+
open class ColResult : TupleResult
+ +
+
+

Wraps a Coll result from a Mentat query. +A Coll result is a list of rows of single values of type TypedValue. +Values for individual rows can be fetched as TypedValue or converted into a requested type.

+ +

Row values can be fetched as one of the following types:

+ + + +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/ColResultIterator.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/ColResultIterator.html new file mode 100644 index 00000000..cc470b67 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/ColResultIterator.html @@ -0,0 +1,251 @@ + + + + ColResultIterator Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

ColResultIterator

+
+
+
open class ColResultIterator : OptionalRustObject, IteratorProtocol
+ +
+
+

Iterator for ColResult.

+ +

To iterate over the result set use standard iteration flows.

+
query.runColl { rows in
+    rows.forEach { value in
+       ...
+    }
+}
+
+ +

Note that iteration is consuming and can only be done once.

+ +
+
+
+
    +
  • +
    + + + + Element + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Element = TypedValue
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + next() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func next() -> Element?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/EntityBuilder.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/EntityBuilder.html new file mode 100644 index 00000000..d1fbbdf3 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/EntityBuilder.html @@ -0,0 +1,1438 @@ + + + + EntityBuilder Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

EntityBuilder

+
+
+
open class EntityBuilder : OptionalRustObject
+ +
+
+

This class wraps a raw pointer that points to a Rust EntityBuilder<InProgressBuilder> object.

+ +

EntityBuilder provides a programmatic interface to performing assertions on a specific entity. +It provides functions for adding and retracting values for attributes for an entity within +an in progress transaction.

+ +

The transact function will transact the assertions that have been added to the EntityBuilder +and pass back the TxReport that was generated by this transact and the InProgress that was +used to perform the transact. This enables you to perform further transacts on the same InProgress +before committing.

+
let aEntid = txReport.entid(forTempId: "a")
+let bEntid = txReport.entid(forTempId: "b")
+do {
+   let builder = try mentat.entityBuilder(forEntid: bEntid)
+   try builder.add(keyword: ":foo/boolean", boolean: true)
+   try builder.add(keyword: ":foo/instant", date: newDate)
+   let (inProgress, report) = try builder.transact()
+   try inProgress.transact(transaction: "[[:db/add \(aEntid) :foo/long 22]]")
+   try inProgress.commit()
+} catch {
+   ...
+}
+
+ +

The commit function will transact and commit the assertions that have been added to the EntityBuilder. +It will consume the InProgress used to perform the transact. It returns the TxReport generated by +the transact. After calling commit, a new transaction must be started by calling Mentat.beginTransaction() +in order to perform further actions.

+
let aEntid = txReport.entid(forTempId: "a")
+do {
+    let builder = try mentat.entityBuilder(forEntid: aEntid)
+    try builder.add(keyword: ":foo/boolean", boolean: true)
+    try builder.add(keyword: ":foo/instant", date: newDate)
+    let report = try builder.commit()
+    ...
+} catch {
+   ...
+}
+
+ +
+
+
+
    +
  • +
    + + + + add(keyword:long:) + +
    +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/long.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(keyword: String, long value: Int64) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/ref.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(keyword: String, reference value: Int64) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + add(keyword:keyword:) + +
    +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/keyword.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(keyword: String, keyword value: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + add(keyword:boolean:) + +
    +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/boolean.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(keyword: String, boolean value: Bool) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + add(keyword:double:) + +
    +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/double.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(keyword: String, double value: Double) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + add(keyword:date:) + +
    +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/instant.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(keyword: String, date value: Date) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + add(keyword:string:) + +
    +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/string.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(keyword: String, string value: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + add(keyword:uuid:) + +
    +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/uuid.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(keyword: String, uuid value: UUID) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/long.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(keyword: String, long value: Int64) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/ref.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(keyword: String, reference value: Int64) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/keyword.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(keyword: String, keyword value: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/boolean.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(keyword: String, boolean value: Bool) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/double.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(keyword: String, double value: Double) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/instant.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(keyword: String, date value: Date) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/string.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(keyword: String, string value: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/uuid.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(keyword: String, uuid value: UUID) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + transact() + +
    +
    +
    +
    +
    +
    +

    Transacts the added assertions. This consumes the pointer associated with this EntityBuilder +such that no further assertions can be added after the transact has completed. To perform +further assertions, use the InProgress returned from this function.

    + +

    This does not commit the transaction. In order to do so, commit can be called on the InProgress returned +from this function.

    +
    +

    Throws

    + PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed. + +
    +
    +

    Throws

    +

    ResultError.error if an error occured during the execution of the transact.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func transact() throws -> (InProgress, TxReport?)
    + +
    +
    +
    +

    Return Value

    +

    The current InProgress and the TxReport generated by the transact.

    +
    +
    +
    +
  • +
  • +
    + + + + commit() + +
    +
    +
    +
    +
    +
    +

    Transacts the added assertions and commits. This consumes the pointer associated with this EntityBuilder +and the associated InProgress such that no further assertions can be added after the commit has completed. +To perform further assertions, a new InProgress or EntityBuilder should be created.

    +
    +

    Throws

    + PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed. + +
    +
    +

    Throws

    +

    ResultError.error if an error occured during the execution of the transact.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func commit() throws -> TxReport
    + +
    +
    +
    +

    Return Value

    +

    The TxReport generated by the transact.

    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/InProgress.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/InProgress.html new file mode 100644 index 00000000..2902b6f4 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/InProgress.html @@ -0,0 +1,543 @@ + + + + InProgress Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

InProgress

+
+
+
open class InProgress : OptionalRustObject
+ +
+
+

This class wraps a raw pointer that points to a Rust InProgress object.

+ +

InProgress allows for multiple transacts to be performed in a single transaction. + Each transact performed results in a TxReport that can be used to gather information + to be used in subsequent transacts.

+ +

Committing an InProgress commits all the transacts that have been performed using + that InProgress.

+ +

Rolling back and InProgress rolls back all the transacts that have been performed + using that InProgress.

+
 do {
+     let inProgress = try mentat.beginTransaction()
+     let txReport = try inProgress.transact(transaction: "[[:db/add "a" :foo/long 22]]")
+     let aEntid = txReport.entid(forTempId: "a")
+     let report = try inProgress.transact(transaction: "[[:db/add "b" :foo/ref \(aEntid)] [:db/add "b" :foo/boolean true]]")
+     try inProgress.commit()
+ } catch {
+    ...
+ }
+
+ +

InProgress also provides a number of functions to generating an builder to assert datoms programatically. + The two types of builder are InProgressBuilder and EntityBuilder.

+ +

InProgressBuilder takes the current InProgress and provides a programmatic interface to add + and retract values from entities for which there exists an Entid. The provided InProgress + is used to perform the transacts.

+
 let aEntid = txReport.entid(forTempId: "a")
+ let bEntid = txReport.entid(forTempId: "b")
+ do {
+     let inProgress = try mentat.beginTransaction()
+     let builder = try inProgress.builder()
+     try builder.add(entid: bEntid, keyword: ":foo/boolean", boolean: true)
+     try builder.add(entid: aEntid, keyword: ":foo/instant", date: newDate)
+     let (inProgress, report) = try builder.transact()
+     try inProgress.transact(transaction: "[[:db/add \(aEntid) :foo/long 22]]")
+     try inProgress.commit()
+ } catch {
+    ...
+ }
+
+ +

EntityBuilder takes the current InProgress and either an Entid or a tempid to provide + a programmatic interface to add and retract values from a specific entity. The provided InProgress + is used to perform the transacts.

+
 do {
+     let transaction = try mentat.beginTransaction()
+     let builder = try transaction.builder(forTempId: "b")
+     try builder.add(keyword: ":foo/boolean", boolean: true)
+     try builder.add(keyword: ":foo/instant", date: newDate)
+     let (inProgress, report) = try builder.transact()
+     let bEntid = report.entid(forTempId: "b")
+     try inProgress.transact(transaction: "[[:db/add \(bEntid) :foo/long 22]]")
+     try inProgress.commit()
+ } catch {
+    ...
+ }
+
+ +
+
+
+
    +
  • +
    + + + + builder() + +
    +
    +
    +
    +
    +
    +

    Creates an InProgressBuilder using this InProgress.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the InProgress +has already been committed, or converted into a Builder.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func builder() throws -> InProgressBuilder
    + +
    +
    +
    +

    Return Value

    +

    an InProgressBuilder for this InProgress

    +
    +
    +
    +
  • +
  • +
    + + + + builder(forEntid:) + +
    +
    +
    +
    +
    +
    +

    Creates an EntityBuilder using this InProgress for the entity with entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the InProgress +has already been committed, or converted into a Builder.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func builder(forEntid entid: Int64) throws -> EntityBuilder
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entid + + +
    +

    The Entid for this entity.

    +
    +
    +
    +
    +

    Return Value

    +

    an EntityBuilder for this InProgress

    +
    +
    +
    +
  • +
  • +
    + + + + builder(forTempId:) + +
    +
    +
    +
    +
    +
    +

    Creates an EntityBuilder using this InProgress for a new entity with tempId.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the InProgress +has already been committed, or converted into a Builder.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func builder(forTempId tempId: String) throws -> EntityBuilder
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + tempId + + +
    +

    The temporary identifier for this entity.

    +
    +
    +
    +
    +

    Return Value

    +

    an EntityBuilder for this InProgress

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Transacts the transaction

    + +

    This does not commit the transaction. In order to do so, commit can be called.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the transaction failed.

    + +
    +
    +

    Throws

    +

    ResultError.empty if no TxReport is returned from the transact.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func transact(transaction: String) throws -> TxReport
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + transaction + + +
    +

    The EDN string to be transacted.

    +
    +
    +
    +
    +

    Return Value

    +

    The TxReport generated by the transact.

    +
    +
    +
    +
  • +
  • +
    + + + + commit() + +
    +
    +
    +
    +
    +
    +
    Commits all the transacts that have been performed on this `InProgress`, either directly
    +or through a Builder.
    +
    +
    +

    Throws

    + PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed. + +
    +
    +

    Throws

    + ResultError.error if the commit failed. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func commit() throws
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + rollback() + +
    +
    +
    +
    +
    +
    +

    Rolls back all the transacts that have been performed on this InProgress, either directly +or through a Builder.

    +
    +

    Throws

    + PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed. + +
    +
    +

    Throws

    + ResultError.error if the rollback failed. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func rollback() throws
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/InProgressBuilder.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/InProgressBuilder.html new file mode 100644 index 00000000..a0500349 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/InProgressBuilder.html @@ -0,0 +1,1632 @@ + + + + InProgressBuilder Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

InProgressBuilder

+
+
+
open class InProgressBuilder : OptionalRustObject
+ +
+
+

This class wraps a raw pointer that points to a Rust InProgressBuilder object.

+ +

InProgressBuilder provides a programmatic interface to performing assertions for entities. +It provides functions for adding and retracting values for attributes for an entity within +an in progress transaction.

+ +

The transact function will transact the assertions that have been added to the InProgressBuilder +and pass back the TxReport that was generated by this transact and the InProgress that was +used to perform the transact. This enables you to perform further transacts on the same InProgress +before committing.

+
let aEntid = txReport.entid(forTempId: "a")
+let bEntid = txReport.entid(forTempId: "b")
+do {
+    let builder = try mentat.entityBuilder()
+    try builder.add(entid: bEntid, keyword: ":foo/boolean", boolean: true)
+    try builder.add(entid: aEntid, keyword: ":foo/instant", date: newDate)
+    let (inProgress, report) = try builder.transact()
+    try inProgress.transact(transaction: "[[:db/add \(aEntid) :foo/long 22]]")
+    try inProgress.commit()
+    ...
+} catch {
+   ...
+}
+
+ +

The commit function will transact and commit the assertions that have been added to the EntityBuilder. +It will consume the InProgress used to perform the transact. It returns the TxReport generated by +the transact. After calling commit, a new transaction must be started by calling Mentat.beginTransaction() +in order to perform further actions.

+
let aEntid = txReport.entid(forTempId: "a")
+let bEntid = txReport.entid(forTempId: "b")
+do {
+    let builder = try mentat.entityBuilder(forEntid: aEntid)
+    try builder.add(entid: bEntid, keyword: ":foo/boolean", boolean: true)
+    try builder.add(entid: aEntid, keyword: ":foo/instant", date: newDate)
+    let report = try builder.commit()
+   ...
+} catch {
+   ...
+}
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/long.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(entid: Entid, keyword: String, long value: Int64) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/ref.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(entid: Entid, keyword: String, reference value: Entid) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/keyword.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(entid: Entid, keyword: String, keyword value: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/boolean.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(entid: Entid, keyword: String, boolean value: Bool) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/double.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(entid: Entid, keyword: String, double value: Double) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/instant.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(entid: Entid, keyword: String, date value: Date) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/string.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(entid: Entid, keyword: String, string value: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asserts the value of attribute keyword to be the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/uuid.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func add(entid: Entid, keyword: String, uuid value: UUID) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be asserted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/long.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(entid: Entid, keyword: String, long value: Int64) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/ref.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(entid: Entid, keyword: String, reference value: Entid) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/keyword.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(entid: Entid, keyword: String, keyword value: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/boolean.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(entid: Entid, keyword: String, boolean value: Bool) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/double.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(entid: Entid, keyword: String, double value: Double) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/instant.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(entid: Entid, keyword: String, date value: Date) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/string.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(entid: Entid, keyword: String, string value: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retracts the value of attribute keyword from the provided value for entity entid.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed.

    + +
    +
    +

    Throws

    +

    ResultError.error if the attribute is not present in the schema or the attribute value type +is not :db.type/uuid.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func retract(entid: Entid, keyword: String, uuid value: UUID) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + entid + + +
    +

    The Entid of the entity to be touched.

    +
    +
    + + keyword + + +
    +

    The name of the attribute in the format :namespace/name.

    +
    +
    + + value + + +
    +

    The value to be retracted

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + transact() + +
    +
    +
    +
    +
    +
    +

    Transacts the added assertions. This consumes the pointer associated with this InProgressBuilder +such that no further assertions can be added after the transact has completed. To perform +further assertions, use the InProgress returned from this function.

    + +

    This does not commit the transaction. In order to do so, commit can be called on the InProgress returned +from this function.

    +
    +

    Throws

    + PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed. + +
    +
    +

    Throws

    +

    ResultError.error if an error occured during the execution of the transact.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func transact() throws -> (InProgress, TxReport?)
    + +
    +
    +
    +

    Return Value

    +

    The current InProgress and the TxReport generated by the transact.

    +
    +
    +
    +
  • +
  • +
    + + + + commit() + +
    +
    +
    +
    +
    +
    +

    Transacts the added assertions and commits. This consumes the pointer associated with this InProgressBuilder +and the associated InProgress such that no further assertions can be added after the commit has completed. +To perform further assertions, a new InProgress or InProgressBuilder should be created.

    +
    +

    Throws

    + PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the builder +has already been transacted or committed. + +
    +
    +

    Throws

    +

    ResultError.error if an error occured during the execution of the transact.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func commit() throws -> TxReport
    + +
    +
    +
    +

    Return Value

    +

    The TxReport generated by the transact.

    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/Mentat.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/Mentat.html new file mode 100644 index 00000000..4f446394 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/Mentat.html @@ -0,0 +1,904 @@ + + + + Mentat Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Mentat

+
+
+
open class Mentat : RustObject
+ +
+
+

The primary class for accessing Mentat’s API. +This class provides all of the basic API that can be found in Mentat’s Store struct. +The raw pointer it holds is a pointer to a Store.

+ +
+
+
+
    +
  • +
    + + + + init(raw:) + +
    +
    +
    +
    +
    +
    +

    Create a new Mentat with the provided pointer to a Mentat Store

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required override init(raw: OpaquePointer)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + raw + + +
    +

    A pointer to a Mentat Store.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + init(storeURI:) + +
    +
    +
    +
    +
    +
    +

    Open a connection to a Store in a given location. +If the store does not already exist, one will be created.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(storeURI: String = "")
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storeURI + + +
    +

    The URI as a String of the store to open. +If no store URI is provided, an in-memory store will be opened.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Add an attribute to the cache. The {@link CacheDirection} determines how that attribute can be +looked up.

    +
    +

    Throws

    +

    ResultError.error if an error occured while trying to cache the attribute.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func cache(attribute: String, direction: CacheDirection) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + attribute + + +
    +

    The attribute to cache

    +
    +
    + + direction + + +
    +

    The direction the attribute should be keyed. +forward caches values for an attribute keyed by entity +(i.e. find values and entities that have this attribute, or find values of attribute for an entity) +reverse caches entities for an attribute keyed by value. +(i.e. find entities that have a particular value for an attribute). +both adds an attribute such that it is cached in both directions.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Simple transact of an EDN string.

    +
    +

    Throws

    +

    ResultError.error if the an error occured during the transaction, or the TxReport is nil.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func transact(transaction: String) throws -> TxReport
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + transaction + + +
    +

    The string, as EDN, to be transacted

    +
    +
    +
    +
    +

    Return Value

    +

    The TxReport of the completed transaction

    +
    +
    +
    +
  • +
  • +
    + + + + beginTransaction() + +
    +
    +
    +
    +
    +
    +

    Start a new transaction.

    +
    +

    Throws

    + ResultError.error if the creation of the transaction fails. + +
    +
    +

    Throws

    +

    ResultError.empty if no InProgress is created.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func beginTransaction() throws -> InProgress
    + +
    +
    +
    +

    Return Value

    +

    The InProgress used to manage the transaction

    +
    +
    +
    +
  • +
  • +
    + + + + entityBuilder() + +
    +
    +
    +
    +
    +
    +

    Creates a new transaction (InProgress) and returns an InProgressBuilder for that transaction.

    +
    +

    Throws

    + ResultError.error if the creation of the transaction fails. + +
    +
    +

    Throws

    +

    ResultError.empty if no InProgressBuilder is created.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func entityBuilder() throws -> InProgressBuilder
    + +
    +
    +
    +

    Return Value

    +

    an InProgressBuilder for this InProgress

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a new transaction (InProgress) and returns an EntityBuilder for the entity with entid +for that transaction.

    +
    +

    Throws

    +

    ResultError.error if the creation of the transaction fails.

    + +
    +
    +

    Throws

    +

    ResultError.empty if no EntityBuilder is created.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func entityBuilder(forEntid entid: Entid) throws -> EntityBuilder
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entid + + +
    +

    The Entid for this entity.

    +
    +
    +
    +
    +

    Return Value

    +

    an EntityBuilder for this InProgress

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a new transaction (InProgress) and returns an EntityBuilder for a new entity with tempId +for that transaction.

    +
    +

    Throws

    +

    ResultError.error if the creation of the transaction fails.

    + +
    +
    +

    Throws

    +

    ResultError.empty if no EntityBuilder is created.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func entityBuilder(forTempId tempId: String) throws -> EntityBuilder
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + tempId + + +
    +

    The temporary identifier for this entity.

    +
    +
    +
    +
    +

    Return Value

    +

    an EntityBuilder for this InProgress

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Get the the Entid of the attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func entidForAttribute(attribute: String) -> Entid
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + attribute + + +
    +

    The string represeting the attribute whose Entid we are after. +The string is represented as :namespace/name.

    +
    +
    +
    +
    +

    Return Value

    +

    The Entid associated with the attribute.

    +
    +
    +
    +
  • +
  • +
    + + + + query(query:) + +
    +
    +
    +
    +
    +
    +

    Start a query.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func query(query: String) -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + query + + +
    +

    The string represeting the the query to be executed.

    +
    +
    +
    +
    +

    Return Value

    +

    The Query representing the query that can be executed.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Retrieve a single value of an attribute for an Entity

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func value(forAttribute attribute: String, ofEntity entid: Entid) throws -> TypedValue?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + attribute + + +
    +

    The string the attribute whose value is to be returned. +The string is represented as :namespace/name.

    +
    +
    + + entid + + +
    +

    The Entid of the entity we want the value from.

    +
    +
    +
    +
    +

    Return Value

    +

    The TypedValue containing the value of the attribute for the entity.

    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Register an Observing and a set of attributes to observer for transaction observation. +The transactionDidOccur(String: [TxChange]:) function is called when a transaction +occurs in the Store that this Mentat is connected to that affects the attributes that an +Observing has registered for.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func register(key: String, observer: Observing, attributes: [String])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + key + + +
    +

    String representing an identifier for the Observing.

    +
    +
    + + observer + + +
    +

    The Observing to be notified when a transaction occurs.

    +
    +
    + + attributes + + +
    +

    An Array of Strings representing the attributes that the Observing +wishes to be notified about if they are referenced in a transaction.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + unregister(key:) + +
    +
    +
    +
    +
    +
    +

    Unregister the Observing that was registered with the provided key such that it will no longer be called +if a transaction occurs that affects the attributes that Observing was registered to observe.

    + +

    The Observing will need to re-register if it wants to start observing again.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func unregister(key: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + key + + +
    +

    String representing an identifier for the Observing.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/OptionalRustObject.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/OptionalRustObject.html new file mode 100644 index 00000000..102cd12c --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/OptionalRustObject.html @@ -0,0 +1,315 @@ + + + + OptionalRustObject Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

OptionalRustObject

+
+
+
open class OptionalRustObject : Destroyable
+ +
+
+

Base class that wraps an optional OpaquePointer representing a pointer to a Rust object. +This class should be used to wrap Rust pointer that point to consuming structs, that is, calling a function +for that Rust pointer, will cause Rust to destroy the pointer, leaving the Swift pointer dangling. +These classes are responsible for ensuring that their raw OpaquePointer are nilled after calling a consuming +FFI function. +This class provides cleanup functions on deinit, ensuring that all classes +that inherit from it will have their OpaquePointer destroyed when the Swift wrapper is destroyed. +If a class does not override cleanup then a fatalError is thrown. +The optional pointer is managed here such that is the pointer is nil, then the cleanup function is not called +ensuring that we do not double free the pointer on exit.

+ +
+
+
+
    +
  • +
    + + + + init(raw:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(raw: UnsafeMutableRawPointer)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(raw:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(raw: OpaquePointer?)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + getRaw() + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func getRaw() -> OpaquePointer?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + validPointer() + +
    +
    +
    +
    +
    +
    +

    Provides a non-optional OpaquePointer if one exists for this class.

    +
    +

    Throws

    +

    Pointer.pointerConsumed if the raw pointer wrapped by this class is nil

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func validPointer() throws -> OpaquePointer
    + +
    +
    +
    +

    Return Value

    +

    the raw OpaquePointer wrapped by this class.

    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/Query.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/Query.html new file mode 100644 index 00000000..4838707f --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/Query.html @@ -0,0 +1,1103 @@ + + + + Query Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Query

+
+
+
open class Query : OptionalRustObject
+ +
+
+

This class allows you to construct a query, bind values to variables and run those queries against a mentat DB.

+ +

This class cannot be created directly, but must be created through Mentat.query(String:).

+ +

The types of values you can bind are

+ +
    +
  • Int64
  • +
  • Entid
  • +
  • Keyword
  • +
  • Bool
  • +
  • Double
  • +
  • Date
  • +
  • String
  • +
  • UUID.
  • +
+ +

Each bound variable must have a corresponding value in the query string used to create this query.

+
let query = """
+           [:find ?name ?cat
+            :in ?type
+            :where
+            [?c :community/name ?name]
+            [?c :community/type ?type]
+            [?c :community/category ?cat]]
+           """
+mentat.query(query: query)
+       .bind(varName: "?type", toKeyword: ":community.type/website")
+       .run { result in
+            ...
+        }
+
+ +

Queries can be run and the results returned in a number of different formats. Individual result values are returned as TypedValues and +the format differences relate to the number and structure of those values. The result format is related to the format provided in the query string.

+ +
    +
  • Rel - This is the default run function and returns a list of rows of values. Queries that wish to have Rel results should format their query strings: + +let query = """ + [: find ?a ?b ?c + : where ... ] + """ +mentat.query(query: query) +.run { result in + ... +} +
  • +
  • Scalar - This returns a single value as a result. This can be optional, as the value may not be present. Queries that wish to have Scalar results should format their query strings: + +let query = """ + [: find ?a . + : where ... ] + """ +mentat.query(query: query) +.runScalar { result in + ... +} +
  • +
  • Coll - This returns a list of single values as a result. Queries that wish to have Coll results should format their query strings: + +let query = """ + [: find [?a ...] + : where ... ] + """ +mentat.query(query: query) + .runColl { result in + ... + } +
  • +
  • Tuple - This returns a single row of values. Queries that wish to have Tuple results should format their query strings: + +let query = """ + [: find [?a ?b ?c] + : where ... ] + """ +mentat.query(query: query) +.runTuple { result in + ... +} +
  • +
+ +
+
+
+
    +
  • +
    + + + + bind(varName:toLong:) + +
    +
    +
    +
    +
    +
    +

    Binds a Int64 value to the provided variable name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toLong value: Int64) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Binds a Entid value to the provided variable name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toReference value: Entid) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Binds a String value representing a keyword for an attribute to the provided variable name. +Keywords take the format :namespace/name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toReference value: String) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Binds a keyword String value to the provided variable name. +Keywords take the format :namespace/name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toKeyword value: String) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Binds a Bool value to the provided variable name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toBoolean value: Bool) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Binds a Double value to the provided variable name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toDouble value: Double) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • +
    + + + + bind(varName:toDate:) + +
    +
    +
    +
    +
    +
    +

    Binds a Date value to the provided variable name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toDate value: Date) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Binds a String value to the provided variable name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toString value: String) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • +
    + + + + bind(varName:toUuid:) + +
    +
    +
    +
    +
    +
    +

    Binds a UUID value to the provided variable name.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has already been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func bind(varName: String, toUuid value: UUID) throws -> Query
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + varName + + +
    +

    The name of the variable in the format ?name.

    +
    +
    + + value + + +
    +

    The value to be bound

    +
    +
    +
    +
    +

    Return Value

    +

    This Query such that further function can be called.

    +
    +
    +
    +
  • +
  • +
    + + + + run(callback:) + +
    +
    +
    +
    +
    +
    +

    Execute the query with the values bound associated with this Query and call the provided callback function with the results as a list of rows of TypedValues.

    +
    +

    Throws

    +

    QueryError.executionFailed if the query fails to execute. This could be because the provided query did not parse, or that +variable we incorrectly bound, or that the query provided was not Rel.

    + +
    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has previously been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func run(callback: @escaping (RelResult?) -> Void) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + callback + + +
    +

    the function to call with the results of this query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + runScalar(callback:) + +
    +
    +
    +
    +
    +
    +

    Execute the query with the values bound associated with this Query and call the provided callback function with the result as a single TypedValue.

    +
    +

    Throws

    +

    QueryError.executionFailed if the query fails to execute. This could be because the provided query did not parse, that +variable we incorrectly bound, or that the query provided was not Scalar.

    + +
    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has previously been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func runScalar(callback: @escaping (TypedValue?) -> Void) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + callback + + +
    +

    the function to call with the results of this query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + runColl(callback:) + +
    +
    +
    +
    +
    +
    +

    Execute the query with the values bound associated with this Query and call the provided callback function with the result as a list of single TypedValues.

    +
    +

    Throws

    +

    QueryError.executionFailed if the query fails to execute. This could be because the provided query did not parse, that +variable we incorrectly bound, or that the query provided was not Coll.

    + +
    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has previously been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func runColl(callback: @escaping (ColResult?) -> Void) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + callback + + +
    +

    the function to call with the results of this query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + runTuple(callback:) + +
    +
    +
    +
    +
    +
    +

    Execute the query with the values bound associated with this Query and call the provided callback function with the result as a list of single TypedValues.

    +
    +

    Throws

    +

    QueryError.executionFailed if the query fails to execute. This could be because the provided query did not parse, that +variable we incorrectly bound, or that the query provided was not Tuple.

    + +
    +
    +

    Throws

    +

    PointerError.pointerConsumed if the underlying raw pointer has already consumed, which will occur if the query has previously been executed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func runTuple(callback: @escaping (TupleResult?) -> Void) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + callback + + +
    +

    the function to call with the results of this query

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/RelResult.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/RelResult.html new file mode 100644 index 00000000..0c38ae71 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/RelResult.html @@ -0,0 +1,293 @@ + + + + RelResult Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

RelResult

+
+
+
open class RelResult : OptionalRustObject
+ +
+
+

Wraps a Rel result from a Mentat query. +A Rel result is a list of rows of TypedValues. +Individual rows can be fetched or the set can be iterated.

+ +

To fetch individual rows from a RelResult use row(Int32).

+
query.run { rows in
+   let row1 = rows.row(0)
+   let row2 = rows.row(1)
+}
+
+ +

To iterate over the result set use standard iteration flows.

+
query.run { rows in
+    rows.forEach { row in
+        ...
+    }
+}
+
+ +

Note that iteration is consuming and can only be done once.

+ +
+
+
+
    +
  • +
    + + + + row(index:) + +
    +
    +
    +
    +
    +
    +

    Fetch the row at the requested index.

    +
    +

    Throws

    +

    PointerError.pointerConsumed if the result set has already been iterated.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func row(index: Int32) throws -> TupleResult?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    the index of the row to be fetched

    +
    +
    +
    +
    +

    Return Value

    +

    The row at the requested index as a TupleResult, if present, or nil if there is no row at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/RelResultIterator.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/RelResultIterator.html new file mode 100644 index 00000000..5a92da4d --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/RelResultIterator.html @@ -0,0 +1,251 @@ + + + + RelResultIterator Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

RelResultIterator

+
+
+
open class RelResultIterator : OptionalRustObject, IteratorProtocol
+ +
+
+

Iterator for RelResult.

+ +

To iterate over the result set use standard iteration flows.

+
query.run { result in
+    rows.forEach { row in
+       ...
+    }
+}
+
+ +

Note that iteration is consuming and can only be done once.

+ +
+
+
+
    +
  • +
    + + + + Element + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Element = TupleResult
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + next() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func next() -> Element?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/RustObject.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/RustObject.html new file mode 100644 index 00000000..d1be5c1f --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/RustObject.html @@ -0,0 +1,300 @@ + + + + RustObject Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

RustObject

+
+
+
open class RustObject : Destroyable
+ +
+
+

Base class that wraps an non-optional OpaquePointer representing a pointer to a Rust object. +This class provides cleanup functions on deinit, ensuring that all classes +that inherit from it will have their OpaquePointer destroyed when the Swift wrapper is destroyed. +If a class does not override cleanup then a fatalError is thrown.

+ +
+
+
+
    +
  • +
    + + + + init(raw:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(raw: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(raw:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(raw: UnsafeMutableRawPointer)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + init(raw:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(raw: OpaquePointer?)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + getRaw() + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func getRaw() -> OpaquePointer
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/TupleResult.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/TupleResult.html new file mode 100644 index 00000000..4539938a --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/TupleResult.html @@ -0,0 +1,672 @@ + + + + TupleResult Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

TupleResult

+
+
+
open class TupleResult : OptionalRustObject
+ +
+
+

Wraps a Tuple result from a Mentat query. +A Tuple result is a list of TypedValues. +Individual values can be fetched as TypedValues or converted into a requested type.

+ +

Values can be fetched as one of the following types:

+ + + +
+
+
+
    +
  • +
    + + + + get(index:) + +
    +
    +
    +
    +
    +
    +

    Return the TypedValue at the specified index. +If the index is greater than the number of values then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func get(index: Int) -> TypedValue
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The TypedValue at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + asLong(index:) + +
    +
    +
    +
    +
    +
    +

    Return the Int64 at the specified index. +If the index is greater than the number of values then this function will crash. +If the value type if the TypedValue at this index is not Long then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asLong(index: Int) -> Int64
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The Int64 at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + asEntid(index:) + +
    +
    +
    +
    +
    +
    +

    Return the Entid at the specified index. +If the index is greater than the number of values then this function will crash. +If the value type if the TypedValue at this index is not Ref then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asEntid(index: Int) -> Entid
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The Entid at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + asKeyword(index:) + +
    +
    +
    +
    +
    +
    +

    Return the keyword String at the specified index. +If the index is greater than the number of values then this function will crash. +If the value type if the TypedValue at this index is not Keyword then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asKeyword(index: Int) -> String
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The keyword String at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + asBool(index:) + +
    +
    +
    +
    +
    +
    +

    Return the Bool at the specified index. +If the index is greater than the number of values then this function will crash. +If the value type if the TypedValue at this index is not Boolean then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asBool(index: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The Bool at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + asDouble(index:) + +
    +
    +
    +
    +
    +
    +

    Return the Double at the specified index. +If the index is greater than the number of values then this function will crash. +If the value type if the TypedValue at this index is not Double then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asDouble(index: Int) -> Double
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The Double at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + asDate(index:) + +
    +
    +
    +
    +
    +
    +

    Return the Date at the specified index. +If the index is greater than the number of values then this function will crash. +If the value type if the TypedValue at this index is not Instant then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asDate(index: Int) -> Date
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The Date at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + asString(index:) + +
    +
    +
    +
    +
    +
    +

    Return the String at the specified index. +If the index is greater than the number of values then this function will crash. +If the value type if the TypedValue at this index is not String then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asString(index: Int) -> String
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The String at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + asUUID(index:) + +
    +
    +
    +
    +
    +
    +

    Return the UUID at the specified index. +If the index is greater than the number of values then this function will crash. +If the value type if the TypedValue at this index is not Uuid then this function will crash.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asUUID(index: Int) -> UUID?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + index + + +
    +

    The index of the value to fetch.

    +
    +
    +
    +
    +

    Return Value

    +

    The UUID at that index.

    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/TxReport.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/TxReport.html new file mode 100644 index 00000000..b88b87ce --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/TxReport.html @@ -0,0 +1,308 @@ + + + + TxReport Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

TxReport

+
+
+
open class TxReport : RustObject
+ +
+
+

This class wraps a raw pointer that points to a Rust TxReport object.

+ +

The TxReport contains information about a successful Mentat transaction.

+ +

This information includes:

+ +
    +
  • txId - the identifier for the transaction.
  • +
  • txInstant - the time that the transaction occured.
  • +
  • a map of temporary identifiers provided in the transaction and the Entids that they were mapped to,
  • +
+ +

Access an Entid for a temporary identifier that was provided in the transaction can be done through entid(String:).

+
let report = mentat.transact("[[:db/add "a" :foo/boolean true]]")
+let aEntid = report.entid(forTempId: "a")
+
+ +
+
+
+
    +
  • +
    + + + + txId + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open var txId: Entid { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + txInstant + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open var txInstant: Date { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + entid(forTempId:) + +
    +
    +
    +
    +
    +
    +

    Access an Entid for a temporary identifier that was provided in the transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func entid(forTempId tempId: String) -> Entid?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + tempId + + +
    +

    A String representing the temporary identifier to fetch the Entid for.

    +
    +
    +
    +
    +

    Return Value

    +

    The Entid for the temporary identifier, if present, otherwise nil.

    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/TypedValue.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/TypedValue.html new file mode 100644 index 00000000..1240c1a8 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Classes/TypedValue.html @@ -0,0 +1,452 @@ + + + + TypedValue Class Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

TypedValue

+
+
+
open class TypedValue : OptionalRustObject
+ +
+
+

A wrapper around Mentat’s TypedValue Rust object. This class wraps a raw pointer to a Rust TypedValue +struct and provides accessors to the values according to expected result type.

+ +

As the FFI functions for fetching values are consuming, this class keeps a copy of the result internally after +fetching so that the value can be referenced several times.

+ +

Also, due to the consuming nature of the FFI layer, this class also manages it’s raw pointer, nilling it after calling the +FFI conversion function so that the underlying base class can manage cleanup.

+ +
+
+
+
    +
  • +
    + + + + asLong() + +
    +
    +
    +
    +
    +
    +

    This value as a Int64. This function will panic if the ValueType of this TypedValue +is not a Long

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asLong() -> Int64
    + +
    +
    +
    +

    Return Value

    +

    the value of this TypedValue as a Int64

    +
    +
    +
    +
  • +
  • +
    + + + + asEntid() + +
    +
    +
    +
    +
    +
    +

    This value as an Entid. This function will panic if the ValueType of this TypedValue +is not a Ref

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asEntid() -> Entid
    + +
    +
    +
    +

    Return Value

    +

    the value of this TypedValue as an Entid

    +
    +
    +
    +
  • +
  • +
    + + + + asKeyword() + +
    +
    +
    +
    +
    +
    +

    This value as a keyword String. This function will panic if the ValueType of this TypedValue +is not a Keyword

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asKeyword() -> String
    + +
    +
    +
    +

    Return Value

    +

    the value of this TypedValue as a keyword String

    +
    +
    +
    +
  • +
  • +
    + + + + asBool() + +
    +
    +
    +
    +
    +
    +

    This value as a Bool. This function will panic if the ValueType of this TypedValue +is not a Boolean

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asBool() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    the value of this TypedValue as a Bool

    +
    +
    +
    +
  • +
  • +
    + + + + asDouble() + +
    +
    +
    +
    +
    +
    +

    This value as a Double. This function will panic if the ValueType of this TypedValue +is not a Double

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asDouble() -> Double
    + +
    +
    +
    +

    Return Value

    +

    the value of this TypedValue as a Double

    +
    +
    +
    +
  • +
  • +
    + + + + asDate() + +
    +
    +
    +
    +
    +
    +

    This value as a Date. This function will panic if the ValueType of this TypedValue +is not a Instant

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asDate() -> Date
    + +
    +
    +
    +

    Return Value

    +

    the value of this TypedValue as a Date

    +
    +
    +
    +
  • +
  • +
    + + + + asString() + +
    +
    +
    +
    +
    +
    +

    This value as a String. This function will panic if the ValueType of this TypedValue +is not a String

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asString() -> String
    + +
    +
    +
    +

    Return Value

    +

    the value of this TypedValue as a String

    +
    +
    +
    +
  • +
  • +
    + + + + asUUID() + +
    +
    +
    +
    +
    +
    +

    This value as a UUID. This function will panic if the ValueType of this TypedValue +is not a Uuid

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func asUUID() -> UUID?
    + +
    +
    +
    +

    Return Value

    +

    the value of this TypedValue as a UUID?. If the UUID is not valid then this function returns nil.

    +
    +
    +
    +
  • +
  • +
    + + + + cleanup(pointer:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func cleanup(pointer: OpaquePointer)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Enums.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Enums.html new file mode 100644 index 00000000..75323db6 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Enums.html @@ -0,0 +1,272 @@ + + + + Enumerations Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Enumerations

+

The following enumerations are available globally.

+ +
+
+
+
    +
  • +
    + + + + QueryError + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum QueryError : Error
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + PointerError + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum PointerError : Error
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ResultError + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ResultError : Error
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + CacheDirection + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum CacheDirection
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Enums/CacheDirection.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Enums/CacheDirection.html new file mode 100644 index 00000000..875124a4 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Enums/CacheDirection.html @@ -0,0 +1,243 @@ + + + + CacheDirection Enumeration Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

CacheDirection

+
+
+
public enum CacheDirection
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + forward + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case forward
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + reverse + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case reverse
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + both + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case both
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Enums/PointerError.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Enums/PointerError.html new file mode 100644 index 00000000..08a63799 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Enums/PointerError.html @@ -0,0 +1,189 @@ + + + + PointerError Enumeration Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

PointerError

+
+
+
public enum PointerError : Error
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + pointerConsumed + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case pointerConsumed
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Enums/QueryError.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Enums/QueryError.html new file mode 100644 index 00000000..5090fcec --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Enums/QueryError.html @@ -0,0 +1,216 @@ + + + + QueryError Enumeration Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

QueryError

+
+
+
public enum QueryError : Error
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + invalidKeyword + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case invalidKeyword(message: String)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + executionFailed + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case executionFailed(message: String)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Enums/ResultError.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Enums/ResultError.html new file mode 100644 index 00000000..d3219856 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Enums/ResultError.html @@ -0,0 +1,216 @@ + + + + ResultError Enumeration Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

ResultError

+
+
+
public enum ResultError : Error
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + error + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case error(message: String)
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + empty + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case empty
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Extensions.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Extensions.html new file mode 100644 index 00000000..09cd69f0 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Extensions.html @@ -0,0 +1,215 @@ + + + + Extensions Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Extensions

+

The following extensions are available globally.

+ +
+
+
+
    +
  • +
    + + + + Date + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Date : ReferenceConvertible, Comparable, Equatable
    + +
    +
    +
    +
    +
  • +
+
+
+
    +
  • +
    + + + + Result + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    struct Result
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Extensions/Date.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Extensions/Date.html new file mode 100644 index 00000000..e64d0df5 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Extensions/Date.html @@ -0,0 +1,192 @@ + + + + Date Extension Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Date

+
+
+
struct Date : ReferenceConvertible, Comparable, Equatable
+ +
+
+ +
+
+
+
    +
  • +
    + + + + toMicroseconds() + +
    +
    +
    +
    +
    +
    +

    This Date as microseconds.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func toMicroseconds() -> Int64
    + +
    +
    +
    +

    Return Value

    +

    The timeIntervalSince1970 in microseconds

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Extensions/Result.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Extensions/Result.html new file mode 100644 index 00000000..f78bf684 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Extensions/Result.html @@ -0,0 +1,242 @@ + + + + Result Extension Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Result

+
+
+
struct Result
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + unwrap() + +
    +
    +
    +
    +
    +
    +

    Force unwraps a result. +Expects there to be a value attached and throws an error is there is not.

    +
    +

    Throws

    + ResultError.error if the result contains an error + +
    +
    +

    Throws

    +

    ResultError.empty if the result contains no error but also no result.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func unwrap() throws -> UnsafeMutableRawPointer
    + +
    +
    +
    +

    Return Value

    +

    The pointer to the successful result value.

    +
    +
    +
    +
  • +
  • +
    + + + + tryUnwrap() + +
    +
    +
    +
    +
    +
    +

    Unwraps an optional result, yielding either a successful value or a nil.

    +
    +

    Throws

    +

    ResultError.error if the result contains an error

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func tryUnwrap() throws -> UnsafeMutableRawPointer?
    + +
    +
    +
    +

    Return Value

    +

    The pointer to the successful result value, or nil if no value is present.

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Protocols.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Protocols.html new file mode 100644 index 00000000..223c09e5 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Protocols.html @@ -0,0 +1,212 @@ + + + + Protocols Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Protocols

+

The following protocols are available globally.

+ +
+
+
+
    +
  • +
    + + + + Observing + +
    +
    +
    +
    +
    +
    +

    Protocol to be implemented by any object that wishes to register for transaction observation

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol Observing
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Observable + +
    +
    +
    +
    +
    +
    +

    Protocol to be implemented by any object that provides an interface to Mentat’s transaction observers.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol Observable
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Protocols/Observable.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Protocols/Observable.html new file mode 100644 index 00000000..ed5f8bcc --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Protocols/Observable.html @@ -0,0 +1,216 @@ + + + + Observable Protocol Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Observable

+
+
+
public protocol Observable
+ +
+
+

Protocol to be implemented by any object that provides an interface to Mentat’s transaction observers.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func register(key: String, observer: Observing, attributes: [String])
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + unregister(key:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func unregister(key: String)
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Protocols/Observing.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Protocols/Observing.html new file mode 100644 index 00000000..070d11e3 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Protocols/Observing.html @@ -0,0 +1,189 @@ + + + + Observing Protocol Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Observing

+
+
+
public protocol Observing
+ +
+
+

Protocol to be implemented by any object that wishes to register for transaction observation

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func transactionDidOccur(key: String, reports: [TxChange])
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Structs.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Structs.html new file mode 100644 index 00000000..e0dac947 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Structs.html @@ -0,0 +1,183 @@ + + + + Structures Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Structures

+

The following structures are available globally.

+ +
+
+
+
    +
  • +
    + + + + MentatError + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct MentatError : Error
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Typealiases.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Typealiases.html new file mode 100644 index 00000000..500a8e4a --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/Typealiases.html @@ -0,0 +1,183 @@ + + + + Type Aliases Reference + + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+

Type Aliases

+

The following type aliases are available globally.

+ +
+
+
+
    +
  • +
    + + + + Entid + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Entid = Int64
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/css/highlight.css b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/css/highlight.css new file mode 100644 index 00000000..d0db0e13 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/css/highlight.css @@ -0,0 +1,200 @@ +/* Credit to https://gist.github.com/wataru420/2048287 */ +.highlight { + /* Comment */ + /* Error */ + /* Keyword */ + /* Operator */ + /* Comment.Multiline */ + /* Comment.Preproc */ + /* Comment.Single */ + /* Comment.Special */ + /* Generic.Deleted */ + /* Generic.Deleted.Specific */ + /* Generic.Emph */ + /* Generic.Error */ + /* Generic.Heading */ + /* Generic.Inserted */ + /* Generic.Inserted.Specific */ + /* Generic.Output */ + /* Generic.Prompt */ + /* Generic.Strong */ + /* Generic.Subheading */ + /* Generic.Traceback */ + /* Keyword.Constant */ + /* Keyword.Declaration */ + /* Keyword.Pseudo */ + /* Keyword.Reserved */ + /* Keyword.Type */ + /* Literal.Number */ + /* Literal.String */ + /* Name.Attribute */ + /* Name.Builtin */ + /* Name.Class */ + /* Name.Constant */ + /* Name.Entity */ + /* Name.Exception */ + /* Name.Function */ + /* Name.Namespace */ + /* Name.Tag */ + /* Name.Variable */ + /* Operator.Word */ + /* Text.Whitespace */ + /* Literal.Number.Float */ + /* Literal.Number.Hex */ + /* Literal.Number.Integer */ + /* Literal.Number.Oct */ + /* Literal.String.Backtick */ + /* Literal.String.Char */ + /* Literal.String.Doc */ + /* Literal.String.Double */ + /* Literal.String.Escape */ + /* Literal.String.Heredoc */ + /* Literal.String.Interpol */ + /* Literal.String.Other */ + /* Literal.String.Regex */ + /* Literal.String.Single */ + /* Literal.String.Symbol */ + /* Name.Builtin.Pseudo */ + /* Name.Variable.Class */ + /* Name.Variable.Global */ + /* Name.Variable.Instance */ + /* Literal.Number.Integer.Long */ } + .highlight .c { + color: #999988; + font-style: italic; } + .highlight .err { + color: #a61717; + background-color: #e3d2d2; } + .highlight .k { + color: #000000; + font-weight: bold; } + .highlight .o { + color: #000000; + font-weight: bold; } + .highlight .cm { + color: #999988; + font-style: italic; } + .highlight .cp { + color: #999999; + font-weight: bold; } + .highlight .c1 { + color: #999988; + font-style: italic; } + .highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; } + .highlight .gd { + color: #000000; + background-color: #ffdddd; } + .highlight .gd .x { + color: #000000; + background-color: #ffaaaa; } + .highlight .ge { + color: #000000; + font-style: italic; } + .highlight .gr { + color: #aa0000; } + .highlight .gh { + color: #999999; } + .highlight .gi { + color: #000000; + background-color: #ddffdd; } + .highlight .gi .x { + color: #000000; + background-color: #aaffaa; } + .highlight .go { + color: #888888; } + .highlight .gp { + color: #555555; } + .highlight .gs { + font-weight: bold; } + .highlight .gu { + color: #aaaaaa; } + .highlight .gt { + color: #aa0000; } + .highlight .kc { + color: #000000; + font-weight: bold; } + .highlight .kd { + color: #000000; + font-weight: bold; } + .highlight .kp { + color: #000000; + font-weight: bold; } + .highlight .kr { + color: #000000; + font-weight: bold; } + .highlight .kt { + color: #445588; } + .highlight .m { + color: #009999; } + .highlight .s { + color: #d14; } + .highlight .na { + color: #008080; } + .highlight .nb { + color: #0086B3; } + .highlight .nc { + color: #445588; + font-weight: bold; } + .highlight .no { + color: #008080; } + .highlight .ni { + color: #800080; } + .highlight .ne { + color: #990000; + font-weight: bold; } + .highlight .nf { + color: #990000; } + .highlight .nn { + color: #555555; } + .highlight .nt { + color: #000080; } + .highlight .nv { + color: #008080; } + .highlight .ow { + color: #000000; + font-weight: bold; } + .highlight .w { + color: #bbbbbb; } + .highlight .mf { + color: #009999; } + .highlight .mh { + color: #009999; } + .highlight .mi { + color: #009999; } + .highlight .mo { + color: #009999; } + .highlight .sb { + color: #d14; } + .highlight .sc { + color: #d14; } + .highlight .sd { + color: #d14; } + .highlight .s2 { + color: #d14; } + .highlight .se { + color: #d14; } + .highlight .sh { + color: #d14; } + .highlight .si { + color: #d14; } + .highlight .sx { + color: #d14; } + .highlight .sr { + color: #009926; } + .highlight .s1 { + color: #d14; } + .highlight .ss { + color: #990073; } + .highlight .bp { + color: #999999; } + .highlight .vc { + color: #008080; } + .highlight .vg { + color: #008080; } + .highlight .vi { + color: #008080; } + .highlight .il { + color: #009999; } diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/css/jazzy.css b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/css/jazzy.css new file mode 100644 index 00000000..d6282826 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/css/jazzy.css @@ -0,0 +1,337 @@ +html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { + background: transparent; + border: 0; + margin: 0; + outline: 0; + padding: 0; + vertical-align: baseline; } + +body { + background-color: #f2f2f2; + font-family: Helvetica, freesans, Arial, sans-serif; + font-size: 14px; + -webkit-font-smoothing: subpixel-antialiased; + word-wrap: break-word; } + +h1, h2, h3 { + margin-top: 0.8em; + margin-bottom: 0.3em; + font-weight: 100; + color: black; } + +h1 { + font-size: 2.5em; } + +h2 { + font-size: 2em; + border-bottom: 1px solid #e2e2e2; } + +h4 { + font-size: 13px; + line-height: 1.5; + margin-top: 21px; } + +h5 { + font-size: 1.1em; } + +h6 { + font-size: 1.1em; + color: #777; } + +.section-name { + color: gray; + display: block; + font-family: Helvetica; + font-size: 22px; + font-weight: 100; + margin-bottom: 15px; } + +pre, code { + font: 0.95em Menlo, monospace; + color: #777; + word-wrap: normal; } + +p code, li code { + background-color: #eee; + padding: 2px 4px; + border-radius: 4px; } + +a { + color: #0088cc; + text-decoration: none; } + +ul { + padding-left: 15px; } + +li { + line-height: 1.8em; } + +img { + max-width: 100%; } + +blockquote { + margin-left: 0; + padding: 0 10px; + border-left: 4px solid #ccc; } + +.content-wrapper { + margin: 0 auto; + width: 980px; } + +header { + font-size: 0.85em; + line-height: 26px; + background-color: #414141; + position: fixed; + width: 100%; + z-index: 1; } + header img { + padding-right: 6px; + vertical-align: -4px; + height: 16px; } + header a { + color: #fff; } + header p { + float: left; + color: #999; } + header .header-right { + float: right; + margin-left: 16px; } + +#breadcrumbs { + background-color: #f2f2f2; + height: 27px; + padding-top: 17px; + position: fixed; + width: 100%; + z-index: 1; + margin-top: 26px; } + #breadcrumbs #carat { + height: 10px; + margin: 0 5px; } + +.sidebar { + background-color: #f9f9f9; + border: 1px solid #e2e2e2; + overflow-y: auto; + overflow-x: hidden; + position: fixed; + top: 70px; + bottom: 0; + width: 230px; + word-wrap: normal; } + +.nav-groups { + list-style-type: none; + background: #fff; + padding-left: 0; } + +.nav-group-name { + border-bottom: 1px solid #e2e2e2; + font-size: 1.1em; + font-weight: 100; + padding: 15px 0 15px 20px; } + .nav-group-name > a { + color: #333; } + +.nav-group-tasks { + margin-top: 5px; } + +.nav-group-task { + font-size: 0.9em; + list-style-type: none; + white-space: nowrap; } + .nav-group-task a { + color: #888; } + +.main-content { + background-color: #fff; + border: 1px solid #e2e2e2; + margin-left: 246px; + position: absolute; + overflow: hidden; + padding-bottom: 60px; + top: 70px; + width: 734px; } + .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { + margin-bottom: 1em; } + .main-content p { + line-height: 1.8em; } + .main-content section .section:first-child { + margin-top: 0; + padding-top: 0; } + .main-content section .task-group-section .task-group:first-of-type { + padding-top: 10px; } + .main-content section .task-group-section .task-group:first-of-type .section-name { + padding-top: 15px; } + .main-content section .heading:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + +.section { + padding: 0 25px; } + +.highlight { + background-color: #eee; + padding: 10px 12px; + border: 1px solid #e2e2e2; + border-radius: 4px; + overflow-x: auto; } + +.declaration .highlight { + overflow-x: initial; + padding: 0 40px 40px 0; + margin-bottom: -25px; + background-color: transparent; + border: none; } + +.section-name { + margin: 0; + margin-left: 18px; } + +.task-group-section { + padding-left: 6px; + border-top: 1px solid #e2e2e2; } + +.task-group { + padding-top: 0px; } + +.task-name-container a[name]:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + +.item { + padding-top: 8px; + width: 100%; + list-style-type: none; } + .item a[name]:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + .item code { + background-color: transparent; + padding: 0; } + .item .token { + padding-left: 3px; + margin-left: 15px; + font-size: 11.9px; } + .item .declaration-note { + font-size: .85em; + color: gray; + font-style: italic; } + +.pointer-container { + border-bottom: 1px solid #e2e2e2; + left: -23px; + padding-bottom: 13px; + position: relative; + width: 110%; } + +.pointer { + background: #f9f9f9; + border-left: 1px solid #e2e2e2; + border-top: 1px solid #e2e2e2; + height: 12px; + left: 21px; + top: -7px; + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); + position: absolute; + width: 12px; } + +.height-container { + display: none; + left: -25px; + padding: 0 25px; + position: relative; + width: 100%; + overflow: hidden; } + .height-container .section { + background: #f9f9f9; + border-bottom: 1px solid #e2e2e2; + left: -25px; + position: relative; + width: 100%; + padding-top: 10px; + padding-bottom: 5px; } + +.aside, .language { + padding: 6px 12px; + margin: 12px 0; + border-left: 5px solid #dddddd; + overflow-y: hidden; } + .aside .aside-title, .language .aside-title { + font-size: 9px; + letter-spacing: 2px; + text-transform: uppercase; + padding-bottom: 0; + margin: 0; + color: #aaa; + -webkit-user-select: none; } + .aside p:last-child, .language p:last-child { + margin-bottom: 0; } + +.language { + border-left: 5px solid #cde9f4; } + .language .aside-title { + color: #4b8afb; } + +.aside-warning { + border-left: 5px solid #ff6666; } + .aside-warning .aside-title { + color: #ff0000; } + +.graybox { + border-collapse: collapse; + width: 100%; } + .graybox p { + margin: 0; + word-break: break-word; + min-width: 50px; } + .graybox td { + border: 1px solid #e2e2e2; + padding: 5px 25px 5px 10px; + vertical-align: middle; } + .graybox tr td:first-of-type { + text-align: right; + padding: 7px; + vertical-align: top; + word-break: normal; + width: 40px; } + +.slightly-smaller { + font-size: 0.9em; } + +#footer { + position: absolute; + bottom: 10px; + margin-left: 25px; } + #footer p { + margin: 0; + color: #aaa; + font-size: 0.8em; } + +html.dash header, html.dash #breadcrumbs, html.dash .sidebar { + display: none; } +html.dash .main-content { + width: 980px; + margin-left: 0; + border: none; + width: 100%; + top: 0; + padding-bottom: 0; } +html.dash .height-container { + display: block; } +html.dash .item .token { + margin-left: 0; } +html.dash .content-wrapper { + width: auto; } +html.dash #footer { + position: static; } diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/img/carat.png b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/img/carat.png new file mode 100755 index 00000000..29d2f7fd Binary files /dev/null and b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/img/carat.png differ diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/img/dash.png b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/img/dash.png new file mode 100755 index 00000000..6f694c7a Binary files /dev/null and b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/img/dash.png differ diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/img/gh.png b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/img/gh.png new file mode 100755 index 00000000..628da97c Binary files /dev/null and b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/img/gh.png differ diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/index.html b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/index.html new file mode 100644 index 00000000..6045e9b6 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/index.html @@ -0,0 +1,149 @@ + + + + Reference + + + + + + + + + +
+
+

Docs (74% documented)

+
+
+
+ +
+
+ +
+
+
+ +

Authors

+ +
+
+ +
+
+ + + diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/js/jazzy.js b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/js/jazzy.js new file mode 100755 index 00000000..3965b5fb --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/js/jazzy.js @@ -0,0 +1,46 @@ +window.jazzy = {'docset': false} +if (typeof window.dash != 'undefined') { + document.documentElement.className += ' dash' + window.jazzy.docset = true +} +if (navigator.userAgent.match(/xcode/i)) { + document.documentElement.className += ' xcode' + window.jazzy.docset = true +} + +// On doc load, toggle the URL hash discussion if present +$(document).ready(function() { + if (!window.jazzy.docset) { + var linkToHash = $('a[href="' + window.location.hash +'"]'); + linkToHash.trigger("click"); + } +}); + +// On token click, toggle its discussion and animate token.marginLeft +$(".token").click(function(event) { + if (window.jazzy.docset) { + return; + } + var link = $(this); + var animationDuration = 300; + var tokenOffset = "15px"; + var original = link.css('marginLeft') == tokenOffset; + link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); + $content = link.parent().parent().next(); + $content.slideToggle(animationDuration); + + // Keeps the document from jumping to the hash. + var href = $(this).attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); +}); + +// Dumb down quotes within code blocks that delimit strings instead of quotations +// https://github.com/realm/jazzy/issues/714 +$("code q").replaceWith(function () { + return ["\"", $(this).contents(), "\""]; +}); diff --git a/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/js/jquery.min.js b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/js/jquery.min.js new file mode 100755 index 00000000..ab28a247 --- /dev/null +++ b/docs/apis/swift/0.1/docsets/.docset/Contents/Resources/Documents/js/jquery.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; +if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="
a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/\s*$/g,rb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:k.htmlSerialize?[0,"",""]:[1,"X
","
"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?""!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("