Skip to main content

InferenceEngine

Struct InferenceEngine 

Source
pub struct InferenceEngine { /* private fields */ }
Expand description

スレッドセーフな ONNX Runtime 推論エンジン。

内部にセッションプールを保持し、複数スレッドからの並行推論要求に対して アロケーションフリーかつ競合を最小化したフォワードパスを実行する。 Arc<InferenceEngine> として複数ワーカー間で安全に共有可能である。

Implementations§

Source§

impl InferenceEngine

Source

pub fn forward_batch_tokenized( &self, batch: &BatchTokenizedQuestions, ) -> Result<IndexMap<String, Vec<f64>>>

事前パッキング済みバッチトークン列を受け取り、単一フォワードパスで各質問のロジットを算出する。

出力されたテンソルから各質問の真の候補数 $K_i$ 個のロジットのみをスライス抽出することで、 パディングスロット由来のダミーロジットを完全に除外して返却する。

§引数
  • batch: パディングおよび平坦化済みのバッチトークナイズ結果。
§戻り値

質問キーと有効ロジット列 (Vec<f64>) の順序付きマップ。

§エラー

ONNX Runtime 推論処理またはテンソル検証に失敗した場合にエラーを返す。

Source

pub fn forward_batch_tokenized_into( &self, batch: &BatchTokenizedQuestions, out_logits: &mut [f64], ) -> Result<()>

事前パッキング済みバッチトークン列を受け取り、推論結果を指定されたスライスに書き込む。

借用ビュー (TensorRef) によりゼロコピーで ONNX Runtime に渡される。

§引数
  • batch: パディングおよび平坦化済みのバッチトークナイズ結果。
  • out_logits: 平坦化生ロジットの書き込み先バッファ ([batch_size * num_options])。
Source

pub fn forward_batch_questions( &self, tokenizer: &JevTokenizer, state: &str, questions: &IndexMap<String, Question>, ) -> Result<IndexMap<String, Vec<f64>>>

共通 State と複数質問群を受け取り、トークンプレフィックス共有バッチ推論を実行する。

State のトークナイズを 1 度だけ実行し、各質問を単一のバッチ次元に集約して 1 回のフォワードパスで全質問の有効ロジットを返却する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 共通文脈テキスト。
  • questions: 質問識別子と質問定義のマップ。
§戻り値

質問キーと有効ロジット列 (Vec<f64>) の順序付きマップ。

Source

pub fn evaluate_batch_questions( &self, tokenizer: &JevTokenizer, state: &str, questions: &IndexMap<String, Question>, calib_config: &CalibrationConfig, ) -> Result<IndexMap<String, Answer>>

共通 State、複数質問群、および較正設定を受け取り、単一フォワードパスで判定結果を一括導出する。

§処理フロー
  1. tokenizer.encode_batch_questions によるプレフィックス共有バッチ化。
  2. forward_batch_tokenized_into による単一フォワードパス実行。
  3. 各質問の真の候補数 $K_i$ によるスライス抽出とダミーロジット破棄。
  4. sokuto_core::decision::evaluate_question_with_buf による決定論的プリミティブ解決。
  5. 較正設定の閾値に基づき、透過的に確信度ゲーティングを適用して返却。
§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 共通文脈テキスト。
  • questions: 質問識別子と質問定義のマップ。
  • calib_config: 較正温度設定。
§戻り値

質問キーと決定結果 (Answer) の順序付きマップ。

Source

pub fn evaluate_batch_questions_with_gating( &self, tokenizer: &JevTokenizer, state: &str, questions: &IndexMap<String, Question>, calib_config: &CalibrationConfig, gating_config: Option<&GatingConfig>, ) -> Result<IndexMap<String, Answer>>

ゲーティング設定を明示指定して、複数質問一括バッチ推論を実行する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 共通文脈テキスト。
  • questions: 質問識別子と質問定義のマップ。
  • calib_config: 較正温度設定。
  • gating_config: 明示的なゲーティング設定 (任意、未指定時は較正設定から導出)。
