Skip to main content

Block

Struct Block 

Source
pub struct Block { /* private fields */ }
Expand description

Componente genérico que representa un bloque de contenido.

Los bloques se utilizan como contenedores de otros componentes o contenidos, con un título opcional y un cuerpo que sólo se renderiza si existen componentes hijos (children).

Implementations§

Source§

impl Block

Source

pub const fn classes(&self) -> &Classes

Devuelve las clases CSS asociadas al bloque.

Source

pub const fn title(&self) -> &L10n

Devuelve el título del bloque.

Source

pub const fn children(&self) -> &Children

Devuelve la lista de componentes hijo del bloque.

Source§

impl Block

Source

pub fn with_id(self, id: impl AsRef<str>) -> Self

Establece el identificador único (id) del bloque.

§También añade el método alter_id() generado por #[builder_fn]

Permite modificar la instancia (&mut self) con los mismos argumentos pero sin consumirla.

pub fn alter_id(&mut self, ...) -> &mut Self
Source

pub fn with_classes(self, op: ClassesOp, classes: impl AsRef<str>) -> Self

Modifica la lista de clases CSS aplicadas al bloque.

§También añade el método alter_classes() generado por #[builder_fn]

Permite modificar la instancia (&mut self) con los mismos argumentos pero sin consumirla.

pub fn alter_classes(&mut self, ...) -> &mut Self
Source

pub fn with_title(self, title: L10n) -> Self

Establece el título del bloque.

§También añade el método alter_title() generado por #[builder_fn]

Permite modificar la instancia (&mut self) con los mismos argumentos pero sin consumirla.

pub fn alter_title(&mut self, ...) -> &mut Self
Source

pub fn with_child(self, op: impl Into<ChildOp>) -> Self

Añade un nuevo componente al bloque o modifica la lista de componentes (children) con una operación ChildOp.

§También añade el método alter_child() generado por #[builder_fn]

Permite modificar la instancia (&mut self) con los mismos argumentos pero sin consumirla.

pub fn alter_child(&mut self, ...) -> &mut Self

Trait Implementations§

Source§

impl Clone for Block

Source§

fn clone(&self) -> Block

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Component for Block

Source§

fn new() -> Self

Crea una nueva instancia del componente. Read more
Source§

fn id(&self) -> Option<String>

Devuelve el identificador del componente, si existe. Read more
Source§

fn setup(&mut self, _cx: &Context)

Configura el estado interno del componente antes de generar el marcado. Read more
Source§

fn prepare(&self, cx: &mut Context) -> Result<Markup, ComponentError>

Genera el marcado HTML del componente cuando ningún tema lo sobrescribe. Read more
Source§

fn name(&self) -> &'static str

Devuelve el nombre del componente. Read more
Source§

fn description(&self) -> Option<String>

Devuelve una descripción del componente, si existe. Read more
Source§

fn is_renderable(&self, cx: &Context) -> bool

Indica si el componente es renderizable. Read more
Source§

impl Debug for Block

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Block

Source§

fn default() -> Self

Returns a Block default.

Auto Trait Implementations§

§

impl Freeze for Block

§

impl !RefUnwindSafe for Block

§

impl Send for Block

§

impl Sync for Block

§

impl Unpin for Block

§

impl UnsafeUnpin for Block

§

impl !UnwindSafe for Block

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyCast for T
where T: AnyInfo + ?Sized,

Source§

fn is<T>(&self) -> bool
where T: AnyInfo,

Comprueba si la instancia subyacente es de tipo T.
Source§

fn downcast_ref<T>(&self) -> Option<&T>
where T: AnyInfo,

Intenta hacer downcast de un objeto para obtener una referencia de tipo T.
Source§

fn downcast_mut<T>(&mut self) -> Option<&mut T>
where T: AnyInfo,

Intenta hacer downcast de un objeto para obtener una referencia mutable de tipo T.
Source§

impl<T> AnyInfo for T
where T: Any,

Source§

fn type_name(&self) -> &'static str

Devuelve el nombre totalmente cualificado del tipo.
Source§

fn short_name(&self) -> &'static str

Devuelve el nombre corto del tipo (último segmento del nombre).
Source§

fn as_any_ref(&self) -> &(dyn Any + 'static)

Devuelve una referencia a dyn Any para la conversión dinámica de tipos.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Devuelve una referencia mutable a dyn Any para la conversión dinámica de tipos.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ComponentClone for T
where T: Component + Clone + 'static,

Source§

fn clone_box(&self) -> Box<dyn Component>

Devuelve un clon del componente encapsulado en un Box<dyn Component>.
Source§

impl<C> ComponentRender for C
where C: Component,

Source§

fn render(&mut self, cx: &mut Context) -> PreEscaped<String>

Renderiza el componente usando el contexto proporcionado.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more