pub enum Namespace {
Neo4j,
System,
SystemOntologies,
}Expand description
One of the three fixed namespaces of a store.
Element ids name their namespace through the middle segment of
<kind>:<segment>:<n|r><id> (ADR-0116 §7, ADR-0554): the segment is
dash-bearing and names the database — rl-id for neo4j,
rl-onto for system_ontologies — and system has
no elements and no
segment.
Variants§
Neo4j
The user data graph. The only namespace Cypher can write.
System
The CE system database: SHOW commands, supported administration commands and procedure calls only. Holds no graph data.
SystemOntologies
The read-only ontology graph, written only through the db.ontology.*
procedures. Its dialect visibility gates behind the ontology
preview feature (ADR-0593): invisible — unlisted, unaddressable —
while the opt-in is off.
Implementations§
Source§impl Namespace
impl Namespace
Sourcepub const ALL: [Namespace; 3]
pub const ALL: [Namespace; 3]
Every namespace, in canonical order: neo4j, system,
system_ontologies.
Sourcepub fn parse(name: &str) -> Option<Namespace>
pub fn parse(name: &str) -> Option<Namespace>
Parses a namespace name, case-insensitively (ADR-0116 §1). Returns
None for any other name.
Sourcepub fn is_writable(&self) -> bool
pub fn is_writable(&self) -> bool
Whether Cypher can write this namespace. Only neo4j is writable
(ADR-0116 §5: read many, write one).
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
Whether this namespace is read-only to Cypher. Only
system_ontologies is (ADR-0116 §1).
Sourcepub fn visible_under(self, preview: PreviewFeatures) -> bool
pub fn visible_under(self, preview: PreviewFeatures) -> bool
Whether this namespace is visible under preview (ADR-0593): a
namespace gated by [namespace_preview_feature] stays invisible
until its feature’s opt-in is set; the ungated namespaces are
always visible. The one predicate every visibility consumer
derives from — the SHOW DATABASES listing, USE and connect
resolution, ALTER DATABASE targets.
Sourcepub fn require_visible(self, preview: PreviewFeatures) -> Result<(), Error>
pub fn require_visible(self, preview: PreviewFeatures) -> Result<(), Error>
The visibility gate (ADR-0593): Ok(()) when
Self::visible_under holds, otherwise the ordinary
unknown-database rejection (42N00, ce_messages::graph_not_found)
— the name-gate form ADR-0371 prescribes for hidden names: never
the authored preview error, which would advertise a name the
catalog must not list.
Sourcepub fn element_id_segment(&self) -> Option<&'static str>
pub fn element_id_segment(&self) -> Option<&'static str>
The element-id middle segment for this namespace (ADR-0116 §7,
ADR-0554), or None for system, which has no elements. The
segment is dash-bearing and names the database, as Neo4j’s UUID
segment does — clients classify an id as an element id by that
observable dash (ADR-0554’s Context).
Sourcepub fn from_element_id_segment(segment: &str) -> Option<Namespace>
pub fn from_element_id_segment(segment: &str) -> Option<Namespace>
The inverse of Namespace::element_id_segment: maps an element-id
middle segment back to its namespace. Returns None for any other
segment (including system, which has none).
Trait Implementations§
impl Copy for Namespace
impl Eq for Namespace
Source§impl Ord for Namespace
impl Ord for Namespace
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Namespace
impl PartialOrd for Namespace
impl StructuralPartialEq for Namespace
Auto Trait Implementations§
impl Forget for Namespace
impl Freeze for Namespace
impl Move for Namespace
impl RefUnwindSafe for Namespace
impl Send for Namespace
impl Sync for Namespace
impl Unpin for Namespace
impl UnsafeUnpin for Namespace
impl UnwindSafe for Namespace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.