Skip to content

Commit

Permalink
experimenting
Browse files Browse the repository at this point in the history
  • Loading branch information
Wandalen committed Mar 27, 2024
1 parent aaf6119 commit 3cf75d0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
27 changes: 15 additions & 12 deletions module/core/former/src/axiomatic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! ....

/// xxx
pub trait Storage : ::core::default::Default
{
// type Types : FormerDefinitionTypes< Storage = Self >;
Expand All @@ -21,6 +21,9 @@ pub trait FormerDefinitionTypes : Sized
type Storage : Default;
type Formed;
type Context;

// fn preform( storage : Self::Storage, context : Self::Context ) -> Self::Formed;

}

/// xxx
Expand Down Expand Up @@ -66,23 +69,23 @@ where
}
}

// /// A `FormingEnd` implementation that returns the formed container itself instead of the context.
// ///
// /// This struct is useful when the forming process should result in the formed container being returned directly,
// /// bypassing any additional context processing. It simplifies scenarios where the formed container is the final result.
// #[ derive( Debug, Default ) ]
// pub struct ReturnFormed;
//
/// A `FormingEnd` implementation that returns the formed container itself instead of the context.
///
/// This struct is useful when the forming process should result in the formed container being returned directly,
/// bypassing any additional context processing. It simplifies scenarios where the formed container is the final result.
#[ derive( Debug, Default ) ]
pub struct ReturnFormed;

// impl< Definition > FormingEnd< Definition >
// for ReturnFormed
// where
// Definition::Storage : StoragePerform< Formed = Definition::Formed >,
// Definition : FormerDefinitionTypes< Context = () >,
// // Definition::Storage : StoragePerform< Formed = Definition::Formed >,
// Definition : FormerDefinitionTypes< Definition::Context >,
// {
// #[ inline( always ) ]
// fn call( &self, storage : Definition::Storage, _context : core::option::Option< () > ) -> Definition::Formed
// fn call( &self, storage : Definition::Storage, context : core::option::Option< Context > ) -> Definition::Formed
// {
// storage.preform()
// storage.preform( context )
// }
// }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ for Struct1FormerDefinition
{
type Storage = Struct1FormerStorage;
type Formed = Struct1;
type End = former::ReturnFormed;
}

// = storage
Expand Down Expand Up @@ -72,7 +73,8 @@ impl Default for Struct1FormerStorage
impl former::Storage
for Struct1FormerStorage
{
type Types = Struct1FormerDefinition;
// type Types = Struct1FormerDefinition;
type Formed = Struct1;
}

impl former::StoragePerform
Expand Down

0 comments on commit 3cf75d0

Please sign in to comment.