-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
36 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
// @author hanepjiv <[email protected]> | ||
// @copyright The MIT License (MIT) / Apache License Version 2.0 | ||
// @since 2024/04/14 | ||
// @date 2024/09/11 | ||
// @date 2024/12/01 | ||
|
||
// //////////////////////////////////////////////////////////////////////////// | ||
// use ======================================================================= | ||
|
@@ -28,9 +28,9 @@ pub(crate) mod mine { | |
// ======================================================================== | ||
#[derive(Debug, Default, Clone, Aelicit)] | ||
#[aelicit_mod_author(mine_aelicit::author)] | ||
pub struct MineX {} | ||
pub struct X {} | ||
// ------------------------------------------------------------------------ | ||
impl Mine for MineX { | ||
impl Mine for X { | ||
fn action(&self) -> i32 { | ||
0i32 | ||
} | ||
|
@@ -39,22 +39,22 @@ pub(crate) mod mine { | |
#[derive(Debug, Clone, Aelicit)] | ||
#[aelicit_mod_author(mine_aelicit::author)] | ||
//#[aelicit_from_self_field(_fsf)] // here | ||
pub struct MineY { | ||
pub struct Y { | ||
#[aelicit_from_self_field] // or here | ||
_fsf: mine_aelicit::author::AelicitFromSelfField, | ||
i: i32, | ||
} | ||
// ------------------------------------------------------------------------ | ||
impl MineY { | ||
impl Y { | ||
pub(crate) fn new(a: i32) -> Self { | ||
Self { | ||
_fsf: Default::default(), | ||
_fsf: mine_aelicit::author::AelicitFromSelfField::default(), | ||
i: a, | ||
} | ||
} | ||
} | ||
// ------------------------------------------------------------------------ | ||
impl Mine for MineY { | ||
impl Mine for Y { | ||
fn action(&self) -> i32 { | ||
self.i | ||
} | ||
|
@@ -148,10 +148,10 @@ mod error { | |
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { | ||
match *self { | ||
Error::Elicit(ref e) => Some(e), | ||
Error::AelicitLockRead(_) => None, | ||
Error::AelicitLockWrite(_) => None, | ||
Error::AelicitTryLockRead(_) => None, | ||
Error::AelicitTryLockWrite(_) => None, | ||
Error::AelicitLockRead(_) | ||
| Error::AelicitLockWrite(_) | ||
| Error::AelicitTryLockRead(_) | ||
| Error::AelicitTryLockWrite(_) => None, | ||
} | ||
} | ||
} | ||
|
@@ -164,11 +164,11 @@ mod error { | |
// ============================================================================ | ||
fn main() -> elicit::Result<()> { | ||
use mine::aelicit_user::Aelicit as MineAelicit; | ||
use mine::{MineX, MineY}; | ||
use mine::{X, Y}; | ||
|
||
let mut e: MineAelicit; | ||
|
||
e = MineAelicit::new(MineX::default())?; | ||
e = MineAelicit::new(X::default())?; | ||
|
||
if let Err(x) = e.with(|m| -> error::Result<'_, ()> { | ||
println!("{m:?}"); | ||
|
@@ -178,7 +178,7 @@ fn main() -> elicit::Result<()> { | |
eprintln!("{x:?}"); | ||
} | ||
|
||
let y = MineY::new(2); | ||
let y = Y::new(2); | ||
e = MineAelicit::new(y)?; | ||
|
||
if let Err(e) = e.try_with(|m| -> error::Result<'_, ()> { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
// @author hanepjiv <[email protected]> | ||
// @copyright The MIT License (MIT) / Apache License Version 2.0 | ||
// @since 2024/04/13 | ||
// @date 2024/09/11 | ||
// @date 2024/12/01 | ||
|
||
// //////////////////////////////////////////////////////////////////////////// | ||
// use ======================================================================= | ||
|
@@ -29,9 +29,9 @@ pub(crate) mod mine { | |
// ======================================================================== | ||
#[derive(Debug, Default, Clone, Elicit)] | ||
#[elicit_mod_author(mine_elicit::author)] | ||
pub struct MineX {} | ||
pub struct X {} | ||
// ------------------------------------------------------------------------ | ||
impl Mine for MineX { | ||
impl Mine for X { | ||
fn action(&self) -> i32 { | ||
0i32 | ||
} | ||
|
@@ -40,22 +40,22 @@ pub(crate) mod mine { | |
#[derive(Debug, Clone, Elicit)] | ||
#[elicit_mod_author(mine_elicit::author)] | ||
// #[elicit_from_self_field(_fsf)] // here | ||
pub struct MineY { | ||
pub struct Y { | ||
#[elicit_from_self_field] // or here | ||
_fsf: mine_elicit::author::ElicitFromSelfField, | ||
i: i32, | ||
} | ||
// ------------------------------------------------------------------------ | ||
impl MineY { | ||
impl Y { | ||
pub(crate) fn new(a: i32) -> Self { | ||
Self { | ||
_fsf: Default::default(), | ||
_fsf: mine_elicit::author::ElicitFromSelfField::default(), | ||
i: a, | ||
} | ||
} | ||
} | ||
// ------------------------------------------------------------------------ | ||
impl Mine for MineY { | ||
impl Mine for Y { | ||
fn action(&self) -> i32 { | ||
self.i | ||
} | ||
|
@@ -65,11 +65,11 @@ pub(crate) mod mine { | |
// ============================================================================ | ||
fn main() -> elicit::Result<()> { | ||
use mine::elicit_user::Elicit as MineElicit; | ||
use mine::{MineX, MineY}; | ||
use mine::{X, Y}; | ||
|
||
let mut e: MineElicit; | ||
|
||
e = MineElicit::new(MineX::default())?; | ||
e = MineElicit::new(X::default())?; | ||
|
||
e.try_with(|m| -> elicit::Result<()> { | ||
println!("{m:?}"); | ||
|
@@ -79,7 +79,7 @@ fn main() -> elicit::Result<()> { | |
Ok(()) | ||
})?; | ||
|
||
let y = MineY::new(1); | ||
let y = Y::new(1); | ||
e = MineElicit::new(y)?; | ||
|
||
e.try_with_mut(|m| -> elicit::Result<()> { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
// @author hanepjiv <[email protected]> | ||
// @copyright The MIT License (MIT) / Apache License Version 2.0 | ||
// @since 2024/04/13 | ||
// @date 2024/09/11 | ||
// @date 2024/12/01 | ||
|
||
// //////////////////////////////////////////////////////////////////////////// | ||
// use ======================================================================= | ||
|
@@ -29,9 +29,9 @@ pub(crate) mod mine { | |
// ======================================================================== | ||
#[derive(Debug, Default, Clone, Melicit)] | ||
#[melicit_mod_author(mine_melicit::author)] | ||
pub struct MineX {} | ||
pub struct X {} | ||
// ------------------------------------------------------------------------ | ||
impl Mine for MineX { | ||
impl Mine for X { | ||
fn action(&self) -> i32 { | ||
0i32 | ||
} | ||
|
@@ -40,22 +40,22 @@ pub(crate) mod mine { | |
#[derive(Debug, Clone, Melicit)] | ||
#[melicit_mod_author(mine_melicit::author)] | ||
// #[melicit_from_self_field(_fsf)] here | ||
pub struct MineY { | ||
pub struct Y { | ||
#[melicit_from_self_field] // or here | ||
_fsf: mine_melicit::author::MelicitFromSelfField, | ||
i: i32, | ||
} | ||
// ------------------------------------------------------------------------ | ||
impl MineY { | ||
impl Y { | ||
pub(crate) fn new(a: i32) -> Self { | ||
Self { | ||
_fsf: Default::default(), | ||
_fsf: mine_melicit::author::MelicitFromSelfField::default(), | ||
i: a, | ||
} | ||
} | ||
} | ||
// ------------------------------------------------------------------------ | ||
impl Mine for MineY { | ||
impl Mine for Y { | ||
fn action(&self) -> i32 { | ||
self.i | ||
} | ||
|
@@ -127,8 +127,7 @@ mod error { | |
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { | ||
match *self { | ||
Error::Elicit(ref e) => Some(e), | ||
Error::MelicitLock(_) => None, | ||
Error::MelicitTryLock(_) => None, | ||
Error::MelicitLock(_) | Error::MelicitTryLock(_) => None, | ||
} | ||
} | ||
} | ||
|
@@ -141,11 +140,11 @@ mod error { | |
// ============================================================================ | ||
fn main() -> elicit::Result<()> { | ||
use mine::melicit_user::Melicit as MineMelicit; | ||
use mine::{MineX, MineY}; | ||
use mine::{X, Y}; | ||
|
||
let mut e: MineMelicit; | ||
|
||
e = MineMelicit::new(MineX::default())?; | ||
e = MineMelicit::new(X::default())?; | ||
|
||
if let Err(x) = e.with(|m| -> error::Result<'_, ()> { | ||
println!("{m:?}"); | ||
|
@@ -155,7 +154,7 @@ fn main() -> elicit::Result<()> { | |
eprintln!("{x:?}"); | ||
} | ||
|
||
let y = MineY::new(3); | ||
let y = Y::new(3); | ||
e = MineMelicit::new(y)?; | ||
|
||
if let Err(x) = e.try_with(|m| -> error::Result<'_, ()> { | ||
|