#[repr(i32)]pub enum GraphWeightEncoding {
GraphWeightUnit = 0,
GraphWeightTextKey = 1,
GraphWeightJsonKey = 2,
GraphWeightF32LePrefix = 3,
}Expand description
How to decode a non-negative edge cost (weight) from an edge’s properties.
Variants§
GraphWeightUnit = 0
No weight is read; every edge costs 1.0 (== unweighted hop count).
GraphWeightTextKey = 1
Properties are the UTF-8 text “weight_key field selects default_weight.
GraphWeightJsonKey = 2
Properties are a UTF-8 JSON object; weight_key names a top-level numeric
field (default “weight”). Missing/non-numeric falls back to default_weight.
GraphWeightF32LePrefix = 3
Properties begin with a little-endian f32 cost in the first 4 bytes. This is a NEW convention defined by this RPC (no such prefix existed before); writers that want it must prepend the 4 weight bytes themselves.
Implementations§
Source§impl GraphWeightEncoding
impl GraphWeightEncoding
Sourcepub fn from_i32(value: i32) -> Option<GraphWeightEncoding>
👎Deprecated: Use the TryFrom<i32> implementation instead
pub fn from_i32(value: i32) -> Option<GraphWeightEncoding>
Use the TryFrom<i32> implementation instead
Converts an i32 to a GraphWeightEncoding, or None if value is not a valid variant.
Source§impl GraphWeightEncoding
impl GraphWeightEncoding
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for GraphWeightEncoding
impl Clone for GraphWeightEncoding
Source§fn clone(&self) -> GraphWeightEncoding
fn clone(&self) -> GraphWeightEncoding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for GraphWeightEncoding
Source§impl Debug for GraphWeightEncoding
impl Debug for GraphWeightEncoding
Source§impl Default for GraphWeightEncoding
impl Default for GraphWeightEncoding
Source§fn default() -> GraphWeightEncoding
fn default() -> GraphWeightEncoding
impl Eq for GraphWeightEncoding
Source§impl From<GraphWeightEncoding> for i32
impl From<GraphWeightEncoding> for i32
Source§fn from(value: GraphWeightEncoding) -> i32
fn from(value: GraphWeightEncoding) -> i32
Source§impl Hash for GraphWeightEncoding
impl Hash for GraphWeightEncoding
Source§impl Ord for GraphWeightEncoding
impl Ord for GraphWeightEncoding
Source§fn cmp(&self, other: &GraphWeightEncoding) -> Ordering
fn cmp(&self, other: &GraphWeightEncoding) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for GraphWeightEncoding
impl PartialEq for GraphWeightEncoding
Source§impl PartialOrd for GraphWeightEncoding
impl PartialOrd for GraphWeightEncoding
impl StructuralPartialEq for GraphWeightEncoding
Source§impl TryFrom<i32> for GraphWeightEncoding
impl TryFrom<i32> for GraphWeightEncoding
Source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
Source§fn try_from(value: i32) -> Result<GraphWeightEncoding, UnknownEnumValue>
fn try_from(value: i32) -> Result<GraphWeightEncoding, UnknownEnumValue>
Auto Trait Implementations§
impl Freeze for GraphWeightEncoding
impl RefUnwindSafe for GraphWeightEncoding
impl Send for GraphWeightEncoding
impl Sync for GraphWeightEncoding
impl Unpin for GraphWeightEncoding
impl UnsafeUnpin for GraphWeightEncoding
impl UnwindSafe for GraphWeightEncoding
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request