Source

pub fn evaluate_batch_questions_with_scratchpad( &self, tokenizer: &JevTokenizer, state: &str, questions: &IndexMap<String, Question>, calib_config: &CalibrationConfig, scratchpad: &mut BatchScratchpad, ) -> Result<IndexMap<String, Answer>>

スクラッチパッドバッファを再利用し、共通 State と複数質問群の判定結果を一括導出する。

アロケーションを最小化したい高頻度 API サーバー環境向けの高速推論インターフェース。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 共通文脈テキスト。
  • questions: 質問識別子と質問定義のマップ。
  • calib_config: 較正温度設定。
  • scratchpad: 再利用可能な作業用スクラッチパッドバッファ。
Source

pub fn evaluate_batch_questions_with_scratchpad_and_gating( &self, tokenizer: &JevTokenizer, state: &str, questions: &IndexMap<String, Question>, calib_config: &CalibrationConfig, gating_config: Option<&GatingConfig>, scratchpad: &mut BatchScratchpad, ) -> Result<IndexMap<String, Answer>>

スクラッチパッドバッファとゲーティング設定を指定してバッチ推論を実行する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 共通文脈テキスト。
  • questions: 質問識別子と質問定義のマップ。
  • calib_config: 較正温度設定。
  • gating_config: 明示的なゲーティング設定 (任意)。
  • scratchpad: 再利用可能な作業用スクラッチパッドバッファ。
Source

pub fn forward_batch_questions_chunked( &self, tokenizer: &JevTokenizer, state: &str, questions: &IndexMap<String, Question>, chunk_size: usize, ) -> Result<IndexMap<String, Vec<f64>>>

共通 State と複数質問群を指定されたチャンクサイズで分割実行し、有効ロジットを返却する。

質問数が極端に多いリクエストにおいて、メモリ使用量 ($N \times L_{\max}$) の急増を抑制し OOM (Out Of Memory) を防止するマイクロバッチ推論インターフェース。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 共通文脈テキスト。
  • questions: 質問識別子と質問定義のマップ。
  • chunk_size: 1 回のフォワードパスで処理する最大質問数。
Source

pub fn evaluate_batch_questions_chunked( &self, tokenizer: &JevTokenizer, state: &str, questions: &IndexMap<String, Question>, calib_config: &CalibrationConfig, chunk_size: usize, ) -> Result<IndexMap<String, Answer>>

共通 State と複数質問群を指定されたチャンクサイズで分割実行し、判定結果を一括導出する。

サーバー層 (sokuto-server) のガードレール等と連携し、大規模質問リクエストを 安全な固定バッチサイズで順次推論・解決する。較正設定の閾値に基づき、各質問に透過的にゲーティングを適用する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 共通文脈テキスト。
  • questions: 質問識別子と質問定義のマップ。
  • calib_config: 較正温度設定。
  • chunk_size: 1 回のフォワードパスで処理する最大質問数。
Source

pub fn evaluate_batch_questions_chunked_with_gating( &self, tokenizer: &JevTokenizer, state: &str, questions: &IndexMap<String, Question>, calib_config: &CalibrationConfig, chunk_size: usize, gating_config: Option<&GatingConfig>, ) -> Result<IndexMap<String, Answer>>

チャンク分割およびゲーティング設定を指定してバッチ推論を実行する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 共通文脈テキスト。
  • questions: 質問識別子と質問定義のマップ。
  • calib_config: 較正温度設定。
  • chunk_size: 1 回のフォワードパスで処理する最大質問数。
  • gating_config: 明示的なゲーティング設定 (任意)。
Source

pub fn evaluate_batch_questions_coarse_to_fine_with_scorer<S: CoarseScorer>( &self, tokenizer: &JevTokenizer, state: &str, questions: &IndexMap<String, Question>, calib_config: &CalibrationConfig, coarse_config: &CoarseToFineConfig, scorer: &S, ) -> Result<IndexMap<String, Answer>>

