Skip to main content

TypeCompatibilityResult

Struct TypeCompatibilityResult 

Source
pub struct TypeCompatibilityResult {
    pub is_compatible: bool,
    pub reason: Option<String>,
    pub suggestions: Vec<String>,
    pub details: CompatibilityDetails,
}
Expand description

类型兼容性结果

表示类型兼容性检查的详细结果,包含是否兼容、不兼容原因和建议修复方案。

Fields§

§is_compatible: bool

是否兼容

§reason: Option<String>

不兼容原因

§suggestions: Vec<String>

建议修复方案

§details: CompatibilityDetails

兼容性详情

Implementations§

Source§

impl TypeCompatibilityResult

Source

pub fn compatible( source_type: impl Into<String>, target_type: impl Into<String>, ) -> Self

创建兼容的结果

§参数
  • source_type - 源类型
  • target_type - 目标类型
§返回值

返回表示兼容的结果

Source

pub fn incompatible( source_type: impl Into<String>, target_type: impl Into<String>, reason: impl Into<String>, ) -> Self

创建不兼容的结果

§参数
  • source_type - 源类型
  • target_type - 目标类型
  • reason - 不兼容原因
§返回值

返回表示不兼容的结果

Source

pub fn with_suggestion(self, suggestion: impl Into<String>) -> Self

添加建议修复方案

§参数
  • suggestion - 建议修复方案
§返回值

返回修改后的结果

Source

pub fn with_level(self, level: CompatibilityLevel) -> Self

设置兼容性级别

§参数
  • level - 兼容性级别
§返回值

返回修改后的结果

Source

pub fn with_mapping( self, source: impl Into<String>, target: impl Into<String>, ) -> Self

添加匹配的类型映射

§参数
  • source - 源类型
  • target - 目标类型
§返回值

返回修改后的结果

Trait Implementations§

Source§

impl Clone for TypeCompatibilityResult

Source§

fn clone(&self) -> TypeCompatibilityResult

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for TypeCompatibilityResult

Source§

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

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

impl Default for TypeCompatibilityResult

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for TypeCompatibilityResult

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 TypeCompatibilityResult

Source§

impl StructuralPartialEq for TypeCompatibilityResult

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, 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V