pub struct CustomPlanError { /* private fields */ }Expand description
Plan-time decode failure raised by a hand-written FromCell::build_plan
or FromRow::build_plan.
Use this for custom validation of column metadata or row shape. The connector’s structured schema mismatches still
return SchemaError.
Callers provide only a reason and optional source. The connector adds column context for failures returned through
CellPlan::new; row-level plan failures keep no column context.
Implementations§
Source§impl CustomPlanError
impl CustomPlanError
Sourcepub fn new(reason: impl Into<Box<str>>) -> Self
pub fn new(reason: impl Into<Box<str>>) -> Self
Build a plan-time error with just a reason, equivalent to builder(reason).build().
pub fn builder(reason: impl Into<Box<str>>) -> CustomPlanErrorBuilder
pub fn reason(&self) -> &str
pub fn source(&self) -> Option<&(dyn StdError + Send + Sync + 'static)>
Sourcepub fn column_index(&self) -> Option<usize>
pub fn column_index(&self) -> Option<usize>
The column this plan was being built for, filled in by the connector for
FromCell::build_plan failures.
pub fn column_name(&self) -> Option<&str>
Trait Implementations§
Source§impl Debug for CustomPlanError
impl Debug for CustomPlanError
Source§impl Display for CustomPlanError
impl Display for CustomPlanError
Source§impl Error for CustomPlanError
impl Error for CustomPlanError
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<CustomPlanError> for PlanBuildError
impl From<CustomPlanError> for PlanBuildError
Source§fn from(error: CustomPlanError) -> Self
fn from(error: CustomPlanError) -> Self
Converts to this type from the input type.
Source§impl From<CustomPlanError> for Error
impl From<CustomPlanError> for Error
Source§fn from(error: CustomPlanError) -> Self
fn from(error: CustomPlanError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for CustomPlanError
impl !UnwindSafe for CustomPlanError
impl Freeze for CustomPlanError
impl Send for CustomPlanError
impl Sync for CustomPlanError
impl Unpin for CustomPlanError
impl UnsafeUnpin for CustomPlanError
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