Skip to main content

BcsrError

Enum BcsrError 

Source
pub enum BcsrError {
Show 15 variants OffsetLengthOverflow { count: usize, }, OffsetLength { section: BcsrSection, expected: usize, actual: usize, }, HyperedgeOffsetLengthMismatch { head_offsets_len: usize, tail_offsets_len: usize, }, VertexOffsetLengthMismatch { outgoing_offsets_len: usize, incoming_offsets_len: usize, }, FirstOffset { section: BcsrSection, actual: usize, }, NonMonotonicOffset { section: BcsrSection, index: usize, previous: usize, actual: usize, }, FinalOffset { section: BcsrSection, final_offset: usize, value_len: usize, }, VertexOutOfRange { section: BcsrSection, index: usize, vertex: usize, vertex_count: usize, }, HyperedgeOutOfRange { section: BcsrSection, index: usize, hyperedge: usize, hyperedge_count: usize, }, OutgoingTotalMismatch { head_participants_len: usize, outgoing_hyperedges_len: usize, }, IncomingTotalMismatch { tail_participants_len: usize, incoming_hyperedges_len: usize, }, NotStrictlyAscending { section: BcsrSection, index: usize, previous: usize, actual: usize, }, UsizeOverflow { value: usize, }, TotalIncidenceCountOverflow { p_head: usize, p_tail: usize, }, CrossDirectionMismatch { side: BcsrRoleSide, hyperedge: usize, vertex: usize, },
}
Expand description

Bipartite-CSR validation error.

Returned by BcsrHypergraph::open and BcsrHypergraph::open_with when one of the eight section payloads fails validation.

§Performance

perf: unspecified; errors are returned only from validation paths.

Variants§

§

OffsetLengthOverflow

count + 1 overflowed usize, so the offset slice length cannot fit.

Fields

§count: usize

The count for which count + 1 overflowed.

§

OffsetLength

An offset slice has the wrong length.

Fields

§section: BcsrSection

Which offset section this error came from.

§expected: usize

Expected length (count + 1).

§actual: usize

Actual length seen.

§

HyperedgeOffsetLengthMismatch

head_offsets and tail_offsets disagree on hyperedge_count + 1.

Fields

§head_offsets_len: usize

head_offsets.len().

§tail_offsets_len: usize

tail_offsets.len().

§

VertexOffsetLengthMismatch

vertex_outgoing_offsets and vertex_incoming_offsets disagree on vertex_count + 1.

Fields

§outgoing_offsets_len: usize

vertex_outgoing_offsets.len().

§incoming_offsets_len: usize

vertex_incoming_offsets.len().

§

FirstOffset

The first offset in an offset slice was not zero.

Fields

§section: BcsrSection

Which offset section this error came from.

§actual: usize

Actual first offset.

§

NonMonotonicOffset

Offsets were not monotonically non-decreasing.

Fields

§section: BcsrSection

Which offset section this error came from.

§index: usize

Offset index where monotonicity failed.

§previous: usize

Previous offset value.

§actual: usize

Actual offset value at index.

§

FinalOffset

Final offset does not match the corresponding value slice length.

Fields

§section: BcsrSection

Which offset section this error came from.

§final_offset: usize

Final offset value.

§value_len: usize

Length of the value slice this offset references.

§

VertexOutOfRange

A vertex ID was outside 0..vertex_count.

Fields

§section: BcsrSection

Which value section the bad ID came from.

§index: usize

Position within that section.

§vertex: usize

The bad vertex ID.

§vertex_count: usize

vertex_count.

§

HyperedgeOutOfRange

A hyperedge ID was outside 0..hyperedge_count.

Fields

§section: BcsrSection

Which value section the bad ID came from.

§index: usize

Position within that section.

§hyperedge: usize

The bad hyperedge ID.

§hyperedge_count: usize

hyperedge_count.

§

OutgoingTotalMismatch

head_participants.len() and vertex_outgoing_hyperedges.len() disagree on the total outgoing-incidence count.

Fields

§head_participants_len: usize

head_participants.len() (P_head).

§outgoing_hyperedges_len: usize

vertex_outgoing_hyperedges.len() (P_outgoing).

§

IncomingTotalMismatch

tail_participants.len() and vertex_incoming_hyperedges.len() disagree on the total incoming-incidence count.

Fields

§tail_participants_len: usize

tail_participants.len() (P_tail).

§incoming_hyperedges_len: usize

vertex_incoming_hyperedges.len() (P_incoming).

§

NotStrictlyAscending

A range-local sequence (e.g. one hyperedge’s head participants, or one vertex’s outgoing hyperedges) was not strictly ascending.

Bipartite-CSR requires set semantics within each range: vertex IDs inside a single hyperedge’s head/tail and hyperedge IDs inside a single vertex’s outgoing/incoming must be strictly increasing.

Fields

§section: BcsrSection

Which value section the bad pair came from.

§index: usize

Position of the offending value within the section.

§previous: usize

Previous value at index - 1.

§actual: usize

Actual value at index.

§

UsizeOverflow

A stored index value did not fit in usize on this target platform.

Fields

§value: usize

Value that could not be represented as usize.

§

TotalIncidenceCountOverflow

P_head + P_tail overflowed usize, so the incidence ID space cannot be indexed on this target.

Fields

§p_head: usize

Total head-side incidences (P_head == P_outgoing).

§p_tail: usize

Total tail-side incidences (P_tail == P_incoming).

§

CrossDirectionMismatch

Cross-CSR consistency check (Strict-only) found a hyperedge that is recorded in one direction but missing from the other.

Fields

§side: BcsrRoleSide

Which side of the bipartite index disagreed.

§hyperedge: usize

The hyperedge ID that did not match across the two indexes.

§vertex: usize

The vertex ID that did not match across the two indexes.

Trait Implementations§

Source§

impl Clone for BcsrError

Source§

fn clone(&self) -> BcsrError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for BcsrError

Source§

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

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

impl Display for BcsrError

Source§

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

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

impl Error for BcsrError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<BcsrError> for BcsrSnapshotError

Source§

fn from(error: BcsrError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for BcsrError

Source§

fn eq(&self, other: &BcsrError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for BcsrError

Source§

impl StructuralPartialEq for BcsrError

Auto Trait Implementations§

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> 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.