leptos_struct_table

Trait CellValue

Source
pub trait CellValue<M: ?Sized = ()> {
    type RenderOptions: Default + Clone + Send + Sync + 'static;

    // Required method
    fn render_value(self, options: Self::RenderOptions) -> impl IntoView;
}
Expand description

A value that can be rendered as part of a table, required for types if the crate::DefaultTableCellRenderer() is used

Required Associated Types§

Source

type RenderOptions: Default + Clone + Send + Sync + 'static

Formatting options for this cell value type, needs to implement default and have public named fields, the empty tuple: () is fine if no formatting options can be accepted.

Required Methods§

Source

fn render_value(self, options: Self::RenderOptions) -> impl IntoView

This is called to actually render the value. The parameter options is filled by the #[table(format(...))] macro attribute or Default::default() if omitted.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl CellValue<&String> for &String

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<IpAddr> for IpAddr

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<SocketAddr> for SocketAddr

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<bool> for bool

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<char> for char

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<f32> for f32

Source§

impl CellValue<f64> for f64

Source§

impl CellValue<i8> for i8

Source§

impl CellValue<i16> for i16

Source§

impl CellValue<i32> for i32

Source§

impl CellValue<i64> for i64

Source§

impl CellValue<i128> for i128

Source§

impl CellValue<isize> for isize

Source§

impl CellValue<u8> for u8

Source§

impl CellValue<u16> for u16

Source§

impl CellValue<u32> for u32

Source§

impl CellValue<u64> for u64

Source§

impl CellValue<u128> for u128

Source§

impl CellValue<usize> for usize

Source§

impl CellValue<ToLowercase> for ToLowercase

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<ToUppercase> for ToUppercase

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<Ipv4Addr> for Ipv4Addr

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<Ipv6Addr> for Ipv6Addr

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<SocketAddrV4> for SocketAddrV4

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<SocketAddrV6> for SocketAddrV6

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<NonZero<i8>> for NonZeroI8

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<NonZero<i16>> for NonZeroI16

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<NonZero<i32>> for NonZeroI32

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<NonZero<i64>> for NonZeroI64

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<NonZero<i128>> for NonZeroI128

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<NonZero<isize>> for NonZeroIsize

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<NonZero<u8>> for NonZeroU8

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<NonZero<u16>> for NonZeroU16

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<NonZero<u32>> for NonZeroU32

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<NonZero<u64>> for NonZeroU64

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<NonZero<u128>> for NonZeroU128

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<NonZero<usize>> for NonZeroUsize

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<Location<'_>> for Location<'_>

Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Source§

impl CellValue<NaiveDate> for NaiveDate

Implementation for NaiveDate to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    #[table(format(string = "%Y-%m-%d"))]
    my_field: NaiveDate
}
Source§

impl CellValue<NaiveDateTime> for NaiveDateTime

Implementation for NaiveDateTime to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    #[table(format(string = "%Y-%m-%d %H:%M:%S"))]
    my_field: NaiveDateTime
}
Source§

impl CellValue<NaiveTime> for NaiveTime

Implementation for NaiveTime to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    #[table(format(string = "%H:%M:%S"))]
    my_field: NaiveTime
}
Source§

impl CellValue<Decimal> for Decimal

Implementation for Decimal to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    #[table(format(precision = 2usize))]
    my_field: Decimal
}
Source§

impl CellValue<Date> for Date

Implementation for Date to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    #[table(format(string = "[year]-[month]-[day]"))]
    my_field: Date
}
Source§

impl CellValue<OffsetDateTime> for OffsetDateTime

Implementation for OffsetDateTime to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    #[table(format(string = "[year]-[month]-[day] [hour]:[minute]:[second] Z[offset_hour]"))]
    my_field: OffsetDateTime
}
Source§

impl CellValue<PrimitiveDateTime> for PrimitiveDateTime

Implementation for PrimitiveDateTime to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    #[table(format(string = "[year]-[month]-[day] [hour]:[minute]:[second]"))]
    my_field: PrimitiveDateTime
}
Source§

impl CellValue<Time> for Time

Implementation for Time to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    #[table(format(string = "[hour]:[minute]:[second]"))]
    my_field: Time
}
Source§

impl CellValue<Uuid> for Uuid

Implementation for Uuid to work with the TableRow derive and the DefaultTableCellRenderer

#[derive(TableRow, Clone)]
#[table]
struct SomeStruct {
    my_field: Uuid
}
Source§

type RenderOptions = ()

Source§

fn render_value(self, _options: Self::RenderOptions) -> impl IntoView

Implementors§

Source§

impl<V> CellValue for V
where V: IntoView,