任意の類似度スコアラーを指定して、粗密 2 段階探索を適用した複数質問一括バッチ推論を実行する。

§処理フロー
  1. 各質問を走査し、Choice かつ候補数 $K > \text{threshold}$ の質問を個別に Top-M 候補にスクリーニング。
  2. 縮小質問群(および閾値以下の元質問群)をプレフィックス共有バッチ化。
  3. バッチ全体の最大候補数 $K_{\max}$ が圧縮された状態で単一フォワードパスを実行。
  4. 各質問の決定プリミティブを解決し、スクリーニングされた質問については除外候補を確率 0.0 として全候補確率マップを再構成。
§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 共通文脈テキスト。
  • questions: 質問マップ。
  • calib_config: 較正温度設定。
  • coarse_config: 粗密探索設定。
  • scorer: 類似度スコアラー実装。
Source

pub fn evaluate_batch_questions_coarse_to_fine( &self, tokenizer: &JevTokenizer, state: &str, questions: &IndexMap<String, Question>, calib_config: &CalibrationConfig, coarse_config: &CoarseToFineConfig, ) -> Result<IndexMap<String, Answer>>

既定の語彙スコアラー (LexicalCoarseScorer) を用いて、粗密 2 段階探索を適用した複数質問一括バッチ推論を実行する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 共通文脈テキスト。
  • questions: 質問マップ。
  • calib_config: 較正温度設定。
  • coarse_config: 粗密探索設定。
Source

pub fn evaluate_batch_questions_coarse_to_fine_chunked_with_scorer<S: CoarseScorer>( &self, tokenizer: &JevTokenizer, state: &str, questions: &IndexMap<String, Question>, calib_config: &CalibrationConfig, coarse_config: &CoarseToFineConfig, chunk_size: usize, scorer: &S, ) -> Result<IndexMap<String, Answer>>

任意の類似度スコアラーを指定して、粗密 2 段階探索とマイクロバッチチャンキングを統合した安全推論を実行する。

候補数が膨大な質問を事前に Top-$M$ 件へスクリーニングした上で、 共通 State を 1 度だけエンコードし、質問群を指定されたチャンクサイズごとに順次フォワードパスへ供給する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 共通文脈テキスト。
  • questions: 質問マップ。
  • calib_config: 較正温度設定。
  • coarse_config: 粗密探索設定。
  • chunk_size: 1 回のフォワードパスで処理する最大質問数。
  • scorer: 類似度スコアラー実装。
Source

pub fn evaluate_batch_questions_coarse_to_fine_chunked_with_gating_and_scorer<S: CoarseScorer>( &self, tokenizer: &JevTokenizer, state: &str, questions: &IndexMap<String, Question>, calib_config: &CalibrationConfig, coarse_config: &CoarseToFineConfig, chunk_size: usize, gating_config: Option<&GatingConfig>, scorer: &S, ) -> Result<IndexMap<String, Answer>>

任意の類似度スコアラーおよび明示的なゲーティング設定を指定して、粗密 2 段階探索とマイクロバッチチャンキングを統合した安全推論を実行する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 共通文脈テキスト。
  • questions: 質問マップ。
  • calib_config: 較正温度設定。
  • coarse_config: 粗密探索設定。
  • chunk_size: 1 回のフォワードパスで処理する最大質問数。
  • gating_config: 明示的なゲーティング設定 (任意)。
  • scorer: 類似度スコアラー実装。
Source

pub fn evaluate_batch_questions_coarse_to_fine_chunked( &self, tokenizer: &JevTokenizer, state: &str, questions: &IndexMap<String, Question>, calib_config: &CalibrationConfig, coarse_config: &CoarseToFineConfig, chunk_size: usize, ) -> Result<IndexMap<String, Answer>>

