pub struct BlockRegistration {
pub factory: fn() -> Box<dyn Block>,
pub origin: &'static str,
}Expand description
One registered block — a factory the framework calls to materialize
a Block trait object. Each call returns a fresh box (cheap;
Blocks are stateless descriptors). Submitted via
crate::register_block!.
Fields§
§factory: fn() -> Box<dyn Block>Constructor function. Convention: || Box::new(MyBlock::default())
— or any callable returning Box<dyn Block>.
origin: &'static strThe module that registered it (module_path!() at the
register_block! call), so a site’s block can be told from a
built-in one of the same name.
Implementations§
Source§impl BlockRegistration
impl BlockRegistration
Sourcepub fn is_builtin(&self) -> bool
pub fn is_builtin(&self) -> bool
Registered by Rustango-CMS itself.
Trait Implementations§
impl Collect for BlockRegistration
Auto Trait Implementations§
impl Forget for BlockRegistration
impl Freeze for BlockRegistration
impl RefUnwindSafe for BlockRegistration
impl Send for BlockRegistration
impl Sync for BlockRegistration
impl Unpin for BlockRegistration
impl UnsafeUnpin for BlockRegistration
impl UnwindSafe for BlockRegistration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.