add r
prefixes to avoid confusion
This commit is contained in:
parent
13932f098c
commit
45923c401e
@ -1,4 +1,4 @@
|
|||||||
//! Data structures and algorithms, independent of [`crate::core`] concepts.
|
//! Data structures and algorithms, independent of [`crate::rcore`] concepts.
|
||||||
|
|
||||||
pub mod binary;
|
pub mod binary;
|
||||||
pub mod traversible;
|
pub mod traversible;
|
||||||
|
@ -173,7 +173,7 @@ impl<'a, T: 'a + Monad, A: 'a> UnbalancedConstructor<'a, T, A> {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use rand::{Rng, SeedableRng};
|
use rand::{Rng, SeedableRng};
|
||||||
|
|
||||||
use crate::std::tracing::*;
|
use crate::rstd::tracing::*;
|
||||||
|
|
||||||
use super::{algorithms::contains::*, algorithms::subset::*, *};
|
use super::{algorithms::contains::*, algorithms::subset::*, *};
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
//! # RADN
|
//! # RADN
|
||||||
//! Rainbow something something Network.
|
//! Rainbow something something Network.
|
||||||
|
|
||||||
pub mod core;
|
|
||||||
pub mod flow;
|
pub mod flow;
|
||||||
pub mod func;
|
pub mod func;
|
||||||
pub mod std;
|
pub mod rcore;
|
||||||
|
pub mod rstd;
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod testing;
|
mod testing;
|
||||||
|
@ -81,7 +81,7 @@ pub type ParseResult<'a, Ctx, F> =
|
|||||||
Result<<F as Factory<'a, Ctx>>::Mtbl, <F as Factory<'a, Ctx>>::ParseError>;
|
Result<<F as Factory<'a, Ctx>>::Mtbl, <F as Factory<'a, Ctx>>::ParseError>;
|
||||||
|
|
||||||
/// Trait representing deserialisation rules for [Mentionable]s.
|
/// Trait representing deserialisation rules for [Mentionable]s.
|
||||||
/// Crucial for [`crate::std::typeless`].
|
/// Crucial for [`crate::rstd::typeless`].
|
||||||
pub trait Factory<'a, Ctx: 'a + Context>: 'a + Send + Sync + Clone {
|
pub trait Factory<'a, Ctx: 'a + Context>: 'a + Send + Sync + Clone {
|
||||||
/// Type of the associated objects.
|
/// Type of the associated objects.
|
||||||
type Mtbl: Mentionable<'a, Ctx, Fctr = Self>;
|
type Mtbl: Mentionable<'a, Ctx, Fctr = Self>;
|
@ -67,7 +67,7 @@ impl<'a, Ctx: 'a + Context, F: Factory<'a, Ctx>> ExtFactory<'a, Ctx> for F {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::core::*;
|
use crate::rcore::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_read_one_address() {
|
fn can_read_one_address() {
|
@ -5,7 +5,7 @@ use super::*;
|
|||||||
pub const HASH_SIZE: usize = 32;
|
pub const HASH_SIZE: usize = 32;
|
||||||
|
|
||||||
/// Zeroed out array of the same length as [`type@Hash`].
|
/// Zeroed out array of the same length as [`type@Hash`].
|
||||||
/// Used in [`crate::std::nullable`].
|
/// Used in [`crate::rstd::nullable`].
|
||||||
pub const HASH_ZEROS: [u8; HASH_SIZE] = [0; HASH_SIZE];
|
pub const HASH_ZEROS: [u8; HASH_SIZE] = [0; HASH_SIZE];
|
||||||
|
|
||||||
/// For use in [`Point`]/[`Address`].
|
/// For use in [`Point`]/[`Address`].
|
@ -8,7 +8,7 @@ use super::*;
|
|||||||
pub trait Serializer {
|
pub trait Serializer {
|
||||||
/// Writes bytes from a slice. Should advance value of [`Serializer::tell()`] by `buf.len()`.
|
/// Writes bytes from a slice. Should advance value of [`Serializer::tell()`] by `buf.len()`.
|
||||||
fn write(&mut self, buf: &[u8]);
|
fn write(&mut self, buf: &[u8]);
|
||||||
/// Current position of the stream. Used by [`crate::std::inlining::CheckedSerialize`].
|
/// Current position of the stream. Used by [`crate::rstd::inlining::CheckedSerialize`].
|
||||||
fn tell(&self) -> usize;
|
fn tell(&self) -> usize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ pub trait Deserializer {
|
|||||||
fn read_n(&mut self, n: usize) -> &[u8];
|
fn read_n(&mut self, n: usize) -> &[u8];
|
||||||
/// Read til the end of the stream.
|
/// Read til the end of the stream.
|
||||||
fn read_all(&mut self) -> &[u8];
|
fn read_all(&mut self) -> &[u8];
|
||||||
/// Current position of the stream. Used by [`crate::std::inlining::CheckedParse`].
|
/// Current position of the stream. Used by [`crate::rstd::inlining::CheckedParse`].
|
||||||
fn tell(&self) -> usize;
|
fn tell(&self) -> usize;
|
||||||
}
|
}
|
||||||
|
|
@ -2,7 +2,7 @@ use std::cmp::min;
|
|||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
/// [Deserializer] for slices. Used in [`ExtFactory::parse_slice`] and [`crate::std::atomic::ExtAtomic::parse_slice`].
|
/// [Deserializer] for slices. Used in [`ExtFactory::parse_slice`] and [`crate::rstd::atomic::ExtAtomic::parse_slice`].
|
||||||
pub struct SliceDeserializer<'a> {
|
pub struct SliceDeserializer<'a> {
|
||||||
slice: &'a [u8],
|
slice: &'a [u8],
|
||||||
pos: usize,
|
pos: usize,
|
@ -1,4 +1,4 @@
|
|||||||
//! Standard extensions to [`crate::core`].
|
//! Standard extensions to [`crate::rcore`].
|
||||||
|
|
||||||
pub mod atomic;
|
pub mod atomic;
|
||||||
pub mod cast;
|
pub mod cast;
|
||||||
@ -14,8 +14,8 @@ mod wrapped_origin;
|
|||||||
|
|
||||||
use std::{error::Error, fmt::Display, rc::Rc};
|
use std::{error::Error, fmt::Display, rc::Rc};
|
||||||
|
|
||||||
use crate::core::*;
|
|
||||||
use crate::func::*;
|
use crate::func::*;
|
||||||
|
use crate::rcore::*;
|
||||||
|
|
||||||
impl Display for Address {
|
impl Display for Address {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
@ -7,7 +7,7 @@ pub mod plain;
|
|||||||
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
use crate::core::*;
|
use crate::rcore::*;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
use crate::std::inlining::*;
|
use crate::rstd::inlining::*;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
@ -58,7 +58,7 @@ impl Plain {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::std::*;
|
use crate::rstd::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_parse_plain_slice() -> Result<(), PlainParseError> {
|
fn can_parse_plain_slice() -> Result<(), PlainParseError> {
|
@ -1,11 +1,11 @@
|
|||||||
//! Utilities to convert from typeless instances defined in [`crate::core`].
|
//! Utilities to convert from typeless instances defined in [`crate::rcore`].
|
||||||
//! See [`TypelessMentionable::cast`]/[`Point::cast`].
|
//! See [`TypelessMentionable::cast`]/[`Point::cast`].
|
||||||
//!
|
//!
|
||||||
//! p.s. the implementation is horrific.
|
//! p.s. the implementation is horrific.
|
||||||
|
|
||||||
use std::convert::identity;
|
use std::convert::identity;
|
||||||
|
|
||||||
use crate::core::*;
|
use crate::rcore::*;
|
||||||
|
|
||||||
use super::{typeless::*, wrapped_origin::*, *};
|
use super::{typeless::*, wrapped_origin::*, *};
|
||||||
|
|
@ -3,8 +3,8 @@
|
|||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
|
|
||||||
use crate::core::*;
|
use crate::rcore::*;
|
||||||
use crate::std::inlining::{static_pair::*, *};
|
use crate::rstd::inlining::{static_pair::*, *};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Pair<A, B> {
|
pub struct Pair<A, B> {
|
@ -2,8 +2,8 @@ pub mod subset;
|
|||||||
|
|
||||||
use std::{error::Error, fmt::Display, rc::Rc};
|
use std::{error::Error, fmt::Display, rc::Rc};
|
||||||
|
|
||||||
use crate::core::*;
|
use crate::rcore::*;
|
||||||
use crate::std::{
|
use crate::rstd::{
|
||||||
atomic::{boolean::*, *},
|
atomic::{boolean::*, *},
|
||||||
nullable::*,
|
nullable::*,
|
||||||
point::*,
|
point::*,
|
@ -2,7 +2,7 @@ use std::rc::Rc;
|
|||||||
|
|
||||||
use crate::flow::traversible::*;
|
use crate::flow::traversible::*;
|
||||||
use crate::func::*;
|
use crate::func::*;
|
||||||
use crate::std::{fallible::*, *};
|
use crate::rstd::{fallible::*, *};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
//! Basic implementation of a stack/linked list.
|
//! Basic implementation of a stack/linked list.
|
||||||
|
|
||||||
use crate::core::*;
|
use crate::rcore::*;
|
||||||
use crate::std::{inlining::*, nullable::*, point::*, *};
|
use crate::rstd::{inlining::*, nullable::*, point::*, *};
|
||||||
|
|
||||||
/// Node containing a (nullable) reference to the next node and an element.
|
/// Node containing a (nullable) reference to the next node and an element.
|
||||||
pub struct StackNode<'a, Ctx: 'a + Context, A: Mentionable<'a, Ctx>> {
|
pub struct StackNode<'a, Ctx: 'a + Context, A: Mentionable<'a, Ctx>> {
|
||||||
@ -205,7 +205,7 @@ where
|
|||||||
mod tests {
|
mod tests {
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
use crate::std::{
|
use crate::rstd::{
|
||||||
atomic::{atomic_object::*, plain::*},
|
atomic::{atomic_object::*, plain::*},
|
||||||
tracing::*,
|
tracing::*,
|
||||||
};
|
};
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
pub mod static_pair;
|
pub mod static_pair;
|
||||||
|
|
||||||
use crate::core::*;
|
use crate::rcore::*;
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
atomic::{atomic_object::*, *},
|
atomic::{atomic_object::*, *},
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
use crate::std::*;
|
use crate::rstd::*;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
use crate::core::*;
|
use crate::rcore::*;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
//! This module introduces [`Option`]-like concepts into RADN typesystem using [`Nullable`].
|
//! This module introduces [`Option`]-like concepts into RADN typesystem using [`Nullable`].
|
||||||
|
|
||||||
use crate::core::*;
|
use crate::rcore::*;
|
||||||
|
|
||||||
use super::{inlining::*, point::*, *};
|
use super::{inlining::*, point::*, *};
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
use std::{error::Error, fmt::Display, rc::Rc};
|
use std::{error::Error, fmt::Display, rc::Rc};
|
||||||
|
|
||||||
use crate::core::*;
|
use crate::rcore::*;
|
||||||
|
|
||||||
impl<'a, Ctx: 'a + Context, A: Mentionable<'a, Ctx>> Serializable for Point<'a, Ctx, A> {
|
impl<'a, Ctx: 'a + Context, A: Mentionable<'a, Ctx>> Serializable for Point<'a, Ctx, A> {
|
||||||
fn serialize(&self, serializer: &mut dyn Serializer) {
|
fn serialize(&self, serializer: &mut dyn Serializer) {
|
@ -6,7 +6,7 @@ mod trace;
|
|||||||
mod traceable;
|
mod traceable;
|
||||||
mod traced;
|
mod traced;
|
||||||
|
|
||||||
use crate::core::*;
|
use crate::rcore::*;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
@ -1,9 +1,9 @@
|
|||||||
use std::cmp::max;
|
use std::cmp::max;
|
||||||
|
|
||||||
#[cfg(doc)]
|
|
||||||
use crate::core::*;
|
|
||||||
#[cfg(doc)]
|
#[cfg(doc)]
|
||||||
use crate::func::*;
|
use crate::func::*;
|
||||||
|
#[cfg(doc)]
|
||||||
|
use crate::rcore::*;
|
||||||
|
|
||||||
#[cfg(doc)]
|
#[cfg(doc)]
|
||||||
use super::*;
|
use super::*;
|
@ -1,4 +1,4 @@
|
|||||||
use crate::std::tracing::{rendered::*, *};
|
use crate::rstd::tracing::{rendered::*, *};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
use crate::std::{cast::*, typeless::*};
|
use crate::rstd::{cast::*, typeless::*};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
//! Previously part of [`crate::core`].
|
//! Previously part of [`crate::rcore`].
|
||||||
|
|
||||||
use super::{wrapped_origin::*, *};
|
use super::{wrapped_origin::*, *};
|
||||||
|
|
@ -5,10 +5,10 @@ use std::{error::Error, fmt::Display, rc::Rc};
|
|||||||
|
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
|
|
||||||
use crate::core::*;
|
|
||||||
use crate::func::*;
|
use crate::func::*;
|
||||||
use crate::std::cast::*;
|
use crate::rcore::*;
|
||||||
use crate::std::typeless::*;
|
use crate::rstd::cast::*;
|
||||||
|
use crate::rstd::typeless::*;
|
||||||
|
|
||||||
pub struct NoDiagnostic;
|
pub struct NoDiagnostic;
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
use std::cmp::max;
|
use std::cmp::max;
|
||||||
|
|
||||||
use crate::core::*;
|
|
||||||
use crate::func::*;
|
use crate::func::*;
|
||||||
use crate::std::typeless::*;
|
use crate::rcore::*;
|
||||||
|
use crate::rstd::typeless::*;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use crate::core::*;
|
use crate::rcore::*;
|
||||||
use crate::std::tracing::*;
|
use crate::rstd::tracing::*;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user