🚧 Enhance function-associated type names
This commit is contained in:
parent
8934330523
commit
df0b2eeb71
4 changed files with 9 additions and 9 deletions
|
|
@ -1,9 +1,9 @@
|
||||||
use crate::core::component::Context;
|
use crate::core::component::Context;
|
||||||
|
|
||||||
pub type IsRenderable = fn(cx: &Context) -> bool;
|
pub type FnIsRenderable = fn(cx: &Context) -> bool;
|
||||||
|
|
||||||
pub struct Renderable {
|
pub struct Renderable {
|
||||||
pub check: IsRenderable,
|
pub check: FnIsRenderable,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Renderable {
|
impl Default for Renderable {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::response::page::Page;
|
use crate::response::page::Page;
|
||||||
|
|
||||||
pub type ActionPage = fn(page: &mut Page);
|
pub type FnActionPage = fn(page: &mut Page);
|
||||||
|
|
||||||
mod before_prepare_body;
|
mod before_prepare_body;
|
||||||
pub use before_prepare_body::*;
|
pub use before_prepare_body::*;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
use crate::core::action::{action_ref, run_actions, ActionTrait};
|
use crate::core::action::{action_ref, run_actions, ActionTrait};
|
||||||
use crate::response::page::action::ActionPage;
|
use crate::response::page::action::FnActionPage;
|
||||||
use crate::response::page::Page;
|
use crate::response::page::Page;
|
||||||
use crate::{new_handle, Handle, Weight};
|
use crate::{new_handle, Handle, Weight};
|
||||||
|
|
||||||
new_handle!(ACTION_AFTER_PREPARE_BODY for Action);
|
new_handle!(ACTION_AFTER_PREPARE_BODY for Action);
|
||||||
|
|
||||||
pub struct ActionAfterPrepareBody {
|
pub struct ActionAfterPrepareBody {
|
||||||
action: Option<ActionPage>,
|
action: Option<FnActionPage>,
|
||||||
weight: Weight,
|
weight: Weight,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -28,7 +28,7 @@ impl ActionTrait for ActionAfterPrepareBody {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ActionAfterPrepareBody {
|
impl ActionAfterPrepareBody {
|
||||||
pub fn with_action(mut self, action: ActionPage) -> Self {
|
pub fn with_action(mut self, action: FnActionPage) -> Self {
|
||||||
self.action = Some(action);
|
self.action = Some(action);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
use crate::core::action::{action_ref, run_actions, ActionTrait};
|
use crate::core::action::{action_ref, run_actions, ActionTrait};
|
||||||
use crate::response::page::action::ActionPage;
|
use crate::response::page::action::FnActionPage;
|
||||||
use crate::response::page::Page;
|
use crate::response::page::Page;
|
||||||
use crate::{new_handle, Handle, Weight};
|
use crate::{new_handle, Handle, Weight};
|
||||||
|
|
||||||
new_handle!(ACTION_BEFORE_PREPARE_BODY for Action);
|
new_handle!(ACTION_BEFORE_PREPARE_BODY for Action);
|
||||||
|
|
||||||
pub struct ActionBeforePrepareBody {
|
pub struct ActionBeforePrepareBody {
|
||||||
action: Option<ActionPage>,
|
action: Option<FnActionPage>,
|
||||||
weight: Weight,
|
weight: Weight,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -28,7 +28,7 @@ impl ActionTrait for ActionBeforePrepareBody {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ActionBeforePrepareBody {
|
impl ActionBeforePrepareBody {
|
||||||
pub fn with_action(mut self, action: ActionPage) -> Self {
|
pub fn with_action(mut self, action: FnActionPage) -> Self {
|
||||||
self.action = Some(action);
|
self.action = Some(action);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue