use crate::{ConversionError, ExcelStr, ExcelValueRef, FromExcel};
#[derive(Debug)]
pub struct ExcelValueArg<'call>(ExcelValueRef<'call>);
impl<'call> ExcelValueArg<'call> {
pub const fn new(value: ExcelValueRef<'call>) -> Self {
Self(value)
}
pub fn into_inner(self) -> ExcelValueRef<'call> {
self.0
}
}
impl<'call> FromExcel<'call> for ExcelValueArg<'call> {
fn from_excel(value: ExcelValueRef<'call>) -> Result<Self, ConversionError> {
Ok(Self::new(value))
}
}
#[derive(Debug)]
pub struct ExcelReferenceArg<'call>(ExcelValueRef<'call>);
impl<'call> ExcelReferenceArg<'call> {
pub const fn new(value: ExcelValueRef<'call>) -> Self {
Self(value)
}
pub fn into_inner(self) -> ExcelValueRef<'call> {
self.0
}
}
impl<'call> FromExcel<'call> for ExcelReferenceArg<'call> {
fn from_excel(value: ExcelValueRef<'call>) -> Result<Self, ConversionError> {
Ok(Self::new(value))
}
}
#[derive(Debug)]
pub struct CountedUtf16Arg<'call>(ExcelStr<'call>);
impl<'call> CountedUtf16Arg<'call> {
pub const fn new(value: ExcelStr<'call>) -> Self {
Self(value)
}
pub const fn as_excel_str(&self) -> &ExcelStr<'call> {
&self.0
}
pub fn into_inner(self) -> ExcelStr<'call> {
self.0
}
}
#[derive(Debug)]
pub struct NullTerminatedUtf16Arg<'call>(ExcelStr<'call>);
impl<'call> NullTerminatedUtf16Arg<'call> {
pub const fn new(value: ExcelStr<'call>) -> Self {
Self(value)
}
pub const fn as_excel_str(&self) -> &ExcelStr<'call> {
&self.0
}
pub fn into_inner(self) -> ExcelStr<'call> {
self.0
}
}