Skip to content

better-mojo/disc

Repository files navigation

Disc

🦀 binding rust libraries to mojo 🔥

Mojo Version MIT License Pixi Badge
Contributors Welcome

简体中文 | English

Docs

Packages

Package Description Host
uuid-ffi uuid-rs FFI https://prefix.dev/channels/better-ffi/packages/libuuid_ffi
uuid-mojo uuid mojo https://prefix.dev/channels/better-mojo/packages/uuid

🔥 uuid

# add rust(ffi) package
magic add libuuid_ffi  # add channel first: "https://repo.prefix.dev/better-ffi" 

# add mojo package
magic add uuid  # add channel first: "https://repo.prefix.dev/better-mojo" 
  • example
import uuid


def test_uuid():
    # implement style 1:
    var id = uuid.uuid_v4()  # auto free memory
    var id2 = uuid.uuid_v7()  # auto free memory

    # implement style 2:
    var id3 = uuid.gen_uuid_v4()
    var id4 = uuid.gen_uuid_v7()  # auto free memory

    print(id)
    print(id2)

    print(id3)
    print(id4)


fn main() raises:
    test_uuid()

Reference

rust:

Releases

No releases published

Packages

No packages published