refactor(output): group ops/ and space/

This commit is contained in:
🪞👃🪞 2025-04-13 21:19:25 +03:00
parent 18a01b8355
commit ec7621eff9
17 changed files with 29 additions and 13 deletions

View file

@ -1,18 +1,10 @@
#![feature(step_trait)]
#![feature(type_alias_impl_trait)]
#![feature(impl_trait_in_assoc_type)]
mod direction; pub use self::direction::*;
mod coordinate; pub use self::coordinate::*;
mod size; pub use self::size::*;
mod area; pub use self::area::*;
mod output; pub use self::output::*;
mod measure; pub use self::measure::*;
mod thunk; pub use self::thunk::*;
mod op_cond; pub use self::op_cond::*;
mod op_iter; pub use self::op_iter::*;
mod op_align; pub use self::op_align::*;
mod op_bsp; pub use self::op_bsp::*;
mod op_transform; pub use self::op_transform::*;
mod space; pub use self::space::*;
mod ops; pub use self::ops::*;
mod output; pub use self::output::*;
pub(crate) use std::marker::PhantomData;
pub(crate) use std::error::Error;

11
output/src/ops.rs Normal file
View file

@ -0,0 +1,11 @@
mod align; pub use self::align::*;
mod bsp; pub use self::bsp::*;
mod cond; pub use self::cond::*;
mod map; pub use self::map::*;
//mod reduce; pub use self::reduce::*;
mod thunk; pub use self::thunk::*;
mod transform; pub use self::transform::*;
#[cfg(test)] #[test] fn test_ops () -> Usually<()> {
Ok(())
}

10
output/src/space.rs Normal file
View file

@ -0,0 +1,10 @@
mod area; pub use self::area::*;
mod coordinate; pub use self::coordinate::*;
mod direction; pub use self::direction::*;
mod measure; pub use self::measure::*;
mod size; pub use self::size::*;
#[cfg(test)] #[test] fn test_space () {
use crate::*;
assert_eq!(Area::center(&[10u16, 10, 20, 20]), [20, 20]);
}

View file

@ -25,7 +25,10 @@ use crate::*;
// An ephemeral wrapper around view state and view description,
// that is meant to be constructed and returned from [Content::content].
#[cfg(feature = "dsl")]
pub struct View<'a, T>(pub &'a T, pub SourceIter<'a>);
pub struct View<'a, T>(
pub &'a T,
pub SourceIter<'a>
);
#[cfg(feature = "dsl")]
impl<'a, O: Output + 'a, T: ViewContext<'a, O>> Content<O> for View<'a, T> {