Struct entity::Edge [−][src]
Represents a edge from an ent to one or more other ents
Implementations
impl Edge
[src]
pub fn new<N: Into<String>, V: Into<EdgeValue>>(name: N, value: V) -> Self
[src]
Creates a new edge with the given name, value, and deletion policy of nothing
Examples
use entity::{Edge, EdgeDeletionPolicy}; let edge = Edge::new("edge1", 999); assert_eq!(edge.name(), "edge1"); assert_eq!(edge.to_ids(), vec![999]); assert_eq!(edge.deletion_policy(), EdgeDeletionPolicy::Nothing);
pub fn new_with_deletion_policy<N: Into<String>, V: Into<EdgeValue>>(
name: N,
value: V,
deletion_policy: EdgeDeletionPolicy
) -> Self
[src]
name: N,
value: V,
deletion_policy: EdgeDeletionPolicy
) -> Self
Creates a new edge with the given name, value, and deletion policy
Examples
use entity::{Edge, EdgeDeletionPolicy}; let edge = Edge::new_with_deletion_policy( "edge1", 999, EdgeDeletionPolicy::DeepDelete, ); assert_eq!(edge.name(), "edge1"); assert_eq!(edge.to_ids(), vec![999]); assert_eq!(edge.deletion_policy(), EdgeDeletionPolicy::DeepDelete);
pub fn name(&self) -> &str
[src]
The name of the edge
pub fn value(&self) -> &EdgeValue
[src]
The value of the edge
pub fn value_mut(&mut self) -> &mut EdgeValue
[src]
The mutable value of the edge
pub fn into_value(self) -> EdgeValue
[src]
Converts edge into its value
pub fn to_ids(&self) -> Vec<Id>
[src]
Converts to the ids of the ents referenced by this edge
pub fn to_type(&self) -> EdgeValueType
[src]
Converts to the edge’s value type
pub fn deletion_policy(&self) -> EdgeDeletionPolicy
[src]
Returns the policy to perform for this edge when its ent is deleted
pub fn has_no_deletion_policy(&self) -> bool
[src]
Returns true if the deletion policy is nothing
pub fn has_shallow_deletion_policy(&self) -> bool
[src]
Returns true if the deletion policy is shallow
pub fn has_deep_deletion_policy(&self) -> bool
[src]
Returns true if the deletion policy is deep
Trait Implementations
impl Clone for Edge
[src]
impl Debug for Edge
[src]
impl Eq for Edge
[src]
impl<'a> From<&'a Edge> for EdgeDefinition
[src]
impl From<Edge> for EdgeDefinition
[src]
impl PartialEq<Edge> for Edge
[src]
impl StructuralEq for Edge
[src]
impl StructuralPartialEq for Edge
[src]
Auto Trait Implementations
impl RefUnwindSafe for Edge
impl Send for Edge
impl Sync for Edge
impl Unpin for Edge
impl UnwindSafe for Edge
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,