pub struct SphinxPacket {
pub header: SphinxHeader,
pub payload: Payload,
}Fields§
§header: SphinxHeader§payload: PayloadImplementations§
Source§impl SphinxPacket
impl SphinxPacket
pub fn new( message: Vec<u8>, route: &[Node], destination: &Destination, delays: &[Delay], ) -> Result<SphinxPacket>
pub fn len(&self) -> usize
Sourcepub fn process_with_derived_keys(
self,
new_blinded_secret: &Option<PublicKey>,
routing_keys: &RoutingKeys,
) -> Result<ProcessedPacket>
pub fn process_with_derived_keys( self, new_blinded_secret: &Option<PublicKey>, routing_keys: &RoutingKeys, ) -> Result<ProcessedPacket>
Processes the header with the provided derived keys. It could be useful in the situation where sender is re-using initial secret and we could cache processing results.
However, unless you know exactly what you are doing, you should NEVER use this method! Prefer normal [process] instead.
pub fn process(self, node_secret_key: &StaticSecret) -> Result<ProcessedPacket>
pub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Auto Trait Implementations§
impl Freeze for SphinxPacket
impl RefUnwindSafe for SphinxPacket
impl Send for SphinxPacket
impl Sync for SphinxPacket
impl Unpin for SphinxPacket
impl UnwindSafe for SphinxPacket
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