Skip to content

Commit

Permalink
impl<T: 'static> From<T> for External<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
any committed Sep 17, 2022
1 parent 8a568be commit ee6a433
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/napi/src/bindgen_runtime/js_values/external.rs
Expand Up @@ -3,9 +3,8 @@ use std::{
ops::{Deref, DerefMut},
};

use crate::{check_status, sys, Error, Status, TaggedObject};

use super::{FromNapiValue, ToNapiValue, TypeName, ValidateNapiValue};
use crate::{check_status, sys, Error, Status, TaggedObject};

pub struct External<T: 'static> {
obj: *mut TaggedObject<T>,
Expand All @@ -25,6 +24,12 @@ impl<T: 'static> TypeName for External<T> {

unsafe impl<T> Send for External<T> {}

impl<T: 'static> From<T> for External<T> {
fn from(t: T) -> Self {
External::new(t)
}
}

impl<T: 'static> ValidateNapiValue for External<T> {}

impl<T: 'static> External<T> {
Expand Down

0 comments on commit ee6a433

Please sign in to comment.