Card

Enum Card 

Source
pub enum Card {
Show 17 variants Login { userid: String, nonce: String, signature: String, }, Push { servercode: String, projectcode: String, }, Pull { servercode: String, projectcode: String, }, Clone { protocol_version: Option<u32>, sequence_number: Option<u64>, }, File { artifact_id: String, delta_source: Option<String>, content: Vec<u8>, }, CFile { artifact_id: String, delta_source: Option<String>, uncompressed_size: usize, content: Vec<u8>, }, Igot { artifact_id: String, is_private: bool, }, Gimme { artifact_id: String, }, Cookie { payload: String, }, Error { message: String, }, Message { text: String, }, Pragma { name: String, values: Vec<String>, }, Comment { text: String, }, Private, CloneSeqNo { sequence_number: u64, }, ReqConfig { name: String, }, Config { name: String, content: Vec<u8>, },
}
Expand description

A card in the Heroforge sync protocol.

Variants§

§

Login

Login card: login userid nonce signature

Fields

§userid: String
§nonce: String
§signature: String
§

Push

Push card: push servercode projectcode

Fields

§servercode: String
§projectcode: String
§

Pull

Pull card: pull servercode projectcode

Fields

§servercode: String
§projectcode: String
§

Clone

Clone card: clone [protocol-version sequence-number]

Fields

§protocol_version: Option<u32>
§sequence_number: Option<u64>
§

File

File card: file artifact-id [delta-source-id] size \n content

Fields

§artifact_id: String
§delta_source: Option<String>
§content: Vec<u8>
§

CFile

Compressed file card (for clone protocol 3+)

Fields

§artifact_id: String
§delta_source: Option<String>
§uncompressed_size: usize
§content: Vec<u8>
§

Igot

Igot card: igot artifact-id [private-flag]

Fields

§artifact_id: String
§is_private: bool
§

Gimme

Gimme card: gimme artifact-id

Fields

§artifact_id: String
§

Cookie

Cookie card: cookie payload

Fields

§payload: String
§

Error

Error card: error message

Fields

§message: String
§

Message

Message card: message text

Fields

§text: String
§

Pragma

Pragma card: pragma name value…

Fields

§name: String
§values: Vec<String>
§

Comment

Comment card: # text

Fields

§text: String
§

Private

Private marker (precedes a file card)

§

CloneSeqNo

Clone sequence number response

Fields

§sequence_number: u64
§

ReqConfig

Request config card

Fields

§name: String
§

Config

Config card with content

Fields

§name: String
§content: Vec<u8>

Implementations§

Source§

impl Card

Source

pub fn to_line(&self) -> Result<String>

Convert a card to its line representation.

Source

pub fn content_bytes(&self) -> Option<&[u8]>

Get file content bytes for file/cfile cards.

Trait Implementations§

Source§

impl Clone for Card

Source§

fn clone(&self) -> Card

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Card

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Card

§

impl RefUnwindSafe for Card

§

impl Send for Card

§

impl Sync for Card

§

impl Unpin for Card

§

impl UnwindSafe for Card

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.