pub struct Path {
nodes: Vec<Node>,
next_node_index: usize,
target: BlockPos,
dist_to_target: f32,
reached: bool,
}Fields§
§nodes: Vec<Node>§next_node_index: usize§target: BlockPos§dist_to_target: f32§reached: boolImplementations§
Source§impl Path
impl Path
pub fn new(nodes: Vec<Node>, target: BlockPos, reached: bool) -> Self
pub const fn advance(&mut self)
pub const fn not_started(&self) -> bool
pub const fn is_done(&self) -> bool
pub fn end_node(&self) -> Option<&Node>
pub fn node(&self, index: usize) -> Option<&Node>
pub fn truncate_nodes(&mut self, index: usize)
pub fn replace_node(&mut self, index: usize, replace_with: Node) -> bool
pub const fn node_count(&self) -> usize
pub const fn next_node_index(&self) -> usize
pub const fn set_next_node_index(&mut self, next_node_index: usize)
pub fn node_pos(&self, index: usize) -> Option<BlockPos>
pub fn next_node_pos(&self) -> Option<BlockPos>
pub fn next_node(&self) -> Option<&Node>
pub fn previous_node(&self) -> Option<&Node>
pub fn same_as(&self, path: &Self) -> bool
pub const fn can_reach(&self) -> bool
pub const fn target(&self) -> BlockPos
pub const fn dist_to_target(&self) -> f32
pub fn nodes(&self) -> &[Node]
Trait Implementations§
impl StructuralPartialEq for Path
Auto Trait Implementations§
impl Freeze for Path
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnsafeUnpin for Path
impl UnwindSafe for Path
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>