pub trait ExecSpecSeqIndexOfFirst<'a>: Sized + DeepView {
type Elem: DeepView;
// Required method
exec fn exec_index_of_first(self, needle: Self::Elem) -> Option<usize>;
}Expand description
Spec for executable version of Seq::index_of_first.
Required Associated Types§
Required Methods§
Sourceexec fn exec_index_of_first(self, needle: Self::Elem) -> Option<usize>
exec fn exec_index_of_first(self, needle: Self::Elem) -> Option<usize>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<'a, T: DeepView + PartialEq> ExecSpecSeqIndexOfFirst<'a> for &'a [T]
impl<'a, T: DeepView + PartialEq> ExecSpecSeqIndexOfFirst<'a> for &'a [T]
Source§exec fn exec_index_of_first(self, needle: Self::Elem) -> res : Option<usize>
exec fn exec_index_of_first(self, needle: Self::Elem) -> res : Option<usize>
ensures
match res {
Some(i) => {
self.deep_view().index_of_first(needle.deep_view()).is_some()
&& i as int == self.deep_view().index_of_first(needle.deep_view())->0
}
None => self.deep_view().index_of_first(needle.deep_view()) == None::<int>,
},