既定の語彙スコアラー (LexicalCoarseScorer) を用いて、粗密 2 段階探索とマイクロバッチチャンキングを統合した推論を実行する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 共通文脈テキスト。
  • questions: 質問マップ。
  • calib_config: 較正温度設定。
  • coarse_config: 粗密探索設定。
  • chunk_size: 1 回のフォワードパスで処理する最大質問数。
Source

pub fn evaluate_batch_questions_coarse_to_fine_chunked_with_gating( &self, tokenizer: &JevTokenizer, state: &str, questions: &IndexMap<String, Question>, calib_config: &CalibrationConfig, coarse_config: &CoarseToFineConfig, chunk_size: usize, gating_config: Option<&GatingConfig>, ) -> Result<IndexMap<String, Answer>>

既定の語彙スコアラーとゲーティング設定を指定して、粗密 2 段階探索とマイクロバッチチャンキングを統合した推論を実行する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 共通文脈テキスト。
  • questions: 質問マップ。
  • calib_config: 較正温度設定。
  • coarse_config: 粗密探索設定。
  • chunk_size: 1 回のフォワードパスで処理する最大質問数。
  • gating_config: 明示的なゲーティング設定 (任意)。
Source

pub fn evaluate_batch_questions_hierarchical( &self, tokenizer: &JevTokenizer, state: &str, questions: &IndexMap<String, Question>, mapping: &HierarchicalMapping, calib_config: &CalibrationConfig, config: HierarchicalRouterConfig, gating_config: Option<&GatingConfig>, ) -> Result<IndexMap<String, HierarchicalResult>>

粗密二段階階層ルーティング (Coarse-to-Fine Hierarchical Routing) を用いて複数質問を一括評価する。

共通の階層オントロジーマッピングとルーター設定を各質問に適用し、 大分類オントロジー、ODIR Dirichlet 較正、Soft-Beam、エントロピー連動温度較正による低遅延・高精度推論を実行する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 共通文脈テキスト。
  • questions: 評価対象の質問群マップ。
  • mapping: 大分類・細分類の階層オントロジー定義。
  • calib_config: 較正温度設定。
  • config: 階層ルーター設定。
  • gating_config: ゲーティング閾値設定 (任意)。
§戻り値

各質問キーと階層推論結果 (HierarchicalResult) の順序付きマップ。

Source§

impl InferenceEngine

Source

pub fn new(model_path: impl AsRef<Path>, config: SessionConfig) -> Result<Self>

ファイルパスからモデルを読み込み、推論エンジンを初期化する。

§引数
  • model_path: ONNX モデルファイルのパス。
  • config: セッション構築設定。
Source

pub fn from_bytes(model_bytes: &[u8], config: SessionConfig) -> Result<Self>

メモリ上のバイト列からモデルを読み込み、推論エンジンを初期化する。

§引数
  • model_bytes: ONNX モデルバイナリデータ。
  • config: セッション構築設定。
Source

pub fn active_provider(&self) -> ExecutionProvider

有効化された Execution Provider を取得する。

Source

pub fn input_names(&self) -> &[String]

モデルの入力テンソル名一覧を取得する。

Source

pub fn output_names(&self) -> &[String]

モデルの出力テンソル名一覧を取得する。

Source

pub fn pool_size(&self) -> usize

セッションプールサイズを取得する。

Source

pub fn forward_raw( &self, input_ids: &[i64], attention_mask: &[i64], op_indices: &[i64], dims: ModelInputDimensions, ) -> Result<Vec<Vec<f64>>>

平坦化された生テンソルスライスを受け取り、推論を実行してロジットを返却する。

§引数
  • input_ids: トークン ID 列 ([batch_size * seq_len])。
  • attention_mask: アテンションマスク列 ([batch_size * seq_len])。
  • op_indices: オプションマーカー位置インデックス ([batch_size * num_options])。
  • dims: 入力テンソルの次元情報 (batch_size, sequence_length, num_options)。
