|
| 1 | +//! `exnref` implementation stubs when GC is disabled. |
| 2 | +
|
| 3 | +use crate::{ |
| 4 | + AsContext, AsContextMut, ExnType, GcRefImpl, HeapType, Result, Rooted, Tag, Val, |
| 5 | + store::{AutoAssertNoGc, StoreContextMut, StoreOpaque}, |
| 6 | +}; |
| 7 | + |
| 8 | +/// Support for `ExnRefPre` disabled at compile time because the `gc` |
| 9 | +/// cargo feature was not enabled. |
| 10 | +pub enum ExnRefPre {} |
| 11 | + |
| 12 | +/// Support for `exnref` disabled at compile time because the `gc` |
| 13 | +/// cargo feature was not enabled. |
| 14 | +pub enum ExnRef {} |
| 15 | + |
| 16 | +impl GcRefImpl for ExnRef {} |
| 17 | + |
| 18 | +impl ExnRef { |
| 19 | + pub unsafe fn from_raw(_store: impl AsContextMut, _raw: u32) -> Option<Rooted<Self>> { |
| 20 | + None |
| 21 | + } |
| 22 | + |
| 23 | + pub(crate) fn _from_raw(_store: &mut AutoAssertNoGc, _raw: u32) -> Option<Rooted<Self>> { |
| 24 | + None |
| 25 | + } |
| 26 | + |
| 27 | + pub unsafe fn to_raw(&self, _store: impl AsContextMut) -> Result<u32> { |
| 28 | + Ok(0) |
| 29 | + } |
| 30 | + |
| 31 | + pub(crate) unsafe fn _to_raw(&self, _store: &mut AutoAssertNoGc<'_>) -> Result<u32> { |
| 32 | + Ok(0) |
| 33 | + } |
| 34 | + |
| 35 | + pub fn ty(&self, _store: impl AsContext) -> Result<ExnType> { |
| 36 | + match *self {} |
| 37 | + } |
| 38 | + |
| 39 | + pub(crate) fn _ty(&self, _store: &StoreOpaque) -> Result<ExnType> { |
| 40 | + match *self {} |
| 41 | + } |
| 42 | + |
| 43 | + pub fn matches_ty(&self, _store: impl AsContext, _ty: &HeapType) -> Result<bool> { |
| 44 | + match *self {} |
| 45 | + } |
| 46 | + |
| 47 | + pub(crate) fn _matches_ty(&self, _store: &StoreOpaque, _ty: &HeapType) -> Result<bool> { |
| 48 | + match *self {} |
| 49 | + } |
| 50 | + |
| 51 | + pub fn tag(&self, _store: impl AsContextMut) -> Result<Tag> { |
| 52 | + match *self {} |
| 53 | + } |
| 54 | + |
| 55 | + pub fn fields<'a, T: 'static>( |
| 56 | + &self, |
| 57 | + _store: impl Into<StoreContextMut<'a, T>>, |
| 58 | + ) -> Result<impl ExactSizeIterator<Item = Val> + 'a + '_> { |
| 59 | + match *self {} |
| 60 | + Ok([].into_iter()) |
| 61 | + } |
| 62 | + |
| 63 | + pub fn field(&self, _store: impl AsContextMut, _index: usize) -> Result<Val> { |
| 64 | + match *self {} |
| 65 | + } |
| 66 | + |
| 67 | + pub fn set_field(&self, _store: impl AsContextMut, _index: usize, _value: Val) -> Result<()> { |
| 68 | + match *self {} |
| 69 | + } |
| 70 | +} |
0 commit comments