Struct apollo_compiler::schema::Component
source · pub struct Component<T> {
pub origin: ComponentOrigin,
pub node: Node<T>,
}
Expand description
Fields§
§origin: ComponentOrigin
§node: Node<T>
Implementations§
Methods from Deref<Target = Node<T>>§
pub fn location(&self) -> Option<NodeLocation>
sourcepub fn is_built_in(&self) -> bool
pub fn is_built_in(&self) -> bool
Whether this node is located in FileId::BUILT_IN
,
which defines built-in directives, built-in scalars, and introspection types.
sourcepub fn same_location<U>(&self, node: U) -> Node<U>
pub fn same_location<U>(&self, node: U) -> Node<U>
Returns the given node
at the same location as self
(e.g. for a type conversion).
pub fn to_component(&self, origin: ComponentOrigin) -> Component<T>
sourcepub fn ptr_eq(&self, other: &Self) -> bool
pub fn ptr_eq(&self, other: &Self) -> bool
Returns whether two Node
s point to the same memory allocation
sourcepub fn make_mut(&mut self) -> &mut Twhere
T: Clone,
pub fn make_mut(&mut self) -> &mut Twhere
T: Clone,
Returns a mutable reference to T
, cloning it if necessary
This is functionally equivalent to Arc::make_mut
from the standard library.
If this Node
is uniquely owned, make_mut()
will provide a mutable
reference to the contents. If not, make_mut()
will create a new Node
with a clone of the contents, update self
to point to it, and provide
a mutable reference to its contents.
This is useful for implementing copy-on-write schemes where you wish to
avoid copying things if your Node
is not shared.
Trait Implementations§
source§impl<T: PartialEq> PartialEq for Component<T>
impl<T: PartialEq> PartialEq for Component<T>
impl<T: Eq> Eq for Component<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Component<T>where
T: RefUnwindSafe,
impl<T> Send for Component<T>
impl<T> Sync for Component<T>
impl<T> Unpin for Component<T>where
T: Unpin,
impl<T> UnwindSafe for Component<T>where
T: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> FromFd for T
impl<T> FromFd for T
§impl<T> FromFilelike for T
impl<T> FromFilelike for T
§fn from_filelike(owned: OwnedFd) -> T
fn from_filelike(owned: OwnedFd) -> T
Self
from the given filelike object. Read more§fn from_into_filelike<Owned>(owned: Owned) -> Twhere
Owned: IntoFilelike,
fn from_into_filelike<Owned>(owned: Owned) -> Twhere
Owned: IntoFilelike,
Self
from the given filelike object
converted from into_owned
. Read more§impl<T> FromSocketlike for T
impl<T> FromSocketlike for T
§fn from_socketlike(owned: OwnedFd) -> T
fn from_socketlike(owned: OwnedFd) -> T
Self
from the given socketlike object.§fn from_into_socketlike<Owned>(owned: Owned) -> Twhere
Owned: IntoSocketlike,
fn from_into_socketlike<Owned>(owned: Owned) -> Twhere
Owned: IntoSocketlike,
Self
from the given socketlike object
converted from into_owned
.