§戻り値

各バッチサンプルのロジット配列 (Vec<Vec<f64>>)。

Source

pub fn forward_raw_into( &self, input_ids: &[i64], attention_mask: &[i64], op_indices: &[i64], dims: ModelInputDimensions, out_logits: &mut [f64], ) -> Result<()>

平坦化された生テンソルスライスを受け取り、推論結果を指定されたスライスに書き込む。

入力テンソルは借用ビュー (TensorRef) によりゼロコピーで ORT に渡され、 出力も事前確保済みスライスに直接展開されるため、ヒープ確保が発生しない。

§引数
  • input_ids: トークン ID 列 ([batch_size * seq_len])。
  • attention_mask: アテンションマスク列 ([batch_size * seq_len])。
  • op_indices: オプションマーカー位置インデックス ([batch_size * num_options])。
  • dims: 入力テンソルの次元情報 (batch_size, sequence_length, num_options)。
  • out_logits: 結果ロジットの書き込み先バッファ ([batch_size * num_options])。
Source

pub fn forward_question( &self, tokenized: &TokenizedQuestion, ) -> Result<Vec<f64>>

単一のトークナイズ済み質問を受け取り、ロジット配列を算出する。

§引数
  • tokenized: 高速トークナイザーから得られた TokenizedQuestion。
§戻り値

各選択肢に対応する決定ロジット (Vec<f64>)。

Source

pub fn evaluate_question_coarse_to_fine_with_scorer<S: CoarseScorer>( &self, tokenizer: &JevTokenizer, state: &str, question: &Question, calib_config: &CalibrationConfig, coarse_config: &CoarseToFineConfig, scorer: &S, ) -> Result<Answer>

任意の類似度スコアラーを指定して、粗密 2 段階探索 (Coarse-to-Fine) で単一質問を評価する。

§処理フロー
  1. question.question_type == QuestionType::Choice かつ criteria.len() > coarse_config.threshold の場合にのみ 2 段階探索を発動。
  2. ネガティブ候補保護 (Pinning) およびスコアラーによる Top-M スクリーニングを実施。
  3. 絞り込み後の候補マップを用いて部分質問 sub_question を構築。
  4. tokenizer.encode_question および self.forward_question を実行。
  5. 較正設定 calib_config (Fine 候補数 $M$ に対応するバケット) を適用して sub_answer を導出。
  6. reconstruct_probabilities により除外候補を確率 0.0 として全候補確率マップを再構成して返却。

発動条件を満たさない質問 (候補数 $K \le \text{threshold}$、または Score/Noul 型) は、 直接通常推論 (encode_question -> forward_question -> evaluate_question) へバイパスする。

§引数

任意の類似度スコアラーを指定して、粗密 2 段階探索 (Coarse-to-Fine) で単一質問を評価する。

§処理フロー
  1. question.question_type == QuestionType::Choice かつ criteria.len() > coarse_config.threshold の場合にのみ 2 段階探索を発動。
  2. ネガティブ候補保護 (Pinning) およびスコアラーによる Top-M スクリーニングを実施。
  3. 絞り込み後の候補マップを用いて部分質問 sub_question を構築。
  4. tokenizer.encode_question および self.forward_question を実行。
  5. 較正設定 calib_config (Fine 候補数 $M$ に対応するバケット) を適用して sub_answer を導出。
  6. reconstruct_probabilities により除外候補を確率 0.0 として全候補確率マップを再構成。
  7. 較正設定の閾値またはリクエスト指定設定に基づき、透過的に確信度ゲーティングを適用して返却。

発動条件を満たさない質問 (候補数 $K \le \text{threshold}$、または Score/Noul 型) は、 直接通常推論 (encode_question -> forward_question -> evaluate_question) へバイパスする。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 文脈テキスト。
  • question: 質問定義。
  • calib_config: 較正温度設定。
  • coarse_config: 粗密探索設定。
  • scorer: 類似度スコアラー実装。
