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§
Required Methods§
Sourcefn render_value(self, options: Self::RenderOptions) -> impl IntoView
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".
Implementations on Foreign Types§
Source§impl CellValue<&String> for &String
impl CellValue<&String> for &String
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<Date> for Date
Implementation for Date to work with the TableRow derive and the DefaultTableCellRenderer
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
}type RenderOptions = RenderTimeOptions
fn render_value(self, options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<Decimal> for Decimal
Implementation for Decimal to work with the TableRow derive and the DefaultTableCellRenderer
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
}type RenderOptions = DecimalNumberRenderOptions
fn render_value(self, options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<IpAddr> for IpAddr
impl CellValue<IpAddr> for IpAddr
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<Ipv4Addr> for Ipv4Addr
impl CellValue<Ipv4Addr> for Ipv4Addr
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<Ipv6Addr> for Ipv6Addr
impl CellValue<Ipv6Addr> for Ipv6Addr
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<Location<'_>> for Location<'_>
impl CellValue<Location<'_>> for Location<'_>
type RenderOptions = ()
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
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
}type RenderOptions = RenderChronoOptions
fn render_value(self, options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<NaiveDateTime> for NaiveDateTime
Implementation for NaiveDateTime to work with the TableRow derive and the DefaultTableCellRenderer
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
}type RenderOptions = RenderChronoOptions
fn render_value(self, options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<NaiveTime> for NaiveTime
Implementation for NaiveTime to work with the TableRow derive and the DefaultTableCellRenderer
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
}type RenderOptions = RenderChronoOptions
fn render_value(self, options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<NonZero<i8>> for NonZeroI8
impl CellValue<NonZero<i8>> for NonZeroI8
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<NonZero<i16>> for NonZeroI16
impl CellValue<NonZero<i16>> for NonZeroI16
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<NonZero<i32>> for NonZeroI32
impl CellValue<NonZero<i32>> for NonZeroI32
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<NonZero<i64>> for NonZeroI64
impl CellValue<NonZero<i64>> for NonZeroI64
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<NonZero<i128>> for NonZeroI128
impl CellValue<NonZero<i128>> for NonZeroI128
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<NonZero<isize>> for NonZeroIsize
impl CellValue<NonZero<isize>> for NonZeroIsize
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<NonZero<u8>> for NonZeroU8
impl CellValue<NonZero<u8>> for NonZeroU8
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<NonZero<u16>> for NonZeroU16
impl CellValue<NonZero<u16>> for NonZeroU16
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<NonZero<u32>> for NonZeroU32
impl CellValue<NonZero<u32>> for NonZeroU32
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<NonZero<u64>> for NonZeroU64
impl CellValue<NonZero<u64>> for NonZeroU64
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<NonZero<u128>> for NonZeroU128
impl CellValue<NonZero<u128>> for NonZeroU128
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<NonZero<usize>> for NonZeroUsize
impl CellValue<NonZero<usize>> for NonZeroUsize
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<OffsetDateTime> for OffsetDateTime
Implementation for OffsetDateTime to work with the TableRow derive and the DefaultTableCellRenderer
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
}type RenderOptions = RenderTimeOptions
fn render_value(self, options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<PrimitiveDateTime> for PrimitiveDateTime
Implementation for PrimitiveDateTime to work with the TableRow derive and the DefaultTableCellRenderer
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
}type RenderOptions = RenderTimeOptions
fn render_value(self, options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<SocketAddr> for SocketAddr
impl CellValue<SocketAddr> for SocketAddr
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<SocketAddrV4> for SocketAddrV4
impl CellValue<SocketAddrV4> for SocketAddrV4
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<SocketAddrV6> for SocketAddrV6
impl CellValue<SocketAddrV6> for SocketAddrV6
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<Time> for Time
Implementation for Time to work with the TableRow derive and the DefaultTableCellRenderer
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
}type RenderOptions = RenderTimeOptions
fn render_value(self, options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<ToLowercase> for ToLowercase
impl CellValue<ToLowercase> for ToLowercase
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<ToUppercase> for ToUppercase
impl CellValue<ToUppercase> for ToUppercase
type RenderOptions = ()
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView
Source§impl CellValue<Uuid> for Uuid
Implementation for Uuid to work with the TableRow derive and the DefaultTableCellRenderer
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
}