Source

pub fn evaluate_question_coarse_to_fine_with_gating_and_scorer<S: CoarseScorer>( &self, tokenizer: &JevTokenizer, state: &str, question: &Question, calib_config: &CalibrationConfig, coarse_config: &CoarseToFineConfig, gating_config: Option<&GatingConfig>, scorer: &S, ) -> Result<Answer>

任意の類似度スコアラーとゲーティング設定を指定して、粗密 2 段階探索で単一質問を評価する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 文脈テキスト。
  • question: 質問定義。
  • calib_config: 較正温度設定。
  • coarse_config: 粗密探索設定。
  • gating_config: 明示的なゲーティング設定 (任意、未指定時は較正設定から導出)。
  • scorer: 類似度スコアラー実装。
Source

pub fn evaluate_question_coarse_to_fine( &self, tokenizer: &JevTokenizer, state: &str, question: &Question, calib_config: &CalibrationConfig, coarse_config: &CoarseToFineConfig, ) -> Result<Answer>

既定の語彙スコアラー (LexicalCoarseScorer) を用いて、粗密 2 段階探索で単一質問を評価する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 文脈テキスト。
  • question: 質問定義。
  • calib_config: 較正温度設定。
  • coarse_config: 粗密探索設定。
Source

pub fn evaluate_question_coarse_to_fine_with_gating( &self, tokenizer: &JevTokenizer, state: &str, question: &Question, calib_config: &CalibrationConfig, coarse_config: &CoarseToFineConfig, gating_config: Option<&GatingConfig>, ) -> Result<Answer>

既定の語彙スコアラーとゲーティング設定を指定して、粗密 2 段階探索で単一質問を評価する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 文脈テキスト。
  • question: 質問定義。
  • calib_config: 較正温度設定。
  • coarse_config: 粗密探索設定。
  • gating_config: 明示的なゲーティング設定 (任意)。
Source

pub fn evaluate_question_hierarchical( &self, tokenizer: &JevTokenizer, state: &str, instructions: &str, mapping: &HierarchicalMapping, calib_config: &CalibrationConfig, config: HierarchicalRouterConfig, gating_config: Option<&GatingConfig>, ) -> Result<HierarchicalResult>

粗密二段階階層ルーティング (Coarse-to-Fine Hierarchical Routing) により単一質問を評価する。

大分類オントロジーと Soft-Beam、大分類エントロピー連動温度調整を活用し、 高基数分類 ($K > 20 \sim 30$) においても高精度かつ低遅延に決定を出力する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 文脈テキスト。
  • instructions: 質問指示文。
  • mapping: 大分類と細分類のオントロジー階層マッピング。
  • calib_config: 較正温度設定。
  • config: 階層ルーター設定 (Soft-Beam, Early-Exit 閾値など)。
  • gating_config: ゲーティング閾値設定 (任意)。
§戻り値

階層推論結果 (HierarchicalResult)。

Source

pub fn forward_question_raw( &self, tokenizer: &JevTokenizer, state: &str, question: &Question, ) -> Result<Vec<f64>>

単一の質問をトークナイズして生ロジット配列 (Softmax 正規化前) を算出する。

粗密推論における第 2 パス動的温度適用や、独自の後処理を行うために使用する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 文脈テキスト。
  • question: 質問仕様。
§戻り値

各選択肢の未正規化生ロジット列 (Vec<f64>)。

Source

pub fn predict_single_question( &self, tokenizer: &JevTokenizer, state: &str, question: &Question, calib_config: &CalibrationConfig, ) -> Result<Answer>

単一の質問をトークナイズから決定数理評価まで一括して実行し、決定結果を返却する。

§引数
  • tokenizer: Jev 高速トークナイザー。
  • state: 文脈テキスト。
  • question: 質問仕様。
  • calib_config: 較正温度設定。
§戻り値

確率較正済みの Answer。

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more